summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/job.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary cast to pid_t.kevlo2013-07-041-2/+2
|
* Include target names in diagnostic output.fjoe2012-02-121-8/+15
| | | | Submitted by: Garrett Cooper
* Spelling fixes for usr.bin/uqs2011-12-301-1/+1
|
* Revert r228521: sometimes job output is lostfjoe2011-12-151-8/+2
| | | | | | | | (see tools/regression/usr.bin/make/execution/joberr test). openpty(fd + 0, fd + 1,...) version does not have this problem but it sometimes enters an infinite sleep in "ttywait" state in tty_drain() when make(1) closes slave pty.
* job make: if stdout is a tty create a pty when running a command.fjoe2011-12-151-2/+8
|
* - Fix segmentation fault when running "+command" when run with -jX -n duefjoe2011-11-301-57/+48
| | | | | | | | | | | to Compat_RunCommand() being called with `cmd' that is not on the node->commands list - Make ellipsis ("..." command) handling consistent: check for "..." command in job make after variables expansion to match compat make behavior - Fix empty command handling (after variables expansion and @+- modifiers are processed): now empty commands are ignored in compat make and are not printed in job make case - Bump MAKE_VERSION to 5-2011-11-30-0
* Fix the previous commit (still not used to svn vs. cvs). Use theharti2010-01-111-4/+2
| | | | | define from paths.h for the default temporary directory and remove and unneccessary getenv call.
* Make make respect the TMPDIR environment variable.harti2010-01-101-5/+14
| | | | | PR: bin/115447 Submitted by: Eugene Grosbein
* Add missing `void' keyword.ed2009-12-291-1/+1
|
* Garbage collect some old #ifdef'ed code from 1994 that causes vi's '%'obrien2009-11-171-11/+0
| | | | to be unable to find a match in Path_FindFile().
* Exit with non-zero error code in case of errorsfjoe2009-10-181-0/+2
| | | | when make is run with -k and not parallel (compat) make is run.
* Add volatile to sig_atomic_t where it was missing.des2009-06-141-1/+1
| | | | MFC after: 1 week
* Partially revert r186559.obrien2009-02-031-1/+1
|
* Don't enable -Q by default - I've fixed the rescue build issue.obrien2009-01-131-2/+1
|
* + Add the -Q be-quiet flag for parallel jobs.obrien2009-01-031-1/+1
| | | | | - Enable -Q by default for the moment - there is something weird going on in the rescue build.
* 1. Add the ability to tweak the token output before targets in job mode.obrien2008-12-291-3/+16
| | | | | | | | | | | | E.g., .MAKE.JOB.PREFIX=${.newline}---[${.MAKE.PID}] would produce ---[1234] target --- 2. Added ${.newline} as a simple means of being able to include '\n' in the assignment of .MAKE.JOB.PREFIX Obtained from: NetBSD
* Exit with error code 2 when run with -k (continue if errors) and build failed.fjoe2008-12-181-15/+11
|
* Since in some cases (when found obsolete) 'make' can be builded earlierache2008-09-291-1/+6
| | | | | at 'upgrade_checks' target, put arc4random_uniform() into __FreeBSD_version ifdef.
* Use arc4random_uniform(3)ache2008-08-071-1/+1
|
* It seems some don't care for the anchient joke. Add WITHOUT_OLD_JOKEobrien2008-03-041-0/+2
| | | | to your CFLAGS if you fall into this camp.
* No need to tell make to DTRT with "make love", just do it.obrien2008-03-041-6/+0
| | | | | Also remove the 2002/08/31 bootstrapping aid for upgrades from year old (mid-2001) systems.
* Implement "Remaking Makefiles" feature:fjoe2007-03-081-20/+29
| | | | | | | | | | | | | | | | | | | | | | | After reading Makefile and all the files that are included using .include or .sinclude directives (source Makefiles) make considers each source Makefile as a target and tries to rebuild it. Both explicit and implicit rules are checked and all source Makefiles are updated if necessary. If any of the source Makefiles were rebuilt, make restarts from clean state. To prevent infinite loops the following source Makefile targets are ignored: - :: targets that have no prerequisites but have commands - ! targets - targets that have .PHONY or .EXEC attributes - targets without prerequisites and without commands When remaking a source Makefile options -t (touch target), -q (query mode), and -n (no exec) do not take effect, unless source Makefile is specified explicitly as a target in make command line. Additionally, system makefiles and .depend are not considered as a Makefiles that can be rebuilt. Reviewed by: harti
* Fix a bug where the standard input (fifoFd == 0) was confused with anwill2007-03-081-1/+1
| | | | | | | | error return from open(2), leading to an erroneous value of maxJobs and a hung make when -f is standard input and -j is used. PR: bin/101232 Submitted by: Nate Eldredge <nge@cs.hmc.edu>
* Make sure that the created fifo gets deleted if the top level make instancescottl2005-10-091-0/+2
| | | | exits due to a signal.
* Fix the "..." special command. If this command is found all furtherharti2005-07-191-1/+1
| | | | | | | | | | | commands for this target are appended to the .END target instead of beeing executed now. They are executed when the graph is finished. There was a bug with executing the .END target which came in when doing conversion to LST_FOREACH() which caused make to dump core. PR: bin/83698 Submitted by: Max Okumoto <okumoto@ucsd.edu> MFC after: 3 days
* The caller of Var_Value() should not change the variable value. Makeharti2005-05-241-1/+1
| | | | | | this clear by constifying the return value. Obtained from: DragonFlyBSD
* Get rid of the third argument to Var_Value() the pointer it pointedharti2005-05-241-17/+5
| | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD
* Factor out ProcExec() into its own file and rename it to Proc_Exec() forharti2005-05-241-121/+4
| | | | | | 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-241-472/+1
| | | | | | | 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-241-1/+1
| | | | | | the default shell. Idea from: DragonFlyBSD
* Another shell attribute 'unsetenv' that will cause to unsetenv("ENV")harti2005-05-241-8/+13
| | | | | | 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.
* Before doing any parsing parse the builtin shell specifications andharti2005-05-241-178/+195
| | | | | | | | | | | | | | | | | | | | 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.
* Get rid of global variables for argument vectors produced by brk_string()harti2005-05-181-35/+38
| | | | | | | | 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-181-9/+9
| | | | | | | in two places. While here don't bother returning anything from Lst_Replace - nobody ever checks the return code. Suggested by: jmallet
* Make Shell_Init() static - it's only used here.harti2005-05-131-9/+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.
* 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)
* The first element of the vector built by brk_string() is neverharti2005-05-121-2/+7
| | | | | | | 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 main(). Move catching SIGCHLD into job.c. Move unsetenv("ENV")harti2005-05-121-0/+32
| | | | | | | | 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)
* Compat_RunCommand is used only in job.c so make it static there.harti2005-05-121-1/+2
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.234)
* Fix the fix for bin/72510 applied in job.c:1.70. Actually there haveharti2005-05-121-1/+6
| | | | | | | | | | 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
* 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-121-39/+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>
* Style: remove spaces before tabs.harti2005-05-101-31/+31
| | | | | Patch: 7.207 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Make shellPath and shellName static - they're used in job.c only.harti2005-05-101-2/+2
| | | | | | | Move definition of parsing error levels from make.h into parse.h. Patches: 7.202,7.203 Submitted by: Max Okumoto <okumoto@ucsd.edu>
OpenPOWER on IntegriCloud