X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=Makefile;h=adb4c2d91d4ba8335b66330e7579f2aa721108c4;hb=refs%2Fheads%2Feap-chbind;hp=28929c364e2c73e9246be861b5774e7bc1b84992;hpb=70185af97d07e0cbe7b9ea3a3717b8c129cae757;p=freeradius.git diff --git a/Makefile b/Makefile index 28929c3..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,7 @@ all: clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -f *~ +endif .PHONY: tests tests: @@ -43,6 +88,7 @@ tests: # we make sure DESTDIR is defined. # export DESTDIR := $(R) +ifeq "$(BOILERMAKE)" "" install: $(INSTALL) -d -m 755 $(R)$(sbindir) $(INSTALL) -d -m 755 $(R)$(bindir) @@ -66,6 +112,7 @@ install: $(INSTALL) -m 644 $$i $(R)$(dictdir); \ done $(LIBTOOL) --finish $(R)$(libdir) +endif ifneq ($(RADMIN),) ifneq ($(RGROUP),) @@ -88,11 +135,13 @@ install-chown: endif endif -common: - @for dir in $(SUBDIRS); do \ - echo "Making $(WHAT_TO_MAKE) in $$dir..."; \ - $(MAKE) $(MFLAGS) -C $$dir $(WHAT_TO_MAKE) || exit $$?; \ - done +.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 \ @@ -112,20 +161,18 @@ 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 -src/include/stamp-h.in: configure.in +.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 @@ -170,10 +217,14 @@ freeradius-server-$(RADIUSD_VERSION).tar.bz2.sig: freeradius-server-$(RADIUSD_VE .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