summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2008-03-12 14:50:58 +0000
committerobrien <obrien@FreeBSD.org>2008-03-12 14:50:58 +0000
commit7658c18ee933f8903295380209083dfdd36078f9 (patch)
tree167ef509c912d8665e1544a453ee24ee71bc9af6 /usr.bin
parentf2e5e0ae4524d1a3d5058c7486915c7904b59944 (diff)
downloadFreeBSD-src-7658c18ee933f8903295380209083dfdd36078f9.zip
FreeBSD-src-7658c18ee933f8903295380209083dfdd36078f9.tar.gz
If the special target .MAKEFILEDEPS exists, then enable the
"remaking makefiles" feature. Otherwise, follow traditional Pmake behavior. (hash table will be regenerated and committed follow this commit)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/globals.h1
-rw-r--r--usr.bin/make/main.c3
-rw-r--r--usr.bin/make/make.116
-rw-r--r--usr.bin/make/parse.c5
4 files changed, 24 insertions, 1 deletions
diff --git a/usr.bin/make/globals.h b/usr.bin/make/globals.h
index 465c4f3..04c7da9 100644
--- a/usr.bin/make/globals.h
+++ b/usr.bin/make/globals.h
@@ -78,6 +78,7 @@ extern Boolean beVerbose; /* True if should print extra cruft */
extern Boolean noExecute; /* True if should execute nothing */
extern Boolean allPrecious; /* True if every target is precious */
extern Boolean is_posix; /* .POSIX target seen */
+extern Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */
/* True if should continue on unaffected portions of the graph
* when have an error in one portion */
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index b75004f..7be2aa2 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -123,6 +123,7 @@ Lst create = Lst_Initializer(create);
Boolean allPrecious; /* .PRECIOUS given on line by itself */
Boolean is_posix; /* .POSIX target seen */
+Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */
Boolean beSilent; /* -s flag */
Boolean beVerbose; /* -v flag */
Boolean compatMake; /* -B argument */
@@ -1252,7 +1253,7 @@ main(int argc, char **argv)
*/
Lst targs = Lst_Initializer(targs);
- if (!is_posix) {
+ if (!is_posix && mfAutoDeps) {
/*
* Check if any of the makefiles are out-of-date.
*/
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index f17ab88..b5201a3 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -1312,6 +1312,11 @@ explicitly, or implicitly when
.Nm
selects the default target, to give the user a way to refer to the default
target on the command line.
+.It Ic .MAKEFILEDEPS
+Enable the
+.Dq Li Remaking Makefiles
+functionality.
+See below.
.It Ic .MAKEFLAGS
This target provides a way to specify flags for
.Nm
@@ -1381,6 +1386,10 @@ Apply the
attribute to any specified sources.
Targets with this attribute are always
considered to be out of date.
+.It Ic .POSIX
+Adjust
+.Mn 's
+behavior to match the applicable POSIX specifications.
.It Ic .PRECIOUS
Apply the
.Ic .PRECIOUS
@@ -1544,6 +1553,13 @@ Several flags can be specified on a single
target by seperating them with blanks.
.El
.Sh REMAKING MAKEFILES
+If the special target
+.Ic .MAKEFILEDEPS
+exists in the Makefile,
+.Nm
+enables the
+.Dq Li Remaking Makefiles
+feature.
After reading Makefile and all the files that are included using
.Ic .include
or
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 14ffe18..3e8cb93 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -168,6 +168,7 @@ typedef enum {
ExPath, /* .PATH */
Phony, /* .PHONY */
Posix, /* .POSIX */
+ MakefileDeps, /* .MAKEFILEDEPS */
Precious, /* .PRECIOUS */
ExShell, /* .SHELL */
Silent, /* .SILENT */
@@ -213,6 +214,7 @@ static const struct keyword {
{ ".LIBS", Libs, 0 },
{ ".MAIN", Main, 0 },
{ ".MAKE", Attribute, OP_MAKE },
+ { ".MAKEFILEDEPS", MakefileDeps, 0 },
{ ".MAKEFLAGS", MFlags, 0 },
{ ".MFLAGS", MFlags, 0 },
{ ".NOTMAIN", Attribute, OP_NOTMAIN },
@@ -1069,6 +1071,9 @@ ParseDoDependency(char *line)
LST_FOREACH(ln, &paths)
Path_Clear(Lst_Datum(ln));
break;
+ case MakefileDeps:
+ mfAutoDeps = TRUE;
+ break;
case Posix:
is_posix = TRUE;
Var_Set("%POSIX", "1003.2", VAR_GLOBAL);
OpenPOWER on IntegriCloud