Commit Graph

777 Commits

Author SHA1 Message Date
sjg
9bb1d7525f Update the modification date 2008-10-30 00:40:42 +00:00
sjg
b3afe166ae Add some examples of how to use :? 2008-10-29 23:30:08 +00:00
sjg
16d084a837 If Parse_Error is called after curFile is invalid, set it to a dummy
to avoid seg-fault.  Also the NULL filename will cause ParseVErrorInternal
to skip trying to report file and line number info.

If CondToken is called outside the context of a .if etc, variables in
the expression being parsed will already be expanded, so allow for
an unqouted number to jump us back into the compare logic.
This allows ${${SomeNumber:U42} > 0:?True:False} to work anywhere.

Job_Finish should process postCommands if it has commands or children.
2008-10-29 15:37:08 +00:00
apb
f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +00:00
apb
675ed64522 Send debugging output to stderr by default, not to stderr.
If you really want debugging to stdout, specify "-dFstdout"
in MAKEFLAGS or on the command line.

Discussed in tech-userlevel.
2008-10-22 15:04:49 +00:00
wiz
bcb1e574cb Add missing dot before macro. 2008-10-19 16:59:08 +00:00
apb
3bf9f42fd4 Always make the debugging output unbuffered; in addition, if debugging
is enabled but debugging output is not directed to stdout, then make
stdout line buffered.

Previously, the code to make debug output unbuffered applied only if
debugging to a file, not if debugging to stdout or stderr.  Making
stdout line buffered when debugging was suggested by Steven Bellovin.
2008-10-19 08:30:10 +00:00
apb
56ce706140 Document how "-dF[+]filename" works. 2008-10-18 14:36:40 +00:00
apb
1dd3e3655e Allow optional "+" in "-dF[+]filename" even if the filename is "stdout"
or "stderr".  Previously, the "+" was alowed only for real file names,
but it's easier to write the documentation if the "+" is always allowed.
2008-10-18 14:35:32 +00:00
joerg
bd681a4d7e Don't use emalloc and friends directly, but call them consistently
bmake_malloc and friends. Implement them via macros for the native case
and provide fallback implementations otherwise. Avoid polluting the
namespace by not defining enomem globally. Don't bother to provide
strdup and strndup, they were only used for the estrdup and estrndup
comapt code.

This addresses the presence of emalloc in system libraries on A/UX and
resulted strange issues as reported by Timothy E. Larson.
2008-10-06 22:09:21 +00:00
wiz
6ae5b86a80 Drop trailing whitespace. Use .Dq. 2008-08-10 23:25:50 +00:00
cube
dda0645b09 Clarify a bit .SUFFIXES and .IMPSRC. Should fix PR#37822. 2008-08-10 19:47:29 +00:00
joerg
f45c989c53 Micro-optimise VarQuote by exploiting that meta characters are normally
rare and skipping over normal characters with strcspn is therefore
faster. Further simplify logic by always setting newline and precompute
the size of the string.

OK christos@
2008-07-31 15:19:19 +00:00
joerg
2ad045d932 Meta characters are a constant, mark it so. 2008-07-31 14:59:39 +00:00
lukem
98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
christos
9f1edc04f7 PR/38840: Pierre Pronchery: make crashes while parsing long lines in Makefiles 2008-06-03 13:02:28 +00:00
christos
8567cf00de PR/38756: dominik: make dumps core on invalid makefile 2008-05-26 14:29:55 +00:00
sjg
f2c43a72d5 VAR_CMD context is used by conditionals and other purposes, so
actually set VAR_FROM_CMD when appropriate and only skip setting in
VAR_GLOBAL when that flag is set.
2008-05-15 21:05:54 +00:00
sjg
db7f6ac403 Disable this for now, VAR_CMD is abused for other purposes... 2008-05-15 18:25:12 +00:00
sjg
20275ee931 Do not set vars in VAR_GLOBAL context, if they have been set on the
command line.
Add a suitable unit-test.
2008-05-14 14:27:02 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sjg
98deadff04 If the name passed to Var_Exists contains '$' run it through Var_Subst. 2008-03-31 00:12:21 +00:00
christos
a686e4e754 back all changes out until I fix it properly. 2008-02-15 21:29:50 +00:00
christos
4b3df4502b Improve dh's fix:
- make sure i is initialized
	- don't subtract 1 in comparison, add 1 to the other side
2008-02-15 20:08:11 +00:00
dholland
cb84a8637d fix typo in comment 2008-02-15 09:18:56 +00:00
dholland
a9c8da72a1 Avoid SIGSEGV caused by signed/unsigned mismatch. (hi xtos) 2008-02-15 08:55:31 +00:00
christos
e654b454bc remove error/noerror const 2008-02-15 02:50:53 +00:00
christos
649f359b39 fix != expansion bug I introduced. 2008-02-15 02:38:07 +00:00
christos
4d9d6704c1 - symbolic names for error and no error
- more size_t
2008-02-15 02:37:51 +00:00
christos
2b28370627 - use pid_t/size_t as appropriate instead of int.
- use %ld to print pids.
- fix a bit of lint.
- WARNS=4
2008-02-14 22:11:20 +00:00
joerg
bcdbb8101f Print the complain about random stuff after empty only once. 2008-02-07 00:49:38 +00:00
joerg
c8bc46c4bc Warn for constructs like
.if empty xxx(foo)
which are interpreted as
.if empty(foo)
or
.if empty (foo)

