History log of /freebsd-10.1-release/usr.bin/make/for.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 228992 30-Dec-2011 uqs

Spelling fixes for usr.bin/


# 200417 11-Dec-2009 delphij

Remove unnecessary includes.

Reviewed by: rodrigc


# 186558 29-Dec-2008 obrien

Consistently use Var_SetGlobal().


# 177545 24-Mar-2008 ru

Fix splitting into words of the .for expression to allow for
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


# 146048 10-May-2005 harti

Var_SubstOnly() is only used to subsitute a variable from the global
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>


# 146027 09-May-2005 harti

Split Var_Subst() into two functions: Var_SubstOnly() which substitutes
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>


# 144894 11-Apr-2005 harti

Rework the directive parsing code. Instead of using a lot of strcmp()s
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.


# 143959 22-Mar-2005 harti

Simplify buffer access by using Buf_Data() and Buf_Peel() where
appropriate.

Patch: 7.147-7.151

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 143288 08-Mar-2005 harti

Use the new Buf_Peel function to simplify things.
Remove an unused struct definition.


# 142457 25-Feb-2005 harti

Change the return value of Var_Subst to return a Buffer instead
of a char *.

Patch: 7.49

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 142299 23-Feb-2005 harti

Use the LST_FOREACH macro instead of the Lst_ForEach function
and so get rid of the ForExec helper function by inlining it
into For_Run.


# 142298 23-Feb-2005 harti

Style: fix indent, use tabs instead of space+tab for aligning things.
Add a couple of comments.


# 141648 10-Feb-2005 harti

Fix spacing by converting mixes of space and tab to tab. Also add a number
of empty lines in appropriate places.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141437 07-Feb-2005 harti

Invent a Buf_AppendRange function that appends a non-NUL-terminated string
given by a pointer to the start of the string and a pointer one behind
the end.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141436 07-Feb-2005 harti

Invent a Buf_Append function to append a NUL-terminated string
and use it thoughout the code.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141291 04-Feb-2005 harti

Where the returned line length from Buf_GetAll is not used just pass
a NULL to the function. Delete the now unused local variables.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141273 04-Feb-2005 harti

Inline the ADDWORD() macro in the two places where it is used. It just
obfuscates the code.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141133 02-Feb-2005 harti

Convert several typedefs from beeing pointers to structs to be the structs
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>


# 141104 01-Feb-2005 harti

Clean up include files and file including. Split nonints.h into pieces
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>


# 138916 16-Dec-2004 harti

Instead of dynamically allocating list heads allocated them statically
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.


# 138512 07-Dec-2004 harti

Typedefs of pointers to structs are evil. Make Lst and LstNode typedef of
the structs itself not of pointers to them. This will simplify constification.

Checked by: diff on the object files


# 138510 07-Dec-2004 harti

Make needs no circular lists so remove them from the list code.


# 138346 03-Dec-2004 harti

Fix breakage introduced on 64-bit platforms with my last commit. Need
to change to size_t in a couple of other places too.


# 138264 01-Dec-2004 harti

Style: remove a lot of unnecessary casts, add some and spell the null
pointer constant as NULL.

Checked by: diff -r on the object files before and after


# 138232 30-Nov-2004 harti

Stylification: missing spaces, extra space after function names, casts
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)


# 138192 29-Nov-2004 harti

Use typedefs for the types of the functions that are passed as arguments
to the list functions for better readability.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 126824 10-Mar-2004 ru

Reworked the fix to print the useful line number on error in
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


# 119876 08-Sep-2003 ru

Command line variables take precedence over global variables.
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.)


# 104696 09-Oct-2002 jmallett

Convert make(1) to use ANSI style function declarations. Variable
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.


# 103545 18-Sep-2002 jmallett

Make the DEBUGF() macro portable by (ugh) adding a Debug() function, which
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.


# 103508 17-Sep-2002 jmallett

Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), using
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.


# 103503 17-Sep-2002 jmallett

#define<space> -> #define<tab>


# 94589 13-Apr-2002 obrien

Fix copyrights, and undo SCS ID damage.


# 94587 13-Apr-2002 obrien

Update SCM ID method.


# 92921 21-Mar-2002 imp

remove __P


# 69531 02-Dec-2000 will

There's also no point in #typedef'ing void/char pointers. Accordingly,
rip out ClientData/Address pointers and use standard types.

Obtained from: OpenBSD


# 62833 09-Jul-2000 wsanchez

Use __RCSID()


# 51150 11-Sep-1999 hoek

Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49938 16-Aug-1999 hoek

Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).

Obtained from: OpenBSD, sometimes indirected from NetBSD; myself


# 23006 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 18804 08-Oct-1996 steve

O' to be bitten by CVS. Cleanup after import
of Christos' version of make(1) and add Id's.

Set straight by: Bruce Evans and Peter Wemm :)


# 18433 21-Sep-1996 steve

Fix for PR#1230, make ``.for'' loops iterate backwards.


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 5814 23-Jan-1995 jkh

Bring in a number of changes from NetBSD's make, fixing quite a few
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)


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources