import from branch_1_1:
[freeradius.git] / Makefile
index 7778316..21709e8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ include Make.inc
 
 .PHONY: all clean install
 
-SUBDIRS                = ${LIBLTDLPATH} src raddb scripts doc
+SUBDIRS                = $(LTDL_SUBDIRS) src raddb scripts doc
 WHAT_TO_MAKE   = all
 
 all:
@@ -35,6 +35,10 @@ clean:
 # Many of the platform-specific packaging tools use the $(R) variable
 # when creating their packages.
 #
+# For compatibility with typical GNU packages (e.g. as seen in libltdl),
+# we make sure DESTDIR is defined.
+#
+export DESTDIR := $(R)
 install:
        $(INSTALL) -d -m 755    $(R)$(sbindir)
        $(INSTALL) -d -m 755    $(R)$(bindir)
@@ -62,7 +66,7 @@ install:
 common:
        @for dir in $(SUBDIRS); do \
                echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
-               (cd $$dir && $(MAKE) $(MFLAGS) $(WHAT_TO_MAKE)) || exit $?;\
+               $(MAKE) $(MFLAGS) -C $$dir $(WHAT_TO_MAKE) || exit $$?; \
        done
 
 distclean: clean
@@ -103,5 +107,9 @@ config.status: configure
 
 configure.in:
 
+.PHONY: check-includes
+check-includes:
+       scripts/min-includes.pl `find . -name "*.c" -print`
+
 TAGS:
        etags `find src -type f -name '*.[ch]' -print`