4 # NOTE: This top-level Makefile must not
5 # use GNU-make extensions. The lower ones can.
12 .PHONY: all clean install
14 SUBDIRS = $(LTDL_SUBDIRS) src raddb scripts doc
18 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
21 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
25 # The $(R) is a magic variable not defined anywhere in this source.
26 # It's purpose is to allow an admin to create an installation 'tar'
27 # file *without* actually installing it. e.g.:
29 # $ R=/home/root/tmp make install
31 # $ tar -cf ~/freeradius-package.tar *
33 # The 'tar' file can then be un-tar'd on any similar machine. It's a
34 # cheap way of creating packages, without using a package manager.
35 # Many of the platform-specific packaging tools use the $(R) variable
36 # when creating their packages.
38 # For compatibility with typical GNU packages (e.g. as seen in libltdl),
39 # we make sure DESTDIR is defined.
41 export DESTDIR := $(R)
43 $(INSTALL) -d -m 755 $(R)$(sbindir)
44 $(INSTALL) -d -m 755 $(R)$(bindir)
45 $(INSTALL) -d -m 755 $(R)$(raddbdir)
46 $(INSTALL) -d -m 755 $(R)$(mandir)
47 $(INSTALL) -d -m 755 $(R)$(RUNDIR)
48 $(INSTALL) -d -m 700 $(R)$(logdir)
49 $(INSTALL) -d -m 700 $(R)$(radacctdir)
50 $(INSTALL) -d -m 755 $(R)$(datadir)
51 $(INSTALL) -d -m 755 $(R)$(dictdir)
53 $(INSTALL) -d -m 755 $(R)$(mandir)/man$$i; \
54 for p in man/man$$i/*.$$i; do \
55 $(INSTALL) -m 644 $$p $(R)$(mandir)/man$$i; \
58 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
59 @echo "Installing dictionary files in $(R)$(dictdir)"; \
61 for i in dictionary*; do \
62 $(INSTALL) -m 644 $$i $(R)$(dictdir); \
64 $(LIBTOOL) --finish $(R)$(libdir)
67 @for dir in $(SUBDIRS); do \
68 echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
69 $(MAKE) $(MFLAGS) -C $$dir $(WHAT_TO_MAKE) || exit $$?; \
73 rm -f config.cache config.log config.status libtool \
74 src/include/radpaths.h src/include/stamp-h \
75 libltdl/config.log libltdl/config.status \
77 -find . ! -name configure.in -name \*.in -print | \
79 while read file; do rm -f $$file; done
80 -find src/modules -name config.mak | \
81 while read file; do rm -f $$file; done
82 -find src/modules -name config.h | \
83 while read file; do rm -f $$file; done
85 ######################################################################
87 # Automatic remaking rules suggested by info:autoconf#Automatic_Remaking
89 ######################################################################
90 reconfig: configure src/include/autoconf.h.in
92 configure: configure.in aclocal.m4
95 # autoheader might not change autoconf.h.in, so touch a stamp file
96 src/include/autoconf.h.in: src/include/stamp-h.in acconfig.h
97 src/include/stamp-h.in: configure.in acconfig.h
99 echo timestamp > src/include/stamp-h.in
101 src/include/autoconf.h: src/include/stamp-h
102 src/include/stamp-h: src/include/autoconf.h.in config.status
105 config.status: configure
106 ./config.status --recheck
111 etags `find src -type f -name '*.[ch]' -print`