Commit Graph

881 Commits

Author SHA1 Message Date
sjg d86fd0848e We must delay setting .CURDIR and .OBJDIR until after MainParseArgs()
in case -C is used - in which case we should also ignore $PWD.
2009-09-09 17:09:49 +00:00
sjg 44c6580dd0 Reviewed by: apb
Use .MAKE.LEVEL to track recursion.
The first instance of make will have .MAKE.LEVEL 0, which
can be handy for excluding rules which should not apply
in a sub-make.
gmake and freebsd's make have a similar mechanism, but each
uses a different variable to track it.  Since we cannot be
compatible with both, we allow the makefiles to cope if they want
by handling the export of .MAKE.LEVEL+1 in Var_Set().
2009-09-08 17:29:20 +00:00
sjg cd5a3748ef PR: 41998
:Ufu\:goo

should expand to fu:goo even when it appears in :M${:Ufu\:goo}
When scanning for :M do not compress \: if we know we have
to call Var_Subst.
2009-09-07 17:56:23 +00:00
dholland 01f8dc7731 Use the W* macros to test wait results.
(Mentioned by Joerg in chat a few days ago.)
2009-09-03 06:45:23 +00:00
sjg b69bd507ef Bump date 2009-08-26 23:18:57 +00:00
sjg 3745b729fb Add -C directory, same as gmake and freebsd make. 2009-08-26 23:17:11 +00:00
sjg dd8e1ba252 JobExec: child of vfork must not empty the sigset_t that parent will
restore.  Use a separate mask.
2009-06-26 01:26:32 +00:00
sjg 39bb2e98a1 Child of vfork() must not alter the state of parent.
There is no need to touch the state of vars in child anyway.
Change 2nd arg to Var_Export1() to indicate if we are the parent or child,
and only set flags in the parent.
2009-06-16 05:44:06 +00:00
sjg 2428caab9f Missing ':' in .ORDER example 2009-06-01 23:28:39 +00:00
wiz 7560090357 Whitespace fix. 2009-05-13 22:56:42 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
snj ab4a318284 Typo fix: many file -> many files. 2009-04-11 15:51:42 +00:00
wiz 8216b2d443 Bump date for previous. 2009-04-11 09:44:22 +00:00
apb af9429a671 Honour the TMPDIR environment variable instead of always using /tmp
as a place to store temporary files.
2009-04-11 09:41:18 +00:00
perry 08429de660 remove unneeded special rule for main.o 2009-03-24 13:54:37 +00:00
perry f113e91b18 per dholland, put back MAKE_VERSION for the benefit of third party users. 2009-03-24 13:53:21 +00:00
perry a24e0ba1bb The Makefile and main.c arranged to put "netbsd-${DATE}" into the
executable. Remove this so that different compiles can be binary
compared. rcsid's for all files are already embedded in the executable
so versions can be easily distinguished. (I didn't catch this on
previous passes because I did my builds on the same day.)

Note: there's a special rule for main.o in Makefile with a purpose I
can't actually discern -- I think it isn't needed, and I've flagged it
with a comment.
2009-03-20 20:48:00 +00:00
christos 0efea3414c use progname instead of getprogname() for portability. 2009-03-18 22:02:49 +00:00
christos 20ad44cb97 use siginfo to report on the directory we are working on if available. 2009-03-01 01:49:17 +00:00
sno 6adead3ca0 replace c++ style comment by a c-style one 2009-02-25 21:17:21 +00:00
dholland 1fc98979b6 Use pid_t for the result of fork and wait. PR 38031 from Ryan Stutsman. 2009-02-22 07:33:00 +00:00
christos a5e73ebace adjust patch to current. 2009-02-18 21:06:47 +00:00
christos ca9294c412 CID 5044: Protect against NULL deref. 2009-02-18 20:08:32 +00:00
sjg 55d9c66506 Update expected results to match recent changes! 2009-02-03 23:11:12 +00:00
dsl efe788379e Rename all the members of 'enum Token' to TOK_FOO.
Makes it rather more obvious wherethey belong - especially since
two of them were 'True' and 'False' (and not 1 and 0 either).
2009-01-30 23:07:17 +00:00
dsl 9c773fc1c6 Treat .ifdef ${foo} as .if defined(${foo}) not .if "${foo}" != "".
(and similarly for the other .ifxxx).
Do comparison against "" or 0 for .if "foo" and .if <numeric> directly
instead of faking up the operator string.
Rename error: to done: and use it for more exit paths.
Elucidate and correct some comments.

