Changed comments calling the code Cistron to FreeRADIUS. Corrected some
[freeradius.git] / Makefile
index ae64d7e..0b5394a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# Makefile     Makefile for the cistron-radius package.
+# Makefile
 #
 #              NOTE: This top-level Makefile must not
 #              use GNU-make extensions. The lower ones can.
@@ -9,7 +9,7 @@
 
 include Make.inc
 
-SUBDIRS                = src raddb doc scripts
+SUBDIRS                = libltdl src raddb doc scripts
 WHAT_TO_MAKE   = all
 
 all:
@@ -21,21 +21,25 @@ clean:
 
 install:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-       install -d -m 755       $(mandir);
+       $(INSTALL) -d -m 755    $(R)$(mandir);
+       $(INSTALL) -d -m 755    $(R)$(RUNDIR);
        for i in 1 5 8; do \
-               install -d -m 755       $(mandir)/man$$i; \
-               install -m 444 man/man$$i/*.$$i $(mandir)/man$$i; \
+               $(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
-       @echo "Creating/updating files in $(raddbdir)"; \
-       install -d -m 755       $(raddbdir); \
+       @echo "Creating/updating files in $(R)$(raddbdir)"; \
+       $(INSTALL) -d -m 755    $(R)$(raddbdir); \
        cd raddb; \
        for i in [a-c]* [e-z]*; do \
-               [ ! -f $(raddbdir)/$$i ] && install -m 644 $$i $(raddbdir); \
+               [ $$i != radiusd.conf.in -a ! -f $(R)$(raddbdir)/$$i ] && \
+                $(INSTALL) -m 644 $$i $(R)$(raddbdir); \
        done; \
        for i in dictionary*; do \
-               [ ! -f $(raddbdir)/$$i ] && install -m 644 $$i $(raddbdir); \
-               if [ $$i -nt $(raddbdir)/$$i ]; then \
-                       echo "** $(raddbdir)/$$i"; \
+               [ ! -f $(R)$(raddbdir)/$$i ] && $(INSTALL) -m 644 $$i $(R)$(raddbdir); \
+               if [ "`find $$i -newer $(R)$(raddbdir)/$$i`" ]; then \
+                       echo "** $(R)$(raddbdir)/$$i"; \
                        nt=1; \
                fi; \
        done; \
@@ -51,7 +55,10 @@ common:
        done
 
 distclean: clean
-       rm -f config.cache config.log config.status
+       rm -f config.cache config.log config.status libtool \
+               src/include/radpaths.h src/include/stamp-h \
+               libltdl/config.log libltdl/config.status \
+               libltdl/libtool
        -find . ! -name configure.in -name \*.in -print | \
                sed 's/\.in$$//' | \
                while read file; do rm -f $$file; done
@@ -60,6 +67,12 @@ distclean: clean
        -find src/modules -name config.h | \
                while read file; do rm -f $$file; done
 
+ifndef prefix  # catch runs without configuring, and give helpful advice.
+Make.inc:
+       @echo "   Sorry!  You must run 'configure', before 'make'.";
+       @false
+endif
+
 ######################################################################
 #
 #  Automatic remaking rules suggested by info:autoconf#Automatic_Remaking
@@ -68,12 +81,12 @@ distclean: clean
 reconfig: configure src/include/autoconf.h.in
 
 configure: configure.in aclocal.m4
-       autoconf
+       $(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
-       autoheader
+       $(AUTOHEADER)
        echo timestamp > src/include/stamp-h.in
 
 src/include/autoconf.h: src/include/stamp-h