summaryrefslogtreecommitdiffstats
path: root/usr.bin/make (follow)
Commit message (Collapse)AuthorAgeFilesLines
* somehow, when I used more bool, I forgot to check with WARNINGS=Yesespie2020-06-031-2/+2
| | | | | | no reason for those types to have different return types, all compilers are slightly unhappy with incompatible function pointers (again, obvious commit, no difference in generated code)
* Init_Sigset() isn't a prototype without the void!espie2020-06-031-2/+2
| | | | obvious warning fix
* kill dead lineespie2020-06-021-2/+1
| | | | okay millert@
* use the right abstraction to abort jobs, also show debug info as thisespie2020-06-021-3/+7
| | | | | | thing is tricky okay millert@
* in case there are several operators on a dependency line, prefer theespie2020-04-201-2/+5
| | | | | | | | | standard one (:) to the very BSD specific (!) so that standard Makefiles keep working in the presence of ! in filenames. This doesn't supersede the usual heuristics of choosing the operator followed by space if several are present. okay millert@
* in the very strange case where make's child gets ptrace'd by its own infantespie2020-01-291-2/+5
| | | | | | | | | | (hi mpi@) we may wish to ignore WIFSTOPPED so that other bugs elsewhere may get found. Also give more information in "can't happen" case to speed up figuring problems out. okay millert@, mpi@
* remove OP_* for deprecated keywords (document that :: still usesespie2020-01-268-74/+28
| | | | | | OP_INVISIBLE) okay millert@
* remove documentation for .MADEespie2020-01-261-4/+2
|
* deprecate old keywords, some already removed, some now hitting the bitbucket.espie2020-01-262-9/+23
| | | | | | | | | | | okay on principle from millert@/schwarze@ The rationale is that those aren't even documented (apart from .MADE) and the corresponding code has never been maintained (just untouched when changing other things, so it probably doesn't work right if it ever did) This went through a full release/bulk to make sure nobody was using that stuff. okay millert@
* simplify logic in compat engine, we can set ABORTED directly instead ofespie2020-01-261-10/+7
| | | | | waiting for the father to do so. okay millert@
* turns out there WAS something fishy in signal handling in the "generic"espie2020-01-165-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reaper. Specifically, the sigprocmask/wait/sigsuspend dance is correct for the main process, BUT you have to remember to reset the signal mask to something sane for the child (this was a duh! moment, that bug is very stupid) Finally, bluhm@ saw the actual issue. Kudoes to him. The change to "unify" sequential and parallel make made the bug reproducible under some circumstances (because in the parallel make case, many things may happen in different successions, so you don't get the wrong signal mask that often, but the sequential case is reproducible, and using the "streamlined" reaper meant the fork would occur WITHIN the signal loop instead of OUTSIDE) So: - discover signal state early on through Sigset_init; - introduce reset_signal_mask to get back to the initial state; - call reset_signal_mask systematically after fork This organisation thanks to cmd_exec. SOME cmd_exec happens before Job_Init happens, some afterwards (variables are still lazy and both !!= and :sh will occur AFTER parsing), so both fork() need to be protected. okay bluhm@ thx to sthen@ and naddy@ and mpi@ for helping out.
* move function around to minimize conflictsespie2020-01-131-17/+17
|
* forgot to remove Job_Begin/Job_Endespie2020-01-131-11/+1
|
* proper prototypeespie2020-01-131-2/+2
|
* forgot gc'ing one functionespie2020-01-131-7/+1
|
* make the choice of engine explicitespie2020-01-1313-136/+137
| | | | | | simplify the running of .BEGIN/.END so that they pass through the engine first (so they can now have dependencies). Error out properly if .BEGIN/.END fails.
* unify compat mode and parallelmode a bit: there's no longer a need forespie2020-01-135-82/+24
| | | | handle_one_job, always go thru Job_Make now.
* make things more complex so that they can become simpler:espie2020-01-133-8/+11
| | | | | | | in the compatMake case, we still get into handle_all_running_jobs in case of a fatal signal and at the end. Pass compatMake around to job.c so that it will *not* run parallel make code in the sequential make case, thus actually making sure both engines are separate.
* less confusing function nameespie2020-01-133-6/+6
|
* introduce a JOB_KEEPERROR flag so that the logic for moving jobsespie2020-01-133-12/+17
| | | | to availableJobs/errorJobs happens just once
* cleanup headerespie2020-01-131-10/+10
|
* zap more unneeded indirection, may_continue_job is enoughespie2020-01-131-15/+9
|
* remove_job no longer pulls its weightespie2020-01-131-4/+3
|
* better name for functionespie2020-01-133-8/+8
|
* simplify the way we account for different jobs:espie2020-01-137-50/+76
| | | | | | | | | - have a simple variable "sequential" that counts whether we are running more than one job (for the expensive heuristics) - don't expose various things globally, just have a set_noparallel() for the parser - preallocate exactly enough job structures and record them in availableJobs - keep one job on the side for .INTERRUPT
* and actually comment about itespie2020-01-131-1/+5
|
* move expensive heuristics a bit and explain better why we do thatespie2020-01-132-9/+8
| | | | in that error case.
* concept borrowed from netbsd: turns out SPECIAL_SOURCE/TARGET is no longerespie2020-01-134-57/+49
| | | | | | | needed, because if we're special it's a target, if we have special_op, it's a source. There's just SPECIAL_WAIT which requires funny handling anyhow
* move a large chunk of suff.c into its own file (independent functions whichespie2020-01-136-221/+288
| | | | | are not really directly related to suffix handling), so that I can eventually understand how this whole thing works.
* move documentation around to be more specific to suff.cespie2020-01-133-60/+49
| | | | | | | Rename Suff_ClearSuffixes to the more explicit Suff_DisableAllSuffixes which describes accurately what this function actually does. remove outdated comments about .INCLUDE/.LIBS
* a lot of special keywors (.INCLUDE/.LIBRARIES) were removed a few releasesespie2020-01-132-37/+20
| | | | | | ago. Document what's actually going on with special keywords (mostly .PATH has special semantics) and document that SPECIAL_NOTHING corresponds to ignoring former keywords.
* introduce a "Buf_Reinit" function for handling static buffers that canespie2020-01-134-14/+23
| | | | | | be reused throughout running make. Instead of recreating buffers of dubious appropriate size, have one single buffer for various stages of parsing.
* tweak special node creation to be simpler: nodes created for special keywordsespie2020-01-133-43/+51
| | | | | | | | are created exactly once, so they don't need to be looked up to check whether they exist or not. Go thru a Targ_mk_node internal with all the special fields, and note the special nodes are the only one with special values in there
* document special values.espie2020-01-132-11/+17
| | | | | unconfuse type/special field (first commit of a large patch that was ok'd tb@, millert@)
* fix -q: in compatMode, compute and return outofdate just like parallel mode.espie2020-01-084-11/+18
| | | | | | | Also, never run .END in querymode (we don't actually care about updating problem in that case). okay millert@
* create a separate function "may_continue_heldback_jobs" and invokeespie2020-01-041-2/+9
| | | | | | | | | | | | | | | | | it in the main reaper loop, instead of waiting for a job with an expensive command to exit. This prevents jobs with an expensive command from holding back everything else until their full list of commands is run, instead of just the expensive one. (as JOB_IS_EXPENSIVE is updated before and after each command for a job, this is safe) This might make things slightly more parallel. It's definitely more correct and less tangled. okay millert@
* remove redundant test, !keepgoing is already a condition forespie2020-01-041-3/+2
| | | | | | a job getting on the errorJobs list okay millert@
* plug memory leakespie2019-12-311-2/+3
| | | | okay millert@
* 7 years later, I think the commit message was not enough.espie2019-12-301-1/+5
| | | | document this rather intricate loop (only comments no code change)
* exit_type is already set up with exactly the information we need,espie2019-12-251-11/+10
| | | | | | so get rid of cluttered duplicate logic okay kn@
* Remove non-sensical line. The node certainly hasn't been rebuilt yet,espie2019-12-241-3/+1
| | | | | | | | | and the first thing job_attach_node does is... set the field to BUILDING. probably remnants of code prior to refactoring okay captain_obvious
* - give a specific value to OP_ERROR that doesn't occur in natureespie2019-12-224-55/+74
| | | | | | | | | | - define OP_ZERO as zero, to make some function calls obvious - split ParseDoOp into two functions: ParseDoOp that only deals with : :: ! and ParseDoSpecial that only deals with special nodes. This simplifies both functions accordingly - always initialize special_op okay millert@
* we also have "VAR_*" constants in parsevar with totally different meanings.espie2019-12-221-4/+4
| | | | | | | | | | Rename to avoid ambiguity - VAR_IS_SHELL (in var.c): the SHELL variable, which has specific POSIX semantics - VAR_SHELL (in parsevar.c): assign the result of running the command to the variable. no actual code change
* yet another mostly cosmetic diffespie2019-12-218-62/+65
| | | | | | | | | | - rename context into localvars, which is more meaningful and less generic - instantiate the random rumbling at the start of gnode.h with actual variable names - explain and group gnode.h variables better - make some comments terser/more meaningful okay millert@
* those fields only hold true/false valueespie2019-12-211-3/+3
| | | | | make it obvious okay millert@
* rename a few variable/functions to have better names.espie2019-12-2112-135/+128
| | | | | | | | adjust comments to be more meaningful reorder predecessors/successors fields in an order that makes more sense to me. okay millert@
* rename built_status constants to be less quirkyespie2019-12-217-31/+27
| | | | | | | fold back BEINGMADE and BUILDING which mean the same thing GC CYCLE/ENDCYCLE okay millert@
* tweak buffer handling a bit:espie2019-12-212-36/+29
| | | | | | | | | | - make BufExpand a real function, zap BufOverflow - sprinkle assert that justify the arithmetic - use unsigned constants - fix a bug in the unlikely condition where Buf_printf would exactly match the buffer boundary and Buf_Retrieve would be called right after okay millert@
* The man page actually didn't explain its main parameters!espie2019-12-211-2/+13
| | | | | | fix glaring omission okay schwarze@, jmc@
* GC some old stuffespie2019-08-222-18/+5
| | | | okay millert@