Commit Graph

755 Commits

Author SHA1 Message Date
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
christos 31bed26f71 improve on previous 2007-10-12 23:07:04 +00:00
dsl bb4beef604 Var_Subst() seems to write into its input string! So we do need a copy. 2007-10-12 22:49:36 +00:00
dsl 215593ad6c Remove tmp[] buffer and strncpy() call. 2007-10-12 21:47:25 +00:00
sjg 1050c04a22 If _BASENAME_DEFSHELL is defined, it might be a full path,
in which case we should not prepend _PATH_DEFSHELLDIR.
2007-10-11 21:19:28 +00:00
sjg 3a5409e4eb Fix an off-by-one error in handing mal-formed modifiers.
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.
2007-10-09 05:55:03 +00:00
sjg e73405e272 Use .MAKE.MAKEFILES to track all the makefiles that have been read
so they can be used in dependency rules.
2007-10-08 20:26:36 +00:00
sjg f28827375c Add the ability to .export variables to the environment. 2007-10-05 15:27:45 +00:00
sjg 216e9ba475 Add the ability to tweak the token output before targets in job mode.
Eg.
.MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
would produce
---make[1234] target ---
2007-10-01 22:14:09 +00:00
uwe 7a8181d0dc Revert 1.34 (CFLAGS+=-g) that have been commited by mistake (hi, xtos). 2007-09-25 21:28:26 +00:00
rillig 3911c95333 A small word can sometimes express things clearer ... 2007-08-13 06:14:08 +00:00
dsl 53bf780833 Under DEBUG(VAR) report when the variable wasn't found.
Disposes of pr bin/15842
2007-06-16 19:47:29 +00:00
dsl 1752887780 Delete some comments that refer to long-extinct code. 2007-05-23 19:03:56 +00:00
christos fc1f18e6ca kill clobbered warning from Tobias Nygren 2007-04-05 14:11:35 +00:00
dsl 69a5cd957a Don't increment 'cp' twice when looking for commands following ';' on a
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.
2007-02-24 17:55:54 +00:00
dsl 8732462d65 Add code to ensure that .if/.endif are correctly nested with .for/.endfor
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.
2007-02-04 19:23:49 +00:00
dsl 9ac7863b40 Check of open conditionals before we trash 'curFile' - so we can actually
report the filename of the error (without core dumping!).
Also fix tests for reporting errors to the debug_file, and don't add $PWD
to (stdin).
2007-01-24 21:43:01 +00:00
wiz 6aacb705f6 4 -> 4.0, since Nx does not accept all arguments without complaint. 2007-01-23 22:23:48 +00:00
dsl bbdea71364 Don't delete '\' from before '#' in shell command lines.
Probably fixes build of pkgsrc:editors/xemacs.
Pointed out by Richard Earnshaw.
2007-01-18 20:22:44 +00:00
hubertf 48b31403c5 Remove duplicate #includes
From Slava Semushin <slava.semushin@gmail.com>, via private mail
2007-01-17 00:21:43 +00:00
christos 66fbdf9319 Avoid coredumping. Found by accidentally running make instead of gmake
in java's control/make directory.
2007-01-15 01:26:32 +00:00
dsl 8a7693fba6 Don't delete whitespace before a "\\\n" sequence. Somewhere I'd misread
the required behaviour and replaced it with something more sensible - except
for makefiles that contain "\n\t\\\n shell command"...
2007-01-02 23:22:37 +00:00
dsl 8b25f96e43 Remove the (now redundant) MAKE_BSIZE, BUF_DEF_SIZE from buf.c is used instead. 2007-01-01 21:48:43 +00:00