install each man page explicitely, due to bugs in the install-sh
[freeradius.git] / Makefile
index 4615c13..52f1c7d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@
 
 include Make.inc
 
-SUBDIRS                = src raddb doc scripts
+SUBDIRS                = libltdl src raddb doc scripts
 WHAT_TO_MAKE   = all
 
 all:
@@ -21,6 +21,31 @@ clean:
 
 install:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
+       $(INSTALL) -d -m 755    $(R)$(mandir);
+       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
+       @echo "Creating/updating files in $(R)$(raddbdir)"; \
+       $(INSTALL) -d -m 755    $(R)$(raddbdir); \
+       cd raddb; \
+       for i in [a-c]* [e-z]*; do \
+               [ $$i != radiusd.conf.in -a ! -f $(R)$(raddbdir)/$$i ] && \
+                $(INSTALL) -m 644 $$i $(R)$(raddbdir); \
+       done; \
+       for i in dictionary*; do \
+               [ ! -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; \
+       if [ "$$nt" ]; then \
+               echo "** The samples in ../raddb are newer than these files";\
+               echo "** Please investigate and copy manually if appropriate";\
+       fi
 
 common:
        @for dir in $(SUBDIRS); do \
@@ -29,10 +54,23 @@ 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
+       -find src/modules -name config.mak | \
+               while read file; do rm -f $$file; done
+       -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
 
 ######################################################################
 #
@@ -41,13 +79,13 @@ distclean: clean
 ######################################################################
 reconfig: configure src/include/autoconf.h.in
 
-configure: configure.in
-       autoconf
+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 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