diff options
author | harti <harti@FreeBSD.org> | 2004-11-17 11:32:46 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-11-17 11:32:46 +0000 |
commit | 8a003e9336f23d27d8e21e3343a9744d55f658ad (patch) | |
tree | 1cf318998b1ea230203b20492ed52e0431bda9e7 | |
parent | db12de4f40fceade11c1a9f90c670b666db6082d (diff) | |
download | FreeBSD-src-8a003e9336f23d27d8e21e3343a9744d55f658ad.zip FreeBSD-src-8a003e9336f23d27d8e21e3343a9744d55f658ad.tar.gz |
Eliminate the define for POSIX and build with Posix behaviour.
Our make has been build with POSIX enabled from the first day
and the ifdef'ed out code served no purpose.
-rw-r--r-- | usr.bin/make/config.h | 9 | ||||
-rw-r--r-- | usr.bin/make/main.c | 8 | ||||
-rw-r--r-- | usr.bin/make/parse.c | 57 |
3 files changed, 12 insertions, 62 deletions
diff --git a/usr.bin/make/config.h b/usr.bin/make/config.h index 15a4b15..a40e445 100644 --- a/usr.bin/make/config.h +++ b/usr.bin/make/config.h @@ -78,15 +78,6 @@ #define RECHECK /* - * POSIX - * Adhere to the POSIX 1003.2 draft for the make(1) program. - * - Use MAKEFLAGS instead of MAKE to pick arguments from the - * environment. - * - Allow empty command lines if starting with tab. - */ -#define POSIX - -/* * SYSVINCLUDE * Recognize system V like include directives [include "filename"] * SYSVVARSUB diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 34d0597..4d90332 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -612,11 +612,7 @@ main(int argc, char **argv) * (Note this is *not* MAKEFLAGS since /bin/make uses that and it's * in a different format). */ -#ifdef POSIX Main_ParseArgLine(getenv("MAKEFLAGS")); -#else - Main_ParseArgLine(getenv("MAKE")); -#endif MainParseArgs(argc, argv); @@ -766,11 +762,7 @@ main(int argc, char **argv) /* Install all the flags into the MAKE envariable. */ if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p) -#ifdef POSIX setenv("MAKEFLAGS", p, 1); -#else - setenv("MAKE", p, 1); -#endif free(p1); /* diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 9cbef99..52a1bc3 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -143,9 +143,7 @@ typedef enum { Parallel, /* .PARALLEL */ ExPath, /* .PATH */ Phony, /* .PHONY */ -#ifdef POSIX Posix, /* .POSIX */ -#endif Precious, /* .PRECIOUS */ ExShell, /* .SHELL */ Silent, /* .SILENT */ @@ -199,9 +197,7 @@ static struct { { ".PARALLEL", Parallel, 0 }, { ".PATH", ExPath, 0 }, { ".PHONY", Phony, OP_PHONY }, -#ifdef POSIX { ".POSIX", Posix, 0 }, -#endif { ".PRECIOUS", Precious, OP_PRECIOUS }, { ".RECURSIVE", Attribute, OP_MAKE }, { ".SHELL", ExShell, 0 }, @@ -1034,11 +1030,9 @@ ParseDoDependency (char *line) case ExPath: Lst_ForEach(paths, ParseClearPath, (void *)NULL); break; -#ifdef POSIX case Posix: Var_Set("%POSIX", "1003.2", VAR_GLOBAL); break; -#endif default: break; } @@ -2428,9 +2422,6 @@ Parse_File(char *name, FILE *stream) * If a line starts with a tab, it can only hope to be * a creation command. */ -#ifndef POSIX - shellCommand: -#endif for (cp = line + 1; isspace ((unsigned char) *cp); cp++) { continue; } @@ -2474,10 +2465,6 @@ Parse_File(char *name, FILE *stream) * line's script, we assume it's actually a shell command * and add it to the current list of targets. */ -#ifndef POSIX - Boolean nonSpace = FALSE; -#endif - cp = line; if (isspace((unsigned char) line[0])) { while ((*cp != '\0') && isspace((unsigned char) *cp)) { @@ -2486,44 +2473,24 @@ Parse_File(char *name, FILE *stream) if (*cp == '\0') { goto nextLine; } -#ifndef POSIX - while ((*cp != ':') && (*cp != '!') && (*cp != '\0')) { - nonSpace = TRUE; - cp++; - } -#endif } -#ifndef POSIX - if (*cp == '\0') { - if (inLine) { - Parse_Error (PARSE_WARNING, - "Shell command needs a leading tab"); - goto shellCommand; - } else if (nonSpace) { - Parse_Error (PARSE_FATAL, "Missing operator"); - } - } else { -#endif - ParseFinishLine(); + ParseFinishLine(); - cp = Var_Subst (NULL, line, VAR_CMD, TRUE); - free (line); - line = cp; + cp = Var_Subst (NULL, line, VAR_CMD, TRUE); + free (line); + line = cp; - /* - * Need a non-circular list for the target nodes - */ - if (targets) - Lst_Destroy(targets, NOFREE); + /* + * Need a non-circular list for the target nodes + */ + if (targets) + Lst_Destroy(targets, NOFREE); - targets = Lst_Init (FALSE); - inLine = TRUE; + targets = Lst_Init (FALSE); + inLine = TRUE; - ParseDoDependency (line); -#ifndef POSIX - } -#endif + ParseDoDependency (line); } nextLine: |