summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
Commit message (Collapse)AuthorAgeFilesLines
* Under certain conditions the condition parser would go one past end ofharti2005-05-251-1/+1
| | | | | | the string. Until now this caused no harm, because the buffer code used to tack two NULs onto buffers. With the new, soon to come, parsing code this isn't the case anymore in all cases, so fix this.
* Document why there is a dependency of certain object files from theharti2005-05-251-0/+6
| | | | | | Makefile. Requested by: ru
* The caller of Var_Value() should not change the variable value. Makeharti2005-05-245-14/+15
| | | | | | this clear by constifying the return value. Obtained from: DragonFlyBSD
* Get rid of the third argument to Var_Value() the pointer it pointedharti2005-05-248-65/+26
| | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD
* Make shell.o dependend on the Makefile just in case someone changesharti2005-05-241-1/+1
| | | | the default shell in the Makefile.
* Bump the warning level to 6.harti2005-05-241-1/+1
|
* Fix a 64-bit warning by casting an int64_t to intmax_t and printing itharti2005-05-241-1/+2
| | | | with %jd.
* Factor out ProcExec() into its own file and rename it to Proc_Exec() forharti2005-05-244-123/+193
| | | | | | consistency with the rest of make. Obtained from: DragonFlyBSD (except for the rename)
* Factor out all the .SHELL parsing related stuff into its own file andharti2005-05-247-477/+588
| | | | | | | rename the function to be consistent with the naming scheme in the rest of make. No functional changes. Obtained from: DragonFlyBSD (idea and most of shell.h)
* Use the name of the default shell instead of a numeric index to selectharti2005-05-243-8/+4
| | | | | | the default shell. Idea from: DragonFlyBSD
* Another shell attribute 'unsetenv' that will cause to unsetenv("ENV")harti2005-05-242-8/+18
| | | | | | before executing the shell. Until now this was done when the default shell was the ksh. This failed if the default shell was sh or csh and the user switched to ksh.
* Describe the meta and builtins attributes for the .SHELL specialharti2005-05-241-0/+14
| | | | target.
* Describe the -x option and the .WARN pseudo-target.harti2005-05-241-0/+33
|
* Before doing any parsing parse the builtin shell specifications andharti2005-05-243-178/+204
| | | | | | | | | | | | | | | | | | | | set the current shell to DEFSHELL. Put all these specifications into a list. Add user specified new shells to this list. If the user just selects one of the already know shells just pick the right one off the list. This let's one do something like: # Full specification of the user's shell. This also selects the shell. .SHELL: name=myshell path=/somewhere/foo echo=loud ... FOO != bar # use myshell here .SHELL: name=sh BAR != baz # use /bin/sh here .SHELL: name=myshell # no need for full spec here. # continue to use the user's special shell.
* Allow the .SHELL target to specify the list of shell meta characters andharti2005-05-241-289/+305
| | | | | | | | | | | | | | the list of shell builtins. Both of these are needed for the compat mode where make directly executes commands if the command line contains neither a shell meta character nor a shell builtin. The list of builtins is not changed, but csh has '@' added as a meta-character. Initialize the default shell by parsing a string as one would specify to the .SHELL target. So we get rid of the CShell clone of struct Shell which just contained const char * where struct Shell had char *. Add a debugging function for dumping a parsed shell description to stdout.
* Make the ArgArray_Init() function visible to the rest of make.harti2005-05-232-1/+2
| | | | It will soon be needed for the .SHELL parsing code.
* Get rid of global variables for argument vectors produced by brk_string()harti2005-05-187-211/+263
| | | | | | | | introduce a struct that holds all the information about an argument vector and pass that around. Author: Max Okumoto <okumoto@ucsd.edu> Obtained from: DragonFlyBSD
* Get rid of the ReturnStatus obscuration that was anyway used onlyharti2005-05-188-45/+32
| | | | | | | in two places. While here don't bother returning anything from Lst_Replace - nobody ever checks the return code. Suggested by: jmallet
* Use the print_flags function to print the OP_ flags of a target.harti2005-05-134-41/+28
| | | | | Give the function one more argument to decide whether it should print the flags like a C-expression or just space-delimited.
* Move the Boolean and ReturnStatus stuff from sprite.h to util.h andharti2005-05-1316-81/+27
| | | | | | get rid of sprite.h. Obtained from: DragonFlyBSD
* Make Shell_Init() static - it's only used here.harti2005-05-132-10/+9
| | | | | | | | | Make sure we don't end up with shellPath beeing non-zero, but shellName beeing zero in the error case - back out cleanly from the error. When executing a command for macro assignment in Cmd_Exec() stuff the path of the shell into argv[0], not the name. This makes no difference from the functionality point of view, but allows the regression tests to determine whether make executes the correct shell.
* Include <err.h>. On my system CVS Make(1) has an implicit declaration ofjmallett2005-05-121-0/+1
| | | | warnc(3) without it.
* Still too early to bump WARNS - there are still warnings on 64bitharti2005-05-121-1/+1
| | | | architectures.
* Make sure machine is initialize before use. Also make two pointers constharti2005-05-121-4/+5
| | | | to get rid of the last two const warnings.
* Get rid of the warning about vfork() clobbering variables.harti2005-05-121-4/+9
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.246)
* Do mktemp() by hand to get rid of the mktemp() warning and theharti2005-05-121-17/+102
| | | | | | possible associated security hole. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.245)
* Use a variable initialized to a string instead of the string directlyharti2005-05-122-7/+8
| | | | | | to get rid of a const warning. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.244)
* Move code in CondToken() and get rid of a goto.harti2005-05-121-12/+11
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.243)
* Remove a useless else and un-indent the following code.harti2005-05-121-377/+378
|
* Revert the previous accidential commit.harti2005-05-121-1/+1
|
* Cleanup SuffFindArchDeps() to get rid of two const-warnings.harti2005-05-122-12/+10
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.240)
* The first element of the vector built by brk_string() is neverharti2005-05-122-10/+15
| | | | | | | used so there is no need to stuff the value of .MAKE into it, which btw isn't set for quite a while already. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.239)
* Cleanup. Move initialisation of file and program global variablesharti2005-05-121-56/+56
| | | | | | | to top of main() and sort them. Make chdir_verify_path() static - it is used only here. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.238)
* Replace a lot of Var_Set(..., VAR_GLOBAL) by Var_SetGlobal().harti2005-05-123-18/+30
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.237)
* Cleanup main(). Move catching SIGCHLD into job.c. Move unsetenv("ENV")harti2005-05-123-53/+63
| | | | | | | | into job.c. Move retrieving of environment nearer to the place where it is actually used and invert the preprocessor conditionals to use positive logic. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.236)
* Reshuffle functions to get rid of prototypes.harti2005-05-121-108/+102
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.235)
* Compat_RunCommand is used only in job.c so make it static there.harti2005-05-122-2/+2
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.234)
* Move variable printing from main.c to var.charti2005-05-123-29/+38
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.233)
* Fix the fix for bin/72510 applied in job.c:1.70. Actually there haveharti2005-05-125-8/+13
| | | | | | | | | | been two maxJobs variables: one static in job.c and one global used in main.c and parse.c. Makeing one global out of these was the wrong way to fix the problem. Instead rename the global one to jobLimit and keep maxJobs static in job.c. Suggested by: rwatson PR: bin/72510
* Move some global variables to the correct files.harti2005-05-124-10/+12
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.232)
* Untwist the convoluted if() expressions in JobFinish(). Theyharti2005-05-121-106/+174
| | | | | | could benefit from even more untwisting. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.23[01])
* Move some comments around to where they belong and remove some unneccessaryharti2005-05-122-48/+34
| | | | | | gcc magic. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.229)
* Convert Compat_RunCommand() to use ProcWait(). This also gives Cmd_Exec()harti2005-05-121-73/+68
| | | | | | the potential to handle interrupts which it doesn't currently. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.228)
* Make a function ProcWait() that waits for the given process.harti2005-05-121-20/+31
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.227)
* Overhaul the fork(), exec() code. Put all the common handling thatharti2005-05-121-167/+222
| | | | | | | | | | | | | | takes place in the child process in a function ProcExec(). Make sure, that the child does not call malloc() or other potential dangerous functions (there are still calls to Punt() in the error case that should go away). Allocate the argv string via malloc to overcome the non-constness bug of the execvp prototype. Change the handling of shell meta-characters and move the builtin list near the list of shell builtins. Both of these lists should actuall be configurable by the .SHELL target since they depend on the shell used. Patch: 7.21[2-9], 7.22[0-46] Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the definitions of the OP_* constants from make.h into GNode.hharti2005-05-105-79/+86
| | | | | | | | where they actually belong to. Move the definitions of the strings for special macros like "$*" from make.h to parse.h - they're used only in the parser. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.211)
* Path_Expand() expects its first argument to be writeable so put theharti2005-05-101-1/+2
| | | | | | | default system directory into a writeable character array before passing it to Path_Expand(). Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.210)
* Move declarations of variables belonging to the variable moduleharti2005-05-102-6/+9
| | | | | | from globals.h into var.h. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.209)
* Style: remove spaces before tabs.harti2005-05-101-31/+31
| | | | | Patch: 7.207 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the remaining two prototypes from nonints.h to make.h andharti2005-05-105-53/+3
| | | | | | | remove nonints.h. Patch: 7.204 Submitted by: Max Okumoto <okumoto@ucsd.edu>
OpenPOWER on IntegriCloud