From 2341649dda6c2217e9c6a4588120645594890faf Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 13 Mar 2014 09:06:30 -0700 Subject: [PATCH] build: do not fail due to an existing read-only hello.1 * Makefile.am (hello.1): In Makefile rules, never redirect directly to the target. Instead, redirect to a temporary, address@hidden, and once that succeeds, rename to target using "mv -f". Also, since this is a generated file, explicitly make it read-only, so one is less likely to think it is an editable primary source. Reported by Assaf Gordon. --- Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 14aa203..eb02a4c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,7 +48,9 @@ EXTRA_DIST += $(man_MANS) CLEANFILES = $(man_MANS) hello.1: hello - $(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello -o $@ + $(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello -o address@hidden + chmod a=r address@hidden + mv -f address@hidden $@ TESTS = \ tests/greeting-1 \ -- 1.9.0.152.g6ab4ae2