# HG changeset patch # User John W. Eaton # Date 1260556216 18000 # Node ID a7e288044ef7ae347c20ab2cac245883426dd23a # Parent b7bc274136550da9631a900d6b9a7e46b29241a2 avoid cp -a --update diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-12-11 John W. Eaton + + * common.mk (cp_update_rule): New macro. + 2009-12-10 John W. Eaton * mkoctfile.in, mkoctfile.cc.in: If output file is specified and diff --git a/common.mk b/common.mk --- a/common.mk +++ b/common.mk @@ -435,6 +435,13 @@ fi endef +define cp_update_rule +if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/$@ ] && [ ! -f $@ ]; then \ + cp $(srcdir)/$@ $@; \ + touch -r $(srcdir)/$@ $@; \ +fi +endef + # Yes, the second sed command near the end is needed, to avoid limits # in command lengths for some versions of sed. UGLY_DEFS is often # quite large, so it makes sense to split this command there. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-12-11 John W. Eaton + + * Makefile.am (DOCSTRINGS): Use $(cp_update_rule) instead of + cp -a --update. + 2009-12-09 Rik * Makefile.am: Copy DOCSTRINGS from srcdir to builddir if it does not diff --git a/scripts/Makefile.am b/scripts/Makefile.am --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -328,8 +328,8 @@ all-local: $(GEN_FCN_FILES) $(PKG_ADD_FILES) DOCSTRINGS -DOCSTRINGS: mkdoc $(FCN_FILES) $(GEN_FCN_FILES) gethelp$(BUILD_EXEEXT) - @cp -a --update $(srcdir)/$@ $@ ; exit 0; +DOCSTRINGS: mkdoc $(FCN_FILES) $(GEN_FCN_FILES) gethelp$(BUILD_EXEEXT) + $(cp_update_rule) $(srcdir)/mkdoc "$(srcdir)" $(FCN_FILES) -- $(GEN_FCN_FILES) > $@-t $(simple_move_if_change_rule) diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-12-11 John W. Eaton + + * Makefile.am (DOCSTRINGS): Use $(cp_update_rule) instead of + cp -a --update. + 2009-12-10 Rik * Makefile.am: distclean symbolic links for OCT_FILES diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -629,7 +629,7 @@ mv $@-t $@ DOCSTRINGS: gendoc$(BUILD_EXEEXT) - @cp -a --update $(srcdir)/$@ $@ ; exit 0; + $(cp_update_rule) ./gendoc > $@-t $(simple_move_if_change_rule)