Fix depend rules to keep state about whether verification of various
authorTom Yu <tlyu@mit.edu>
Thu, 12 Dec 2002 21:10:55 +0000 (21:10 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 12 Dec 2002 21:10:55 +0000 (21:10 +0000)
things succeeded.  Change some double colons to single colons.  Add a
new depend-dependencies target to allow Makefile.in to specify things
that must be built for depend to work.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15045 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/Makefile.in
src/config/ChangeLog
src/config/post.in
src/config/pre.in
src/lib/kadm5/ChangeLog
src/lib/kadm5/Makefile.in
src/lib/rpc/ChangeLog
src/lib/rpc/Makefile.in
src/util/ss/ChangeLog
src/util/ss/Makefile.in

index 93b6c7a1d9605d3963747df7a7860c5f6b5c2016..0ebf43612e1cace22bc9cc49615330579e97f9ee 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (install-headers-prerecurse): Update to not use
+       double colons.
+
 2002-12-06  Ezra Peisach  <epeisach@bu.edu>
 
        * Makefile.in (clean-unix): Remove krb5-config.
index 19404ae906fb7b8cc9038f775ab91fb3da549bbc..3e26037e25c65efecc3630b8f892e7c5e958afc5 100644 (file)
@@ -62,11 +62,11 @@ install-mkdirs:
                $(srcdir)/config/mkinstalldirs $(DESTDIR)$$i; \
        done
 
-install-headers-prerecurse::
+install-headers-mkdirs:
        $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)
        $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssapi
        $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/kerberosIV
-
+install-headers-prerecurse: install-headers-mkdirs
 
 # install::
 #      $(MAKE) $(MFLAGS) install.man
index 1361cb9a1a978717992dcf62035de9d04cccf9b1..b7731d9b265eef661d943cee8de121a9f1debf4c 100644 (file)
@@ -1,3 +1,13 @@
+2002-12-12  Tom Yu  <tlyu@mit.edu>
+
+       * post.in: Fix depend rules to keep state about whether
+       verification of various things succeeded.  Change some double
+       colons to single colons.  Add a new depend-dependencies target to
+       allow Makefile.in to specify things that must be built for depend
+       to work.
+
+       * pre.in: Fix recursion rules to use fewer double colons.
+
 2002-12-09  Tom Yu  <tlyu@mit.edu>
 
        * post.in: depfix2.sed -> .depfix2.sed to avoid a little clutter.
index d84a84af7284bb13fa9fdc3071542c93196fb157..2e90625c6c1d9521ae511f477081fab3618473c5 100644 (file)
-# config/post.in
+############################################################
+## config/post.in
+##
+
+# in case there is no default target (very unlikely)
+all::
 
 check-windows::
 
+##############################
+# dependency generation
+#
+
+depend:: depend-postrecurse
+depend-postrecurse: depend-recurse
+depend-recurse: depend-prerecurse
+
+depend-prerecurse:
+depend-postrecurse:
+
+depend-postrecurse: depend-update-makefile
+
 ALL_DEP_SRCS= $(SRCS) $(EXTRADEPSRCS)
 
 # be sure to check ALL_DEP_SRCS against *what it would be if SRCS and
 # EXTRADEPSRCS are both empty*
-depend-verify-srcdir:
+.depend-verify-srcdir:
        @if test "$(srcdir)" = "." ; then \
                echo 1>&2 error: cannot build dependencies with srcdir=. ; \
                echo 1>&2 "(can't distinguish generated files from source files)" ; \
                exit 1 ; \
+       else \
+               if test -r .depend-verify-srcdir; then :; \
+                       else (set -x; touch .depend-verify-srcdir); fi \
        fi
-depend-verify-et: depend-verify-et-$(COM_ERR_VERSION)
+.depend-verify-et: depend-verify-et-$(COM_ERR_VERSION)
 depend-verify-et-k5:
+       @if test -r .depend-verify-et; then :; \
+               else (set -x; touch .depend-verify-et); fi
 depend-verify-et-sys:
        @echo 1>&2 error: cannot build dependencies using system et package
        @exit 1
-depend-verify-ss: depend-verify-ss-$(SS_VERSION)
+.depend-verify-ss: depend-verify-ss-$(SS_VERSION)
 depend-verify-ss-k5:
+       @if test -r .depend-verify-ss; then :; \
+               else (set -x; touch .depend-verify-ss); fi
 depend-verify-ss-sys:
        @echo 1>&2 error: cannot build dependencies using system ss package
        @exit 1
-depend-verify-db: depend-verify-db-$(DB_VERSION)
+.depend-verify-db: depend-verify-db-$(DB_VERSION)
 depend-verify-db-k5:
