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
26 @$(MAKE) -C src/tests tests
29 # The $(R) is a magic variable not defined anywhere in this source.
30 # It's purpose is to allow an admin to create an installation 'tar'
31 # file *without* actually installing it. e.g.:
33 # $ R=/home/root/tmp make install
35 # $ tar -cf ~/freeradius-package.tar *
37 # The 'tar' file can then be un-tar'd on any similar machine. It's a
38 # cheap way of creating packages, without using a package manager.
39 # Many of the platform-specific packaging tools use the $(R) variable
40 # when creating their packages.
42 # For compatibility with typical GNU packages (e.g. as seen in libltdl),
43 # we make sure DESTDIR is defined.
45 export DESTDIR := $(R)
47 $(INSTALL) -d -m 755 $(R)$(sbindir)
48 $(INSTALL) -d -m 755 $(R)$(bindir)
49 $(INSTALL) -d -m 755 $(R)$(raddbdir)
50 $(INSTALL) -d -m 755 $(R)$(mandir)
51 $(INSTALL) -d -m 755 $(R)$(RUNDIR)
52 $(INSTALL) -d -m 700 $(R)$(logdir)
53 $(INSTALL) -d -m 700 $(R)$(radacctdir)
54 $(INSTALL) -d -m 755 $(R)$(datadir)
55 $(INSTALL) -d -m 755 $(R)$(dictdir)
57 $(INSTALL) -d -m 755 $(R)$(mandir)/man$$i; \
58 for p in man/man$$i/*.$$i; do \
59 $(INSTALL) -m 644 $$p $(R)$(mandir)/man$$i; \
62 @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
63 @echo "Installing dictionary files in $(R)$(dictdir)"; \
65 for i in dictionary*; do \
66 $(INSTALL) -m 644 $$i $(R)$(dictdir); \
68 $(LIBTOOL) --finish $(R)$(libdir)
74 chown -R $(RADMIN) $(R)$(raddbdir)
75 chgrp -R $(RGROUP) $(R)$(raddbdir)
76 chmod u=rwx,g=rx,o= `find $(R)$(raddbdir) -type d -print`
77 chmod u=rw,g=r,o= `find $(R)$(raddbdir) -type f -print`
78 chown -R $(RADMIN) $(R)$(logdir)
79 chgrp -R $(RGROUP) $(R)$(logdir)
80 find $(R)$(logdir) -type d -exec chmod u=rwx,g=rwx,o= {} \;
81 find $(R)$(logdir) -type d -exec chmod g+s {} \;
82 find $(R)$(logdir) -type f -exec chmod u=rw,g=rw,o= {} \;
83 find $(R)$(RUNDIR) -type d -exec chmod u=rwx,g=rwx,o= {} \;
84 find $(R)$(RUNDIR) -type d -exec chmod g+s {} \;
85 find $(R)$(RUNDIR) -type f -exec chmod u=rw,g=rw,o= {} \;
90 @for dir in $(SUBDIRS); do \
91 echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
92 $(MAKE) $(MFLAGS) -C $$dir $(WHAT_TO_MAKE) || exit $$?; \
96 rm -f config.cache config.log config.status libtool \
97 src/include/radpaths.h src/include/stamp-h \
98 libltdl/config.log libltdl/config.status \
100 -find . ! -name configure.in -name \*.in -print | \
102 while read file; do rm -f $$file; done
103 -find src/modules -name config.mak | \
104 while read file; do rm -f $$file; done
105 -find src/modules -name config.h | \
106 while read file; do rm -f $$file; done
108 ######################################################################
110 # Automatic remaking rules suggested by info:autoconf#Automatic_Remaking
112 ######################################################################
113 reconfig: configure src/include/autoconf.h.in
115 configure: configure.in aclocal.m4
118 # autoheader might not change autoconf.h.in, so touch a stamp file
119 src/include/autoconf.h.in: src/include/stamp-h.in
120 src/include/stamp-h.in: configure.in
122 echo timestamp > src/include/stamp-h.in
124 src/include/autoconf.h: src/include/stamp-h
125 src/include/stamp-h: src/include/autoconf.h.in config.status
128 config.status: configure
129 ./config.status --recheck
133 .PHONY: check-includes
135 scripts/min-includes.pl `find . -name "*.c" -print`
138 etags `find src -type f -name '*.[ch]' -print`
141 # Make test certificates.
145 @cd raddb/certs && $(MAKE)
147 ######################################################################
151 # Note that "Make.inc" has to be updated with the release number
152 # BEFORE running this command!
154 ######################################################################
155 freeradius-server-$(RADIUSD_VERSION): CVS
156 @CVSROOT=`cat CVS/Root`; \
157 cvs -d $$CVSROOT checkout -P -d freeradius-server-$(RADIUSD_VERSION) radiusd
159 freeradius-server-$(RADIUSD_VERSION).tar.gz: freeradius-server-$(RADIUSD_VERSION)
160 @tar --exclude=CVS -zcf $@ $<
162 freeradius-server-$(RADIUSD_VERSION).tar.gz.sig: freeradius-server-$(RADIUSD_VERSION).tar.gz
163 gpg --default-key aland@freeradius.org -b $<
165 freeradius-server-$(RADIUSD_VERSION).tar.bz2: freeradius-server-$(RADIUSD_VERSION)
166 @tar --exclude=CVS -jcf $@ $<
168 freeradius-server-$(RADIUSD_VERSION).tar.bz2.sig: freeradius-server-$(RADIUSD_VERSION).tar.bz2
169 gpg --default-key aland@freeradius.org -b $<
173 dist-check: redhat/freeradius.spec suse/freeradius.spec debian/changelog
174 @if [ `grep ^Version: redhat/freeradius.spec | sed 's/.*://;s/ //'` != "$(RADIUSD_VERSION)" ]; then \
175 echo redhat/freeradius.spec 'Version' needs to be updated; \
178 @if [ `grep ^Version: suse/freeradius.spec | sed 's/.*://;s/ //'` != "$(RADIUSD_VERSION)" ]; then \
179 echo suse/freeradius.spec 'Version' needs to be updated; \
182 @if [ `head -n 1 debian/changelog | sed 's/.*(//;s/-0).*//;s/-1).*//;'` != "$(RADIUSD_VERSION)" ]; then \
183 echo debian/changelog needs to be updated; \
187 dist: dist-check freeradius-server-$(RADIUSD_VERSION).tar.gz freeradius-server-$(RADIUSD_VERSION).tar.bz2
189 dist-sign: freeradius-server-$(RADIUSD_VERSION).tar.gz.sig freeradius-server-$(RADIUSD_VERSION).tar.bz2.sig
191 dist-publish: freeradius-server-$(RADIUSD_VERSION).tar.gz.sig freeradius-server-$(RADIUSD_VERSION).tar.gz freeradius-server-$(RADIUSD_VERSION).tar.gz.sig freeradius-server-$(RADIUSD_VERSION).tar.bz2 freeradius-server-$(RADIUSD_VERSION).tar.gz.sig freeradius-server-$(RADIUSD_VERSION).tar.bz2.sig
192 scp $^ freeradius.org@freeradius.org:public_ftp
195 # Note that we do NOT do the tagging here! We just print out what
198 dist-tag: freeradius-server-$(RADIUSD_VERSION).tar.gz freeradius-server-$(RADIUSD_VERSION).tar.bz2
199 @echo "cd freeradius-server-$(RADIUSD_VERSION) && cvs tag release_`echo $(RADIUSD_VERSION) | tr .- __` && cd .."
202 # Build a debian package
206 fakeroot dpkg-buildpackage -b -uc