[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `Makefile' is removed upon interrupt
From: |
Jim Meyering |
Subject: |
Re: `Makefile' is removed upon interrupt |
Date: |
Mon, 17 Nov 2003 09:25:55 +0100 |
Alexandre Duret-Lutz <address@hidden> wrote:
>>>> "Jim" == Jim Meyering <address@hidden> writes:
> [...]
>
> Jim> One way to fix it is to tell GNU make that `Makefile' should not
> Jim> be removed in such a case, e.g. by adding a line like this:
>
> Jim> .PRECIOUS: Makefile
>
> Sounds sensible. Are there any other files that deserve similar
> treatment?
I don't think so.
Makefile is special in that if it is removed, there
can be no `make' rule to recreate it (unless we presume
everyone has a GNUmakefile with the proper rule).
> Jim> Of course, then we'd also have to ensure that
> Jim> config.status creates Makefile atomically (redirect to a
> Jim> temp. file and rename when done writing).
It does this, now.
> Jim> If you like that, I'll propose a patch.
Here's the proposed patch:
2003-11-17 Jim Meyering <address@hidden>
* lib/am/configure.am: Mark %MAKEFILE% as `.PRECIOUS'.
Index: lib/am/configure.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/configure.am,v
retrieving revision 1.26
diff -u -p -r1.26 configure.am
--- lib/am/configure.am 27 Oct 2003 07:52:00 -0000 1.26
+++ lib/am/configure.am 17 Nov 2003 08:19:29 -0000
@@ -53,6 +53,10 @@ endif %?TOPDIR_P%
cd $(top_srcdir) && \
$(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%
+## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
+## is interrupted. Otherwise, the user would need to know to rerun
+## ./config.status to recreate the lost Makefile.
+.PRECIOUS: %MAKEFILE%
## This rule remakes the Makefile.
%MAKEFILE%: %MAINTAINER-MODE% %MAKEFILE-DEPS% $(top_builddir)/config.status
## If Makefile is to be updated because of config.status, then run
- Re: `Makefile' is removed upon interrupt,
Jim Meyering <=