Age | Commit message (Collapse) | Author |
|
5% speed increase on a make build.
ok miod@
|
|
(__attribute((__unused__)) denotes parameters that MAY be unused in the
code, e.g., it's mostly a `shut up warnings' device).
|
|
|
|
Replace MAXPATHLEN with PATH_MAX (synch with op-make).
ok naddy@
|
|
Don't bother cleaning it up for speed
|
|
|
|
|
|
This is temporary, this code needs better fixes.
|
|
Removes remaining lint stuff from lst.lib.
|
|
|
|
of missing function declarations.
|
|
|
|
- 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).
|
|
Handles unterminated variables, and fixes regression test #10
|
|
Looks like nobody is using this anyways.
|
|
problems.
Bug found by wilfried@.
|
|
static VarPatterns...
Old make could use dynamic variables because everything was jumbled
into one single function.
|
|
file handles it's passed to.
(this is apparently harmless on BSDs, but is still a bug).
|
|
assuming '\0' at the end.
-> importance of proper make bug reports, this was first diagnosed as
a for loop issue...
|
|
Idea taken from NetBSD. implementation completely different,
as our loop implementation diverged a while back.
|
|
|
|
|
|
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...
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
though...
Ok'ed miod@.
|
|
${BC_${A}} worked but not ${${A}_BC}.
Noticed by fries@
|
|
|
|
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.
|
|
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...
|
|
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...
|
|
|
|
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.
|
|
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.
|
|
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).
|
|
* 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
|
|
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.
|
|
- Some .Nm trimming.
- .Sh AUTHOR -> .Sh AUTHORS
- Other miscellaneous fixes here and there.
|
|
|
|
|
|
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.
|
|
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.
|
|
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...
|
|
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.
|
|
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.
|
|
|