OpenBSD CVS

CVS log for src/usr.bin/make/dir.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.69 / (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.68: +1 -2 lines
Diff to previous 1.68 (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.68 / (download) - annotate - [select for diffs], Fri Oct 21 16:12:38 2016 UTC (7 years, 6 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, 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, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.67: +4 -4 lines
Diff to previous 1.67 (colored)

small obvious cleanups:
- remove a lot of unnecessary casts
- zap extra param that's no longer needed
- add proper prototype and make function static

okay natano@

Revision 1.67 / (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_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Fri Jan 23 13:18:40 2015 UTC (9 years, 3 months ago) by espie
Branch: MAIN
Changes since 1.65: +6 -4 lines
Diff to previous 1.65 (colored)

remove a bunch of dangerous casts (useless casts from void * to something
else, in some cases by adding extra temporary variables.
IMO, it's much better practice to do

void *a;
int *p = a;
*p = 42;

rather than
void *a;
*(int *)a = 42;

okay miod@... to be revisited for some possible const additions later.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jan 16 15:36:29 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.64: +1 -2 lines
Diff to previous 1.64 (colored)

switch to <limits.h>; ok millert

Revision 1.64 / (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.63: +4 -4 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Wed May 22 12:14:08 2013 UTC (10 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.62: +5 -4 lines
Diff to previous 1.62 (colored)

as checked through thorough tests, youngest->mtime == ctime, so ditch
the extra field.

remove some extra abstraction layer: use clock_gettime directly
instead of ts_set_from_now (what is "now" anyways)

time_to_string takes param by pointer

rename "now" into starttime (more accurate term)

randomize queue uses arc4random_uniform (prompted by deraadt@)

display debug timestamp with ns too (it's debug, so it doesn't really
matter whichever way it's done, as long as it's done)

okay millert@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Apr 23 14:32:53 2013 UTC (11 years ago) by espie
Branch: MAIN
Changes since 1.61: +10 -10 lines
Diff to previous 1.61 (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.61 / (download) - annotate - [select for diffs], Fri Dec 7 07:15:31 2012 UTC (11 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.60: +1 -32 lines
Diff to previous 1.60 (colored)

gc dead code

Revision 1.60 / (download) - annotate - [select for diffs], Tue Oct 2 10:29:30 2012 UTC (11 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.59: +1 -20 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Mon Jul 19 19:46:44 2010 UTC (13 years, 10 months ago) by espie
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, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.58: +1 -2 lines
Diff to previous 1.58 (colored)

Correct $OpenBSD$ stuff

Revision 1.58 / (download) - annotate - [select for diffs], Mon Jul 19 19:30:37 2010 UTC (13 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.57: +0 -0 lines
Diff to previous 1.57 (colored)

two small changes:
- allow variables in SysV modifiers, as requested by matthieu@
(since recursive variables are an extension, this just extends the
extension)
- variation on :Q  called :QL (quote list), which does quote every character
EXCEPT for whitespace. e.g.,

toto:
	@for i in ${VAR:QL} ...

Revision 1.57 / (download) - annotate - [select for diffs], Sun Aug 16 09:53:43 2009 UTC (14 years, 9 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.56: +3 -0 lines
Diff to previous 1.56 (colored)

modify timestamp handling to grab current time instead of relying on a
stale timestamp.

all those diffs sent to people ages ago, who didn't answer, except for
Theo, who said he ran it with no issues, so let's get this in...

Revision 1.56 / (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_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.55: +7 -1 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Mon Sep 17 12:17:27 2007 UTC (16 years, 8 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.54: +116 -118 lines
Diff to previous 1.54 (colored)

reorg the directory code a bit.

Instead of readDir, explicitly create PathEntry, and increment the refcount
in there, which is simpler.

Revision 1.54 / (download) - annotate - [select for diffs], Mon Sep 17 12:04:29 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.53: +14 -14 lines
Diff to previous 1.53 (colored)

better variable name

Revision 1.53 / (download) - annotate - [select for diffs], Mon Sep 17 09:28:36 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.52: +57 -57 lines
Diff to previous 1.52 (colored)

kill extra spaces at end of line

Revision 1.52 / (download) - annotate - [select for diffs], Sun Sep 16 14:29:33 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.51: +1 -53 lines
Diff to previous 1.51 (colored)

remove old debug code nothing uses

Revision 1.51 / (download) - annotate - [select for diffs], Sun Sep 16 12:30:35 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.50: +20 -20 lines
Diff to previous 1.50 (colored)

rename dirSearchPath -> defaultPath, and openDirectories -> knownDirectories

Revision 1.50 / (download) - annotate - [select for diffs], Sun Sep 16 12:19:15 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.49: +39 -35 lines
Diff to previous 1.49 (colored)

rename Path to less misleading PathEntry. Get rid of typedef.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Sep 16 12:09:36 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.48: +4 -5 lines
Diff to previous 1.48 (colored)

rename Targ_FmtTime into time_to_string and move it, as it's not related
to target nodes at all (reduces modules inter-dependencies)

Revision 1.48 / (download) - annotate - [select for diffs], Sun Sep 16 10:43:53 2007 UTC (16 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.47: +1 -15 lines
Diff to previous 1.47 (colored)

move free_ohash  function so that we can reuse it.

Revision 1.47 / (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.46: +5 -276 lines
Diff to previous 1.46 (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.46 / (download) - annotate - [select for diffs], Tue Jul 24 21:09:07 2007 UTC (16 years, 9 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.45: +586 -566 lines
Diff to previous 1.45 (colored)

reindent (no binary change)

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jan 18 17:49:51 2007 UTC (17 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.44: +7 -6 lines
Diff to previous 1.44 (colored)

* add an extra argument to the dir lookup functions to say whether we
should look in the current directory.
* refactor include files treatment to have a separate function to look
for an include.
* use both pieces to make sure system includes do not get looked up
in the current directory unless everything else fails.

This is != from the netbsd solution to the same problem, which stuffs
`magic' entries into filepaths to say whether dot should be looked at
first or last.

feature requested by matthieu@.
okay matthieu@

Revision 1.44 / (download) - annotate - [select for diffs], Fri Jan 20 23:10:19 2006 UTC (18 years, 4 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.43: +5 -5 lines
Diff to previous 1.43 (colored)

use stdint.h where appropriate. okay millert@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jun 26 15:19:12 2005 UTC (18 years, 10 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

fail if cwd is not available; pr4265; espie@ ok

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jun 22 19:58:20 2004 UTC (19 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.41: +5 -11 lines
Diff to previous 1.41 (colored)

why should . and .. be the first two entries of any dir ?
Let code be portable.
okay millert@

Revision 1.41 / (download) - annotate - [select for diffs], Wed Apr 7 13:11:35 2004 UTC (20 years, 1 month ago) by espie
Branch: MAIN
Changes since 1.40: +59 -113 lines
Diff to previous 1.40 (colored)

ISO function declarations, trim a few comments, rename a few variables to
more explicit/more consistent names.

okay otto@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:11 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.39: +2 -6 lines
Diff to previous 1.39 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Apr 21 23:10:52 2003 UTC (21 years, 1 month ago) by espie
Branch: MAIN
Changes since 1.38: +7 -7 lines
Diff to previous 1.38 (colored)

build expanded brace with more explicit bound checking.
okay millert@

Revision 1.38 / (download) - annotate - [select for diffs], Mon May 27 03:14:21 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.37: +4 -4 lines
Diff to previous 1.37 (colored)

unsigned vs unsigned int

Revision 1.37 / (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.36: +2 -2 lines
Diff to previous 1.36 (colored)

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

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

undo changes that crash on (at least) the alpha

Revision 1.35 / (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.34: +2 -2 lines
Diff to previous 1.34 (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.34 / (download) - annotate - [select for diffs], Tue May 29 12:53:39 2001 UTC (22 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.33: +5 -2 lines
Diff to previous 1.33 (colored)

Take includes out of lst.h, re-add what's needed to separate files.
Removes remaining lint stuff from lst.lib.

Revision 1.33 / (download) - annotate - [select for diffs], Sun May 27 08:34:10 2001 UTC (22 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.32: +18 -13 lines
Diff to previous 1.32 (colored)

Fix DirExpandCurlyi. Noticed by ho@. Okay miod@.

Revision 1.32 / (download) - annotate - [select for diffs], Wed May 23 12:34:42 2001 UTC (23 years ago) by espie
Branch: MAIN
Changes since 1.31: +260 -345 lines
Diff to previous 1.31 (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.31 / (download) - annotate - [select for diffs], Thu May 3 13:41:03 2001 UTC (23 years ago) by espie
Branch: MAIN
Changes since 1.30: +418 -469 lines
Diff to previous 1.30 (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.30 / (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.29: +42 -42 lines
Diff to previous 1.29 (colored)

Use the ohash_* that's now in libc.

Revision 1.29 / (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.28: +27 -5 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Fri Nov 24 14:27:19 2000 UTC (23 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.27: +17 -21 lines
Diff to previous 1.27 (colored)

Clean-ups:
* 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

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

Introduce a few macros to handle timestamps in an abstract way.

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.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Sep 14 13:46:44 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.25: +132 -134 lines
Diff to previous 1.25 (colored)

Replace the old hash used to hold file names within a directory with
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...

Revision 1.25 / (download) - annotate - [select for diffs], Thu Sep 14 13:43:30 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.24: +100 -128 lines
Diff to previous 1.24 (colored)

- new DirReadDir internal function, that just reads a directory from
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.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Sep 14 13:32:06 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.23: +10 -9 lines
Diff to previous 1.23 (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.23 / (download) - annotate - [select for diffs], Fri Jun 23 16:41:52 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.22: +12 -17 lines
Diff to previous 1.22 (colored)

This patch replaces str_concat with a slightly unobfuscated version.

In particular, Dir_MakeFlags is abusing str_concat, and works much better
with buffers.

Revision 1.22 / (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.21: +32 -42 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Sat Jun 17 14:40:27 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.20: +18 -31 lines
Diff to previous 1.20 (colored)

A few assorted changes, to remove more dynamic lists.
- in Dir_Expand, path is a misnomer. Use a temp variable instead...
Reformat code for readability.
- Change Parse_MainName/Targ_FindList so that they fill arguments instead
of allocating new lists.
- nuke Targ_FindList(TG_NOCREATE), as this is never used.

- close a small memory hole (forgot to free sysMkPath if CLEANUP).

Reviewed by millert@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jun 17 14:38:14 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.19: +28 -29 lines
Diff to previous 1.19 (colored)

This patch introduces a distinction between
Lst_Init (constructor) and Lst_New (allocation + construction)
Lst_Destroy (destructor) and Lst_Delete (deallocation + destruction),
and uses that to turn most dynamic allocation of lists (Lst pointers)
into static structures (LIST).

Most of this is mundane, except for allGNs in targ.c, where the code must
be checked to verify that Targ_Init is called soon enough.

Lst_New is a temporary addition. All lists will soon be static.

Reviewed by millert@, like the previous patch.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jun 10 01:41:05 2000 UTC (23 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.18: +20 -19 lines
Diff to previous 1.18 (colored)

Clean-up patch: use `void *' instead of old-fashioned ClientData/Address.

Revision 1.18 / (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.17: +14 -26 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Sun Mar 26 16:21:32 2000 UTC (24 years, 1 month ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.16: +19 -17 lines
Diff to previous 1.16 (colored)

Remove idiotic, braindead casts T* -> void*
They serve no purpose, except hiding potential bugs.

In particular, remove (ClientData) cast from macro, showing potentially
troublesome use of Hashes to store time_t.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Feb 2 13:47:47 2000 UTC (24 years, 3 months ago) by espie
Branch: MAIN
Changes since 1.15: +13 -9 lines
Diff to previous 1.15 (colored)

Bug-fix: make should behave sensibly when presented with negative times...

- let *_MTime return booleans, as that's what they're used for, the time_t
is set as a side effect.

- use OUT_OF_DATE for a date starting point, set it at the origin of time.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jan 25 20:52:15 2000 UTC (24 years, 3 months ago) by espie
Branch: MAIN
Changes since 1.14: +8 -3 lines
Diff to previous 1.14 (colored)

Kludge to fix timestamp bug.

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

Rearrange Lst_Find interface to conform better with other functions.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Dec 18 21:58:07 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.12: +9 -9 lines
Diff to previous 1.12 (colored)

Nothing ever checks ReturnStatus on Lst_Insert, Lst_Append, Lst_AtFront,
Lst_AtEnd, Lst_Concat, Lst_Remove, Lst_Replace.

Don't bother returning one.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Dec 18 21:56:07 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.11: +4 -6 lines
Diff to previous 1.11 (colored)

Lst_DeQueue already checks for empty lists.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Dec 18 21:53:32 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.10: +12 -12 lines
Diff to previous 1.10 (colored)

NIL, NILGNODE, etc, are only glorified NULL.
Get rid of them.

Get rid of list.h, nothing uses it anyway.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Dec 18 02:11:26 1999 UTC (24 years, 5 months ago) by espie
Branch: MAIN
Changes since 1.9: +5 -5 lines
Diff to previous 1.9 (colored)

make does not use circular lists, get rid of the extra weight.

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

Efficiency patch from NetBSD:
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.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 5 00:06:27 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], Tue Apr 1 07:28:11 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.6: +26 -5 lines
Diff to previous 1.6 (colored)

Sync with NetBSD (mostly by christos initial substitution/regexp from Der Mouse)

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

Revision 1.6 / (download) - annotate - [select for diffs], Sat Nov 30 21:08:53 1996 UTC (27 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.5: +43 -43 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Mon Sep 2 16:04:09 1996 UTC (27 years, 8 months ago) by briggs
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.4: +12 -12 lines
Diff to previous 1.4 (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.4 / (download) - annotate - [select for diffs], Wed Jun 26 05:36:29 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

rcsid

Revision 1.3 / (download) - annotate - [select for diffs], Thu Feb 22 22:24:46 1996 UTC (28 years, 3 months ago) by niklas
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (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.2 / (download) - annotate - [select for diffs], Thu Dec 14 03:23:29 1995 UTC (28 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

from christos@netbsd:
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.)

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.