summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/parse.c
Commit message (Collapse)AuthorAgeFilesLines
* Report lines that ought to contain a ':' operator but start with a '.'obrien2010-01-041-2/+5
| | | | | | | as "Unknown directive" sinze they are more likely to be .elseif (etc). (NetBSD PR 37222). Obtained from: NetBSD
* Add check for subversion "original" marker.obrien2010-01-041-0/+1
|
* 1. Add the ability to tweak the token output before targets in job mode.obrien2008-12-291-0/+2
| | | | | | | | | | | | 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
* Consistently use Var_SetGlobal().obrien2008-12-291-1/+1
|
* If the special target .MAKEFILEDEPS exists, then enable theobrien2008-03-121-0/+5
| | | | | "remaking makefiles" feature. Otherwise, follow traditional Pmake behavior. (hash table will be regenerated and committed follow this commit)
* In .error and .warning, prefer command-line variablesru2007-04-121-1/+1
| | | | | | to globals, as per documentation. Nudged by: Jeremie Le Hen
* Implement "Remaking Makefiles" feature:fjoe2007-03-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* Tell when a .include is processed with '-dd'.obrien2006-07-221-0/+1
|
* Make sure that files included using ".include <foo>" are reallyru2005-10-171-17/+16
| | | | | | | | looked for in the system make file directory or in the specified -m paths instead of always looking in the other -I and .PATH specified paths. (Commit log shamelessly stolen from NetBSD.) Reviewed by: yar
* Add a .sinclude directive which does the exact same as .include, exceptphk2005-09-261-2/+17
| | | | whine when the file cannot be found and opened.
* Factor out all the .SHELL parsing related stuff into its own file andharti2005-05-241-1/+2
| | | | | | | 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)
* Get rid of global variables for argument vectors produced by brk_string()harti2005-05-181-6/+5
| | | | | | | | 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-7/+6
| | | | | | | in two places. While here don't bother returning anything from Lst_Replace - nobody ever checks the return code. Suggested by: jmallet
* Fix the fix for bin/72510 applied in job.c:1.70. Actually there haveharti2005-05-121-1/+1
| | | | | | | | | | 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
* Move some comments around to where they belong and remove some unneccessaryharti2005-05-121-9/+0
| | | | | | gcc magic. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.229)
* Move the remaining two prototypes from nonints.h to make.h andharti2005-05-101-1/+0
| | | | | | | remove nonints.h. Patch: 7.204 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesharti2005-05-091-7/+7
| | | | | | | | | | only one variable and Var_Subst() which substitutes all. Split out the test whether a variable should not be expanded into match_var(). Make access to the input string consistently using str[]. Remove two unused functions: Var_GetTail() and Var_GetHead(). Patches: 7.184-7.189 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Introduce a new pseudo-target .EXPORTVAR which allows to put aharti2005-05-061-1/+5
| | | | | | | | | | | | | | | | | | make macro into the environment of programs executed by make. This has approximately the same function as gmake's export directive. The form of a pseudo target was deliberately choosen to minimize work for POSIX compatibility (Makefiles are not allowed to use any targets starting with a dot and consisting only of uppercase letters except those specified in the standard when they want POSIX compatible behaviour, so such a Makefile can never contain .EXPORTVAR.) Change the handling of macros coming from the environment: instead of asking the environment for each variable we could not find otherwise put all the environment variables in a special variable environment just at start up. This has been tested on the ports cluster by kris. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Rename the directive_hash.[ch] files to hash_tables.[ch] nowharti2005-04-291-1/+1
| | | | | | | that there are more than one hash table in them. There is no history to preserve here, so go without a repo-copy. Asked for by: Max Okumoto <okumoto@ucsd.edu>
* Implement a pseudo-target .WARN that allows toggeling the warning flagsharti2005-04-291-0/+23
| | | | | for the current make. This does not override flags specified on the command line and these settings are not passed to sub-makes.
* Use a minimal perfect hash for the special sources/targets too. Addharti2005-04-281-43/+25
| | | | the corresponding magic to create the hash function to the Makefile.
* Move the hash function for directives into its own file and addharti2005-04-281-65/+3
| | | | | | | | | a Makefile target to re-created this file. Note, that there is no explicite dependency to automatically re-create the file, because this is needed only when the directive table changes and it requires the (yet to come) devel/mph port. Submitted by: Max Okumoto <okumoto@ucsd.edu> (first version)
* Parse_Init() is gone so remove comments that mention it.harti2005-04-111-11/+0
|
* Rework the directive parsing code. Instead of using a lot of strcmp()sharti2005-04-111-324/+387
| | | | | | | | | | | | on every line that starts with a dot use a minimal perfect hash function and a single strcmp() on the first word after the dot to find out whether it is really a directive call and, if yes, which one. Then directly dispatch to a handler function for that directive (or fall through to the dependency handling code). This makes the directive parse a little bit more strict about the syntax: the directive word must be followed by a character that is not alphanumerical and not an underline (making .undefFOO illegal); .endif and .else can only be followed by comments.
* Move the code for parsing .for and .if statements to the place where theharti2005-04-081-56/+42
| | | | other directives are handled.
* When Parse_Error is called after the top-level Makefile is closed weharti2005-04-071-3/+7
| | | | | | | have no CURFILE anymore so we cannot print a file name or line number. When ParseSkipLine() returns NULL (it does this when it has detected an EOF in an .if block) try to pop the input stack and process the next line
* Handle popping of the input stack in ParseReadLine() instead ofharti2005-04-071-341/+329
| | | | | | Parse_File(). Remove a comment and a piece of code comming from ancient times when the if-directive read like #if and not .if. Correctly analyze the first character of a line.
* Make the structure for handling the input stack local to the parseharti2005-03-301-143/+124
| | | | | | | | | | | module. The only module accessing it (the current line number) was the condition module, so pass the current line number as a function argument. Centralize the pushing of new input sources into one function ParsePushInput() and rename the function handling the popping from ParseEOF() to ParsePopInput(). Make the entire thing a little bit clearer, by holding the current input source in the top element of the stack instead of using extra variables for this. Use a type-safe intrusive list for the input stack.
* Style: de-lispify by removing extra parantheses in conditional expressions.harti2005-03-231-19/+18
|
* Style: make indentation 8 characters.harti2005-03-231-1600/+1679
|
* Make paths an explicite datatype instead of using the generic Lst.harti2005-03-231-17/+17
| | | | | | A Path is now a TAILQ of PathElements each of which just points to a reference counted directory. Rename all functions dealing with Paths from the Dir_ prefix to a Path_ prefix.
* Simplify buffer access by using Buf_Data() and Buf_Peel() whereharti2005-03-221-26/+11
| | | | | | | | appropriate. Patch: 7.147-7.151 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Get rid of another bunch of Lst_ForEach in favour of LST_FOREACH andharti2005-03-161-204/+109
| | | | simplify code accordingly.
* Yet another version of passing the last line to ParseFinishLine().harti2005-03-151-2/+2
| | | | | | | It turns out that some ports use the obscure feature of spreading a dependency block across multiple include files. While this seems bad style, allow it for now and call said function only at end of all input to process the really last line of everything.
* Call ParseFinishLine() also for the last line in a file. Thisharti2005-03-111-0/+3
| | | | | | | | | | | | | | patch differs from the previous one in that it calls the function only when a real file hits EOF. The bodies of .for loops are also handled as files, but for these we don't want to end a dependency block on the 'EOF' as in: foo: do-this .for ... do-something .endfor do-more
* Back out the last commit. It turns out that this breaks more thanharti2005-03-111-3/+0
| | | | it fixes. This should fix the buildworld breakage.
* Call ParseFinishLine() for the last line of a file too.harti2005-03-101-0/+3
|
* Reorganize Suff_EndTransform to be called only for nodes forharti2005-03-101-5/+9
| | | | which it is needed (transforms).
* Fix parsing of archive specifications on the target side ofharti2005-03-031-0/+1
| | | | | dependency lines. It seems that nobody is actually is using the archive-feature of make.
* Update the description comment of the function to reflect theharti2005-03-031-5/+2
| | | | previous change.
* Convert a function call to Lst_ForEach with a macro call to LST_FOREACH.harti2005-03-021-16/+17
|
* Make sure the length variable is initialized to 0 before passingharti2005-03-011-1/+1
| | | | | | | | it to Var_Parse(). Patch: 7.85 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Change the return value of Var_Subst to return a Buffer insteadharti2005-02-251-8/+39
| | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Introduce Buf_StripNewLines() and use it where appropriate.harti2005-02-071-4/+4
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Where the returned line length from Buf_GetAll is not used just passharti2005-02-041-4/+2
| | | | | | a NULL to the function. Delete the now unused local variables. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* None of the users of Buf_Discard used it to get rid of only a part ofharti2005-02-041-1/+1
| | | | | | | the buffer. So replace Buf_Discard by Buf_Clear which just gets rid of the entire contents. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* General whitespace cleanup: remove mixes of tabs and spaces, removeharti2005-02-041-8/+8
| | | | | | space after function names, remove spaces on emtpy lines. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Some more easy constification.harti2005-02-041-5/+6
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Convert several typedefs from beeing pointers to structs to be the structsharti2005-02-021-2/+2
| | | | | | | itself. This will ease constification (think of what 'const Ptr foo' means if Ptr is a pointer to a struct). Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Clean up include files and file including. Split nonints.h into piecesharti2005-02-011-6/+20
| | | | | | | | | | | | | that get included just where they are needed. All headers include the headers that they need to compile (just with an empty .c file). Sort includes alphabetically where apropriate and fix some duplicate commenting for struct Job, struct GNode and struct Shell by removing one version and inlining the comments into the structure declaration (the comments have been somewhat outdated). This patch does not contain functional changes (checked with md5). Submitted by: Max Okumoto <okumoto@ucsd.edu>
OpenPOWER on IntegriCloud