summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/for.c
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixes for usr.bin/uqs2011-12-301-1/+1
|
* Remove unnecessary includes.delphij2009-12-111-2/+0
| | | | Reviewed by: rodrigc
* Consistently use Var_SetGlobal().obrien2008-12-291-1/+1
|
* Fix splitting into words of the .for expression to allow forru2008-03-241-22/+8
| | | | | | | | | | | spaces in values. Without this change, the following valid call broke due to parsing of .MAKEFLAGS in bsd.symver.mk: cd /usr/src/lib/libc && make -n DEBUG_FLAGS="-DFOO -DBAR" Spotted by: Igor Sysoev Submitted by: Maxim Dounin, ru MFC after: 1 week
* Var_SubstOnly() is only used to subsitute a variable from the globalharti2005-05-101-2/+1
| | | | | | | | context (and only in one place to substitute the .for variable). Therefor there is no need to pass the context as a parameter. Patch: 7.197 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesharti2005-05-091-2/+2
| | | | | | | | | | 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>
* Rework the directive parsing code. Instead of using a lot of strcmp()sharti2005-04-111-109/+107
| | | | | | | | | | | | 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.
* Simplify buffer access by using Buf_Data() and Buf_Peel() whereharti2005-03-221-1/+1
| | | | | | | | appropriate. Patch: 7.147-7.151 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Use the new Buf_Peel function to simplify things.harti2005-03-081-30/+9
| | | | Remove an unused struct definition.
* Change the return value of Var_Subst to return a Buffer insteadharti2005-02-251-4/+12
| | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Use the LST_FOREACH macro instead of the Lst_ForEach functionharti2005-02-231-40/+25
| | | | | and so get rid of the ForExec helper function by inlining it into For_Run.
* Style: fix indent, use tabs instead of space+tab for aligning things.harti2005-02-231-147/+159
| | | | Add a couple of comments.
* Fix spacing by converting mixes of space and tab to tab. Also add a numberharti2005-02-101-2/+2
| | | | | | of empty lines in appropriate places. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Invent a Buf_AppendRange function that appends a non-NUL-terminated stringharti2005-02-071-3/+3
| | | | | | | given by a pointer to the start of the string and a pointer one behind the end. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Invent a Buf_Append function to append a NUL-terminated stringharti2005-02-071-1/+1
| | | | | | and use it thoughout the code. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Where the returned line length from Buf_GetAll is not used just passharti2005-02-041-2/+1
| | | | | | a NULL to the function. Delete the now unused local variables. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Inline the ADDWORD() macro in the two places where it is used. It justharti2005-02-041-10/+11
| | | | | | obfuscates the code. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Convert several typedefs from beeing pointers to structs to be the structsharti2005-02-021-3/+3
| | | | | | | 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-11/+15
| | | | | | | | | | | | | 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>
* Instead of dynamically allocating list heads allocated them staticallyharti2004-12-161-9/+12
| | | | | | | | 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.
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofharti2004-12-071-2/+2
| | | | | | 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-1/+1
|
* Fix breakage introduced on 64-bit platforms with my last commit. Needharti2004-12-031-2/+2
| | | | 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-4/+5
| | | | | | 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-38/+34
| | | | | | | | 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>
* Reworked the fix to print the useful line number on error inru2004-03-101-2/+4
| | | | | | | | | | | 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
* Command line variables take precedence over global variables.ru2003-09-081-1/+1
| | | | | | | | | | | | | | Make this true in the .for loops too. The following fragment, FOO= foo bar all: .for f in ${FOO} @echo ${f} .endfor when run as "make FOO=xxx" should print "xxx". (OpenBSD had this bug fixed for some time.)
* Convert make(1) to use ANSI style function declarations. Variablejmallett2002-10-091-6/+3
| | | | | | | | | | | 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.
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichjmallett2002-09-181-4/+4
| | | | | 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-8/+4
| | | | | | | | | 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
|
* Fix copyrights, and undo SCS ID damage.obrien2002-04-131-2/+5
|
* Update SCM ID method.obrien2002-04-131-3/+1
|
* remove __Pimp2002-03-221-2/+2
|
* There's also no point in #typedef'ing void/char pointers. Accordingly,will2000-12-021-8/+8
| | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD
* Use __RCSID()wsanchez2000-07-091-6/+4
|
* Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)hoek1999-09-111-3/+1
|
* $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-1/+6
| | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* O' to be bitten by CVS. Cleanup after importsteve1996-10-081-0/+2
| | | | | | of Christos' version of make(1) and add Id's. Set straight by: Bruce Evans and Peter Wemm :)
* Fix for PR#1230, make ``.for'' loops iterate backwards.steve1996-09-211-1/+1
|
* Remove trailing whitespace.rgrimes1995-05-301-8/+8
|
* Bring in a number of changes from NetBSD's make, fixing quite a fewjkh1995-01-231-26/+29
| | | | | | | | | | | | problems in the process: 1. Quoting should work properly now. In particular, Chet's reported bash make problem has gone away. 2. A lot of memory that just wasn't being free'd after use is now freed. This should cause make to take up a LOT less memory when dealing with archive targets. 3. Give proper credit to Adam de Boor in a number of files. Obtained from: NetBSD (and Adam de Boor)
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+296
OpenPOWER on IntegriCloud