summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/parse.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* kill += 1, -= 1 -> ++, --espie2007-09-171-2/+2
|
* rename dirSearchPath -> defaultPath, and openDirectories -> knownDirectoriesespie2007-09-161-5/+5
|
* kill .SHELL, make doesn't even support it in non-parallel mode.espie2007-09-161-9/+1
|
* cut up dir.c into dir.c/direxpand.c as there is very little interface betweenespie2007-09-161-1/+2
| | | | two modules that do different things.
* fix curly in targets... broke it and no-one saw the difference, so it'sespie2007-08-051-2/+2
| | | | probably not used that often.
* introduce a Var_Substi to substitute on intervals.espie2007-07-301-314/+274
| | | | | | | | | | | | | | | | | | | | | | Since we don't really know how to change Var_Subst and dependent functions, we cheat, and copy the string to a buffer instead. Clean-up the parser a bit: reorganize the include files lookup function: introduce a resolve_include_filename function that figures out the full name of the file, introduce a handle_include_file that does all the include file handling, and rename the functions into handle_xxx_include, so that we can remove most comments. Rename ParseIsCond into handle_bsd_command, cut most of its code into constituent functions. Semantic changes: - follow the rules that, if an optional construct does not parse correctly, then it's not a real extension, and give the normal parser a chance to figure it out. If the syntax checks out, semantic errors ARE real errors. - allow variables to not be defined in include file names, no reason not to. okay miod@
* everywhere except in Var_Parse, we always add/append variables to theespie2007-07-301-2/+2
| | | | | | | | VAR_GLOBAL context, so make it the common case: rename the basic functions to Var_Set_with_ctxt/Var_Append_with_ctxt, define Var_Set and Var_Append as macros that specify VAR_GLOBAL, and use these. okay miod@
* separate and name functions to add target nodes to the graph.espie2007-07-301-38/+47
| | | | okay miod@
* simplify computations in the var module: instead of advancing a char *espie2007-07-241-1/+1
| | | | | | | | | | and keeping track of a length, we just advance the char *, and ditch the length. We can still get the length at the end of the top-level functions to satisfy existing interfaces. Much simpler code, less error-prone. Okay millert@
* move the code that grabs a value in Var_Parse in its own function,espie2007-07-241-1/+1
| | | | | | | | | get_expanded_value. Extend the code a bit to be much more thorough in case of a recursive expansion: shows exactly the cycle of variable names involved. okay millert@
* change Var_ParseSkip API to increment the position instead of returning aespie2007-07-241-2/+2
| | | | | | | | length, simplifies code. (warns a bit, symptom of some further issues to fix). okay millert@
* big clean-up patch:espie2007-07-201-3/+2
| | | | | | | | | | | | - rename a few functions in var.c to names that make more sense. - introduce Var_Deletei because it makes more sense. - rewrite .for loops to use a local LoopVar construct to avoid looking up more stuff. - reformat var.c to near K&R - rewrite most comments in var.c shown to a few people. millert@ gave me his okay since it passes through ports correctly.
* A set of big related changes. okay millert@, tested further by kettenis@espie2007-07-081-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and matthieu@ This all revolves around putting ALL global variables into one single big hash, and using flags. This removes some impossible to understand stuff, like old varfind, and allows for some nice stuff. - each time we reference a global variable, we create it, possibly as a dummy variable. - each time we go to the environment, we remember it, thus we no longer go back to it. Lists of dependant changes: - isolate changes to oldVars and checkEnvFirst. - remove VAR_CMD and VAR_GLOBAL contexts. The only distinction is in parsevar. Split Parse_DoVar into Parse_DoVar and Parse_CmdlineVar - rework var modules around obtain_global_var, observe flags in various functions like Var_Value and Var_Seti. - Var_Seti/Var_Appendi are almost the same code, use that internally. - add magic to handle the very special SHELL variable. - introduce Var_Definedi for the cases where we don't want the actual value, to simplify tests. - add keyword .poison, parse it and set global flags accordingly. - do poison_checks where needed. - document poison. - in for loops, set variable temporarily, so that Var_SubstVar will also substitute it in varmodifiers expressions.
* remove some bogus *p tests from charles longeautedu2007-03-201-8/+8
| | | | ok deraadt millert
* * add an extra argument to the dir lookup functions to say whether weespie2007-01-181-26/+43
| | | | | | | | | | | | | | | should look in the current directory. * refactor include files treatment to have a separate function to look for an include. * use both pieces to make sure system includes do not get looked up in the current directory unless everything else fails. This is != from the netbsd solution to the same problem, which stuffs `magic' entries into filepaths to say whether dot should be looked at first or last. feature requested by matthieu@. okay matthieu@
* ISO function declarations, trim a few comments, rename a few variables toespie2004-04-071-62/+38
| | | | | | more explicit/more consistent names. okay otto@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* This is the first step in sanitizing the conditional parser.espie2002-06-111-26/+26
| | | | | | | | | | | | | | | | | Change the conditional recognition algorithm: scan for a sequence of alphabetic characters, hash it, and compare it against a small table (using ohash functions). This makes Cond_Eval entry more logical, and allows for some shortcuts in recognizing .include, .for, .undef. This also means that conditionals must have an intervening blank between the keyword and the actual test, e.g., .ifA will no longer work. (but no-one actually uses this, and it's highly obfuscated) Okay miod@.
* Fixed version... don't see how this could work on i386, since it didn'tespie2001-11-111-4/+4
| | | | initialize create in main.c.
* undo changes that crash on (at least) the alphaderaadt2001-11-111-4/+4
|
* Redo LstInit as a macro: smaller and faster code in all cases, zeroing twoespie2001-11-111-4/+4
| | | | | | | pointers is simpler than calling a function. Recognize purely static lst headers, which don't really need any initialization. ok miod@
* Replace the most used static lists in make by persistent growable arrays.espie2001-06-121-70/+66
| | | | | 5% speed increase on a make build. ok miod@