+       @if test -r .depend-verify-db; then :; \
+               else (set -x; touch .depend-verify-db); fi
 depend-verify-db-sys:
        @echo 1>&2 error: cannot build dependencies using system db package
        @exit 1
-depend-verify-gcc: depend-verify-gcc-@HAVE_GCC@
+.depend-verify-gcc: depend-verify-gcc-@HAVE_GCC@
 depend-verify-gcc-yes:
+       @if test -r .depend-verify-gcc; then :; \
+               else (set -x; touch .depend-verify-gcc); fi
 depend-verify-gcc-no:
        @echo 1>&2 error: The '"depend"' rules are written for gcc.
        @echo 1>&2 Please use gcc, or update the rules to handle your compiler.
        @exit 1
 
-.d: $(ALL_DEP_SRCS) depend-verify-srcdir depend-verify-et depend-verify-ss depend-verify-db
+DEP_CFG_VERIFY = .depend-verify-srcdir \
+       .depend-verify-et .depend-verify-ss .depend-verify-db
+DEP_VERIFY = $(DEP_CFG_VERIFY) .depend-verify-gcc
+
+.d: $(ALL_DEP_SRCS) $(DEP_CFG_VERIFY) depend-dependencies
        if test "$(ALL_DEP_SRCS)" != " " ; then \
-               $(CC) -M $(ALL_CFLAGS) $(ALL_DEP_SRCS) > .dtmp || exit 1 ; \
-               mv -f .dtmp .d ; \
+               $(RM) .dtmp && $(MAKE) .dtmp && mv -f .dtmp .d ; \
        else \
                touch .d ; \
        fi
 
+# These are dependencies of the depend target that do not get fed to
+# the compiler.  Examples include generated header files.
+depend-dependencies:
+
+# .dtmp must *always* be out of date so that $? can be used to perform
+# VPATH searches on the sources.
+#
+# NOTE: This will fail when using Make programs whose VPATH support is
+# broken.
+.dtmp: $(ALL_DEP_SRCS)
+       $(CC) -M $(ALL_CFLAGS) $? > .dtmp
+
 # Generate a script for dropping in the appropriate make variables, using
 # directory-specific parameters.  General substitutions independent of local
 # make variables happen in depfix.sed.
-.depfix2.sed: depend-verify-gcc Makefile $(SRCTOP)/util/depgen.sed
+.depfix2.sed: .depend-verify-gcc Makefile $(SRCTOP)/util/depgen.sed
        x=`$(CC) -print-libgcc-file-name` ; \
        echo '$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' "$$x" | sed -f $(SRCTOP)/util/depgen.sed > .depfix2.tmp
        mv -f .depfix2.tmp .depfix2.sed
 
 DEPLIBOBJNAMEFIX = sed -e 's;^\$$(OUTPRE)\([a-zA-Z0-9_\-]*\)\.\$$(OBJEXT):;\1.so \1.po &;'
 
+# NOTE: This will also generate spurious $(OUTPRE) and $(OBJEXT)
+# references in rules for non-library objects in a directory where
+# library objects happen to be built.  It's mostly harmless.
 .depend: .d .depfix2.sed $(SRCTOP)/util/depfix.sed
        sed -f .depfix2.sed < .d | sed -f $(SRCTOP)/util/depfix.sed | \
        (if test "x$(STLIBOBJS)" != "x"; then $(DEPLIBOBJNAMEFIX) ; else cat; fi ) \
        > .depend
 
-depend-postrecurse:: .depend
+depend-update-makefile: .depend depend-recurse
        if test -n "$(SRCS)" ; then \
                sed -e '/^# +++ Dependency line eater +++/,$$d' \
                        < $(srcdir)/Makefile.in | cat - .depend \
@@ -65,13 +112,16 @@ depend-postrecurse:: .depend
        $(SRCTOP)/config/move-if-changed $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in ; \
        else :; fi
 
-depend:: depend-prerecurse depend-recurse depend-postrecurse
-depend-prerecurse::
+DEPTARGETS = .depend .d .dtmp .depfix2.sed .depfix2.tmp $(DEP_VERIFY)
+
+#
+# end dependency generation
+##############################
 
 clean:: clean-$(WHAT)
 
 clean-unix::
-       $(RM) $(OBJS) .depend .d .depfix2.sed .depfix2.tmp
+       $(RM) $(OBJS) $(DEPTARGETS)
 
 clean-windows::
        $(RM) *.$(OBJEXT)
@@ -79,14 +129,17 @@ clean-windows::
 
 distclean:: distclean-$(WHAT)
 