This is based on rillig's commit to pkgsrc/devel/bmake, but doesn't warn
for the third case. Discussed with sjg.
2008-02-06 18:26:37 +00:00
joerg
a570300f03 Be pedantic and use unsigned int here as uwe@ suggested. 2008-02-05 16:39:26 +00:00
joerg
75ce084b15 Merge from pkgsrc's bmake: don't use signed short for bitfields.
This makes IBM xlc happy.
2008-02-05 15:11:50 +00:00
sjg
807aff24d0 Implement -dl (aka LOUD) to override '@' at the start of script lines.
Based on supplied patch.

PR: 37202
2008-01-19 06:52:13 +00:00
dsl
6a6b0fc96a When we extend the buffer used to read makefiles (in order to read lines
longer than 32k) remember the new length so we DTRT for lines longer than 64k.
Should fix PR/37684
2008-01-03 22:14:53 +00:00
dsl
2cdb58761e If make can't find a rule to create a file it needs to satisfy a rule
that came from .depend then just output a message and contine.
2007-12-21 20:32:24 +00:00
sjg
401ecd47f5 Allow .PATH<suffix> to be used for .include "". 2007-10-22 15:36:13 +00:00
sjg
1d55b1afc4 If we don't have emalloc, we won't have strndup either.
Allows building current make on 2.0.
2007-10-15 01:07:34 +00:00
apb
d15c1edea0 Make it easier for the build environment (such as a configure script)
to override the default shell:

* Rename _BASENAME_DEFSHELL to DEFSHELL_CUSTOM, because it's no longer
  always a basename, it might be a full path;
* Rename DEFSHELL to DEFSHELL_INDEX, because it's actually an index into
  an array;
* Provide symbolic names for the possible values if DEFSHELL_INDEX;
* Document how the build environment may set DEFSHELL_INDEX or
  DEFSHELL_CUSTOM to choose the default shell;
* Move the fallback definition of DEFSHELL_INDEX from config.h to job.c,
  because it's used only in job.c.

Discussed with sjg.
2007-10-14 20:22:53 +00:00
apb
ec2d191f5e Revert to revision 1.128. Now that the Var* functions no longer try to
write into const strings, it's safe to pass a truly constant string to
Var_Subst.
2007-10-13 20:01:33 +00:00
apb
7da86686ca Don't write into const strings; not even if we intend to
reinstate the original contents later.
2007-10-13 19:59:52 +00:00
christos
a59b81d6d8 strlen returns size_t 2007-10-13 18:28:35 +00:00
apb
67bb324312 * Convert all uses of strdup() to estrdup();
* Use estrndup() in a few cases where it simplifies the code;
* Provide compatibility definitions of strndup and estrndup;
2007-10-13 16:16:41 +00:00
apb
781e1efd0c Oops, missed a few more comments in previous. 2007-10-13 14:32:18 +00:00
apb
a8bf2a2f8a Correct documentation for Var_Parse's freePtr arg. It's a pointer to
the thing to be freed (or NULL if nothing to free), not to a pointer to
boolean saying whether or not to free the result.
2007-10-13 13:54:06 +00:00
dsl
5dc59d0d4b When processing .include "../../foo.mk" lexically process the leading ../
against the directory name of the makefile being processed.
Shortens a lot of pathnames (especially in pkgsrc) and significantly
reduces the number of duplicate entries in .MAKE.MAKEFILES
2007-10-13 11:08:05 +00:00
dsl
5651920158 The 'job_prefix' string can be static but not const 'hi xtos'. 2007-10-13 08:58:48 +00:00
dsl
fad077a68d If we are going to save the names of all opened makefiles, do so when files
are first processed, not for every line of every loop inside the file.
When (attempting) to check for duplicate names, use the spaces between names
as separators rather than using strstr() - which is slow and wont find
duplicates after an incorect early match.
However the duplicate check is rather broken (especially for pkgsrc) where
names like ../../devel/atk/../../devel/glib2/../../devel/gettext-lib/ \
../../devel/gettext-lib/../../mk/buildlink3/../../mk/bsd.prefs.mk
which need (some form of) realpath() processing.
'cd pkgsrc/xaa/gtk2; make show-var VARNAME=.MAKE.MAKEFILES' shows the problem.
2007-10-12 23:38:27 +00:00
christos
0f19d8c420 static a const string. 2007-10-12 23:13:16 +00:00