summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/parse.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* put back Lst_Destroy(paths) where it belongsespie2021-03-061-2/+6
| | | | noticed by jsg@
* 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@
* remove OP_* for deprecated keywords (document that :: still usesespie2020-01-261-5/+5
| | | | | | OP_INVISIBLE) okay millert@
* deprecate old keywords, some already removed, some now hitting the bitbucket.espie2020-01-261-8/+20
| | | | | | | | | | | 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 the way we account for different jobs:espie2020-01-131-7/+2
| | | | | | | | | - 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
* concept borrowed from netbsd: turns out SPECIAL_SOURCE/TARGET is no longerespie2020-01-131-44/+42
| | | | | | | 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 documentation around to be more specific to suff.cespie2020-01-131-2/+2
| | | | | | | 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-131-35/+16
| | | | | | 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-131-8/+6
| | | | | | 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-131-5/+4
| | | | | | | | 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-131-3/+3
| | | | | unconfuse type/special field (first commit of a large patch that was ok'd tb@, millert@)
* - give a specific value to OP_ERROR that doesn't occur in natureespie2019-12-221-47/+64
| | | | | | | | | | - 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@
* rename a few variable/functions to have better names.espie2019-12-211-8/+7
| | | | | | | | adjust comments to be more meaningful reorder predecessors/successors fields in an order that makes more sense to me. okay millert@
* fix indentationjsg2018-09-201-2/+2
| | | | ok krw@ millert@
* More NUL (not NULL) checks.zhuk2017-12-191-2/+2
| | | | With support from guenther@ and millert@; final okay espie@
* strip_comments is also called for dot lines, so sometimes the commentespie2017-12-051-2/+1
| | | | | | is all the line. problem reported by Sergey Bronnikov
* add !!=espie2016-10-231-2/+2
| | | | feedback and okay millert@
* small obvious cleanups:espie2016-10-211-9/+8
| | | | | | | | - remove a lot of unnecessary casts - zap extra param that's no longer needed - add proper prototype and make function static okay natano@
* have sinclude/include be more compatible with sysv, handle list of filesespie2016-05-131-33/+45
| | | | small improvement and okay millert@
* in case we have a parse error, dispell the target list early to avoidespie2015-12-221-3/+9
| | | | | | | | various problems. Problem noticed by jsg@, deeper patch than he suggested okay jsg@ and tb@.
* fix duplicate targets in target list for good: split previous groupling fixespie2015-11-291-27/+66
| | | | | | | | in two. Catch 22: we have to dedup targets very early so that commands get attached correctly, but we can't figure out the grouplings heuristics until we have all commands... ok millert@
* I was very optimistic in groupling creation. Turns out lists of targetsespie2015-11-061-6/+48
| | | | | | | | | | | | | can have duplicates, or overlap, or even be empty thanks to fnmatch. So use the big guns to build the circular list correctly, namely actual lists of targets that are made together will be registered in a hash first, then we recreate the full list from there. (merging lists is not an issue, since groupling links are only used to temporarily lock targets in parallel mode). Issue noticed by guenther@, okay guenther@
* a wee little bit more cleanup (more const and remove noise from CDIAGFLAGS...espie2015-01-231-1/+2
| | | | | -pedantic kind of requires -std=c99 here to avoid LL warnings) okay miod@, millert@
* remove a bunch of dangerous casts (useless casts from void * to somethingespie2015-01-231-5/+5
| | | | | | | | | | | | | | | else, in some cases by adding extra temporary variables. IMO, it's much better practice to do void *a; int *p = a; *p = 42; rather than void *a; *(int *)a = 42; okay miod@... to be revisited for some possible const additions later.
* wrappers for is*/to* that make damn sure their arguments areespie2013-11-221-27/+27
| | | | | | cast to unsigned chars. okay deraadt@
* complement "need an operator" fatal error message with the actual line content.espie2012-11-241-2/+3
| | | | okay beck@
* say goodbye to killing trailing spaces.espie2012-11-071-2/+1
| | | | | | | | | this was yet another weirdness in our make that isn't shared by other makes, and that isn't part of any standard. This means end-of-line spaces in variables ARE significant (spaces around the equal sign still aren't). okay sthen@, "sounds fine" deraadt@
* - SPECIAL_DEPRECATED -> SPECIAL_NOTHINGespie2012-10-091-38/+82
| | | | | | | | | | - nodes for .POSIX and .SCCS_GET (which don't do anything) - zap remaining suffix crud. new scaffolding: - groupling list and HELDBACK state to avoid races in engine. - parser recognizes lists of targets that shoul be grouped together - OP_DOUBLE to mark nodes that have multiple lists of commands
* more changes, discussed and tested by various people.espie2012-10-021-76/+6
| | | | | | | | | | | | | | | | | - put back some job control, turns out it's necessary when we don't run a shell. - zap old #ifdef CLEANUP code... probably doesn't even compile. - kill most of the OP_LIB code. Just keep a wee little bit for compatibility (deprecated .LIBS and .INCLUDES, warns for weird dependencies instead of erroring out). - much improved debugging and -p output: sort variables, targets, rules, output stuff in a nicer format mimicing input. - better error message when no command is found, explain where the target comes from. - sort final error list by file. - show system files in errors as <bsd.prog.mk> - reincorporate random delay, that was dropped - optimize siginfo output by not regenerating the whole string each time. - finish zapping old LocationInfo field that's no longer used.
* major overhaul of the way make handle jobs, inspired by dpb:espie2012-09-211-18/+28
| | | | | | | | | | | | | | | | | | | | | | | | | instead of forking a "job" per target, and having that job further fork separate commands, have make maintain a list of jobs, indexed by pid of currently running commands, and handle process termination continuation-style. This has lots of benefits: - make is responsible for most printing, so we no longer need pipes nor job control: make -j jobs see the tty. - no more special-casing for jobs that don't really execute anything. - unify code for make -jn and make -B, including signal handlers and job waiting. So make -n, make -q, +cmd now run commands in the same way in all cases. - unified more accurate error-reporting, as make knows precisely which command failed. Commands are tagged with their lines, and we display failing commands in silent mode. - fine-grained "expensive" command handling (recursion limiter). Do it per-command instead of per-target. Moreover, signal response is now simpler, as we just block the signals in a small critical sections, test for events, and sigpause (thanks a lot to guenther@ and millert@), so running make is now almost always paused without any busy-waiting. Thanks to everyone who tested and gave input.
* dyslexy strikes againespie2012-04-201-3/+3
|
* this error message was impossible to understand without the source code.espie2012-04-171-3/+28
| | | | | | be slightly more verbose and really explain what's going on. okay millert@
* make has had heuristics to avoid parallel make recursion.espie2012-04-111-1/+5
| | | | | | Sometimes they mess up, so add .CHEAP/.EXPENSIVE to explicitly tell make 'hey this is not THAT bad' or 'worse than you think'. agreed by guenther@, millert@ (and some tweaks)
* minor cleanup: error messages include lineno and fileno together, soespie2012-03-221-5/+3
| | | | | | | | recognize that and create a struct Location_ for it. mostly from Jonathan Calmels, a few nits from me. okay otto@
* nits with current being NULL or not.espie2010-12-261-3/+5
| | | | okay miod@
* Correct $OpenBSD$ stuffespie2010-07-191-2/+1
|
* whitespaceespie2010-07-151-4/+4
|
* use unsigned values where applicableespie2009-08-161-42/+42
|
* simple check for cvs conflicts, avoids some "duh" moments (some people likeespie2009-05-101-2/+10
| | | | | | it, other don't care, it's cheap enough). Slightly tweaked patch that also guards against empty arrays (though it's unlikely to happen, I don't feel like proving the array is not empty).
* put parsing of operator (:, ::, !) into its own functionespie2007-09-231-22/+33
|
* reindent a few lines in parse.c which are missing it.espie2007-09-181-93/+84
|
* missing prototype for static functionespie2007-09-181-1/+2
|
* rewrite of the basic suffix/target parsing: use hash for suffixes.espie2007-09-171-691/+601
| | | | | | | | | | | | | | Store special targets in target hash, and use them for the parsing. Use OP_DUMMY flag to mark targets that don't really exist yet, such as interrupt and default nodes. Also, .PATHxxx is special in suffixes. Small tweaks to compat.c, so that run_commands does more stuff after the fork() (and thus no need to free things). Remove distinction between local and global jobs.
* clean-up Parse_File toplevel: add functions to make it clearer what's goingespie2007-09-171-158/+176
| | | | | | on. Start getting rid of globals by passing explicit parameters
* Parse_DoVar -> Parse_As_Var_Assignmentespie2007-09-171-2/+2
|
* parseIncPath -> userIncludePath and assorted renamesespie2007-09-171-13/+13
|
* more zap spacesespie2007-09-171-2/+2
|
* zap more spaces at end of lineespie2007-09-171-2/+2
|
* partial reindentespie2007-09-171-183/+187
|
* kill extra spaces at end of lineespie2007-09-171-13/+13
|