From e1d72ad3f1f9fd9dc72b43b7c618230e0c7d190f Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 8 Jul 1999 06:49:52 +0000 Subject: * Added -R / --no-builtin-variables flag. --- main.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index fc5b335..c315827 100644 --- a/main.c +++ b/main.c @@ -27,8 +27,8 @@ MA 02111-1307, USA. */ #include "getopt.h" #include #ifdef _AMIGA -# include -# include +# include +# include #endif #ifdef WINDOWS32 #include @@ -61,9 +61,9 @@ extern void print_vpath_data_base PARAMS ((void)); extern int chdir (); #endif #ifndef STDC_HEADERS -#ifndef sun /* Sun has an incorrect decl in a header. */ +# ifndef sun /* Sun has an incorrect decl in a header. */ extern void exit PARAMS ((int)) __attribute__ ((noreturn)); -#endif +# endif extern double atof (); #endif extern char *mktemp (); @@ -163,9 +163,10 @@ int print_data_base_flag = 0; int question_flag = 0; -/* Nonzero means do not use any of the builtin rules (-r). */ +/* Nonzero means do not use any of the builtin rules (-r) / variables (-R). */ int no_builtin_rules_flag = 0; +int no_builtin_variables_flag = 0; /* Nonzero means keep going even if remaking some file fails (-k). */ @@ -317,6 +318,9 @@ static const struct command_switch switches[] = { 'r', flag, (char *) &no_builtin_rules_flag, 1, 1, 0, 0, 0, "no-builtin-rules", 0, "Disable the built-in implicit rules" }, + { 'R', flag, (char *) &no_builtin_variables_flag, 1, 1, 0, 0, 0, + "no-builtin-variables", 0, + "Disable the built-in variable settings" }, { 's', flag, (char *) &silent_flag, 1, 1, 0, 0, 0, "silent", 0, "Don't echo commands" }, @@ -1065,6 +1069,10 @@ int main (int argc, char ** argv) if (inhibit_print_directory_flag) print_directory_flag = 0; + /* If -R was given, set -r too (doesn't make sense otherwise!) */ + if (no_builtin_variables_flag) + no_builtin_rules_flag = 1; + /* Construct the list of include directories to search. */ construct_include_path (include_directories == 0 ? (char **) 0 -- cgit v1.2.3