summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-01-12 08:57:10 +0000
committerpeter <peter@FreeBSD.org>1996-01-12 08:57:10 +0000
commit5b70a95cd827978a62482802e9ff51d4e958da7e (patch)
tree87f917319075f55b3a7df24a1226cb5fd2de48e6 /usr.sbin/config/mkmakefile.c
parentb90ef46a2fbc1f210795d01c9dee181dbf3f1922 (diff)
downloadFreeBSD-src-5b70a95cd827978a62482802e9ff51d4e958da7e.zip
FreeBSD-src-5b70a95cd827978a62482802e9ff51d4e958da7e.tar.gz
Make a little more effort to avoid touching certain generated files if
they were not changed. This makes 'make depend' more useful.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index c129ee6..0f057f4 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -150,9 +150,9 @@ makefile()
perror(line);
exit(1);
}
- ofp = fopen(path("Makefile"), "w");
+ ofp = fopen(path("Makefile.new"), "w");
if (ofp == 0) {
- perror(path("Makefile"));
+ perror(path("Makefile.new"));
exit(1);
}
fprintf(ofp, "KERN_IDENT=%s\n", raise(ident));
@@ -234,6 +234,7 @@ makefile()
}
(void) fclose(ifp);
(void) fclose(ofp);
+ moveifchanged(path("Makefile.new"), path("Makefile"));
#ifdef notyet
if (warn_make_clean) {
printf("WARNING: Unknown options used (not in ../../conf/options or ./options.%s).\n", machinename);
OpenPOWER on IntegriCloud