[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`Makefile' is removed upon interrupt
From: |
Jim Meyering |
Subject: |
`Makefile' is removed upon interrupt |
Date: |
Mon, 06 Oct 2003 14:31:12 +0200 |
I interrupted a build and saw this:
...
Making all in cp
make[3]: Entering directory `/fetish/cu/tests/cp'
cd ../.. && \
/bin/sh /fetish/cu/config/missing --run automake-1.7 --gnits
tests/cp/Makefile
cd ../.. && /bin/sh ./config.status tests/cp/Makefile
config.status: creating tests/cp/Makefile
make[3]: *** [Makefile] Error 1
make[2]: *** [all-recursive] Interrupt
make[1]: *** [all-recursive] Interrupt
make: *** [all] Interrupt
[Exit 130 (SIGINT)]
and was surprised when a subsequent `make' command failed
because tests/cp/Makefile had been removed.
Here's how I think that happened:
This is the rule from coreutils/tests/cp/Makefile:
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
$(am__depfiles_maybe)
And this looks like the relevant part of config.status:
sed -e ... -e ... "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
The problem arose because GNU Make removes any target that is
being built when `make' is interrupted.
One way to fix it is to tell GNU make that `Makefile' should not
be removed in such a case, e.g. by adding a line like this:
.PRECIOUS: Makefile
Of course, then we'd also have to ensure that config.status creates Makefile
atomically (redirect to a temp. file and rename when done writing).
If you like that, I'll propose a patch.
Most people don't know to rerun ./config.status to regenerate such a
lost Makefile -- and they shouldn't need to know it.
This is with autoconf-2.57f and automake-1.7.7.
- `Makefile' is removed upon interrupt,
Jim Meyering <=