Fixes problems with makefiles that do:
.for var in var_1 var_2
.ifdef ${var}
...
which used to check whether var_1 was defined - because the .ifdef saw the
literal var_1, not a variable expansion due to the way .for loop variables
were substituted.
2009-01-30 22:35:10 +00:00
dholland 7f999162b5 Fix flagrantly wrong printf formats in compat strftime. 2009-01-29 09:03:04 +00:00
enami ca3f8e6df1 Avoid infinite loop. 2009-01-29 07:48:39 +00:00
dsl 530cac2556 Allow for () in the argument to .ifdef et al.
Save/restore current values of global data across expression evaluation
to give ${foo:? ...} a change of working inside another .if.
2009-01-28 21:38:12 +00:00
dsl b294f6c2a3 Fix sense of MAKE_NATICE test. 2009-01-24 23:19:50 +00:00
dsl 4802ea584f Add #ifndef MAKE_NATIVE around __RCSID 2009-01-24 23:07:48 +00:00
dsl 97347d2cbb Fixes to includes of make_malloc.h to that it actually builds when
USE_EMALLOC is undefined.
Fixes earlier fixes :-)
2009-01-24 14:43:28 +00:00
cegger 9fde1a673e buildfixes for OSX:
- include <sys/types> for size_t
- progname is undeclared
- include <string.h> for string functions like strlen()
- include <errno.h> for errno
2009-01-24 13:06:16 +00:00
wiz 6942778bea Sort sections. Fix typo (last line). 2009-01-24 13:02:33 +00:00
cegger e6227c556c buildfix: remove RCSID. It conflicts with the definition in the .c files. 2009-01-24 12:59:51 +00:00
dsl 4fb693c12c Move the bmake_malloc() functions into their own .c and .h files.
Include instead of make.h in a few places.
2009-01-24 11:59:39 +00:00
dsl 5d04927c08 Correct the definition of the :? modifier - in particular the modifier
applies to the variable name, not its value!
Remove the set of examples that were recently added that failed to
explain why some worked and some didn't.
Add a not to the compatability section about the change in .for loop
substitution post 5.0.
Add a BUGS section.
XXX the BUGS section needs more entries :-)
2009-01-24 11:56:41 +00:00
dsl a1e84ff783 Don't cast 'time_t' to 'void *' and back it will lose precision. 2009-01-24 10:59:09 +00:00
dsl 86df0d691f Sprinkle some const.
In particular for Lst_Find() and Lst_FindFrom().
Remove some unneeded casts and some now-undeeded UNCONST().
2009-01-23 21:58:27 +00:00
dsl 0cbb4ab551 Change 'ClientData' to 'void *' so that relevant parameters can
be made 'const void *'.
2009-01-23 21:26:30 +00:00
dsl d6c81d7cf1 There is no point in saving the last character of a NUL-terminated
string in order to overwrite with a NUL, then restore the original value!
Remove and simplify the CondDoFoo() functions.
2009-01-23 20:22:50 +00:00
dsl 60ec4ca26f Revert previous - cause grief with .ifdef (foo)
Instead return False for exists(), defined(), make() etc when the
argument has length zero.
2009-01-18 17:30:19 +00:00
dsl bae3fcc0c3 Only terminate a conditional function argument on ')' if we expect the
argument to be exclosed in (...).
'.if exists()' is parsed as '.ifdef exists()' and the ')' must not be
left over at the end.
I have no idea why any of my recent changes have affected this.
But pkgsrc/mk/compiler/gcc.mk (line 488) does .if exists(${FCPATH})
even though FCPATH is only set when the file exists.
2009-01-18 12:50:15 +00:00
lukem ab93b4bc61 fix -Wsign-compare issues 2009-01-18 01:31:12 +00:00
dsl 18e81da746 __predict_false() isn't defined if we aren't netbsd, stub out. 2009-01-17 13:55:42 +00:00
dsl 462d090d0f Change 'Buffer' so that it is the actual struct, not a pointer to it.
Saves having to malloc/free a fixed size structure.
Buf_Init() now takes ptr to Buffer to initialiase.
Change Buf_Destroy() to return ptr to string when not freed.
Remove large number of casts to (Byte) and (Byte *) - 'Byte' is 'char' here.
Buf_AddByte[s] guarantees that the data is 0 termininated, so never add '\0'.
Keep 'count' not 'left' and 'inPtr', code is simplier with only one update.
Fix fallou, no functional change.
2009-01-17 13:29:37 +00:00
dsl d020c6ab24 Allocate string vector in chunks, instead of calling realloc()
every time something is added.
2009-01-16 21:15:34 +00:00
dsl 74a68f7259 Debug print improvements. 2009-01-16 21:14:30 +00:00
dsl cd6806d831 Send output of Error() to debug_file (unless stderr/stdout). 2009-01-16 21:13:13 +00:00
dsl e9eac4d91e Parse_Error() really doesn't need to cruft up a dummy structure for curFile.
It only needs the 'fname' and 'lineno' fields - so just use NULL/0 when
curFile is NULL.
2009-01-16 20:50:24 +00:00