-distclean-prerecurse::
+distclean-normal-clean:
        $(MAKE) NORECURSE=true clean
-
-distclean-postrecurse::
+distclean-prerecurse: distclean-normal-clean
+distclean-nuke-configure-state:
        $(RM) config.log config.cache config.status Makefile
+distclean-postrecurse: distclean-nuke-configure-state
 
-Makefiles-prerecurse:: Makefile
+Makefiles-prerecurse: Makefile
 
+# thisconfigdir = relative path from this Makefile to config.status
+# mydir = relative path from config.status to this Makefile
 Makefile: $(srcdir)/Makefile.in $(thisconfigdir)/config.status \
                $(SRCTOP)/config/pre.in $(SRCTOP)/config/post.in
        cd $(thisconfigdir) && $(SHELL) config.status $(mydir)/Makefile
@@ -102,6 +155,15 @@ $(srcdir)/$(thisconfigdir)/configure: $(srcdir)/$(thisconfigdir)/configure.in \
 RECURSE_TARGETS=all-recurse clean-recurse distclean-recurse install-recurse \
        check-recurse depend-recurse Makefiles-recurse install-headers-recurse
 
+# MY_SUBDIRS overrides any setting of SUBDIRS generated by the
+# configure script that generated this Makefile.  This is needed when
+# the configure script that produced this Makefile creates multiple
+# Makefiles in different directories; the setting of SUBDIRS will be
+# the same in each.
+#
+# LOCAL_SUBDIRS seems to account for the case where the configure
+# script doesn't call any other subsidiary configure scripts, but
+# generates multiple Makefiles.
 $(RECURSE_TARGETS):
        @case "`echo 'x$(MFLAGS)'|sed -e 's/^x//' -e 's/ --.*$$//'`" \
                in *[ik]*) e="status=1" ;; *) e="exit 1";; esac; \
@@ -129,3 +191,7 @@ $(RECURSE_TARGETS):
        else :; \
        fi;\
        exit $$status
+
+##
+## end of post.in
+############################################################
index ff162ccc931f5a13ec44256e84bc335c96c91583..1752522b789bdc10c3cd987c9086c82d8ef140d4 100644 (file)
@@ -1,5 +1,7 @@
+############################################################
 ## config/pre.in
 ## common prefix for all Makefile.in in the Kerberos V5 tree.
+##
 
 WHAT = unix
 SHELL=/bin/sh
@@ -8,59 +10,103 @@ all:: all-$(WHAT)
 
 clean:: clean-$(WHAT)
 
+distclean:: distclean-$(WHAT)
+
 install:: install-$(WHAT)
 
 check:: check-$(WHAT)
 
 install-headers:: install-headers-$(WHAT)
 
-all-recurse: all-prerecurse
-all-postrecurse:: all-recurse
+##############################
+# Recursion rule support
+#
+
+# The commands for the recursion targets live in config/post.in.
+#
+# General form of recursion rules:
+#
+# Each recursive target foo-unix has related targets: foo-prerecurse,
+# foo-recurse, and foo-postrecurse
+#
+# The foo-recurse rule is in post.in.  It is what actually recursively
+# calls make.
+#
+# foo-recurse depends on foo-prerecurse, so any targets that must be
+# built before descending into subdirectories must be dependencies of
+# foo-prerecurse.
+#
+# foo-postrecurse depends on foo-recurse, but targets that must be
+# built after descending into subdirectories should be have
+# foo-recurse as dependencies in addition to being listed under
+# foo-postrecurse, to avoid ordering issues.
+#
+# The foo-prerecurse, foo-recurse, and foo-postrecurse rules are all
+# single-colon rules, to avoid nasty ordering problems with
+# double-colon rules.
+#
+# e.g.
+# all:: includes foo
+# foo:
+#      echo foo
+# includes::
+#      echo bar
+# includes::
+#      echo baz
+#
+# will result in "bar", "foo", "baz" on AIX, and possibly others.
 all-unix:: all-postrecurse
+all-postrecurse: all-recurse
+all-recurse: all-prerecurse
 
-all-prerecurse::
-all-postrecurse::
+all-prerecurse:
+all-postrecurse:
 
-clean-unix:: clean-prerecurse
-clean-unix:: clean-recurse
 clean-unix:: clean-postrecurse
+clean-postrecurse: clean-recurse
+clean-recurse: clean-prerecurse
 
-clean-prerecurse::
-clean-postrecurse::
+clean-prerecurse:
+clean-postrecurse:
 
-distclean-unix:: distclean-prerecurse
-distclean-unix:: distclean-recurse
-distclean-unix:: distclean-postrecurse
+distclean-unix: distclean-postrecurse
+distclean-postrecurse: distclean-recurse
+distclean-recurse: distclean-prerecurse
+
+distclean-prerecurse:
+distclean-postrecurse:
 
