summaryrefslogtreecommitdiff
path: root/usr.bin/make
AgeCommit message (Collapse)Author
2001-06-12Replace the most used static lists in make by persistent growable arrays.Marc Espie
5% speed increase on a make build. ok miod@
2001-06-07Better warning fix, in line with the rest of the codeMarc Espie
(__attribute((__unused__)) denotes parameters that MAY be unused in the code, e.g., it's mostly a `shut up warnings' device).
2001-06-05calloc stats in one-shot case.Marc Espie
2001-06-05Use Str_concat instead of fixed buffers and snprintf in building paths.Marc Espie
Replace MAXPATHLEN with PATH_MAX (synch with op-make). ok naddy@
2001-06-03Make sure targs get initialized.Marc Espie
Don't bother cleaning it up for speed
2001-05-31Simple guard against overflow. Better code to appear.Marc Espie
2001-05-30-Wall cleanup, mostly useless otherwiseTheo de Raadt
2001-05-29Protect against copying a too long PWD.Marc Espie
This is temporary, this code needs better fixes.
2001-05-29Take includes out of lst.h, re-add what's needed to separate files.Marc Espie
Removes remaining lint stuff from lst.lib.
2001-05-29SynchMarc Espie
2001-05-29Blech! gcc is a stupid program. Compiling with -fno-builtin shows lotsMarc Espie
of missing function declarations.
2001-05-27Fix DirExpandCurlyi. Noticed by ho@. Okay miod@.Marc Espie
2001-05-23Mostly clean-up:Marc Espie
- cut up those huge include files into separate interfaces for all modules. Put the interface documentation there, and not with the implementation. - light-weight includes for needed concrete types (lst_t.h, timestamp_t.h). - cut out some more logically separate parts: cmd_exec, varname, parsevar, timestamp. - put all error handling functions together, so that we will be able to clean them up. - more systematic naming: functioni to handle interval, function to handle string. - put the init/end code apart to minimize coupling. - kill weird types like ReturnStatus and Boolean. Use standard bool (with a fallback for non-iso systems) - better interface documentation for lots of subsystems. As a result, make compilation goes somewhat faster (5%, even considering the largish BSD copyrights to read). The corresponding preprocessed source goes down from 1,5M to 1M. A few minor code changes as well: Parse_DoVar is no longer destructive. Parse_IsVar functionality is folded into Parse_DoVar (as it knows what an assignment is), a few more interval handling functions. Avoid calling XXX_End when they do nothing, just #define XXX_End to nothing. Parse_DoVar is slightly more general: it will handle compound assignments as long as they make sense, e.g., VAR +!= cmd will work. As a side effect, VAR++=value now triggers an error (two + in assignment). - this stuff doesn't occur in portable Makefiles. - writing VAR++ = value or VAR+ +=value disambiguates it. - this is a good thing, it uncovered a bug in bsd.port.mk. Tested by naddy@. Okayed millert@. I'll handle the fallback if there is any. This went through a full make build anyways, including isakmpd (without mickey's custom binutils, as he didn't see fit to share it with me).
2001-05-15Don't go beyond end of string.Marc Espie
Handles unterminated variables, and fixes regression test #10
2001-05-15thinko in my rewrite. Repair var:sh = somethingMarc Espie
Looks like nobody is using this anyways.
2001-05-14Ensure IFile str is always intialized, so that we can free it withoutMarc Espie
problems. Bug found by wilfried@.
2001-05-07some complex situations need those functions to be reentrant, hence noMarc Espie
static VarPatterns... Old make could use dynamic variables because everything was jumbled into one single function.
2001-05-07avoid closing the same file twice. parse module assumes ownership ofMarc Espie
file handles it's passed to. (this is apparently harmless on BSDs, but is still a bug).
2001-05-07Even though str_concati is supposed to handle intervals, it was stillMarc Espie
assuming '\0' at the end. -> importance of proper make bug reports, this was first diagnosed as a for loop issue...
2001-05-05Document for loop mechanics for several variables.Marc Espie
Idea taken from NetBSD. implementation completely different, as our loop implementation diverged a while back.
2001-05-03Bump bootstrap stuff from op-make. Mostly from fries@Marc Espie
2001-05-03Minor manpage tweaksMarc Espie
2001-05-03Synch with my current work.Marc Espie
Numerous changes: - generate can build several tables - style cleanup - statistics code - use variable names throughout (struct Name) - recursive variables everywhere - faster parser (pass buffer along instead of allocating multiple copies) - correct parser. Handles comments everywhere, and ; correctly - more string intervals - simplified dir.c, less recursion. - extended for loops - sinclude() - finished removing extra junk from Lst_* - handles ${@D} and friends in a simpler way - cleaned up and modular VarModifiers handling. - recognizes some gnu Makefile usages and errors out about them. Additionally, some extra functionality is defined by FEATURES. The set of functionalities is currently hardcoded to OpenBSD defaults, but this may include support for some NetBSD extensions, like ODE modifiers. Backed by miod@ and millert@, who finally got sick of my endless patches...
2001-05-03old fileMarc Espie
2001-03-29Pretty.Aaron Campbell
2001-03-02Use the ohash_* that's now in libc.Marc Espie
2001-02-17Guard against Var_Value() being applied to an empty string, which itMarc Espie
doesn't do [for efficiency reason, hash_interval does not deal with empty strings not declared as intervals. More recent incarnations of this code will use Var_Value_interval extensively instead] Problem found by Peter Stromberg.
2001-01-29$OpenBSD$Niklas Hallqvist
2001-01-28Missing copyrightMarc Espie
2000-12-27Show CURDIR in that failure case too. Can't show a Makefile name yetMarc Espie
though... Ok'ed miod@.
2000-12-07Forgot to copy end of name in nested variable names, so thatMarc Espie
${BC_${A}} worked but not ${${A}_BC}. Noticed by fries@
2000-12-06we actually have useful code for '.for' loops, its not a no-op. ok espie@Todd T. Fries
2000-11-27This patch fixes ArchFindMember so that it handles SVR4 membersMarc Espie
similarly to read_archive. Note we no longer bother seeking back to the start of the header, as only ArchTouch accesses that header, and can do the seek itself. With this, arch handling should be working, more or less. thanks to Todd, Miod, Naddy for reviewing those patches.
2000-11-27This does fix some nasty issues: ar field members are NOT null-terminated.Marc Espie
Hence, read_archive must be very careful to parse stuff correctly: don't use str* when mem* are appropriate, copy numeric fields and ensure they're terminated...
2000-11-27We take of the SVR4 archive handling data structure from our archive,Marc Espie
and put it into a specific structure (it is wasteful to keep lugging SVR4 structures once an archive is parsed). By tweaking read_archive slightly, we can achieve a nicer interface to ArchSVR4Entry. Note a bug in make: ArchFindMember does (currently) not use the SVR4 code, hence some archive members won't be found in non-caching mode...
2000-11-27Factorise duplicated code involved in touching archives.Marc Espie
2000-11-24As it stands now, arch.c does not work.Marc Espie
Its main failing is that ar headers are NOT null terminated. This code is atrocious. This change starts cleaning that up. Replace the list of cached archives with a hash, streamline the logic of ArchMTimeMember, by taking out the actual function that does the reading (read_archive). More fixes to come.
2000-11-24Change the time stamp interface to use an abstract datatype.Marc Espie
Define two possible interfaces: the classic one, and the new one (used where available) that depends on timespec. Better granularity, make is now able to distinguish between files that were built during the same second.
2000-11-24Take advantage of VarModifiers_Apply, which can parse a variable specMarc Espie
and expand it directly, without needing a variable context. Use it in Var_SubstVar, so that .for loops values don't need to be entered into any context nor looked up. This speeds up .for loops some, and avoids nasty variable capture side-effects. Ok'd millert@, miod@, naddy@ (naddy spotted a problem with the first version of that change).
2000-11-24Clean-ups:Marc Espie
* Buf_Destroy can be a macro * X_ instead of _X for struct names, to avoid infringing on the system's namespace. * better wildcard detection heuristics * fix #ifdef CLEANUP code * a few comments
2000-11-22Don't use light-weight Lst_ForEach when the list is going away from underMarc Espie
us. Need to cache the `next' pointer instead. Do this manually, as adding a new function for one place in make where it's needed is a bit icky, especially since suff.c's code might get cleaned up at some point. Bug reported by Niels.
2000-11-10- Section shuffling: comply to the section ordering outlined in mdoc(7).Aaron Campbell
- Some .Nm trimming. - .Sh AUTHOR -> .Sh AUTHORS - Other miscellaneous fixes here and there.
2000-10-13Fix Arch_MemMTime (previous change I did was bogus)Marc Espie
2000-10-13esetenv: does a setenv and bails out if error.Marc Espie
2000-09-14This kills the last old hashing table, in arch.cMarc Espie
Slight optimizations: instead of storing archive members, just keep the modification time, as we don't care for the rest of the archive information. Lazily compute mtime, stash ascii date instead, and convert to mtime when needed (storing an out_of_date value to mark the unconverted values). Archive handling is atrocious and need some clean-up. Thanks to miod@ who took the time to review those patches.
2000-09-14Introduce a few macros to handle timestamps in an abstract way.Marc Espie
Replace the time stamp hash in dir.c with an open hashing structure. In doing so, remove some nasty casts, simplify code a bit: Dir_MTime can return a modification time, since make does not make a distinction between out-of-date and non-existent files.
2000-09-14Replace the old hash used to hold file names within a directory withMarc Espie
open hashing. An interesting optimization is that the open hashing interface is more fine-grained, hence we can compute the correct hash value at the start of Dir_FindFile, and reuse it for each hash structure into which we look (the effect is measurable on large directories along with objdir/VPATH). Remove a few unnecessary Lst_Open/Lst_Close that serve no purpose except obfuscating the code. The interface to dir.h changes slightly, hence tedious includes changes...
2000-09-14- new DirReadDir internal function, that just reads a directory fromMarc Espie
the disk or from a cache. - use it in Dir_AddDir, and directly to set up dot. - change Dir_AddDir to use string intervals, as this simplifies dependend functions. - set up an open-hashing cache for opened directory names. - add_dirpath() function in main, to simplify code. - simplify cleaning-up directories, as Dir_ClearPath is overkill.
2000-09-14Use the new hash scheme to store the target nodes.Marc Espie
Scrap the list of all targets: it only slows make down. The only visible difference is that the list of all targets is not shown in order when debugging.
2000-09-14Clean-up, systematic use of UNUSED, white space...Marc Espie