| 1 | #include "types.h" |
| 2 | #include "globals.h" |
| 3 | |
| 4 | int env_overrides = 0; |
| 5 | |
| 6 | /* Nonzero means ignore status codes returned by commands |
| 7 | executed to remake files. Just treat them all as successful (-i). */ |
| 8 | |
| 9 | int ignore_errors_flag = 0; |
| 10 | |
| 11 | /* Nonzero means don't remake anything, just print the data base |
| 12 | that results from reading the makefile (-p). */ |
| 13 | |
| 14 | int print_data_base_flag = 0; |
| 15 | |
| 16 | /* Nonzero means don't remake anything; just return a nonzero status |
| 17 | if the specified targets are not up to date (-q). */ |
| 18 | |
| 19 | int question_flag = 0; |
| 20 | |
| 21 | /* Nonzero means do not use any of the builtin rules (-r) / variables (-R). */ |
| 22 | |
| 23 | int no_builtin_rules_flag = 0; |
| 24 | int no_builtin_variables_flag = 0; |
| 25 | |
| 26 | /* Nonzero means check symlink mtimes. */ |
| 27 | int check_symlink_flag = 0; |
| 28 | |
| 29 | /* Nonzero means print directory before starting and when done (-w). */ |
| 30 | int print_directory = 0; |
| 31 | |
| 32 | /* Nonzero means print version information. */ |
| 33 | int print_version_flag = 0; |
| 34 | |
| 35 | /*! Nonzero means --trace and shell trace with input. */ |
| 36 | int shell_trace = 0; |
| 37 | |
| 38 | /* Nonzero means profiling is enabled with specific output requested. (option --profile=callgrind|json */ |
| 39 | int profile_flag = 0; |
| 40 | |
| 41 | /* Path to directory to dump profiling data */ |
| 42 | const char *profile_directory; |
| 43 | |
| 44 | /* Nonzero means look in parent directories for a Makefile if one isn't found |
| 45 | in the current directory (option --search-parent). */ |
| 46 | int search_parent_flag = 0; |
| 47 | |
| 48 | /* Nonzero means do extra verification (that may slow things down). */ |
| 49 | int verify_flag; |
| 50 | |
| 51 | /* Nonzero means do not print commands to be executed (-s). */ |
| 52 | int silent_flag; |
| 53 | |
| 54 | /* Nonzero means just touch the files |
| 55 | that would appear to need remaking (-t) */ |
| 56 | int touch_flag; |
| 57 | |
| 58 | /* Nonzero means just print what commands would need to be executed, |
| 59 | don't actually execute them (-n). */ |
| 60 | int just_print_flag; |
| 61 | |
| 62 | /*! If 1, we don't give additional error reporting information. */ |
| 63 | int no_extended_errors = 0; |
| 64 | |
| 65 | int db_level = 0; |
| 66 | |
| 67 | /*! Value of the MAKELEVEL variable at startup (or 0). */ |
| 68 | unsigned int makelevel; |
| 69 | |
| 70 | /*! Value of the MAKEPARENT variable at startup (or 0). */ |
| 71 | pid_t makeparent_pid; |
| 72 | |
| 73 | /*! Value of the MAKEPARENT_TARGET variable at startup (or NULL). */ |
| 74 | char *makeparent_target; |
| 75 | |
| 76 | /*! Nonzero gives a list of explicit target names and exits. Set by option |
| 77 | --targets |
| 78 | */ |
| 79 | int show_targets_flag = 0; |
| 80 | |
| 81 | /*! Nonzero gives a list of explicit target names that have commands |
| 82 | associated with them and exits. Set by option --tasks |
| 83 | */ |
| 84 | int show_tasks_flag = 0; |
| 85 | |
| 86 | /*! If 1, same as --debugger=preaction */ |
| 87 | int debugger_flag; |
| 88 | |
| 89 | /* If nonzero, we should print a warning message |
| 90 | for each reference to an undefined variable. */ |
| 91 | int warn_undefined_variables_flag; |
| 92 | |
| 93 | /** True if we are inside the debugger, false otherwise. */ |
| 94 | int in_debugger = false; |
| 95 | |
| 96 | /*! Nonzero if we have seen the magic '.POSIX' target. |
| 97 | This turns on pedantic compliance with POSIX.2. */ |
| 98 | int posix_pedantic; |
| 99 | |
| 100 | /*! If nonzero, we are debugging after each "step" for that many times. |
| 101 | When we have a value 1, then we actually run the debugger read loop. |
| 102 | Otherwise we decrement the step count. |
| 103 | |
| 104 | */ |
| 105 | unsigned int i_debugger_stepping = 0; |
| 106 | |
| 107 | /*! If nonzero, we are debugging after each "next" for that many times. |
| 108 | When we have a value 1, then we actually run the debugger read loop. |
| 109 | Otherwise we decrement the step count. |
| 110 | |
| 111 | */ |
| 112 | unsigned int i_debugger_nexting = 0; |
| 113 | |
| 114 | /*! If nonzero, enter the debugger if we hit a fatal error. |
| 115 | */ |
| 116 | unsigned int debugger_on_error = 0; |
| 117 | |
| 118 | /*! If nonzero, we have requested some sort of debugging. |
| 119 | */ |
| 120 | unsigned int debugger_enabled; |
| 121 | |
| 122 | /*! If true, enter the debugger before reading any makefiles. */ |
| 123 | bool b_debugger_preread = false; |
| 124 | |
| 125 | /* This character introduces a command: it's the first char on the line. */ |
| 126 | char cmd_prefix = '\t'; |
| 127 | |
| 128 | /*! Our current directory after processing all -C options. */ |
| 129 | char *starting_directory; |
| 130 | |
| 131 | /* One of OUTPUT_SYNC_* if the "--output-sync" option was given. This |
| 132 | attempts to synchronize the output of parallel jobs such that the results |
| 133 | of each job stay together. */ |
| 134 | int output_sync = OUTPUT_SYNC_NONE; |
| 135 | |
| 136 | /*! This is the path to the shell used run Makefile commands. |
| 137 | The value is set in job.c. |
| 138 | */ |
| 139 | extern const char *default_shell; |
| 140 | |
| 141 | char *remote_description = 0; |
| 142 | |
| 143 | /* Remember the original value of the SHELL variable, from the environment. */ |
| 144 | struct variable shell_var; |
| 145 | |
| 146 | /* The filename and pointer to line number of the |
| 147 | makefile currently being read in. */ |
| 148 | const gmk_floc *reading_file = 0; |