From: Alan T. DeKok Date: Wed, 27 Mar 2019 12:47:52 +0000 (-0400) Subject: remove $(shell ...) and replace with $(wildcard ...) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7bcedfd6bd0352fd3434e4bf80fd682913524b2;p=thirdparty%2Ffreeradius-server.git remove $(shell ...) and replace with $(wildcard ...) which is faster. We should really avoid the use of $(shell), and maybe replace it with a build/defs.mk file which is run only once. --- diff --git a/Makefile b/Makefile index 1d6a28fb44d..6817d37485a 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,11 @@ endif export DESTDIR := $(R) export PROJECT_NAME := freeradius +# +# src/include/all.mk needs these, so define them before we include that file. +# +PROTOCOLS := dhcpv4 eap freeradius snmp vqp dhcpv6 ethernet radius tacacs + # And over-ride all of the other magic. ifneq "$(MAKECMDGOALS)" "deb" ifeq "$(findstring crossbuild,$(MAKECMDGOALS))" "" @@ -117,7 +122,8 @@ endif # export DESTDIR := $(R) -DICTIONARIES := $(shell find share/dictionary -type f -name dictionary*) +DICTIONARIES := $(wildcard $(addsuffix /dictionary*,$(addprefix share/dictionary/,$(PROTOCOLS)))) + install.share: $(addprefix $(R)$(dictdir)/,$(patsubst share/dictionary/%,%,$(DICTIONARIES))) $(R)$(dictdir)/%: share/dictionary/% diff --git a/src/include/all.mk b/src/include/all.mk index d03088818ba..cbd84398750 100644 --- a/src/include/all.mk +++ b/src/include/all.mk @@ -38,13 +38,13 @@ src/include/autoconf.sed: src/include/autoconf.h # # Find the RFC dictionaries, and add them to the list to be converted -DICT := $(shell find share/dictionary -type f -name *dictionary.rfc*) +DICT := $(wildcard $(addsuffix /dictionary.rfc*,$(addprefix share/dictionary/,$(PROTOCOLS)))) -# Find internal dictionaries and add them to the list to be converted -DICT += $(shell find share/dictionary -type f -name *dictionary.freeradius*) +# Find internal dictionaries and add them to the list to be converte +DICT += $(wildcard $(addsuffix /dictionary.freeradius*,$(addprefix share/dictionary/,$(PROTOCOLS)))) # These contain the protocol number definitions -DICT += $(shell find share/dictionary -type f -name *dictionary) +DICT += $(wildcard $(addsuffix /dictionary,$(addprefix share/dictionary/,$(PROTOCOLS)))) # Add in protocol specific dictionaries (should be done in proto_* modules?) DICT += share/dictionary/vqp/dictionary.vqp