37 # Build dynamic headers by substituting various values from autoconf.h, these
38 # get installed with the library files, so external programs can tell what
39 # the server library was built with.
42 HEADERS_DY = src/include/features.h src/include/missing.h src/include/tls.h \
43 src/include/radpaths.h src/include/attributes.h
45 src/include/autoconf.sed: src/include/autoconf.h
46 @grep ^#define $< | sed 's,/\*\*/,1,;' | awk '{print "\
47 s,#[[:blank:]]*ifdef[[:blank:]]*" $$2 ",#if "$$3 ",g;\
48 s,#[[:blank:]]*ifndef[[:blank:]]*" $$2 ",#if !"$$3 ",g;\
49 s,defined(" $$2 ")," $$3 ",g;\
50 s," $$2 ","$$3 ",g;"}' > $@
52 src/include/radius.h: | src/include/attributes.h
54 src/include/attributes.h: share/dictionary.freeradius.internal
56 @./scripts/dict2h.pl $< > $@
58 src/freeradius-devel/features.h: src/include/features.h src/freeradius-devel
60 src/include/features.h: src/include/features-h src/include/autoconf.h
63 @grep "^#define[[:blank:]]\{1,\}WITH_" src/include/autoconf.h >> $@
64 @grep "^#define[[:blank:]]\{1,\}RADIUSD_VERSION" src/include/autoconf.h >> $@
66 src/freeradius-devel/missing.h: src/include/missing.h src/freeradius-devel
68 src/include/missing.h: src/include/missing-h src/include/autoconf.sed
70 @sed -f src/include/autoconf.sed < $< > $@
72 src/freeradius-devel/tls.h: src/include/tls.h src/freeradius-devel
74 src/include/tls.h: src/include/tls-h src/include/autoconf.sed
76 @sed -f src/include/autoconf.sed < $< > $@
78 src/freeradius-devel/radpaths.h: src/include/radpaths.h src/freeradius-devel
80 src/include/radpaths.h: src/include/build-radpaths-h
82 @cd src/include && /bin/sh build-radpaths-h
84 ${BUILD_DIR}/make/jlibtool: $(HEADERS_DY)
89 # define the installation directory
90 SRC_INCLUDE_DIR := ${R}${includedir}/freeradius
93 @$(INSTALL) -d -m 755 ${SRC_INCLUDE_DIR}
95 # install the headers by re-writing the local files
97 # install-sh function for creating directories gets confused
98 # if there's a trailing slash, tries to create a directory
99 # it already created, and fails...
100 ${SRC_INCLUDE_DIR}/%.h: ${top_srcdir}/src/include/%.h | $(SRC_INCLUDE_DIR)
101 @echo INSTALL $(notdir $<)
102 @$(INSTALL) -d -m 755 `echo $(dir $@) | sed 's/\/$$//'`
103 @sed 's/^#include <freeradius-devel/#include <freeradius/' < $< > $@
106 install.src.include: $(addprefix ${SRC_INCLUDE_DIR}/,${HEADERS})
107 install: install.src.include
112 .PHONY: clean.src.include distclean.src.include
116 clean: clean.src.include
118 distclean.src.include: clean.src.include
121 distclean: distclean.src.include