From 7658c18ee933f8903295380209083dfdd36078f9 Mon Sep 17 00:00:00 2001 From: obrien Date: Wed, 12 Mar 2008 14:50:58 +0000 Subject: 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) --- usr.bin/make/globals.h | 1 + usr.bin/make/main.c | 3 ++- usr.bin/make/make.1 | 16 ++++++++++++++++ usr.bin/make/parse.c | 5 +++++ 4 files changed, 24 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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); -- cgit v1.1