]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1473] "make distcheck" before build can't make sntp/version.m4.
authorDave Hart <hart@ntp.org>
Tue, 2 Feb 2010 08:09:04 +0000 (08:09 +0000)
committerDave Hart <hart@ntp.org>
Tue, 2 Feb 2010 08:09:04 +0000 (08:09 +0000)
bk: 4b67dda0YGDHInWyHjxjGEMW4ZEPTw

ChangeLog
Makefile.am
sntp/Makefile.am

index fed2d1b4bdd8c42d68686b3becfefda0a01e5a60..a004ccc24b74cada0af9a165e5a9e4c2033c2bda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 * [Bug 1467] Fix bogus rebuild of sntp/sntp.html
 * [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a.
+* [Bug 1473] "make distcheck" before build can't make sntp/version.m4.
 
 ---
 (4.2.6p1-RC3) 2010/01/24 Released by Harlan Stenn <stenn@ntp.org>
index 0a0a89a67dc7777e46d88baa9d937624589022b3..b9e7cbf0891b1c10c07567d2ddaee0e9b8be317b 100644 (file)
@@ -113,7 +113,17 @@ BUILT_SOURCES =                            \
        $(NULL)
 
 $(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html
-       ( echo "This file is automatically generated from html/copyright.html" ; lynx -dump $(srcdir)/html/copyright.html ) > $(srcdir)/COPYRIGHT.new && mv $(srcdir)/COPYRIGHT.new $(srcdir)/COPYRIGHT
+       { echo "This file is automatically generated from html/copyright.html" ; \
+         lynx -dump $(srcdir)/html/copyright.html ;} > COPYRIGHT.new \
+       && mv -f COPYRIGHT.new $(srcdir)/COPYRIGHT
+
+COPYRIGHT-please: $(srcdir)/COPYRIGHT
+       @: do-nothing action to prevent default \
+          This target is needed by sntp/Makefile.am on decrepit \
+          FreeBSD 6.x make which fails with "make COPYRIGHT" \
+          configured in $(srcdir) but "make ./COPYRIGHT" succeeds. \
+          Rather than determine our $(srcdir) from sntp/Makefile.am \
+          COPYRIGHT-please serves as a fixed target.
 
 # HMS: The next bit is still suboptimal.  If bk is present but this NTP
 # repo is not a bk repo, we'll get an error message from the prs command.
@@ -190,6 +200,7 @@ BHOST=`(hostname || uname -n)`
        fi
 
 FRC.CommitLog FRC.distwarn FRC.checkcvo FRC.checkhost FRC.version:
+       @: do-nothing action prevents any default
 
 # HMS: what was I trying to do with this?
 #dot.emacs: FRC.distwarn
index d0785713230dcaf9b1188e443b49dd3af64e05df..10bbb20eb94a07d0639ee6e52c94eb7e0542ae8e 100644 (file)
@@ -21,7 +21,7 @@ else
 sbin_PROGRAMS= sntp
 endif
 
-CLEANFILES=
+CLEANFILES = check-COPYRIGHT-submake
 
 SUBDIRS=
 if NEED_LIBOPTS
@@ -86,6 +86,12 @@ noinst_DATA=                         \
        $(NULL)
 
 FRC:
+       @: do-nothing action to prevent default SCCS get
+       @: FRC "force" depends on nothing and is not a file, so is
+       @: always out-of-date causing targets which depend on it to
+       @: similarly always be outdated causing their rules to fire
+       @: each time they or a dependent is built.
+
 check-autogen-version.def: FRC
        @cd $(srcdir)                                                   \
        && test -r ../include/autogen-version.def                       \
@@ -95,6 +101,9 @@ check-autogen-version.def: FRC
                echo "Installing new sntp/autogen-version.def file";    \
           fi )
 
+$(srcdir)/autogen-version.def:
+       $(MAKE) check-autogen-version.def
+
 check-version.def: FRC
        @cd $(srcdir)                                   \
        && test -r ../include/version.def               \
@@ -104,6 +113,9 @@ check-version.def: FRC
                echo "Installing new sntp/version.def file";    \
           fi )
 
+$(srcdir)/version.def:
+       $(MAKE) check-version.def
+
 check-version.m4: FRC
        @cd $(srcdir)                                   \
        && test -r ../version.m4                        \
@@ -113,6 +125,9 @@ check-version.m4: FRC
                echo "Installing new sntp/version.m4 file";     \
           fi )
 
+$(srcdir)/version.m4:
+       $(MAKE) check-version.m4
+
 check-version.texi: FRC
        @cd $(srcdir)                                   \
        && test -r ../include/version.texi                      \
@@ -122,11 +137,25 @@ check-version.texi: FRC
                echo "Installing new sntp/version.texi file";   \
           fi )
 
+$(srcdir)/version.texi:
+       $(MAKE) check-version.texi
+
 $(srcdir)/../COPYRIGHT:
-       cd .. && $(MAKE) COPYRIGHT
+       cd .. && $(MAKE) COPYRIGHT-please
+
+check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT
+       @cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT      \
+        || { cp $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT     \
+             && echo 'updated sntp/COPYRIGHT installed' ;}
+       @echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@
+
+check-COPYRIGHT: FRC
+       [ ! -r $(srcdir)/../COPYRIGHT ]                                 \
+       || [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ]       \
+       || $(MAKE) check-COPYRIGHT-submake
 
-$(srcdir)/COPYRIGHT: $(srcdir)/../COPYRIGHT
-       cat $(srcdir)/../COPYRIGHT > $@
+$(srcdir)/COPYRIGHT: check-COPYRIGHT
+       @: do-nothing action to prevent any default
 
 $(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c
        @: do-nothing action to avoid default SCCS get, .h built with .c
@@ -147,7 +176,7 @@ $(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)
        cd $(srcdir) && makeinfo --force --html --no-split -o sntp.html sntp.texi
 
 ../libntp/libntp.a:
-       cd ../libntp && $(MAKE)
+       cd ../libntp && $(MAKE) libntp.a
 
 libtool: $(LIBTOOL_DEPS)
        ./config.status --recheck