christos
689b483c53
put a note on what FRC means.
2013-05-22 19:30:35 +00:00
sjg
2987902a0c
We cannot skip all Suff processing for .PHONY targets,
...
else, srcs which are wildcards do not get expanded as needed.
2013-05-18 13:13:34 +00:00
sjg
aea6f93e2d
Var_Delete: expand name if needed.
2013-05-18 13:12:45 +00:00
sjg
5410a37e87
New compiler doesn't like foo()
2013-05-16 21:56:56 +00:00
sjg
e570fc4070
Refine the effect of .OODATE on command comparison.
...
Rather than apply it to the whole script, just the current command line
is affected. This allows a trick like ${.OODATE:M.NOMETA_CMP}
to cause command comparison to be supressed for one command only.
2013-03-31 05:49:51 +00:00
sjg
dd4c105ae6
After removing an entry from missingFiles,
...
set ln=NULL after Lst_Remove() to make it clear we won't use it
after this point.
2013-03-23 23:39:47 +00:00
sjg
03ce90ebea
If built with filemon support, set .MAKE.PATH_FILEMON to _PATH_FILEMON
...
so that makefiles can test for it.
2013-03-23 05:31:29 +00:00
sjg
a577c98aa7
Add unit-test for export-env and gmake export
2013-03-22 16:36:46 +00:00
sjg
cb29a22065
ParseGmakeExport: terminate variable at '=', or setenv(3) will fail
...
on some systems.
2013-03-22 16:07:59 +00:00
christos
ed82ee44b4
Add a .STALE special target that gets invoked when dependency files contain
...
stail entries.
2013-03-05 22:01:43 +00:00
christos
a11ae36917
Keep track of the location where a dependency is defined, so we can report
...
about it.
2013-03-05 02:04:10 +00:00
christos
9208117e65
PR/45042: Thomas Cort: HAVE_foo for setrlimit(2) and setpgid(2)
2013-02-26 00:45:27 +00:00
dholland
21fc2b5d09
Fix obvious typo.
2013-02-25 01:57:14 +00:00
dholland
b3e2273034
typo in comment
2013-02-25 00:15:09 +00:00
christos
34b0d22580
While it is nice to have the same function do both the upper case and
...
lower case conversion, it ends up eating 4% of the total time we spend
in make calling tolower() while building libc.
2013-02-24 19:43:37 +00:00
christos
051dc4b05d
we need utsname all the time.
2013-02-16 02:39:27 +00:00
christos
3241ce1c02
Set .MAKE.OS to utsname.sysname so we can tell bogus OS's apart early in
...
the build process.
2013-02-16 02:11:11 +00:00
christos
c5e748dd3a
fix broken logic:
...
- poll can return EINTR, it is not restartable like read/write
- check poll return
- it does not make sense to check readyfd() is nready < 0
- check read return
- always call Job_CatchChildren, it is harmless
- short circuit scanning of the poll array if we got all the ready descriptors
2013-02-06 16:36:01 +00:00
christos
0b10d223d4
tools build is non-c-99
2013-02-02 15:24:08 +00:00
christos
74d93a2aa9
avoid the long shadow of i
2013-02-02 15:12:25 +00:00
christos
4b11b0a47f
Don't wait forever for output from a child job.
2013-02-02 15:11:48 +00:00
sjg
bd0907ac07
In SHELL COMMANDS section, provide some clues about different
...
behavior in jobs vs non-jobs mode.
Move the comment about when shell is skipped to this discussion
from COMPATABILITY.
Remove the incorrect statement about default mode being somehow
neither jobs mode or compat mode (it is compat mode).
2013-01-27 18:52:01 +00:00
christos
54e31e2d33
Check read and write errors to avoid warnings from linux.
...
XXX: Should we print an error and exit instead?
2013-01-26 15:52:59 +00:00
sjg
7a08ea2711
Remove Check_Cwd - it is no longer needed.
2013-01-25 02:01:10 +00:00
sjg
2a4896f81a
meta_oodate: rename ignoreOODATE to needOODATE.
...
if target uses ${.OODATE} in its script;
1. we canno compare commands
2. if we decide it is out-of-date .OODATE must not be empty.
The only option is to set it to .ALLSRC
2013-01-19 04:23:37 +00:00
christos
7e4ddd095e
include the variable name in debugging printfs.
2012-11-15 16:42:26 +00:00
sjg
15b27c94a1
Add a unit-test for .ORDER
2012-11-09 19:08:28 +00:00
sjg
d6f9abca71
Do not stop looking for children, just because one has a .ORDER dependency.
2012-11-09 18:53:05 +00:00
christos
2ce34034e0
off-by-one
2012-11-03 13:59:27 +00:00
pgoyette
4d44b16846
Fix build break due to signed/unsigned comparison
2012-11-03 04:51:17 +00:00
sjg
484532a973
Allow cond_state[] to grow.
...
The need is rare, but real.
Reviewed by: christos
2012-11-03 02:25:13 +00:00
christos
4f166942a1
It is Sprite, not Sprint; pointed out by Todd Miller.
2012-10-08 15:09:48 +00:00
sjg
0afab3de7c
Treat empty commands same as jobs mode
2012-10-07 19:17:31 +00:00
christos
6010f05a86
spelling
2012-09-17 02:10:46 +00:00
sjg
cf6e63e419
Document the fact that lack of shell meta chars in a command
...
results in direct exec in compat mode.
2012-09-17 01:23:45 +00:00
sjg
ea86d17992
Cast sizeof() to int, which is sufficent and consistent with other use
...
within make.
2012-08-31 07:00:36 +00:00
pgoyette
4e59942717
Cast sizeof() to (ssize_t) to avoid build errors.
2012-08-31 02:59:37 +00:00
wiz
d5a95690ed
Add an s.
2012-08-30 22:35:37 +00:00
sjg
aede2a76f4
Add a knob to control whether -V fully expands a plain variable by default.
...
The default retains the traditional NetBSD behavior, but the knob
can be set so that FreeBSD can retain their expected behavior.
This is a compromise to be sure.
Add a debug flag -dV to override the above, so that regardless of
the knob setting, the raw value of a variable can be easily seen.
2012-08-30 22:09:58 +00:00
sjg
170700dd50
Add a knob to control whether -V fully expands a plain variable by default.
...
The default retains the traditional NetBSD behavior, but the knob
can be set so that FreeBSD can retain their expected behavior.
This is a compromise to be sure.
Add a debug flag -dV to override the above, so that regardless of
the knob setting, the raw value of a variable can be easily seen.
2012-08-30 21:17:05 +00:00
sjg
645c5e28e0
An X!= command, can cause Shell_Init() to be called before Job_ParseShell().
...
Job_ParseShell() should call Shell_Init() again if needed
to ensure shellPath is correct.
2012-07-03 21:03:40 +00:00
sjg
7f9f018fd1
gcc 4.2 doesn't like externs inside functions
2012-06-27 17:22:58 +00:00
sjg
e47157f5d2
Do not include make_malloc.h or declare progname,
...
both are already done in make.h
2012-06-20 17:46:28 +00:00
sjg
d912c0b39e
Add unit-tests for .for
2012-06-19 23:25:53 +00:00
joerg
b1e1b1d4c2
Replace __dead, __unused and the various printf format attributes
...
with versions prefixed by MAKE_ATTR_* to avoid modifying the
implementation namespace. Make sure they are available in all places
using nonints.h to fix bootstrap on Linux.
2012-06-12 19:21:50 +00:00
wiz
8e7413b140
Declare enomem __dead for clang.
2012-06-10 21:44:12 +00:00
wiz
459b76f867
Remove a __dead for an undead function (clang errors out otherwise).
2012-06-10 21:44:01 +00:00
sjg
d8f6b5d3a6
kill(2) is more appropriate and more portable than raise(3)
2012-06-05 17:31:04 +00:00
sjg
b711398c86
Re-raising SIGINT etc, after running .INTERRUPT
...
provides much more reliable shutdown on some systems.
Based on CompatInterrupt in FreeBSD's make.
2012-06-05 06:11:51 +00:00
sjg
5408a8dad9
Fix findenv() to fully match name
2012-06-04 22:45:05 +00:00
sjg
8d38755103
Var_UnExport() and setenv() can both realloc environ.
...
Use a common variable (savedEnv) to track that to avoid wasting memory.
Also, if providing setenv and unsetenv, do getenv too to ensure a consistent
set.
2012-06-04 20:34:20 +00:00
sjg
81320ffe8e
Handle "quoted strings" as items in a .for list
2012-06-03 04:29:40 +00:00
sjg
4c3de88126
Don't pass debug flags etc. to unit-tests
2012-05-30 21:54:23 +00:00
sjg
b420f1eb56
An empty command is quietly ignored in jobs mode, but causes a failure
...
in compat mode. Just skip it.
2012-05-30 21:42:04 +00:00
sjg
26b0dda80a
In meta mode, level 0 can legitimately see > 64 nested .if's
2012-05-21 06:30:02 +00:00
sjg
35fdcec3af
Avoid nested extern declaration warnings
2012-05-18 02:28:16 +00:00
seanb
90cfd29599
- Use _exit() instead of exit() in signal handler since
...
the latter isn't signal safe.
2012-05-15 17:51:51 +00:00
christos
8a981eca3c
Don't use the cache when building nodes that might have changed since the
...
last exec.
2012-05-10 19:53:26 +00:00
sjg
f3251c8ae2
Fix handling of -dF+/tmp/file
2012-04-24 20:35:04 +00:00
sjg
26aa697a51
Var* are generally very liberal with memory, with the expectation
...
that none of it persists for long.
This isn't always true - for example a long running .for loop.
Buf_DestroyCompact() is used by Var_Subst(), rather than Buf_Destroy().
If it looks like we can save BUF_COMPACT_LIMIT (128) or more bytes,
call realloc. This can reduce memory consumption by about 20%
Setting BUF_COMPACT_LIMIT to 0 dissables this.
2012-04-24 20:26:58 +00:00
sjg
845789be8d
Restore previous behavior - supressing duplicate entries in
...
.MAKE.MAKEFILES - it is more efficient.
2012-04-24 20:12:16 +00:00
sjg
7a49f6a73f
Fix some typos in/around ParseGmakeExport.
...
Remove the suppresssion of duplicate entries in .MAKE.MAKEFILES
2012-04-20 05:33:41 +00:00
wiz
1ac719d147
Remove unnecessary Bk/Ek pairs from SYNOPSIS.
...
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
christos
687e469719
Remove recheck hackery that caused extra stats, and explicitly ask for
...
recheck when needed. Before it used to be the case that we could only
use the cached entry once. Once the cached entry was used, we removed
it from the cache. Now it is kept forever.
2012-04-07 18:29:08 +00:00
christos
f8c8cd087a
document gmake export command
2012-03-31 14:46:16 +00:00
christos
3ba1aa3bc8
Add a gmake inspired export command
2012-03-31 00:12:24 +00:00
sjg
006e190034
Avoid the need to escape the # in :[#] when parsing conditionals.
2012-03-24 20:28:41 +00:00
dholland
62244ded10
Note in comment that Str_Match() does not detect or report invalid
...
patterns. This is not critical, since for the moment both possible
cases (unclosed [], and \ at the end of the string) are handled more
or less sanely.
2012-03-03 23:16:47 +00:00
sjg
367aa166aa
Fix description of 'silent' in .MAKE.MODE
...
Also document 'env' in that context.
2012-02-03 21:39:25 +00:00
sjg
25e3dfbf18
Mention limits of :P
2011-12-23 05:01:59 +00:00
sjg
3a4494dc38
The :@ example gives the impression that we encourage the ODE
...
convention of naming loop variables like .LINK., when in fact
single char variables are far more common in NetBSD.
2011-12-17 04:43:45 +00:00
dholland
9851fd89b4
Fix xref to the PSD; PR 45568 from Petri Laakso.
2011-11-13 18:18:35 +00:00
christos
e8514ab687
explain how to use .PARSEDIR and .PARSEFILE
2011-11-06 19:50:46 +00:00
christos
f0528cf595
add debugging for parsedir and parsefile
2011-11-06 19:46:56 +00:00
sjg
123e6558cd
Make sure .PHONY targets get .TARGET set.
...
This wasn't happening when a dependency of .END.
Set .PREFIX too and add a unit-test.
PR: 43534
2011-09-29 23:38:04 +00:00
christos
6f2c981e29
PR/45383: Henning Petersen: Swapped lseek args
2011-09-21 14:30:47 +00:00
joerg
84700a0331
Use __dead consistently. If it doesn't exist, define it away.
2011-09-16 15:38:03 +00:00
sjg
b79c6e0ff9
meta_oodate should ignore makeDependfile
2011-09-02 16:26:21 +00:00
plunky
9f61b80465
NULL does not need a cast
2011-08-31 16:24:54 +00:00
sjg
09fee58e88
In meta mode, we create .meta files for most targets.
...
These capture all the interesting data - useful for debugging.
In such cases there is no need to replicate commands in the build log.
Rather than run the entire build .SILENT, allow meta mode to set that flag
per target iff a .meta file is created.
Normal behavior is retained for targets where no .meta file is created,
ensuring that no build data is lost.
2011-08-28 03:54:07 +00:00
sjg
daf6508d3f
Make some dashes em-dashes (based on patch from Andrew O. Shadoura).
...
Note behavior of .META flag wrt out-of-date.
2011-08-18 15:36:51 +00:00
sjg
4f95291ad9
Fix formatting of Notes to work with groff.
...
Patch from Andrew O. Shadoura.
2011-08-18 15:19:30 +00:00
sjg
bbf6dc9998
If a target is explicitly flagged .META,
...
a missing .meta file means it is out-of-date.
2011-08-18 00:00:21 +00:00
christos
ccb821a2ac
- remove gcc-4.5 warnings
...
- simplify job printing code
- document non-literal format strings
2011-08-14 13:06:09 +00:00
christos
3edabd2e8e
Don't attempt to touch special targets; make -t would create .END in every
...
directory.
2011-08-01 02:13:21 +00:00
wiz
4cbd24b23f
dependant -> dependent
2011-06-30 20:09:15 +00:00
sjg
ebe0193f6c
After each strsep(&p) check that p is valid.
...
If not the .meta file is corrupted (build interrupted?)
issue a warning and declare target oodate.
2011-06-22 21:13:12 +00:00
mrg
c111245a78
apply some -Wno-error and/or -fno-strict-aliasing.
...
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
sjg
0277db2f8c
Use %zu rather than cast
2011-06-11 02:10:48 +00:00
sjg
af8b888000
size_t on amd64 doesn't like %u, use a cast.
2011-06-10 23:57:39 +00:00
sjg
873dae776d
Some systems (eg. MirBSD) use a ksh, with an echo which cannot
...
be used for things containing \x: etc.
Check for print or printf as builtin and use if available.
Note that a builtin will fail, if make decides a shell is not needed.
2011-06-07 00:10:20 +00:00
sjg
43c87c739c
ApplyModifiers: if we parse a variable in the modifier list,
...
do not consider it a nested modifier set, unless it is followed by
endc, a ':' or end of string.
2011-06-03 21:10:42 +00:00
cheusov
a541b13903
fix bug in section .ORDER of make.1
2011-05-28 21:53:54 +00:00
tsutsui
56683e6b6e
Explicitly #include <time.h> for time(3) and strftime(3).
...
Fixes warnings on some non NetBSD hosts.
2011-05-21 07:30:42 +00:00
dsl
cf5ef24619
Back out a local change
2011-05-18 06:36:48 +00:00
dsl
c5191c6734
If a makefile if a multiple of the page size and doesn't end with a
...
newline, then it all goes horribly wrong when make tries to terminate
the last input line.
This was all ok before the mmap changes (rev 1.169) because the last
32 bytes of the input buffer were never read into.
The non-mmap case has a similar problem.
Bug found because my .depend files don't have a newline at the end of
the .OPTIO|NAL line (don't know if that is a local change).
2011-05-17 21:56:51 +00:00
wiz
9e66d3e091
Remove trailing whitespace.
2011-05-04 21:24:59 +00:00
christos
fc29dd21ad
Document what I wrote for PR/40115
2011-05-04 21:14:56 +00:00
sjg
48587910e0
Add .MAKE.META.BAILIWICK - to identify the scope of make's control.
...
meta_oodate: if a file that was written or linked within our bailiwick,
but outside of .OBJDIR is missing, add it to missingFiles.
If we get to the end of the .meta file without seeing it [re]moved,
then consider the target out-of-date.
2011-05-04 20:38:31 +00:00
sjg
2ac5d52245
Add a test case for sysV modifier subst
2011-04-11 15:10:15 +00:00