]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better way to install headers
authorAlan T. DeKok <aland@freeradius.org>
Fri, 17 Aug 2018 16:08:50 +0000 (12:08 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Aug 2018 16:27:18 +0000 (12:27 -0400)
scripts/boiler.mk
src/include/all.mk

index c18fa94778f2e34a43ca7f91b0018a9e7f40010a..2efabe513930a12fd9e9491a385a15236f8b4fb5 100644 (file)
@@ -340,6 +340,7 @@ define INCLUDE_SUBMAKEFILE
     TGT_CHECK_LIBS :=
 
     SOURCES :=
+    HEADERS :=
     SRC_CFLAGS :=
     SRC_CXXFLAGS :=
     SRC_DEFS :=
@@ -435,6 +436,7 @@ define INCLUDE_SUBMAKEFILE
 
         # Save the list of source files for this target.
         $${TGT}_SOURCES += $${SOURCES}
+        $${TGT}_HEADERS += $${HEADERS}
 
         # Convert the source file names to their corresponding object file
         # names.
@@ -506,6 +508,12 @@ define INCLUDE_SUBMAKEFILE
         # add rules to build the target
         $$(eval $$(call ADD_TARGET_RULE$${$${TGT}_SUFFIX},$${TGT}))
 
+        # add rules to install the header files
+       ifneq "${HEADERS}" ""
+         $(foreach h, ${HEADERS},\
+           $(eval $(call ADD_INSTALL_RULE.h,${h},src/include/${h})))
+        endif
+
         # generate the clean rule for this target.
         $$(eval $$(call ADD_CLEAN_RULE,$${TGT}))
 
@@ -674,10 +682,6 @@ endif
 $(foreach D,$(patsubst %/,%,$(sort $(dir ${ALL_INSTALL}))),\
   $(eval $(call ADD_INSTALL_RULE.dir,${D})))
 
-# Install all of the header files
-$(foreach h, $(ALL_HEADERS),\
-    $(eval $(call ADD_INSTALL_RULE.h,${h},src/include/${h})))
-
 scan: ${ALL_PLISTS}
 
 .PHONY: clean.scan
index 1b1cc70d0d5458c46b3870439d3ec317f4c0d61a..20a15e721286e56018dfb424e0a180f13e11fa65 100644 (file)
@@ -108,11 +108,6 @@ src/freeradius-devel:
 BOOTSTRAP_BUILD += src/freeradius-devel $(addprefix src/include/,$(HEADERS_DY)) $(HEADERS_RFC)
 scan: $(BOOTSTRAP_BUILD)
 
-######################################################################
-#
-#  Installation
-ALL_HEADERS += $(HEADERS)
-
 #
 #  Regenerate the headers if we re-run autoconf.
 #  This is to that changes to the build rules (e.g. PW_FOO -> FR_FOO)