diff options
author | Paul Smith <psmith@gnu.org> | 2000-03-26 06:56:54 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2000-03-26 06:56:54 +0000 |
commit | a81013175c2b335c295378b0c826bdbede9fd0c4 (patch) | |
tree | d4dcc537b40b129bd0779bc31e1686e217a9585a | |
parent | 75f879f37f8c8e6b671c558ab85b3926c96fbb0c (diff) | |
download | gunmake-a81013175c2b335c295378b0c826bdbede9fd0c4.tar.gz |
* Ignore attempt to change a file into itself.
* Define COFLAGS to avoid unknown variable warning.
* Fix some usec problems on UnixWare.
* Don't remove .INTERMEDIATE targets specified on the command line.
-rw-r--r-- | ChangeLog | 25 | ||||
-rw-r--r-- | default.c | 6 | ||||
-rw-r--r-- | file.c | 10 | ||||
-rw-r--r-- | filedef.h | 4 | ||||
-rw-r--r-- | make.h | 2 | ||||
-rw-r--r-- | tests/ChangeLog | 5 | ||||
-rw-r--r-- | tests/scripts/targets/INTERMEDIATE | 10 |
7 files changed, 49 insertions, 13 deletions
@@ -1,3 +1,28 @@ +2000-03-26 Paul D. Smith <psmith@gnu.org> + + * file.c (remove_intermediates): Never remove targets explicitly + requested on the command-line by checking the cmd_target flag. + Fixed PR/1669. + +2000-03-23 Paul Eggert <eggert@twinsun.com> + + * filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Don't use + st_mtim.tv_sec; this doesn't work on Unixware. + +2000-03-18 Paul D. Smith <psmith@gnu.org> + + * file.c (file_hash_enter): If we're trying to change a file into + itself, just return. We used to assert this wasn't true, but + someone came up with a weird case involving archives. After + playing with it for a while I decided it was OK to ignore it. + + * default.c: Define COFLAGS to empty to avoid spurious warnings. + + * filedef.h: Change #if ST_MTIM_NSEC to #ifdef; this is a macro + containing the name of the nsec field, not true/false. + * make.h: Ditto. + Reported by Marco Franzen <Marco.Franzen@Thyron.com>. + 2000-02-09 Paul D. Smith <psmith@gnu.org> * Version 3.78.91 released. @@ -396,10 +396,10 @@ static char *default_variables[] = /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist, and to the empty string if $@ does exist. */ - "CHECKOUT,v", - "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)", - + "CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)", "CO", "co", + "COFLAGS", "", + "CPP", "$(CC) -E", #ifdef CRAY "CF77PPFLAGS", "-P", @@ -128,8 +128,7 @@ enter_file (name) char *lname, *ln; #endif - if (*name == '\0') - abort (); + assert (*name != '\0'); #if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS) lname = (char *)malloc (strlen (name) + 1); @@ -252,8 +251,9 @@ file_hash_enter (file, name, oldhash, oldname) if (strieq (oldfile->hname, name)) break; - /* If the old file is the same as the new file, something's wrong. */ - assert (oldfile != file); + /* If the old file is the same as the new file, never mind. */ + if (oldfile == file) + return; if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0)) { @@ -394,7 +394,7 @@ remove_intermediates (sig) for (i = 0; i < FILE_BUCKETS; ++i) for (f = files[i]; f != 0; f = f->next) if (f->intermediate && (f->dontcare || !f->precious) - && !f->secondary) + && !f->secondary && !f->cmd_target) { int status; if (f->update_status == -1) @@ -117,9 +117,9 @@ extern void set_command_state PARAMS ((struct file *file, int state)); extern void notice_finished_file PARAMS ((struct file *file)); -#if ST_MTIM_NSEC +#ifdef ST_MTIM_NSEC # define FILE_TIMESTAMP_STAT_MODTIME(st) \ - FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \ + FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtime, \ (st).st_mtim.ST_MTIM_NSEC) # define FILE_TIMESTAMPS_PER_S \ MIN ((FILE_TIMESTAMP) 1000000000, \ @@ -275,7 +275,7 @@ extern char *alloca (); # endif /* HAVE_ALLOCA_H. */ #endif /* GCC. */ -#if ST_MTIM_NSEC +#ifdef ST_MTIM_NSEC # if HAVE_INTTYPES_H # include <inttypes.h> # endif diff --git a/tests/ChangeLog b/tests/ChangeLog index 6fba7ea..4d859ad 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2000-03-26 Paul D. Smith <psmith@gnu.org> + + * scripts/targets/INTERMEDIATE: Test that make doesn't remove + .INTERMEDIATE files when given on the command line (PR/1669). + 2000-02-07 Paul D. Smith <psmith@gnu.org> * scripts/features/escape: Add a test for backslash-escaped spaces diff --git a/tests/scripts/targets/INTERMEDIATE b/tests/scripts/targets/INTERMEDIATE index 7041e83..fe3f4e9 100644 --- a/tests/scripts/targets/INTERMEDIATE +++ b/tests/scripts/targets/INTERMEDIATE @@ -77,9 +77,15 @@ sleep($wtime); $answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm foo.e bar.e\n"; &compare_output($answer, &get_logfile(1)); +# TEST #6 -- added for PR/1669: don't remove files mentioned on the cmd line. + +&run_make_with_options($makefile,'foo.e',&get_logfile); +$answer = "cp foo.f foo.e\n"; +&compare_output($answer, &get_logfile(1)); + unlink('foo.f', 'foo.e', 'foo.d', 'foo.c', 'bar.f', 'bar.e', 'bar.d', 'bar.c'); -# TEST #6 -- added for PR/1423 +# TEST #7 -- added for PR/1423 $makefile2 = &get_tmpfile; @@ -94,7 +100,7 @@ EOF close(MAKEFILE); -&run_make_with_options($makefile2, "-R", &get_logfile); +&run_make_with_options($makefile2, '-R', &get_logfile); $answer = "touch foo.a\ntouch foo\nrm foo.a\n"; &compare_output($answer, &get_logfile(1)); |