diff common.mk @ 9965:a7e288044ef7

avoid cp -a --update
author John W. Eaton <jwe@octave.org>
date Fri, 11 Dec 2009 13:30:16 -0500
parents c1210502785b
children d36f8c473dff
line wrap: on
line diff
--- a/common.mk	Thu Dec 10 14:51:08 2009 -0800
+++ b/common.mk	Fri Dec 11 13:30:16 2009 -0500
@@ -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.