summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2014-05-24 22:35:09 -0700
committerJim Meyering <meyering@fb.com>2014-06-06 08:57:56 -0700
commitb98cf069c3b7311a7255e03c3bc48efd7500e8db (patch)
tree4834a61ca6e8895a0a2c58a83466c62e7448966c /lib
parent709e7e5d54dbdc83e3290b8c5adc79b36c71886c (diff)
downloadgrep-b98cf069c3b7311a7255e03c3bc48efd7500e8db.tar.gz
build: don't redirect directly to $@
* lib/Makefile.am (colorize.c): Don't redirect directly to target, $@. Otherwise, we could create a corrupt colorize.c file with a timestamp that indicates it is up to date. Also, make the generated file read-only.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index f9e54441..9bd7b0d7 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -34,7 +34,10 @@ libgreputils_a_SOURCES += colorize.h
EXTRA_DIST += colorize-posix.c colorize-w32.c
CLEANFILES += colorize.c
colorize.c:
- $(AM_V_GEN)echo '#include <$(COLORIZE_SOURCE)>' >$@
+ $(AM_V_GEN)rm -f $@-t
+ $(AM_V_at)echo '#include <$(COLORIZE_SOURCE)>' >$@-t
+ $(AM_V_at)chmod a=rx $@-t
+ $(AM_V_at)mv $@-t $@
libgreputils_a_LIBADD += $(LIBOBJS) $(ALLOCA)
libgreputils_a_DEPENDENCIES += $(LIBOBJS) $(ALLOCA)