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.
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
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.
The issue seems to have been present for some time, only showed up
when running unit-tests on SunOS.
Make sure we get an error message, but otherwise behave as before.
dependency line.
This makes the line "foo:;echo bar" not try to execute "cho bar", and the
line "baz:;" not treat the rest of the makefile as commands.
Pointed out by Takahiro Kambe on current-users.
and also include files don't have mismatched .if/.endif
It has been suggested that make used to have this test, but I can't
remember removing any code that might have performed it.
Instead of copying the file byte by byte into an expanding line buffer, just
scan the file buffer for (unescaped) newlines.
Escaped newlines (etc) are processed by modifying the file buffer later.
Speeds up 'nbmake obj' by a factor of 2.
I suspect it will do wonders for parts of pkgsrc as well, since it largely
eliminates cpu cycles from the false part of .ifs.
Commons up the code for reading files and buffers, and allows a further
change where we don't copy the data out of the buffer when generating 'lines.
This will speed up makefile parsing (esp .if clauses).
ParseTraditionalInclude() into a separate routine.
Fix the 'use after free' and 'free on item not malloced' that got added
to ParseTraditionalInclude() in Feb 2006 (rev 1.111).
Kill the 'PTR' struct and put both its members into IFile.
Remove the parameter from ParseEOF(), 1 of the 3 calls passed the wrong value!
Fortunately another test stopped anything nasty happening, we'll use that
test instead.