X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=Makefile;h=cfcb30c03196ba87e4fa76ee379d711ec0cf06ae;hb=refs%2Fheads%2Feap-chbind2;hp=24953d15514deba38ea0b08dbdbeeeb09caf1768;hpb=669f3fd65482bbb83975d6df84eb430b02c722a8;p=freeradius.git diff --git a/Makefile b/Makefile index 24953d1..cfcb30c 100644 --- a/Makefile +++ b/Makefile @@ -10,19 +10,9 @@ 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))" +# The version of GNU Make is too old, don't use it (.FEATURES variable was +# wad added in 3.81) +ifndef .FEATURES $(error The build system requires GNU Make 3.81 or later.) endif @@ -31,22 +21,8 @@ export DESTDIR := $(R) # And over-ride all of the other magic. include scripts/boiler.mk -else -.PHONY: all clean install - -SUBDIRS = $(wildcard src raddb scripts doc) -WHAT_TO_MAKE = all - -all: - @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common - -clean: - @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common - @rm -f *~ -endif - -.PHONY: tests -tests: +test: build.raddb + @$(MAKE) -C raddb/certs @$(MAKE) -C src/tests tests # @@ -68,11 +44,16 @@ tests: # export DESTDIR := $(R) +.PHONY: install.bindir +install.bindir: + @[ -d $(R)$(bindir) ] || $(INSTALL) -d -m 755 $(R)$(bindir) + +.PHONY: install.sbindir +install.sbindir: + @[ -d $(R)$(sbindir) ] || $(INSTALL) -d -m 755 $(R)$(sbindir) + .PHONY: install.dirs -install.dirs: - @$(INSTALL) -d -m 755 $(R)$(sbindir) - @$(INSTALL) -d -m 755 $(R)$(bindir) - @$(INSTALL) -d -m 755 $(R)$(raddbdir) +install.dirs: install.bindir install.sbindir @$(INSTALL) -d -m 755 $(R)$(mandir) @$(INSTALL) -d -m 755 $(R)$(RUNDIR) @$(INSTALL) -d -m 700 $(R)$(logdir) @@ -94,14 +75,8 @@ $(R)$(mandir)/%: man/% @echo INSTALL $(notdir $<) @$(INSTALL) -m 644 $< $@ -ifneq "$(BOILERMAKE)" "" install: install.dirs install.share install.man -else -install: install.dirs install.man install.share - @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common -endif - ifneq ($(RADMIN),) ifneq ($(RGROUP),) .PHONY: install-chown @@ -123,14 +98,6 @@ install-chown: 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 \ src/include/radpaths.h src/include/stamp-h \ @@ -149,24 +116,33 @@ distclean: clean # Automatic remaking rules suggested by info:autoconf#Automatic_Remaking # ###################################################################### -.PHONY: reconfig -reconfig: - @$(MAKE) $(MFLAGS) -C src reconfig - @$(MAKE) configure - @$(MAKE) src/include/autoconf.h.in - -configure: configure.in aclocal.m4 - $(AUTOCONF) - -.PHONY: src/include/autoconf.h.in -src/include/autoconf.h.in: - $(AUTOHEADER) +CONFIGURE_IN_FILES := $(shell find . -name configure.in -print) +CONFIGURE_FILES := $(patsubst %.in,%,$(CONFIGURE_IN_FILES)) + +# Configure files depend on "in" files, and on the top-level macro files +# If there are headers, run auto-header, too. +src/%configure: src/%configure.in acinclude.m4 aclocal.m4 + @echo AUTOCONF $@ + @cd $(dir $@) && $(AUTOCONF) -I $(top_builddir) -I $(top_builddir)/m4 -I ./m4 + @if grep AC_CONFIG_HEADERS $@ >/dev/null; then\ + echo AUTOHEADER $@ \ + cd $(dir $@) && $(AUTOHEADER); \ + fi + +# "%configure" doesn't match "configure" +configure: configure.in $(wildcard ac*.m4) + @echo AUTOCONF $@ + @$(AUTOCONF) + +src/include/autoconf.h.in: configure.in + @echo AUTOHEADER $@ + @$(AUTOHEADER) + +reconfig: $(CONFIGURE_FILES) src/include/autoconf.h.in config.status: configure ./config.status --recheck -configure.in: - .PHONY: check-includes check-includes: scripts/min-includes.pl `find . -name "*.c" -print` @@ -242,3 +218,9 @@ dist-tag: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$ .PHONY: deb deb: fakeroot dpkg-buildpackage -b -uc + +# Developer checks +.PHONY: warnings +warnings: + @(make clean all 2>&1) | egrep -v '^/|deprecated|^In file included|: In function| from |^HEADER|^CC|^LINK' > warnings.txt + @wc -l warnings.txt