From 6de1659640fa5d2a3b27bec69cd13d87b905d5c4 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 24 Sep 1998 08:34:21 +0000 Subject: check whether system type is the same as stored in the cache (full stand-alone macro, candidate for inclusion in the next release of autoconf) create configure flag --enable-maintainer-mode, that enables automatic rebuilding of configure from configure.in and aclocal.m4, and of config.h.in based on acconfig.h. This assumes autoconf and autoheader are available. Maintainer mode also introduces automatic dependency tracking of include files, but it depends on features provided by gcc and GNU make, so you must not enable maintainer mode if you are not using any of these (This used to be commit 64cba1cc8e689bcde2dc124c511da086c33fa4a8) --- source3/Makefile.in | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'source3/Makefile.in') diff --git a/source3/Makefile.in b/source3/Makefile.in index 55c52df51d..16f94789d3 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -201,9 +201,12 @@ CHECK: @echo "Using FLAGS = $(FLAGS)" @echo "Using LIBS = $(LIBS)" -.c.o: $(INCLUDES) +.c.o: @MAINT@ .deps/.dummy @echo Compiling $*.c - @$(CC) -I. -I$(srcdir) $(FLAGS) -c $< -o $@ + @$(CC) -I. -I$(srcdir) $(FLAGS) -c $< -o $@ \ + @MAINT@ -Wp,-MD,.deps/`echo $* | sed s,/,_,g`.P && : >.deps/.stamp +# the line above is for atomatic dependency tracking +# it will only work with GNU make, gcc and --enable-maintainer-mode bin/smbd: $(SMBD_OBJ) @echo Linking $@ @@ -301,7 +304,7 @@ uninstallcp: @$(SHELL) $(srcdir)/script/uninstallcp.sh $(CODEPAGEDIR) $(CODEPAGELIST) clean: - -rm -f core */*~ *~ */*.o + -rm -f core */*~ *~ */*.o proto: @echo rebuilding include/proto.h @@ -319,6 +322,7 @@ realclean: clean distclean: realclean -rm -f include/config.h include/stamp-h */dummy Makefile -rm -f config.status config.cache + -rm -rf .deps # this target is really just for my use. It only works on a limited # range of machines and is used to produce a list of potentially @@ -328,6 +332,14 @@ finddead: nm */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt comm -13 nmused.txt nmfns.txt +# Rules for maintainers (--enable-maintainer-mode) +AUTOCONF=@AUTOCONF@ +AUTOHEADER=@AUTOHEADER@ + +# when configure.in is updated, reconfigure +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/aclocal.m4 + cd $(srcdir) && $(AUTOCONF) + config.status: $(srcdir)/configure $(SHELL) ./config.status --recheck @@ -341,10 +353,24 @@ include/config.h: include/stamp-h include/stamp-h: $(srcdir)/include/config.h.in config.status CONFIG_FILES= CONFIG_HEADERS=include/config.h $(SHELL) ./config.status - @ls -l config.status $(srcdir)/include/config.h.in > include/stamp-h + @echo > include/stamp-h $(srcdir)/include/config.h.in: $(srcdir)/include/stamp-h.in @: -$(srcdir)/include/stamp-h.in: $(srcdir)/acconfig.h $(srcdir)/configure.in - @cd $(srcdir) && ls -l acconfig.h configure.in > include/stamp-h.in +$(srcdir)/include/stamp-h.in: @MAINT@ $(srcdir)/acconfig.h $(srcdir)/configure.in + cd $(srcdir) && $(AUTOHEADER) + @cd $(srcdir) && echo > include/stamp-h.in + +# automatic dependency tracking rules +.deps/.dummy: + @-if test ! -d .deps; then rm -rf .deps; mkdir .deps; fi + @: >$@ + +.deps/.stamp: .deps/.dummy + @: + +.deps/.P: .deps/.stamp + @-cat .deps/*.P >$@ 2>/dev/null + +@MAINT@-include .deps/.P -- cgit