OpenBSD CVS

CVS log for src/usr.bin/make/Makefile


[BACK] Up to [local] / src / usr.bin / make

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.65 / (download) - annotate - [select for diffs], Mon Sep 4 11:35:11 2023 UTC (8 months, 2 weeks ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.64: +2 -3 lines
Diff to previous 1.64 (colored)

GC old code that was originally implemented to facilitate adoption by
other BSDs, which never happened, so make things simpler for further
development.

Ditches config.h entirely since it gets reduced to 2 defines.

okay tb@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Jan 13 15:41:53 2020 UTC (4 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

make the choice of engine explicit

simplify the running of .BEGIN/.END so that they pass through the engine
first (so they can now have dependencies). Error out properly if .BEGIN/.END
fails.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Jan 13 14:05:21 2020 UTC (4 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored)

move a large chunk of suff.c into its own file (independent functions which
are not really directly related to suffix handling), so that I can eventually
understand how this whole thing works.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Jul 19 10:19:25 2017 UTC (6 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.61: +1 -3 lines
Diff to previous 1.61 (colored)

depend is dead

Revision 1.61 / (download) - annotate - [select for diffs], Fri Oct 14 09:27:21 2016 UTC (7 years, 7 months ago) by natano
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored)

Implement the ${<D} and ${<F} variables, as documented in the manual.
They are equivalent to ${<:H} and ${<:T} repectively, however the former
variants are more portable, as they are understood by GNU, FreeBSD and
NetBSD make too.

absence of those variables reported by Dario Niedermann <dnied at tiscali.it>
ok millert espie

Revision 1.60 / (download) - annotate - [select for diffs], Wed Oct 14 13:50:22 2015 UTC (8 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.59: +1 -2 lines
Diff to previous 1.59 (colored)

make sure we use stdbool.h
Mostly diff by Daniel Dickman, who told me to commit in his stead,
as he's tied up at work.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Jan 23 22:35:57 2015 UTC (9 years, 3 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

a wee little bit more cleanup (more const and remove noise from CDIAGFLAGS...
-pedantic kind of requires -std=c99 here to avoid LL warnings)
okay miod@, millert@

Revision 1.58 / (download) - annotate - [select for diffs], Mon May 12 19:11:19 2014 UTC (10 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.57: +11 -10 lines
Diff to previous 1.57 (colored)

adjust to ohash being in libutil now, and to the interface changes.
fix potential integer overflows in memory allocation (mostly for pedagogical
purposes, these are unlikely to overflow in practice)
move the rest of lst.lib stuff into its own directory.

Revision 1.57 / (download) - annotate - [select for diffs], Sat Mar 22 10:36:22 2014 UTC (10 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.56: +4 -4 lines
Diff to previous 1.56 (colored)

don't use >$@ directly

Revision 1.56 / (download) - annotate - [select for diffs], Tue Apr 23 14:32:53 2013 UTC (11 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.55: +1 -2 lines
Diff to previous 1.55 (colored)

remove TIMESTAMP abstraction layer, prodded by theo.
while there, clean up includes.
use strtoll for ar timestamps (pretty much unused in reality, more
standard conforming than anything)

use idea from Todd to adapt to time_t being 32 bits OR 64 bits
(pedantically correct: INT_MIN would work just fine up to 1910 or so...)

okay millert@, gone thru a make build.

Revision 1.55 / (download) - annotate - [select for diffs], Tue Oct 2 10:29:30 2012 UTC (11 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

more changes, discussed and tested by various people.
- put back some job control, turns out it's necessary when we don't run a
shell.
- zap old #ifdef CLEANUP code... probably doesn't even compile.
- kill most of the OP_LIB code. Just keep a wee little bit for compatibility
(deprecated .LIBS and .INCLUDES, warns for weird dependencies instead of
erroring out).
- much improved debugging and -p output: sort variables, targets, rules,
output stuff in a nicer format mimicing input.
- better error message when no command is found, explain where the target comes from.
- sort final error list by file.
- show system files in errors as <bsd.prog.mk>
- reincorporate random delay, that was dropped
- optimize siginfo output by not regenerating the whole string each time.
- finish zapping old LocationInfo field that's no longer used.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Sep 21 10:01:52 2012 UTC (11 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.53: +1 -4 lines
Diff to previous 1.53 (colored)

zap lint remains

Revision 1.53 / (download) - annotate - [select for diffs], Fri Sep 21 07:55:20 2012 UTC (11 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.52: +3 -2 lines
Diff to previous 1.52 (colored)

major overhaul of the way make handle jobs, inspired by dpb:
instead of forking a "job" per target, and having that job further fork
separate commands, have make maintain a list of jobs, indexed by pid
of currently running commands, and handle process termination
continuation-style.  This has lots of benefits:
- make is responsible for most printing, so we no longer need pipes nor
job control: make -j jobs see the tty.
- no more special-casing for jobs that don't really execute anything.
- unify code for make -jn and make -B, including signal handlers and
job waiting.  So make -n, make -q, +cmd now run commands in the same
way in all cases.
- unified more accurate error-reporting, as make knows precisely which
command failed. Commands are tagged with their lines, and we display failing
commands in silent mode.
- fine-grained "expensive" command handling (recursion limiter). Do it
per-command instead of per-target.

Moreover, signal response is now simpler, as we just block the signals
in a small critical sections, test for events, and sigpause (thanks a lot
to guenther@ and millert@), so running make is now almost always paused
without any busy-waiting.

Thanks to everyone who tested and gave input.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Oct 17 22:54:37 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.51: +1 -5 lines
Diff to previous 1.51 (colored)

Stop installing me(1) and ms(1) source code.
We will soon get rid of groff in base,
so there is no longer any way to use these files with base.
No opposition on tech@.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Apr 25 13:59:53 2010 UTC (14 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.50: +1 -1 lines
Diff to previous 1.50 (colored)

pure whitespace cleanup

Revision 1.50 / (download) - annotate - [select for diffs], Tue Nov 4 07:22:35 2008 UTC (15 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.49: +1 -1 lines
Diff to previous 1.49 (colored)

changes to get target equivalence to work better.
- add new file to create lists of equivalent targets (siblings)
- use that for sequential mode to have much better VPATH support
- separate checking commands from reporting error, for later.
- zap DieHorribly accordingly
- renumber existing flags
- signal_running_jobs() is simpler than pass_signal_to_jobs()
- new debug option -dn for name matching.

Similar code to handle parallel make is still missing.

thanks to Mark, Miod, Theo, Otto, Todd for tests and/or comments.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jan 12 13:05:57 2008 UTC (16 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

new function: lstRequeue, to be used by the job handler

Revision 1.48 / (download) - annotate - [select for diffs], Tue Oct 23 22:04:24 2007 UTC (16 years, 6 months ago) by miod
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

Fix CLEANFILES

Revision 1.47 / (download) - annotate - [select for diffs], Mon Sep 17 12:42:09 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.46: +7 -7 lines
Diff to previous 1.46 (colored)

rewrite of the basic suffix/target parsing: use hash for suffixes.

Store special targets in target hash, and use them for the parsing.

Use OP_DUMMY flag to mark targets that don't really exist yet, such
as interrupt and default nodes.

Also, .PATHxxx is special in suffixes.

Small tweaks to compat.c, so that run_commands does more stuff after
the fork() (and thus no need to free things).

Remove distinction between local and global jobs.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Sep 16 10:39:07 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

first step towards sanity: take the functions common to parallel/not parallel
make outside of make.c and job.c, and create an engine.c file to hold them.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Sep 16 10:20:17 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.44: +6 -2 lines
Diff to previous 1.44 (colored)

scaffolding to recognize special targets/sources using ohash functions.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Sep 16 10:14:26 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.43: +3 -2 lines
Diff to previous 1.43 (colored)

cut up dir.c into dir.c/direxpand.c as there is very little interface between
two modules that do different things.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jul 21 14:40:33 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.42: +1 -4 lines
Diff to previous 1.42 (colored)

zap unneeded stuff

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jul 9 21:16:42 2007 UTC (16 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

espie, you have got to be joking

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jul 8 17:44:20 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.40: +4 -1 lines
Diff to previous 1.40 (colored)

A set of big related changes. okay millert@, tested further by kettenis@
and matthieu@

This all revolves around putting ALL global variables into one single big
hash, and using flags. This removes some impossible to understand stuff,
like old varfind, and allows for some nice stuff.
- each time we reference a global variable, we create it, possibly as a dummy
variable.
- each time we go to the environment, we remember it, thus we no longer go
back to it.

Lists of dependant changes:
- isolate changes to oldVars and checkEnvFirst.
- remove VAR_CMD and VAR_GLOBAL contexts. The only distinction is in parsevar.
Split Parse_DoVar into Parse_DoVar and Parse_CmdlineVar
- rework var modules around obtain_global_var, observe flags in various
functions like Var_Value and Var_Seti.
- Var_Seti/Var_Appendi are almost the same code, use that internally.
- add magic to handle the very special SHELL variable.
- introduce Var_Definedi for the cases where we don't want the actual
value, to simplify tests.
- add keyword .poison, parse it and set global flags accordingly.
- do poison_checks where needed.
- document poison.
- in for loops, set variable temporarily, so that Var_SubstVar will also
substitute it in varmodifiers expressions.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Mar 18 15:37:06 2007 UTC (17 years, 2 months ago) by mickey
Branch: MAIN
Changes since 1.39: +11 -7 lines
Diff to previous 1.39 (colored)

allow this to build w/ cross-tools thru providing proper hostcflags; found by rainor's work

Revision 1.39 / (download) - annotate - [select for diffs], Tue Apr 25 11:47:43 2006 UTC (18 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.38: +3 -1 lines
Diff to previous 1.38 (colored)

same hack for .ln as .o

Revision 1.38 / (download) - annotate - [select for diffs], Wed Jan 28 02:50:28 2004 UTC (20 years, 3 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.37: +1 -9 lines
Diff to previous 1.37 (colored)

revert totally unapproved commit.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Jan 28 02:01:48 2004 UTC (20 years, 3 months ago) by mickey
Branch: MAIN
Changes since 1.36: +10 -2 lines
Diff to previous 1.36 (colored)

missing deps for generate and a commented out section useful for bootstrapping w/ alien libc's (now that it uses an evil o'hash functions)

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jul 25 18:40:24 2002 UTC (21 years, 9 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Obey LDSTATIC when building "generate".

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jun 11 21:12:11 2002 UTC (21 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.34: +4 -2 lines
Diff to previous 1.34 (colored)

This is the first step in sanitizing the conditional parser.

Change the conditional recognition algorithm:
scan for a sequence of alphabetic characters, hash it, and compare it against
a small table (using ohash functions).
This makes Cond_Eval entry more logical, and allows for some shortcuts in
recognizing .include, .for, .undef.

This also means that conditionals must have an intervening blank between
the keyword and the actual test, e.g.,
.ifA
will no longer work.

(but no-one actually uses this, and it's highly obfuscated)

Okay miod@.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Apr 22 21:45:01 2002 UTC (22 years, 1 month ago) by miod
Branch: MAIN
Changes since 1.33: +1 -4 lines
Diff to previous 1.33 (colored)

Do not hardcode mvme88k-specific compilation flags here, especially since
the new flags happen to be no different from those set in <sys.mk>

Revision 1.33 / (download) - annotate - [select for diffs], Sun Nov 11 12:35:02 2001 UTC (22 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Fixed version... don't see how this could work on i386, since it didn't
initialize create in main.c.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Nov 11 06:02:05 2001 UTC (22 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +1 -1 lines
Diff to previous 1.31 (colored)

undo changes that crash on (at least) the alpha

Revision 1.31 / (download) - annotate - [select for diffs], Sun Nov 11 01:19:23 2001 UTC (22 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Redo LstInit as a macro: smaller and faster code in all cases, zeroing two
pointers is simpler than calling a function.
Recognize purely static lst headers, which don't really need any
initialization.
ok miod@

Revision 1.30 / (download) - annotate - [select for diffs], Sun Sep 16 01:25:50 2001 UTC (22 years, 8 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

Make make cross-compilable.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jul 18 13:29:49 2001 UTC (22 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.28: +4 -3 lines
Diff to previous 1.28 (colored)

CDIAGFLAGS

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jun 5 11:59:09 2001 UTC (22 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Use Str_concat instead of fixed buffers and snprintf in building paths.
Replace MAXPATHLEN with PATH_MAX (synch with op-make).
ok naddy@

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 23 12:34:39 2001 UTC (23 years ago) by espie
Branch: MAIN
Changes since 1.26: +10 -6 lines
Diff to previous 1.26 (colored)

Mostly clean-up:
- 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).

Revision 1.26 / (download) - annotate - [select for diffs], Thu May 3 13:40:59 2001 UTC (23 years ago) by espie
Branch: MAIN
Changes since 1.25: +20 -15 lines
Diff to previous 1.25 (colored)

Synch with my current work.
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...

Revision 1.25 / (download) - annotate - [select for diffs], Fri Mar 2 16:57:26 2001 UTC (23 years, 2 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.24: +3 -18 lines
Diff to previous 1.24 (colored)

Use the ohash_* that's now in libc.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Nov 24 14:36:33 2000 UTC (23 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Change the time stamp interface to use an abstract datatype.
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.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Sep 14 13:56:14 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

This kills the last old hashing table, in arch.c

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.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Sep 14 13:32:05 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Some systematic clean-up.
- 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...

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jul 17 23:09:06 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Major unobfuscation: split var modifiers handling to a separate file.
This does finally make var handling somewhat readable.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 17 23:01:20 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.19: +9 -1 lines
Diff to previous 1.19 (colored)

This does replace Str_Match with a better routine, which handles negated
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.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jun 25 20:31:08 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.18: +3 -2 lines
Diff to previous 1.18 (colored)

Cater to people who don't run make depend better.
Also forgot a few CLEANFILES.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jun 23 16:39:45 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

This patch is worth a lot, speed-wise.

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@.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jun 23 16:27:29 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.16: +33 -2 lines
Diff to previous 1.16 (colored)

This is the speed-up patch, which doubles make speed (almost).

Use the open hashing functions for global contexts instead of List in
var.c.

All the preliminary work to trim down local contexts means that we don't
suffer from the heavy initialization work that a hash table entails.

There is some make kludgery to:
- build the hashing functions as a library,
- recreate hashconsts.h, even if make depend was not invoked.

One point of the hashing scheme written was to separate the computation
of the hash function, and the hash lookup itself. This is very convenient
for make, because of those pesky special variables. hashconsts.h is there
to pre-hash the correct values, which replaces a few expensive string
comparisons with quick hash value comparisons, followed by one expensive
string comparison. The modulus MAGICSLOTS chosen in the Makefile is
ad-hoc: it is small enough to write a small switch without collision,
and will need changing if the hash function changes...

The function quick_lookup is the most important:
it either returns an index, for a local variable, or it does compute a
hashing value, and returns -1.

Another somewhat controversial decision is the use of string intervals.
This avoids either copying a string, or twiddling with a byte for cases
such as ${VAR}.

Finally, the variable name is stored within the variable itself. Since
a given variable name never changes, this makes sense. All that was needed
was a hash library with support for this.  Note that the hashing table
holds only a variable pointer AND the corresponding hashing value, WITHOUT
a modulo hashtablesize. Two reasons:
- hash resizes can be done faster, without having to recompute hashing values.
- locality of access. The hash table fits into memory without problem. Once
a candidate slot is found, we check the complete hashing value. Probability
of a collision is very small (32 bits...). So bringing up the whole
variable in memory at once is good: the name will almost always match, in
which case we want the variable value as well, so it makes sense to put
them together.

The ohash functions implement open hashing, as described in Knuth, but with
a variable table size.  Choosing powers of 2 sizes does not yield more
collisions, but it makes the hashing scheme much simpler. The thresholds at
which to expand/shrink the tables seem to work well in practice. The
default sizes were chosen such that the tables hardly ever shrink or expand
anyways (though I've tried with smaller/larger sizes to verify that the
shrinking/expanding worked correctly): larger Makefiles hold roughly
500/600 variables, which fits without trouble into a 1024-sized variable.

Disregard #ifdef STATS_HASH, this is some internal scaffolding I'm using
to measure make performance.

The only known issue with open-hashing is that deletions cannot create
empty slots, but do leave slots marked as `occupied once' so that lookup
works.  We use a well-known optimization which records those pseudo-empty
slots while looking up values. If the value is not found, the pseudo-empty
slot is returned to be filled. If the value is found, it is swapped with
the pseudo-empty slot. This is an improvement in both cases, since this
shortens the length of lookup chains, eventually pushing the pseudo-empty
slots to the end.

Reviewed by millert@ and miod@

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jun 23 16:15:49 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.15: +4 -5 lines
Diff to previous 1.15 (colored)

Trivial consequences of the previous list changes:

- audit code for Lst_Datum, it's never applied to an empty pointer,
so check can be removed -> turn into a macro,
- Lst_First, Lst_Last can become macro as well
- specialized version of Lst_Succ (Lst_Adv) to use in loops where it cannot
fail,
- Lst_Open can no longer fail. Trim down corresponding code.

Reviewed millert@, miod@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jun 17 14:43:35 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

This removes the few instances of Lst_New left.
- replaces Lst_Duplicate with Lst_Clone, which does not allocate storage
- split Lst_Concat into Lst_Concat/Lst_ConcatDestroy
Thus, all the LstValid checks are gone, since we always invoke list
functions with valid pointers.

Note that dynamic list allocation accounted for roughly 20% of all calls
to malloc.  The extraneous calls to malloc left are now mostly in parse.c,
which makes some wasteful usage of temporary buffers.

With those few patches, the code is sturdier, and easier to maintain.

Reviewed by millert@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 10 01:32:22 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Thus, Lst_ForEach no longer needs returning a status.
In fact, it can become a macro based on Lst_ForEachFrom.
This also introduces Lst_Every, as a shortcut for the very common case where
Lst_ForEach does not need any user data.

Finally,  make consistent use of a few function typedefs, instead of having
explicit void (*)(Lst)  arguments all over the place.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Dec 19 00:04:24 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

Rearrange Lst_Find interface to conform better with other functions.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Dec 9 18:20:06 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Split some allocation/error handling functions out of main.c

Revision 1.11 / (download) - annotate - [select for diffs], Wed Nov 10 14:11:49 1999 UTC (24 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Turn on strict-prototypes, add missing prototypes.
Move main prototype to main.c, as this is not used
from any other file.

Close open bug.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Oct 5 21:50:34 1999 UTC (24 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

util.c only holds compatibility functions that OpenBSD doesn't use.
Keep the file for compatibility, but don't bother compiling it.
From NetBsd

Revision 1.9 / (download) - annotate - [select for diffs], Tue Sep 28 02:22:53 1999 UTC (24 years, 7 months ago) by smurph
Branch: MAIN
Changes since 1.8: +6 -1 lines
Diff to previous 1.8 (colored)

disabled optimizations for 88k

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 5 00:06:26 1998 UTC (25 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.7: +0 -0 lines
Diff to previous 1.7 (colored)

Modifications from netbsd:
- 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.

Revision 1.7 / (download) - annotate - [select for diffs], Sat Mar 7 18:43:08 1998 UTC (26 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

Add -Wno-char-subscripts to CFLAGS

Revision 1.6 / (download) - annotate - [select for diffs], Sun Sep 21 11:49:52 1997 UTC (26 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.5: +1 -3 lines
Diff to previous 1.5 (colored)

$OpenBSD$

Revision 1.5 / (download) - annotate - [select for diffs], Sat Nov 30 21:08:48 1996 UTC (27 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

Sync with NetBSD:
- 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.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 2 16:04:06 1996 UTC (27 years, 8 months ago) by briggs
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Sync up with NetBSD:
(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.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Mar 27 19:32:34 1996 UTC (28 years, 1 month ago) by niklas
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

From NetBSD: merge of 960317

Revision 1.2 / (download) - annotate - [select for diffs], Thu Feb 22 22:24:43 1996 UTC (28 years, 3 months ago) by niklas
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

From NetBSD:
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.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:41 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:41 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.