summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/parse.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix quoting of the MAKEFLAGS environment variable by only quoting spacesharti2005-01-261-1/+1
| | | | | | | | | | and tabs. This is still not correct for command line variable values ending in a backslash because this would require a larger effort. Document this limitation in the BUGS section of the man page. The quoting is mostly compatible with that of gmake and smake. Tested by: Max Okumoto and Joerg Sonnenberger from DragonFly BSD Reviewed by: ru (man page, partly)
* Remove all the cleanup functions. There is no reason to free memoryharti2004-12-171-13/+0
| | | | | just before exiting (especially given the number of memory leaks) - it just costs time.
* Instead of dynamically allocating list heads allocated them staticallyharti2004-12-161-116/+90
| | | | | | | | now that their size is only two pointers. This eliminates a lot of calls to Lst_Init and from there to malloc together with many calls to Lst_Destroy (in places where the list is obviously empty). This also reduces the chance to leave a list uninitilized so we can remove more NULL pointer checks and probably eliminates a couple of memory leaks.
* Remove a useless list where just all command lines are stuffed onto, neverharti2004-12-101-4/+0
| | | | | used and just freed at the end. The idea might have been to be able to free all the strings, but what's the point to free just before exiting?
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofharti2004-12-071-19/+19
| | | | | | the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files
* Make needs no circular lists so remove them from the list code.harti2004-12-071-12/+12
|
* Fix breakage introduced on 64-bit platforms with my last commit. Needharti2004-12-031-3/+4
| | | | to change to size_t in a couple of other places too.
* Style: remove a lot of unnecessary casts, add some and spell the nullharti2004-12-011-83/+82
| | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after
* Stylification: missing spaces, extra space after function names, castsharti2004-11-301-197/+211
| | | | | | | | and the sizeof operator, missing empty lines, void casts, extra empty lines. Checked by: diff on make *.o lst.lib/*.o Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly)
* Use typedefs for the types of the functions that are passed as argumentsharti2004-11-291-1/+1
| | | | | | to the list functions for better readability. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Eliminate the define for POSIX and build with Posix behaviour.harti2004-11-171-45/+12
| | | | | Our make has been build with POSIX enabled from the first day and the ifdef'ed out code served no purpose.
* Fix handling of comments on .elif lines. The patch given in a followupharti2004-07-221-0/+7
| | | | | | | | | | | | to the PR failed, because the line skipping function is actually called from two places in the code to do quite different things (this should be two functions probably): in a false .if to skip to the next line beginning with a dot and to collect .for loops. In the seconds case we should not skip comments, because they are actually harder to handle than we need for the .if case and should defer this to the main code. PR: bin/25627 Submitted by: Seth Kingsley (original patch)
* Improve make's diagnostic of mistmatched .if-.endif. This patch isharti2004-07-201-16/+2
| | | | | | | | | | slightly different from the patch in the PR. The problem is, that make handles .if clauses inside false .if clauses simply by counting them - it doesn't put them onto the conditional stack, nor even parses them so we need an extra line number stack for these ifs. PR: bin/61257 Submitted by: Mikhail Teterin <mi@aldan.algebra.com>
* New variable `.MAKEFILE_LIST', useful for tracing, debugging and dependency ↵eik2004-07-021-1/+10
| | | | | | | | | | | tracking. Use make -V .MAKEFILE_LIST | tr \ \\n | awk '$0==".." {l--; next} {l++; printf "%*s%s\n", l, " ", $0}' to print a tree of all included makefiles. Approved by: joerg MFC after: 1 week
* Added the new .warning directive.ru2004-04-121-3/+33
| | | | Submitted by: Cyrille Lefevre
* Reworked the fix to print the useful line number on error inru2004-03-101-85/+73
| | | | | | | | | | | the .for loop: - Replaced four global variables in parse.c with one. - Made Parse_FromString() accept the "lineno" as an argument. - Fixed line numbering when there are escaped newlines in the body of the .for loop. Adopted from: NetBSD
* Make it possible to ``.undef ${VAR}'' (expanding VAR to getru2004-03-091-0/+1
| | | | | | the variable name to undef). Submitted by: Cyrille Lefevre
* Fixed line numbering inside the .for loops.ru2004-03-091-1/+3
| | | | Submitted by: Cyrille Lefevre
* Finish the fix in revision 1.39 -- make(1)'s behavior is nowru2002-11-281-12/+9
| | | | | | "greedy" with respect to finding the dependency operators. Approved by: re
* De-obfuscate and correct the include path handling for SysV style includes.jmallett2002-10-231-35/+4
| | | | | | | PR: 32759 Submitted by: Mark Valentine Reviewed by: Matthew Emmerton" <matt@gsicomp.on.ca> MFC after: 15 days
* Convert make(1) to use ANSI style function declarations. Variablejmallett2002-10-091-67/+33
| | | | | | | | | | | documentation already adequatedly existed in the description in most cases. Where it did not, it was added. If no documentation existed beforehand, then none was added. Some unused dummies for use in the traversal functions were marked as __unused during the conversion. Occasionally, local style fixes were applied to lines already being modified or influenced. Now make(1) should always build with WARNS=3.
* Remove extern declarations from functions and source files where they wouldjmallett2002-10-091-2/+0
| | | | happily fit into headers.
* Remove 6-years-stale #if0, the behaviour isn't ever going to be limited tojmallett2002-10-021-5/+1
| | | | compatible mode, as far as I know, since we use it...
* Make make(1) WARNS=6 clean except for const issues. This mostly involvesjmallett2002-09-281-11/+11
| | | | | | | | | | | renaming variables to not shadow libc functions or greater scope locals. Kinda makes one wonder if the extern ones weren't meant in some of these places :) The only thing I'd still like to do WRT this is possibly combine rstat and status in compat.c -- that should be fine, as I do not think the codepaths will want both around at once. Sponsored by: Bright Path Solutions
* Add empty default cases where they should be, remove non-local execution stuffjmallett2002-09-281-1/+6
| | | | | | | | | | in compat.c which doesn't even have preprocessor-conditional-hidden support code, and add a debugging statement where we might end up with a nil list somehow, but where I doubt it. First confirmed userland kill for Flexelint. Sponsored by: Bright Path Solutions
* Remove a semicolon that appears to be a lie.jmallett2002-09-261-1/+1
| | | | | Spotted by: SPARC64 make WARNS=3 Sponsored by: Rachel Hestilow <rachel@jerkcity.com>
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichjmallett2002-09-181-1/+1
| | | | | is merely printf() but to stderr. This takes care of the caveat which lead to the use of a vararg macro -- getting everything to stderr.
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingjmallett2002-09-171-2/+1
| | | | | | | | | variable length arguments to a macro. Bump version as this makes DEBUG statements *always* go to stderr rather than sometimes stdout. There are a few stragglers, which I will take care of as soon as I can. Mostly these relate to the need-for-death-of some of the remote job code. Nearby stylistic nits and XXX added/fixed where appropriate.
* #define<space> -> #define<tab>jmallett2002-09-171-1/+1
|
* Allow embedded `:' and `!' in target names.ru2002-08-201-2/+31
| | | | | | PR: bin/6612 Obtained from: OpenBSD MFC after: 1 week
* Print a warning when we are given two scripts for one target. This is neitherjmallett2002-07-281-0/+4
| | | | | | | as wide-reaching nor intensive as NetBSD's similar, but the warning uses the same text. Inspired by: NetBSD
* Fix a bug fixed by NetBSD in revision 1.42 of parse.c by christos which causedjmallett2002-06-201-0/+8
| | | | | | | an example Makefile I was showing someone just last night to report a variable as being recursive. Obtained from: NetBSD
* More unsigned char casts to isupper(3).jmallett2002-06-201-2/+2
| | | | Obtained from: NetBSD
* Provide a heuristic for RCS conflicts.jmallett2002-06-201-2/+9
| | | | Obtained from: NetBSD
* Diff reduction for great justice against NetBSD, cast to unsigned char whenjmallett2002-06-201-13/+13
| | | | passing an argument to isspace(3).
* The error functions take constant pointers to strings for their format.jmallett2002-06-121-1/+1
|
* Update SCM ID method.obrien2002-04-131-3/+1
|
* De'register.obrien2002-04-131-11/+11
|
* o unifdef -D__STDC__imp2002-03-231-19/+1
| | | | | o remove badly bit-rotted compat file that likely won't work on the systems it purports to support.
* remove __Pimp2002-03-221-21/+21
|
* Revert previous change -- apparently it's not quite right. It brokewill2001-03-151-15/+9
| | | | | | | | | | src/sys/modules/if_ef and possibly other things. I tested the build with a make based on rev. 1.26, and it worked fine. Since I'm not particularly inclined to figure out what's going on with this, it's probably prudent just to back it out for now. Found by: jkh Suggested by: jhay
* Fix make(1) bug: nested comments may be placed in .if, .else .if, andwill2001-03-151-9/+15
| | | | | | | | | | | | | .endif statements but can't be placed in .elif. Basically, the problem was that ParseSkipLine() didn't handle comments the same way that ParseReadLine() did, and thus you had errors with comments that are on a conditional line (i.e. "^.") rather than a non-conditional line. MFC candidate for 4.3-STABLE and 3.5-STABLE. PR: 25627 Bug found by: jhs Fix submitted by: Seth Kingsley <sethk@osd.bsdi.com> (thanks!!)
* Preceed/preceeding are not english words. Use precede and preceding.asmodai2001-02-181-1/+1
|
* There's also no point in #typedef'ing void/char pointers. Accordingly,will2000-12-021-63/+63
| | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD
* There's no reason to use fancy forms of NULL. Replace all instanceswill2000-12-021-10/+10
| | | | | | of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD
* Use __RCSID()wsanchez2000-07-091-6/+4
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).hoek1999-08-171-12/+13
| | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself
* Don't allow pointer underrun in loop.jkh1999-01-081-2/+4
| | | | Spotted by: John W. DeBoskey <jwd@unx.sas.com>
* Add a graceful jumping off point with a new .error directive.steve1998-05-251-1/+35
| | | | | PR: 6720 Submitted by: Niall Smart <njs3@doc.ic.ac.uk>
OpenPOWER on IntegriCloud