summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/parse.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Lst_DeQueue already checks for empty lists.espie1999-12-181-14/+9
|
* NIL, NILGNODE, etc, are only glorified NULL.espie1999-12-181-13/+13
| | | | | | Get rid of them. Get rid of list.h, nothing uses it anyway.
* make does not use circular lists, get rid of the extra weight.espie1999-12-181-14/+14
|
* Var_Subst is actually two distinct functions folded into one:espie1999-12-161-7/+7
| | | | | | | | split the function specific to for.c out, and give them more sensible arguments at the same time. This makes .for loop handling more efficient, as we have some heuristic to evaluate the size of the buffer needed...
* for.c becomes sane.espie1999-12-161-14/+16
| | | | | | | | | | - split For_Eval into For_Eval (first line of loop) / For_Accumulate (remaining lines). - encapsulate state into a For structure, instead of brain damaged static variables that need copy. Very minor performance hit, specifically, For structure is allocated with malloc/free, instead of playing tricks with static/auto variables.
* Allocate buffers as static data structures.espie1999-12-161-17/+15
| | | | | This cuts down quite a lot of malloc, since in actual use, buffer usage is mostly static.
* Remove unneeded extraneous zeros at the end of buffers.espie1999-12-161-6/+3
| | | | Actually, one of these needs to be there, because of two bugs in cond.c
* Split Buf_GetAll into Buf_Retrieve/Buf_Size.espie1999-12-161-4/+4
| | | | (idiotic to retrieve size every time when it's used half the time)
* Start cleaning up buf.c in earnest.espie1999-12-161-5/+4
| | | | | | | | | | | - Buf_Discard is only used to remove all the bytes in a buffer, replace with Buf_Reset, - buffer values are not read unless accessed first through Buf_GetAll, no need to null-terminate it at every point. - Buf_Expand need not check if the expansion is needed. That's Buf_AddChar and Buf_AddChars responsability (otherwise, Buf_AddChar checks twice) - Buf_Overflow only handles overflow. Adding the character is done in every case anyway.
* Clean up buffers interface somewhat:espie1999-12-061-13/+13
| | | | | | | | | - buf.c deals exclusively with chars. Be explicit about it, and remove extraneous dumb casts to char (can hide real type errors). - buffer sizes are size_t. Note that bp->left can never become NULL. - Buf_GetAll is happy with a NULL pointer for the size, remove unneeded extra pointers. - Propagate size_t to all places where buffer functions are used.
* Communicate line numbers between parse.c and for.c.espie1999-11-111-9/+17
| | | | | | Parse_String starts in the current line, but at a given line number. .for loops yield correct line numbers, much easier to debug !
* Lineno as unsigned long. Slightly easier for printf, and more sensible.espie1999-11-111-13/+13
|
* Make ParseSkipLine more regular:espie1999-11-101-7/+13
| | | | | | | | | | | | | | perform the exit tests before checking for EOF. This makes behavior while scanning tests more regular. e.g, .if defined(UVM) && ${UVM} == "yes" ... .endif without a final newline at the endif should always work, instead of being an error half the time...
* Mark ParseReadC as inline (from NetBSD)espie1999-10-051-4/+4
|
* Efficiency patch from NetBSD:espie1999-10-051-2/+10
| | | | | | | make spends time freeing data structures right before exiting. So don't bother. Keep the code inside #ifdef, so that it's still there if someone ever wants to use make code inside a library.
* Better comment explaining last change:millert1999-05-041-5/+14
| | | | | | | | | | We don't want to end a word on ':' or '!' if there is a better match later on in the string. By "better" I mean one that is followed by whitespace. This allows the user to have targets like: fie::fi:fo: fum where "fie::fi:fo" is the target. In real life this is used for perl5 library man pages where "::" separates an object from its class. Ie: "File::Spec::Unix". This behaviour is also consistent with other versions of make.
* Allow embedded ":" or "!" in target namesmillert1999-05-041-5/+19
|
* Modifications from netbsd:espie1998-12-051-13/+83
| | | | | | | | | | | | | | | | | | - don't interfere with MACHINE/MACHINE_ARCH defines for bootstrap - type clean-up, time_t, and printing `unknown' ints - fix TARGET/MEMBER bug in archive rules - memmove... - cleaner Error handler. - reentrant brk_string - .MAKE env variable - preliminary scaffolding for .NOPATH Other improvements: - efree - shellneed streamlined - display Stop in .CURDIR after an error. - document most features and misfeatures. - add a few OpenBSD notes to the tutorial.
* Fix a bug where make gets confused by targets beginning with a period (``.'')millert1998-07-021-3/+4
| | | | | | and tried to do a suffix conversion, following a NULL pointer in the proccess. Also add some sanity checks so we don't blindly assume strchr returns non-NULL.
* #if __STDC__ --> #ifdef __STDC__mickey1997-07-251-5/+5
|
* Back out newer .USE code as it caused problems. I've done a "make build"millert1997-04-281-8/+8
| | | | without problems and the problem Theo saw before is gone.
* Sync with NetBSD (mostly by christos initial substitution/regexp from Der Mouse)millert1997-04-011-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fix the variable substitution code in make [PR/2748] 1. change s/a/b/ so that it substitutes the first occurance of the pattern on each word, not only the first word. 2. add flag '1' to the variable substitution so that the substitutions get performed only once. ***THIS IS AN INCOMPATIBLE CHANGE!*** Unfortunately there was no way to make things consistent without modifying the current behavior. Fortunately none of our Makefiles depended on this. OLD: VAR = aa1 aa2 aa3 aa4 S/a/b/ = ba1 aa2 aa3 aa4 S/a/b/g = bb1 bb2 bb3 bb4 NEW: VAR = aa1 aa2 aa3 aa4 S/a/b/ = ba1 ba2 ba3 ba4 S/a/b/1 = ba1 aa2 aa3 aa4 S/a/b/g = bb1 bb2 bb3 bb4 S/a/b/1g = bb1 aa2 aa3 aa4 - add regexp variable substitution via 'C/foo/bar/' [PR/2752] - add variable quoting via the ${VAR:Q} modifier. This is useful when running recursive invocations of make(1): make VAR=${VAR:Q} will always work... (This may prove useful in the kernel builds...) [PR/2981] - BSD did not traditionally have <sys/cdefs.h>; use BSD4_4 instead and include <sys/param.h> to grab it. - Don't compile the regex code if MAKE_BOOTSTRAP (from gwr) - Use explicit .c.o rule in Makefile.boot so that the bootstrap process works. - Use only integral types in procedure arguments. [buf.c buf.h] - Include <stdlib.h> to get getenv() prototype on SVR4 - if __STDC__ -> ifdef __STDC__ to appease SVR4 - Define const and volatile for non __STDC__ - Implement snprintf() and vsnprintf() for non BSD4_4 systems. - Make $MACHINE_ARCH settable from the environment. - Fix .USE directive problems: (reported by cgd) 1. ${.*} variables did not get expanded in dependencies. 2. expanded ${.*} variables in .USE dependencies can cause tree restructuring; handle it. 3. in compat mode, expand .USE before evaluating the list of targets, instead of doing .USE expansions on demand, because they can cause tree restructuring. - Add a .MADE directive to indicated that the children of a target are up-to-date, even when they are not. This is to simulate our current make install behavior with proper dependencies. - Fix problems in the RE substitution error handling. - Locate all the children of a node marked as MADE. - Do not compile-in ${MACHINE} (as per NetBSD PR#3386) - Disable globbing for targets/dependencies when POSIX is defined. - Fix globbing so that patterns that don't have a matching number of [] or {} don't get expanded. (before the [ case got expanded to nothing!) This is disabled. - Make sure that the children of nodes that are marked .MADE, are marked UPTODATE and their timestamps are consistent. - Don't disable wildcards completely; they are used by other Makefiles.
* s/main/listmain/; seebs@solon.comderaadt1997-03-261-8/+8
|
* Sync with NetBSD:millert1996-11-301-121/+102
| | | | | | | - Merge in FreeBSD and Lite2 changes. - Fix bug where a non-archive target with a .a suffix would always be considered to be out of date, since it does not have a TOC. - Fix NetBSD PR #2930: declare missing variable.
* From NetBSD (christos):briggs1996-09-211-8/+15
| | | | | | - Fix bug where the first line after a conditionally skipped was not ready in its entirety if it contained a continuation. - Print the whole error line, not just the first 20 characters of it.
* Sync up with NetBSD:briggs1996-09-021-148/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (christos) Fix bug reported by Greg Hudson where leaf (source only) nodes were referenced only by their basename and not by their full pathname. This breaks when .PATH or MAKEOBJDIR are used. There might be Makefiles around that try to work around this bug by prepending ${.CURDIR} to the sources, and they should be found and fixed. Also a lot of the gunk in suff.c that was attempting to work around the same problem could be removed. (christos) - Move -D flags from Makefile to config.h and explain what they do. Add -Wall -Wno-unused to CFLAGS. Add new define SYSVVARSUB to enable SysV style variable substitutions and enable them. - Add SunOS style command substitutions via SUNSHCMD - Fix core dump with '{variable = value' (christos) Fix bug where make will always exit with 0, even when one or more parallel jobs failed. (Only affects parallel make code) (christos) Protect __P from being multiply defined (for systems that already define it) (christos) Add strdup() since ultrix is missing it. From Larry Schwimmer <rosebud@cyclone.Stanford.EDU> (christos) Add estrdup(), a checked version of strdup and use it. (christos) Recognize SVR4 style long filename entries in archives. (thorpej) Tidy up some RCS ids a bit.
* nicer error message; netbsd pr#2651; enami@ba2.so-net.or.jpderaadt1996-07-231-2/+2
|
* From NetBSD: merge of 960317niklas1996-03-271-2/+6
|
* Make sure SYSV-style include directives are only matched when there is atholo1996-03-021-0/+1
| | | | whitespace character after the word "include"
* Implement an -m option used for replacing /usr/share/mk with aniklas1996-02-231-19/+0
| | | | custom search path, like $DESTDIR/usr/share/mk
* From NetBSD:niklas1996-02-221-5/+9
| | | | | | | | Support SVR4 style archives. Fix pr/1421 (from Matthew Green) and pr/1997 (from Jeff Thieleke). In ParseDoInclude(), make a temporary copy of the current file name while searching for ""-type include files, since the current file name might not be a writeable string.
* from christos:deraadt1995-12-171-16/+89
| | | | | - Added .WAIT to synchronize between sources like other pmake variants. - Updated documentation to include .ORDER .PARALLEL .NO_PARALLEL .NONPARALLEL
* from christos@netbsd:deraadt1995-12-141-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor: - ${.PREFIX} should never contain a full pathname - Fixed gcc -Wall warnings Major: - compatMake is now FALSE. This means that we are now running in full pmake mode: * rules on dependency lines can be executed in parallel and or out of sequence: foo: bar baz can fire the rule for baz before the rule for bar is fired. To enforce bar to be fired before baz, another rule needs to be added. [bar: baz] * adjacent shell commands in a target are now executed by a single invocation of the shell, not one invocation of the shell per line (compatMake can be turned off using the -B flag) - The -j flag now works... I.e. make -j 4 will fork up to four jobs in parallel when it can. The target name is printed before each burst of output caused by the target execution as '--- target ---', when j > 1 - I have changed all the Makefiles so that they work with make -j N, and I have tested the whole netbsd by: 'make -j 4 cleandir; make -j 4 depend; make -j 4; make -j 4 install' - I have not compiled or tested this version of make with -DREMOTE. - Turn compat mode on by default. It gets turned off when the -j without the -B flag is specified. [Thus you can use -j 1 to turn it off]. - Fix malloc -> emalloc as Gordon noted. Updates for POSIX/SVR4 compiling: arch.c: Don't require ranlib stuff. Not everybody has it. dir.c: SunOS-4 != Solaris; change #ifdef sun to #if sun && !__svr4__ job.c, compat.c: Don't use 'union wait', use int and the W*() macros. main.c: Check for uname() == -1; some unames return > 0... util.c, job.c: Add signal() with BSD semantics for svr4, don't use bsd sigmask and friends. from cgd@netbsd: pull in make.h. (PAlloc() now uses emalloc(), which is prototyped in make.h. If the prototype is not in scope on the Alpha, I see lots of "cast to pointer from integer of different size" warnings.)
* initial import of NetBSD treederaadt1995-10-181-0/+2635