aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/job.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-3391/+0
| | | | | | | | | | really need it can find it in the devel/fmake port or pkg install fmake. Note: This commit is orthogonal to the question 'can we fmake buildworld'. Differential Revision: https://reviews.freebsd.org/D2840 Notes: svn path=/head/; revision=284464
* Remove unnecessary cast to pid_t.Kevin Lo2013-07-041-2/+2
| | | | Notes: svn path=/head/; revision=252679
* Include target names in diagnostic output.Max Khon2012-02-121-8/+15
| | | | | | | Submitted by: Garrett Cooper Notes: svn path=/head/; revision=231544
* Spelling fixes for usr.bin/Ulrich Spörlein2011-12-301-1/+1
| | | | Notes: svn path=/head/; revision=228992
* Revert r228521: sometimes job output is lostMax Khon2011-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. Notes: svn path=/head/; revision=228525
* job make: if stdout is a tty create a pty when running a command.Max Khon2011-12-151-2/+8
| | | | Notes: svn path=/head/; revision=228521
* - Fix segmentation fault when running "+command" when run with -jX -n dueMax Khon2011-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 Notes: svn path=/head/; revision=228157
* Fix the previous commit (still not used to svn vs. cvs). Use theHartmut Brandt2010-01-111-4/+2
| | | | | | | | define from paths.h for the default temporary directory and remove and unneccessary getenv call. Notes: svn path=/head/; revision=202070
* Make make respect the TMPDIR environment variable.Hartmut Brandt2010-01-101-5/+14
| | | | | | | | PR: bin/115447 Submitted by: Eugene Grosbein Notes: svn path=/head/; revision=202045
* Add missing `void' keyword.Ed Schouten2009-12-291-1/+1
| | | | Notes: svn path=/head/; revision=201225
* Garbage collect some old #ifdef'ed code from 1994 that causes vi's '%'David E. O'Brien2009-11-171-11/+0
| | | | | | | to be unable to find a match in Path_FindFile(). Notes: svn path=/head/; revision=199404
* Exit with non-zero error code in case of errorsMax Khon2009-10-181-0/+2
| | | | | | | when make is run with -k and not parallel (compat) make is run. Notes: svn path=/head/; revision=198197
* Add volatile to sig_atomic_t where it was missing.Dag-Erling Smørgrav2009-06-141-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=194217
* Partially revert r186559.David E. O'Brien2009-02-031-1/+1
| | | | Notes: svn path=/head/; revision=188075
* Don't enable -Q by default - I've fixed the rescue build issue.David E. O'Brien2009-01-131-2/+1
| | | | Notes: svn path=/head/; revision=187132
* + Add the -Q be-quiet flag for parallel jobs.David E. O'Brien2009-01-031-1/+1
| | | | | | | | - Enable -Q by default for the moment - there is something weird going on in the rescue build. Notes: svn path=/head/; revision=186713
* 1. Add the ability to tweak the token output before targets in job mode.David E. O'Brien2008-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 Notes: svn path=/head/; revision=186559
* Exit with error code 2 when run with -k (continue if errors) and build failed.Max Khon2008-12-181-15/+11
| | | | Notes: svn path=/head/; revision=186279
* Since in some cases (when found obsolete) 'make' can be builded earlierAndrey A. Chernov2008-09-291-1/+6
| | | | | | | | at 'upgrade_checks' target, put arc4random_uniform() into __FreeBSD_version ifdef. Notes: svn path=/head/; revision=183465
* Use arc4random_uniform(3)Andrey A. Chernov2008-08-071-1/+1
| | | | Notes: svn path=/head/; revision=181397
* It seems some don't care for the anchient joke. Add WITHOUT_OLD_JOKEDavid E. O'Brien2008-03-041-0/+2
| | | | | | | to your CFLAGS if you fall into this camp. Notes: svn path=/head/; revision=176808
* No need to tell make to DTRT with "make love", just do it.David E. O'Brien2008-03-041-6/+0
| | | | | | | | Also remove the 2002/08/31 bootstrapping aid for upgrades from year old (mid-2001) systems. Notes: svn path=/head/; revision=176807
* Implement "Remaking Makefiles" feature:Max Khon2007-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 Notes: svn path=/head/; revision=167330
* Fix a bug where the standard input (fifoFd == 0) was confused with anWill Andrews2007-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> Notes: svn path=/head/; revision=167329
* Make sure that the created fifo gets deleted if the top level make instanceScott Long2005-10-091-0/+2
| | | | | | | exits due to a signal. Notes: svn path=/head/; revision=151162
* Fix the "..." special command. If this command is found all furtherHartmut Brandt2005-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 Notes: svn path=/head/; revision=148151
* The caller of Var_Value() should not change the variable value. MakeHartmut Brandt2005-05-241-1/+1
| | | | | | | | | this clear by constifying the return value. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146581
* Get rid of the third argument to Var_Value() the pointer it pointedHartmut Brandt2005-05-241-17/+5
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Factor out ProcExec() into its own file and rename it to Proc_Exec() forHartmut Brandt2005-05-241-121/+4
| | | | | | | | | consistency with the rest of make. Obtained from: DragonFlyBSD (except for the rename) Notes: svn path=/head/; revision=146574
* Factor out all the .SHELL parsing related stuff into its own file andHartmut Brandt2005-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) Notes: svn path=/head/; revision=146572
* Use the name of the default shell instead of a numeric index to selectHartmut Brandt2005-05-241-1/+1
| | | | | | | | | the default shell. Idea from: DragonFlyBSD Notes: svn path=/head/; revision=146571
* Another shell attribute 'unsetenv' that will cause to unsetenv("ENV")Hartmut Brandt2005-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. Notes: svn path=/head/; revision=146570
* Before doing any parsing parse the builtin shell specifications andHartmut Brandt2005-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. Notes: svn path=/head/; revision=146560
* Allow the .SHELL target to specify the list of shell meta characters andHartmut Brandt2005-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. Notes: svn path=/head/; revision=146557
* Get rid of global variables for argument vectors produced by brk_string()Hartmut Brandt2005-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 Notes: svn path=/head/; revision=146345
* Get rid of the ReturnStatus obscuration that was anyway used onlyHartmut Brandt2005-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 Notes: svn path=/head/; revision=146338
* Make Shell_Init() static - it's only used here.Hartmut Brandt2005-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. Notes: svn path=/head/; revision=146174
* Include <err.h>. On my system CVS Make(1) has an implicit declaration ofJuli Mallett2005-05-121-0/+1
| | | | | | | warnc(3) without it. Notes: svn path=/head/; revision=146160
* Get rid of the warning about vfork() clobbering variables.Hartmut Brandt2005-05-121-4/+9
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.246) Notes: svn path=/head/; revision=146156
* Do mktemp() by hand to get rid of the mktemp() warning and theHartmut Brandt2005-05-121-17/+102
| | | | | | | | | possible associated security hole. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.245) Notes: svn path=/head/; revision=146155
* The first element of the vector built by brk_string() is neverHartmut Brandt2005-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) Notes: svn path=/head/; revision=146147
* Cleanup main(). Move catching SIGCHLD into job.c. Move unsetenv("ENV")Hartmut Brandt2005-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) Notes: svn path=/head/; revision=146144
* Compat_RunCommand is used only in job.c so make it static there.Hartmut Brandt2005-05-121-1/+2
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.234) Notes: svn path=/head/; revision=146142
* Fix the fix for bin/72510 applied in job.c:1.70. Actually there haveHartmut Brandt2005-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 Notes: svn path=/head/; revision=146140
* Untwist the convoluted if() expressions in JobFinish(). TheyHartmut Brandt2005-05-121-106/+174
| | | | | | | | | could benefit from even more untwisting. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.23[01]) Notes: svn path=/head/; revision=146133
* Move some comments around to where they belong and remove some unneccessaryHartmut Brandt2005-05-121-39/+34
| | | | | | | | | gcc magic. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.229) Notes: svn path=/head/; revision=146132
* Convert Compat_RunCommand() to use ProcWait(). This also gives Cmd_Exec()Hartmut Brandt2005-05-121-73/+68
| | | | | | | | | the potential to handle interrupts which it doesn't currently. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.228) Notes: svn path=/head/; revision=146131
* Make a function ProcWait() that waits for the given process.Hartmut Brandt2005-05-121-20/+31
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.227) Notes: svn path=/head/; revision=146130
* Overhaul the fork(), exec() code. Put all the common handling thatHartmut Brandt2005-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> Notes: svn path=/head/; revision=146129
* Style: remove spaces before tabs.Hartmut Brandt2005-05-101-31/+31
| | | | | | | | Patch: 7.207 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146061