-install-unix:: install-prerecurse
-install-unix:: install-recurse
 install-unix:: install-postrecurse
+install-postrecurse: install-recurse
+install-recurse: install-prerecurse
 
-install-prerecurse::
-install-postrecurse::
+install-prerecurse:
+install-postrecurse:
 
-install-headers-unix:: install-headers-prerecurse
-install-headers-unix:: install-headers-recurse
 install-headers-unix:: install-headers-postrecurse
+install-headers-postrecurse: install-headers-recurse
+install-headers-recurse: install-headers-prerecurse
 
-install-headers-prerecurse::
-
-install-headers-postrecurse::
+install-headers-prerecurse:
+install-headers-postrecurse:
 
-
-check-unix:: check-prerecurse
-check-unix:: check-recurse
 check-unix:: check-postrecurse
+check-postrecurse: check-recurse
+check-recurse: check-prerecurse
+
+check-prerecurse:
+check-postrecurse:
 
-check-prerecurse::
-check-postrecurse::
+Makefiles: Makefiles-postrecurse
+Makefiles-postrecurse: Makefiles-recurse
+Makefiles-recurse: Makefiles-prerecurse
 
-Makefiles:: Makefiles-prerecurse
-Makefiles:: Makefiles-recurse
-Makefiles:: Makefiles-postrecurse
+Makefiles-prerecurse:
+Makefiles-postrecurse:
 
-Makefiles-prerecurse::
-Makefiles-postrecurse::
+#
+# end recursion rule support
+##############################
 
 # Directory syntax:
 #
@@ -364,5 +410,6 @@ MAKE_COMMANDS-k5= $(BUILDTOP)/util/ss/mk_cmds
 .ct.c:
        $(MAKE_COMMANDS) $<
 
-#
-# end of pre.in
+##
+## end of pre.in
+############################################################
index a1b5057f14d1c0038f1fee97f71a162fd3f933b4..b673d9c0b15ac2d0b78feab613314511abd43879 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (all-prerecurse): Change double colons to single
+       colons.
+
 2002-11-05  Tom Yu  <tlyu@mit.edu>
 
        * chpass_util_strings.et: Remove trailing colons, as new
index 214dee81d7cad817e278b0622afb5403cbb27296..f6abe942861f9796e71b08d02197faa9e8f7e4e5 100644 (file)
@@ -92,8 +92,8 @@ includes:: $(SRC_HDRS) $(BUILD_HDRS)
 clean-unix::
        $(RM) $(HDRS)
 
-all-prerecurse:: includes
-all-prerecurse:: all-libobjs
+all-prerecurse: includes
+all-prerecurse: all-libobjs
 
 all-windows:: $(OBJS)
 
index 5024f721c7b242d170906c88c750099d4512b154..2a33ed95b8b2e4b65da339c14511304a8b51c162 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (all-prerecurse): Change double colons to single
+       colons.
+
 2002-11-11  Ken Raeburn  <raeburn@mit.edu>
 
        * get_myaddress.c (get_myaddress): Local array buf size should be
index eecee540b3c760a1271f7e712512109a6742722d..47ed6a0a7bc9bf299ec2266feb7b9290725d0bcf 100644 (file)
@@ -174,8 +174,8 @@ HDRS=       $(HDRDIR)/auth.h \
        $(HDRDIR)/types.h \
        $(HDRDIR)/xdr.h
 
-all-prerecurse:: includes
-all-prerecurse:: all-liblinks
+all-prerecurse: includes
+all-prerecurse: all-liblinks
 
 all-windows:: $(OBJS)
 
index 63fefc25d9645e4034fd548cc2434593372d2142..844830000c960dd11b98908c7eca66480554677e 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (depend-dependencies): Was previously
+       depend-prerecurse.
+
 2002-09-10  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (LOCALINCLUDES): Drop references to .. and et
index 083ee39b61dd45b604f40653f447a5bf9dcd34ef..e83c256a567e87faac80532f923c662234bfe74c 100644 (file)
@@ -44,7 +44,7 @@ SRCS= $(srcdir)/invocation.c $(srcdir)/help.c \
        $(srcdir)/error.c $(srcdir)/prompt.c \
        $(srcdir)/request_tbl.c $(srcdir)/list_rqs.c $(srcdir)/pager.c \
        $(srcdir)/requests.c $(srcdir)/data.c
-depend-prerecurse:: ss_err.h includes
+depend-dependencies: ss_err.h includes
 
 std_rqs.o: std_rqs.c ss_err.h