From: Alan T. DeKok Date: Wed, 3 May 2017 18:43:47 +0000 (-0400) Subject: add rules to glue in include files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e24cc2ebbbc477575531e92b13903e97273cb1d;p=thirdparty%2Ffreeradius-server.git add rules to glue in include files --- diff --git a/src/protocols/all.mk b/src/protocols/all.mk index da59dd055fa..d55048164d9 100644 --- a/src/protocols/all.mk +++ b/src/protocols/all.mk @@ -1,4 +1,38 @@ +# +# Create the soft link for the protocol-specific include files +# before building the protocols. +# +define PROTO_INCLUDE +# +# This is a hack to get the include files linked correctly. We would +# LOVE to be able to do: +# +# $${libfreeradius-${1}.la_OBJS}: | src/include/${1} +# +# but GNU Make is too stupid to wait until that variable is defined +# to evaluate the condition. Instead, it evaluates the rule +# immediately, and decides that nothing is there. +# +# So, we instead depend on a library which has already been defined. +# +$${libfreeradius-util.la_OBJS}: | src/include/${1} + +src/include/${1}: + $${Q}[ -e $$@ ] || ln -s $${top_srcdir}/src/protocols/${1} $$@ + @echo LN-SF src/protocols/${1} $$@ + +install.src.include: $(addprefix ${SRC_INCLUDE_DIR}/,${1}/${1}.h) +endef + + # # All protocols go into subdirectories of the "protocols" directory. # SUBMAKEFILES := $(wildcard ${top_srcdir}/src/protocols/*/all.mk) + +# +# Add protocol-specific rules to link include files, etc. +# +$(foreach x,$(SUBMAKEFILES), \ + $(eval $(call PROTO_INCLUDE,$(subst /all.mk,,$(subst ${top_srcdir}/src/protocols/,,$x)))) \ +)