X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=Makefile;h=adb4c2d91d4ba8335b66330e7579f2aa721108c4;hb=refs%2Fheads%2Feap-chbind;hp=c9436db02b91e092b2c3786518d305313ae78ed2;hpb=57dfe2c2a4090fd843662b99e21ecc0498944c80;p=freeradius.git diff --git a/Makefile b/Makefile index c9436db..adb4c2d 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,54 @@ # include Make.inc +MFLAGS += --no-print-directory +# Speed up the build for developers. This means editing Make.inc, +# and adding "BOILER = yes" to the bottom. Once that's done, the +# +# +ifeq "$(BOILER)" "yes" + +# Require at least GNU Make 3.81 for the new build system +# Don't allow 3.80. Allow any 3.8x. This will need to be changed +# in a decade or two when GNU Make 3.90 is released. +BOILERMAKE=$(subst 3.8,yes,$(subst 3.80,,$(MAKE_VERSION))) + +# The version of GNU Make is too old, don't use it. +ifeq "" "$(findstring yes,$(BOILERMAKE))" +BOILERMAKE= +endif + +# Static-only builds still require libtool. +# This is because it does all kinds of preload magic in order +# to force the linker to put the libraries into the main binary. +# We don't support that yet, so we miss it... +ifneq "$(USE_SHARED_LIBS)" "yes" +BOILERMAKE= +endif +endif + +# If possible, drastically decrease the build time. +# The new build system means that +ifneq "" "$(BOILERMAKE)" + +# Don't use libtool or libltdl. +# They are a blight upon the face of the earth. +LIBLTDL := +INCLTDL := -DWITH_DLOPEN +CFLAGS += -DWITHOUT_LIBLTDL +LIBTOOL := JLIBTOOL +LTDL_SUBDIRS := + +export DESTDIR := $(R) + +# And over-ride all of the other magic. +include scripts/boiler.mk + +else .PHONY: all clean install -SUBDIRS = $(LTDL_SUBDIRS) src raddb scripts doc +SUBDIRS = $(LTDL_SUBDIRS) $(wildcard src raddb scripts doc) WHAT_TO_MAKE = all all: @@ -20,6 +64,11 @@ all: clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -f *~ +endif + +.PHONY: tests +tests: + @$(MAKE) -C src/tests tests # # The $(R) is a magic variable not defined anywhere in this source. @@ -39,6 +88,7 @@ clean: # we make sure DESTDIR is defined. # export DESTDIR := $(R) +ifeq "$(BOILERMAKE)" "" install: $(INSTALL) -d -m 755 $(R)$(sbindir) $(INSTALL) -d -m 755 $(R)$(bindir) @@ -62,12 +112,36 @@ install: $(INSTALL) -m 644 $$i $(R)$(dictdir); \ done $(LIBTOOL) --finish $(R)$(libdir) +endif -common: - @for dir in $(SUBDIRS); do \ - echo "Making $(WHAT_TO_MAKE) in $$dir..."; \ - $(MAKE) $(MFLAGS) -C $$dir $(WHAT_TO_MAKE) || exit $$?; \ - done +ifneq ($(RADMIN),) +ifneq ($(RGROUP),) +.PHONY: install-chown +install-chown: + chown -R $(RADMIN) $(R)$(raddbdir) + chgrp -R $(RGROUP) $(R)$(raddbdir) + chmod u=rwx,g=rx,o= `find $(R)$(raddbdir) -type d -print` + chmod u=rw,g=r,o= `find $(R)$(raddbdir) -type f -print` + chown -R $(RADMIN) $(R)$(logdir) + chgrp -R $(RGROUP) $(R)$(logdir) + find $(R)$(logdir) -type d -exec chmod u=rwx,g=rwx,o= {} \; + find $(R)$(logdir) -type d -exec chmod g+s {} \; + find $(R)$(logdir) -type f -exec chmod u=rw,g=rw,o= {} \; + chown -R $(RADMIN) $(R)$(RUNDIR) + chgrp -R $(RGROUP) $(R)$(RUNDIR) + find $(R)$(RUNDIR) -type d -exec chmod u=rwx,g=rwx,o= {} \; + find $(R)$(RUNDIR) -type d -exec chmod g+s {} \; + find $(R)$(RUNDIR) -type f -exec chmod u=rw,g=rw,o= {} \; +endif +endif + +.PHONY: common $(SUBDIRS) + +common: $(SUBDIRS) + +$(SUBDIRS): + @echo "Making $(WHAT_TO_MAKE) in $@..." + @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) distclean: clean rm -f config.cache config.log config.status libtool \ @@ -87,25 +161,96 @@ distclean: clean # Automatic remaking rules suggested by info:autoconf#Automatic_Remaking # ###################################################################### -reconfig: configure src/include/autoconf.h.in +.PHONY: reconfig +reconfig: + @$(MAKE) $(MFLAGS) -C src reconfig + @$(MAKE) configure + @$(MAKE) src/include/autoconf.h.in configure: configure.in aclocal.m4 $(AUTOCONF) -# autoheader might not change autoconf.h.in, so touch a stamp file -src/include/autoconf.h.in: src/include/stamp-h.in acconfig.h -src/include/stamp-h.in: configure.in acconfig.h +.PHONY: src/include/autoconf.h.in +src/include/autoconf.h.in: $(AUTOHEADER) - echo timestamp > src/include/stamp-h.in - -src/include/autoconf.h: src/include/stamp-h -src/include/stamp-h: src/include/autoconf.h.in config.status - ./config.status config.status: configure ./config.status --recheck configure.in: +.PHONY: check-includes +check-includes: + scripts/min-includes.pl `find . -name "*.c" -print` + TAGS: etags `find src -type f -name '*.[ch]' -print` + +# +# Make test certificates. +# +.PHONY: certs +certs: + @cd raddb/certs && $(MAKE) + +###################################################################### +# +# Make a release. +# +# Note that "Make.inc" has to be updated with the release number +# BEFORE running this command! +# +###################################################################### +freeradius-server-$(RADIUSD_VERSION).tar.gz: .git + git archive --format=tar --prefix=freeradius-server-$(RADIUSD_VERSION)/ stable | gzip > $@ + +freeradius-server-$(RADIUSD_VERSION).tar.gz.sig: freeradius-server-$(RADIUSD_VERSION).tar.gz + gpg --default-key aland@freeradius.org -b $< + +freeradius-server-$(RADIUSD_VERSION).tar.bz2: .git + git archive --format=tar --prefix=freeradius-server-$(RADIUSD_VERSION)/ stable | bzip2 > $@ + +freeradius-server-$(RADIUSD_VERSION).tar.bz2.sig: freeradius-server-$(RADIUSD_VERSION).tar.bz2 + gpg --default-key aland@freeradius.org -b $< + +# high-level targets +.PHONY: dist-check +dist-check: redhat/freeradius.spec suse/freeradius.spec debian/changelog + @if [ `grep ^Version: redhat/freeradius.spec | sed 's/.*://;s/ //'` != "$(RADIUSD_VERSION)" ]; then \ + cat redhat/freeradius.spec | sed 's/^Version: .*/Version: $(RADIUSD_VERSION)/' > redhat/.foo; \ + mv redhat/.foo redhat/freeradius.spec; \ + echo redhat/freeradius.spec 'Version' needs to be updated; \ + exit 1; \ + fi + @if [ `grep ^Version: suse/freeradius.spec | sed 's/.*://;s/ //'` != "$(RADIUSD_VERSION)" ]; then \ + cat suse/freeradius.spec | sed 's/^Version: .*/Version: $(RADIUSD_VERSION)/' > suse/.foo; \ + mv suse/.foo suse/freeradius.spec; \ + echo suse/freeradius.spec 'Version' needs to be updated; \ + exit 1; \ + fi + @if [ `head -n 1 debian/changelog | sed 's/.*(//;s/-0).*//;s/-1).*//;'` != "$(RADIUSD_VERSION)" ]; then \ + echo debian/changelog needs to be updated; \ + exit 1; \ + fi + +dist: dist-check freeradius-server-$(RADIUSD_VERSION).tar.gz freeradius-server-$(RADIUSD_VERSION).tar.bz2 + +dist-sign: freeradius-server-$(RADIUSD_VERSION).tar.gz.sig freeradius-server-$(RADIUSD_VERSION).tar.bz2.sig + +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 + scp $^ freeradius.org@ns5.freeradius.org:public_ftp + scp $^ freeradius.org@www.tr.freeradius.org:public_ftp + +# +# Note that we do NOT do the tagging here! We just print out what +# to do! +# +dist-tag: freeradius-server-$(RADIUSD_VERSION).tar.gz freeradius-server-$(RADIUSD_VERSION).tar.bz2 + @echo "git tag release_`echo $(RADIUSD_VERSION) | tr .- __`" + +# +# Build a debian package +# +.PHONY: deb +deb: + fakeroot dpkg-buildpackage -b -uc