Fix rules for installing header files
[freeradius.git] / src / include / all.mk
1 #
2 # Makefile
3 #
4 # Version:      $Id$
5 #
6
7 HEADERS = autoconf.h conf.h conffile.h detail.h dhcp.h event.h hash.h heap.h \
8         ident.h libradius.h md4.h md5.h missing.h modcall.h modules.h \
9         packet.h rad_assert.h radius.h radiusd.h radpaths.h \
10         radutmp.h realms.h sha1.h stats.h sysutmp.h token.h \
11         udpfromto.h vmps.h vqp.h
12
13 # Our target
14 TARGET  := src/include/radpaths.h
15
16 src/include/radpaths.h: src/include/build-radpaths-h
17         cd src/include && /bin/sh build-radpaths-h
18
19 # global install depends on the local rule
20 install: install.src.include
21
22 # define the installation directory
23 SRC_INCLUDE_DIR := ${R}${includedir}/freeradius
24
25 # the local rule depends on the installed headers
26 install.src.include: $(addprefix ${SRC_INCLUDE_DIR}/,${HEADERS})
27
28 # the installed headers require a directory
29 $(addprefix ${SRC_INCLUDE_DIR}/,${HEADERS}): ${SRC_INCLUDE_DIR}/
30
31 # make the directory
32 .PHONY: 
33 ${SRC_INCLUDE_DIR}/:
34         $(INSTALL) -d -m 755 $@
35
36 # install the headers by re-writing the local files
37 ${SRC_INCLUDE_DIR}/%.h: ${top_srcdir}/src/include/%.h
38         @echo INSTALL $(notdir $<)
39         @sed 's/^#include <freeradius-devel/#include <freeradius/' < $< > $@
40         @chmod 644 $@