summaryrefslogtreecommitdiff
path: root/usr.bin/make
AgeCommit message (Collapse)Author
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
2000-09-14Two new functions:Marc Espie
iterate_words: light-weight equivalent to brk_string, which does not need to copy the string, and does not do \ interpretation which are only needed for the string. escape_dup: handles escape sequence in a systematic way. This speeds up variable modifiers. This also makes .for loops more consistent, as they use the same definition of `a word' as the rest of make.
2000-09-14Some systematic clean-up.Marc Espie
- UNUSED macro that expands to __attribute__((unused)) for gcc - move rcsid around so that they can be tagged UNUSED. - activate -Wunused. - use UNUSED instead of kludgy junk for function arguments. - add extern to all extern prototypes. - update comments in lst.h. - clean up var.c a little bit, constifying arguments, updating comments...
2000-08-21Var_Append needs to set v for DEBUG(VAR) to work.Marc Espie
Obvious fix. Problem reported by Gregory Steuck, thanks a lot !
2000-07-31POSIX rules: pass variables set on the command line to submakes throughMarc Espie
MAKEFLAGS
2000-07-24Oops.Marc Espie
2000-07-18Handle MAKEFLAGS variation mandated by POSIX.Marc Espie
Code to pass variable definitions to submakes through make flags. Not activated yet, need to fix src/ first.
2000-07-17FALLTHRU -> FALLTHROUGH, requested by miod@ and style(9)Marc Espie
2000-07-17parse embedded variable specs, e.g., ${VAR_${SUB}}Marc Espie
- need braces, as we don't want to change what $$A means, - this assumes this kind of construct is very infrequent, thus this does NOT copy the variable name needlessly. - the expansion code is in a separate function for clarity. Reviewed by miod@, as previous patches.
2000-07-17- let VarModifiers_Apply accept NULL string gracefully,Marc Espie
- simplify Var_Parse: use varfind, then leverage on the result to recognize `special case' dynamic parsing. VarModifiers_Apply need to be called on NULL strings, to be able to parse modifiers applied to non-existent variables. (Alternately, we could call VarModifiers_Apply on a dummy string, but this is less efficient).
2000-07-17Major unobfuscation: split var modifiers handling to a separate file.Marc Espie
This does finally make var handling somewhat readable.
2000-07-17separate modifiers handling from Var_Parse into a separateMarc Espie
VarModifiers_apply function. for env lookup, create variable structure first, so that we can get away without terminating the variable name in main Var_Parse.
2000-07-17Str_Match returns TRUE or FALSE, better style to test those ratherMarc Espie
than 1 or 0.
2000-07-17This does replace Str_Match with a better routine, which handles negatedMarc Espie
intervals, and \\ in intervals. Accordingly, var.c no longer needs to copy the :Marg to replace \: with : We don't use fnmatch(3) because of various optimizations which are harder to achieve in a generic setting. Also add regression suite for the Str_Match function.
2000-07-17Constify a few functions, propagated from VarModify.Marc Espie
Replace a few int -> size_t Reviewed by miod@
2000-07-17- recognize that FIND_CMD and FIND_GLOBAL are always used together,Marc Espie
- introduce VarFind_interval function. This avoids having to copy variable names in VarParse, - expose internals of VarFind* function (not used yet, but this will avoid multiple lookups in VarParse), - constify a few functions. Reviewed by miod@
2000-07-17Consistency bug: for substitution should look in the same places otherMarc Espie
variable substitution is.
2000-07-06Insert missing .El directive; todd@Aaron Campbell
2000-07-01Slightly nicer wording: begins by -> begins withMarc Espie
2000-07-01Forgot to import one estrdup from my trunk.Marc Espie
Ensure make prints sane error messages when obj/ exists.
2000-06-30Recognize `+cmd' as a command that should always be executed, even inMarc Espie
make -n mode. Currently works only in sequential make mode. In parallel make mode, it's just a no-op. Useful to debug recursive Makefiles, and part of POSIX.
2000-06-28unsigned -> unsigned int (implicit int is deprecated)Marc Espie
hv is a u_int32_t. Add __BEGIN_DECLS/__END_DECLS Remove unused macro (hash_to_info). Add documentation for the hash functions.
2000-06-25Cater to people who don't run make depend better.Marc Espie
Also forgot a few CLEANFILES.
2000-06-23This patch replaces str_concat with a slightly unobfuscated version.Marc Espie
In particular, Dir_MakeFlags is abusing str_concat, and works much better with buffers.
2000-06-23This is complementary to the previous patch.Marc Espie
There is no code change in this patch, we just move the remaining `lowparse' functions to the right file, and adjust the interface file accordingly. Reviewed by miod@
2000-06-23This patch is worth a lot, speed-wise.Marc Espie
This does introduce a proper stack of IFiles to handle included files: instead of having the current file be a special case, it's also an IFile. The corresponding code is slightly unobfuscated, removing the error-prone ParseEOF function, freeing the filename systematically (thus, main.c needs to strdup stdin), and merging both include functions lookup into one. The speed gain comes from changing the IFile structure to merge with fgetln seamlessly. The low-level parse code is mostly moved to a new file, lowparse.c, to make things easier to read (see next patch as well). Accordingly, util.c gains a fgetln. Note the interaction between Parse_File, Dir_FindFile, and ReadMakefile in main.c. This patch closes a subtle memory hole (only the Makefile names, so rather small). Reviewed by miod@.