summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-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> Notes: svn path=/head/; revision=141104
* Fix quoting of the MAKEFLAGS environment variable by only quoting spacesHartmut Brandt2005-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) Notes: svn path=/head/; revision=140870
* Remove all the cleanup functions. There is no reason to free memoryHartmut Brandt2004-12-171-13/+0
| | | | | | | | just before exiting (especially given the number of memory leaks) - it just costs time. Notes: svn path=/head/; revision=138972
* Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt2004-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. Notes: svn path=/head/; revision=138916
* Remove a useless list where just all command lines are stuffed onto, neverHartmut Brandt2004-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? Notes: svn path=/head/; revision=138654
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofHartmut Brandt2004-12-071-19/+19
| | | | | | | | | the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files Notes: svn path=/head/; revision=138512
* Make needs no circular lists so remove them from the list code.Hartmut Brandt2004-12-071-12/+12
| | | | Notes: svn path=/head/; revision=138510
* Fix breakage introduced on 64-bit platforms with my last commit. NeedHartmut Brandt2004-12-031-3/+4
| | | | | | | to change to size_t in a couple of other places too. Notes: svn path=/head/; revision=138346
* Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt2004-12-011-83/+82
| | | | | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after Notes: svn path=/head/; revision=138264
* Stylification: missing spaces, extra space after function names, castsHartmut Brandt2004-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) Notes: svn path=/head/; revision=138232
* Use typedefs for the types of the functions that are passed as argumentsHartmut Brandt2004-11-291-1/+1
| | | | | | | | | to the list functions for better readability. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=138192
* Eliminate the define for POSIX and build with Posix behaviour.Hartmut Brandt2004-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. Notes: svn path=/head/; revision=137810
* Fix handling of comments on .elif lines. The patch given in a followupHartmut Brandt2004-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) Notes: svn path=/head/; revision=132540
* Improve make's diagnostic of mistmatched .if-.endif. This patch isHartmut Brandt2004-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> Notes: svn path=/head/; revision=132439
* New variable `.MAKEFILE_LIST', useful for tracing, debugging and dependency ↵Oliver Eikemeier2004-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 Notes: svn path=/head/; revision=131456
* Added the new .warning directive.Ruslan Ermilov2004-04-121-3/+33
| | | | | | | Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=128160
* Reworked the fix to print the useful line number on error inRuslan Ermilov2004-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 Notes: svn path=/head/; revision=126824
* Make it possible to ``.undef ${VAR}'' (expanding VAR to getRuslan Ermilov2004-03-091-0/+1
| | | | | | | | | the variable name to undef). Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=126779
* Fixed line numbering inside the .for loops.Ruslan Ermilov2004-03-091-1/+3
| | | | | | | Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=126768
* Finish the fix in revision 1.39 -- make(1)'s behavior is nowRuslan Ermilov2002-11-281-12/+9
| | | | | | | | | "greedy" with respect to finding the dependency operators. Approved by: re Notes: svn path=/head/; revision=107373
* De-obfuscate and correct the include path handling for SysV style includes.Juli Mallett2002-10-231-35/+4
| | | | | | | | | | PR: 32759 Submitted by: Mark Valentine Reviewed by: Matthew Emmerton" <matt@gsicomp.on.ca> MFC after: 15 days Notes: svn path=/head/; revision=105754
* Convert make(1) to use ANSI style function declarations. VariableJuli Mallett2002-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. Notes: svn path=/head/; revision=104696
* Remove extern declarations from functions and source files where they wouldJuli Mallett2002-10-091-2/+0
| | | | | | | happily fit into headers. Notes: svn path=/head/; revision=104693
* Remove 6-years-stale #if0, the behaviour isn't ever going to be limited toJuli Mallett2002-10-021-5/+1
| | | | | | | compatible mode, as far as I know, since we use it... Notes: svn path=/head/; revision=104374
* Make make(1) WARNS=6 clean except for const issues. This mostly involvesJuli Mallett2002-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 Notes: svn path=/head/; revision=104121
* Add empty default cases where they should be, remove non-local execution stuffJuli Mallett2002-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 Notes: svn path=/head/; revision=104108
* Remove a semicolon that appears to be a lie.Juli Mallett2002-09-261-1/+1
| | | | | | | | Spotted by: SPARC64 make WARNS=3 Sponsored by: Rachel Hestilow <rachel@jerkcity.com> Notes: svn path=/head/; revision=103991
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett2002-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. Notes: svn path=/head/; revision=103545
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingJuli Mallett2002-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. Notes: svn path=/head/; revision=103508
* #define<space> -> #define<tab>Juli Mallett2002-09-171-1/+1
| | | | Notes: svn path=/head/; revision=103503
* Allow embedded `:' and `!' in target names.Ruslan Ermilov2002-08-201-2/+31
| | | | | | | | | PR: bin/6612 Obtained from: OpenBSD MFC after: 1 week Notes: svn path=/head/; revision=102178
* Print a warning when we are given two scripts for one target. This is neitherJuli Mallett2002-07-281-0/+4
| | | | | | | | | | as wide-reaching nor intensive as NetBSD's similar, but the warning uses the same text. Inspired by: NetBSD Notes: svn path=/head/; revision=100792
* Fix a bug fixed by NetBSD in revision 1.42 of parse.c by christos which causedJuli Mallett2002-06-201-0/+8
| | | | | | | | | | an example Makefile I was showing someone just last night to report a variable as being recursive. Obtained from: NetBSD Notes: svn path=/head/; revision=98509
* More unsigned char casts to isupper(3).Juli Mallett2002-06-201-2/+2
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=98508
* Provide a heuristic for RCS conflicts.Juli Mallett2002-06-201-2/+9
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=98506
* Diff reduction for great justice against NetBSD, cast to unsigned char whenJuli Mallett2002-06-201-13/+13
| | | | | | | passing an argument to isspace(3). Notes: svn path=/head/; revision=98500
* The error functions take constant pointers to strings for their format.Juli Mallett2002-06-121-1/+1
| | | | Notes: svn path=/head/; revision=98136
* Update SCM ID method.David E. O'Brien2002-04-131-3/+1
| | | | Notes: svn path=/head/; revision=94587
* De'register.David E. O'Brien2002-04-131-11/+11
| | | | Notes: svn path=/head/; revision=94584
* o unifdef -D__STDC__Warner Losh2002-03-231-19/+1
| | | | | | | | o remove badly bit-rotted compat file that likely won't work on the systems it purports to support. Notes: svn path=/head/; revision=93056
* remove __PWarner Losh2002-03-221-21/+21
| | | | Notes: svn path=/head/; revision=92921
* Revert previous change -- apparently it's not quite right. It brokeWill Andrews2001-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 Notes: svn path=/head/; revision=74293
* Fix make(1) bug: nested comments may be placed in .if, .else .if, andWill Andrews2001-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!!) Notes: svn path=/head/; revision=74272
* Preceed/preceeding are not english words. Use precede and preceding.Jeroen Ruigrok van der Werven2001-02-181-1/+1
| | | | Notes: svn path=/head/; revision=72645
* There's also no point in #typedef'ing void/char pointers. Accordingly,Will Andrews2000-12-021-63/+63
| | | | | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD Notes: svn path=/head/; revision=69531
* There's no reason to use fancy forms of NULL. Replace all instancesWill Andrews2000-12-021-10/+10
| | | | | | | | | of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD Notes: svn path=/head/; revision=69527
* Use __RCSID()Wilfredo Sanchez2000-07-091-6/+4
| | | | Notes: svn path=/head/; revision=62833
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).Tim Vanderhoek1999-08-171-12/+13
| | | | | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself Notes: svn path=/head/; revision=49938
* Don't allow pointer underrun in loop.Jordan K. Hubbard1999-01-081-2/+4
| | | | | | | Spotted by: John W. DeBoskey <jwd@unx.sas.com> Notes: svn path=/head/; revision=42409