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
# 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
+# These are not yet converted to the new system
+SUBDIRS = $(wildcard raddb)
-.PHONY: tests
-tests:
+.PHONY: test
+test:
+ @$(MAKE) -C raddb/certs
@$(MAKE) -C src/tests tests
#
# we make sure DESTDIR is defined.
#
export DESTDIR := $(R)
-ifeq "$(BOILERMAKE)" ""
+
+.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.raddbdir
+install.raddbdir:
+ @[ -d $(R)$(raddbdir) ] || $(INSTALL) -d -m 755 $(R)$(raddbdir)
+
+.PHONY: install.dirs
+install.dirs: install.bindir install.sbindir
+ @$(INSTALL) -d -m 755 $(R)$(mandir)
+ @$(INSTALL) -d -m 755 $(R)$(RUNDIR)
+ @$(INSTALL) -d -m 700 $(R)$(logdir)
+ @$(INSTALL) -d -m 700 $(R)$(radacctdir)
+ @$(INSTALL) -d -m 755 $(R)$(datadir)
+ @$(INSTALL) -d -m 755 $(R)$(dictdir)
+
+DICTIONARIES := $(wildcard share/dictionary*)
+install.share: $(addprefix $(R)$(dictdir)/,$(notdir $(DICTIONARIES)))
+
+$(R)$(dictdir)/%: share/%
+ @echo INSTALL $(notdir $<)
+ @$(INSTALL) -m 644 $< $@
+
+MANFILES := $(wildcard man/man*/*.?)
+install.man: $(subst man/,$(R)$(mandir)/,$(MANFILES))
+
+$(R)$(mandir)/%: man/%
+ @echo INSTALL $(notdir $<)
+ @$(INSTALL) -m 644 $< $@
+
+install: install.dirs install.share install.man
+
install:
- $(INSTALL) -d -m 755 $(R)$(sbindir)
- $(INSTALL) -d -m 755 $(R)$(bindir)
- $(INSTALL) -d -m 755 $(R)$(raddbdir)
- $(INSTALL) -d -m 755 $(R)$(mandir)
- $(INSTALL) -d -m 755 $(R)$(RUNDIR)
- $(INSTALL) -d -m 700 $(R)$(logdir)
- $(INSTALL) -d -m 700 $(R)$(radacctdir)
- $(INSTALL) -d -m 755 $(R)$(datadir)
- $(INSTALL) -d -m 755 $(R)$(dictdir)
- for i in 1 5 8; do \
- $(INSTALL) -d -m 755 $(R)$(mandir)/man$$i; \
- for p in man/man$$i/*.$$i; do \
- $(INSTALL) -m 644 $$p $(R)$(mandir)/man$$i; \
- done \
- done
@$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
- @echo "Installing dictionary files in $(R)$(dictdir)"; \
- cd share; \
- for i in dictionary*; do \
- $(INSTALL) -m 644 $$i $(R)$(dictdir); \
- done
-endif
ifneq ($(RADMIN),)
ifneq ($(RGROUP),)
.PHONY: common $(SUBDIRS)
+#
+# We need to convert these directories to boilermake!
+#
+all:
+ @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
+
common: $(SUBDIRS)
$(SUBDIRS):
.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