diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index be15e6276c79..7ec42d28b409 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -96,6 +96,17 @@ __FBSDID("$FreeBSD$"); * Job_Touch Update a target without really updating it. * * Job_Wait Wait for all currently-running jobs to finish. + * + * compat.c -- + * The routines in this file implement the full-compatibility + * mode of PMake. Most of the special functionality of PMake + * is available in this mode. Things not supported: + * - different shells. + * - friendly variable substitution. + * + * Interface: + * Compat_Run Initialize things for this module and recreate + * thems as need creatin' */ #include @@ -487,6 +498,24 @@ static void JobInterrupt(int, int); static void JobRestartJobs(void); static void ProcExec(const ProcStuff *) __dead2; +/* + * The following array is used to make a fast determination of which + * commands and characters are interpreted specially by the shell. + * If a command is one of these or contains any of these characters, + * it is executed by the shell, not directly by us. + * XXX Both of these arrays should be configurable via .SHELL + */ +static const char const* sh_builtin[] = { + "alias", "cd", "eval", "exec", + "exit", "read", "set", "ulimit", + "unalias", "umask", "unset", "wait", + ":", NULL +}; +static const char *sh_meta = "#=|^(){};&<>*?[]:$`\\\n"; + +static GNode *curTarg = NULL; +static GNode *ENDNode; + /** * Replace the current process. */ @@ -3083,36 +3112,6 @@ Cmd_Exec(const char *cmd, const char **error) } -/*- - * compat.c -- - * The routines in this file implement the full-compatibility - * mode of PMake. Most of the special functionality of PMake - * is available in this mode. Things not supported: - * - different shells. - * - friendly variable substitution. - * - * Interface: - * Compat_Run Initialize things for this module and recreate - * thems as need creatin' - */ - -/* - * The following array is used to make a fast determination of which - * characters are interpreted specially by the shell. If a command - * contains any of these characters, it is executed by the shell, not - * directly by us. - */ -static const char const* sh_builtin[] = { - "alias", "cd", "eval", "exec", - "exit", "read", "set", "ulimit", - "unalias", "umask", "unset", "wait", - ":", NULL -}; -static const char *sh_meta = "#=|^(){};&<>*?[]:$`\\\n"; - -static GNode *curTarg = NULL; -static GNode *ENDNode; - /* * Interrupt handler - set flag and defer handling to the main code */ @@ -3241,14 +3240,6 @@ Compat_RunCommand(char *cmd, GNode *gn) char *cmd_save; /* saved cmd */ ProcStuff ps; - /* - * Avoid clobbered variable warnings by forcing the compiler - * to ``unregister'' variables - */ -#if __GNUC__ - (void)&av; - (void)&errCheck; -#endif silent = gn->type & OP_SILENT; errCheck = !(gn->type & OP_IGNORE); doit = FALSE; @@ -3377,11 +3368,15 @@ Compat_RunCommand(char *cmd, GNode *gn) * The child is off and running. Now all we can do is wait... */ reason = ProcWait(&ps); + if (interrupted) CompatInterrupt(interrupted); + /* + * Decode and report the reason child exited, then + * indicate how we handled it. + */ if (WIFEXITED(reason)) { - /* exited */ status = WEXITSTATUS(reason); if (status == 0) { return (0); diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 05cd8e3d4cb1..4df224f0092e 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1384,15 +1384,6 @@ Parse_DoVar(char *line, GNode *ctxt) char *opc; /* ptr to operator character to * null-terminate the variable name */ - /* - * Avoid clobbered variable warnings by forcing the compiler - * to ``unregister'' variables - */ -#if __GNUC__ - (void)&cp; - (void)&line; -#endif - /* * Skip to variable name */