Commit graph

126 commits

Author SHA1 Message Date
Paul Smith
0205d3d08c [SV 45049] Check for '$' being the last character in a string.
* expand.c (variable_expand_string): Add a single '$' if '$' ends the
string.
* read.c (find_char_unquote, get_next_mword): Stop if '$' ends the
string.
* variable.c (parse_variable_definition): Ditto.
2015-07-12 13:25:16 -04:00
John Malmberg
e4ac28e830 Fix bs-nl handling, exit and Environment for VMS.
This fix required a complete rewrite of the command parser vmsjobs.c
child_execute_job.  The old parser had too many incorrect assumptions
about DCL commands and could not be repaired to extended.

The parser now more closely parses VMS commands and handles quoted
commands and redirection.  Command File mode has been improved, but can
not fully support bs-nl syntax.

VMS Unix shell simulation has been improved.

* commands.c: vms_comma_separator is now a run-time setting.
* function.c: vms_comma_separator is now a run-time setting.
* function.c(func_basename_dir) now reports "[]" or "./" based on
  VMS crtl runtime setting.
* job.c(start_job_command): VMS Handle empty commands propery.
* main.c: Add VMS environment variables for run-time settings.
  * vms_legacy_behavior - Force older behavior.
  * vms_comma_separator - Commas or spaces for separators.
  * vms_unix_simulation - Enhanced Posix shell simulation features.
  * Detect if VMS CRTL is set to report Unix paths instead of VMS.
  * ':' and '>' are also MAP_DIRSEP on VMS.
* makeint.h: Add VMS run-time option variables.
* readme.vms: Update to current behavior.
* variable.c(define_variable_in_set): Fix VMS Environment variable
  lookup.
* variable.c(define_automatic_variables): Remove some VMS specific
  automatic variables and use the Unix ones instead.
* vms_export_symbol.c: Set max symbol size correctly.
* vmsjobs.c: child_execute_job() complete rewrite of VMS comand
  parsing.
* vmsjobs.c(build_vms_cmd): VMS commmand building with shell simulation.

Signed-off-by: Paul Smith <psmith@gnu.org>
2015-01-27 21:43:16 -05:00
Paul Smith
0a3a0756b9 Update Copyright statements for 2014. 2014-09-30 09:32:42 -04:00
Paul Smith
423c3955d9 * various: Assume ISO C89-compliant free() implementation. 2014-07-07 01:59:03 -04:00
Paul Smith
ac67346d0f * maintMakefile, various: Improve constification of the codebase. 2014-07-07 01:59:03 -04:00
Paul Smith
757849cd93 [SV 40361] Don't use vsnprintf(), which is an ISO C99 function.
* output.c (error, fatal, message): Take an extra argument specifying
how many bytes are used by the formatted arguments.
(get_buffer): New function that allocates the requested buffer size.
Remove msc_vsnprintf(), vfmtconcat(), and fmtconcat() as unneeded.
* makeint.h: Declare various helper macros for generating output.
* *.c: Change all error(), fatal(), message() calls to use the macros,
or pass the extra length argument directly.
2013-11-23 22:23:52 -05:00
Paul Smith
1a991ada47 Add VMS port updates from Hartmut Becker. 2013-09-22 17:10:34 -04:00
Paul Smith
cc85b927cd Create a character map to use for locating stop-points in strings.
In various places we were passing flags and characters to compare, then
using complex conditionals to see where to stop in string searches.
Performance numbers reveal that we were spending as much as 23% of our
processing time in these functions, most of it in the comparison lines.
Instead create a character map and use a single bitwise comparison to
determine if this is any one of the stop characters.
2013-06-22 00:22:08 -04:00
Paul Smith
ef11217de7 Create a new variable MAKE_HOST providing the host architecture. 2013-05-27 13:52:08 -04:00
Paul Smith
96cf67bd29 Update source file format: remove TABs, use GNU coding styles. 2013-05-17 02:29:46 -04:00
Paul Smith
5370238316 Update copyright for changes in 2013. 2013-05-17 01:47:42 -04:00
Paul Smith
58dae24352 [Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile.
If -R is set in the makefile and not the command line, then go through all the
default variables and undefine them.  If -r is set in the makefile and not in
the command line, then remove all .SUFFIX prefixes (unless the user set it)
and SUFFIX variable setting.  In -p mode don't print builtins.
2013-05-13 04:30:20 -04:00
Paul Smith
51fb930ef2 Rename struct floc to typedef gmk_floc as an externally scoped symbol. 2013-01-20 13:16:46 -05:00
Paul Smith
a45f25ece3 Rename the make.h file to makeint.h for internal use only. 2013-01-20 11:33:20 -05:00
Paul Smith
adb50bd4c9 Simplify copyrights using ranges of years.
The new GNU Maintainer's Manual allows the use of year ranges in certain
situations; take advantage of this simplification.
2012-03-05 14:10:39 +00:00
Paul Smith
23c2b99e9d Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.
Fixes Savannah bug #34530.
2012-03-04 00:24:20 +00:00
Paul Smith
ef6461611b Add support for "::=" simple assignment operator.
The next POSIX standard will define "::=" to have the same behavior
as GNU make's ":=", so add support for this new operator.
2012-01-30 00:21:57 +00:00
Paul Smith
3f6bb04e75 Update copyright notices. 2012-01-16 02:29:20 +00:00
Paul Smith
b34438bee8 Add new feature: != shell assignment for portability with BSD make.
Feature submitted by David Wheeler.
2011-04-18 01:25:20 +00:00
Paul Smith
391456aad7 Improve backslash/newline handling to adhere to POSIX requirements. 2010-11-06 21:56:23 +00:00
Eli Zaretskii
c3188c6f31 variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]:
Remove trailing backslashes in $(@D), $(<D), etc., for consistency
 with forward slashes.  Fixes Savannah bug #30795.
2010-08-27 15:01:42 +00:00
Paul Smith
9903cda2a7 Update copyrights for 2010. 2010-07-13 01:20:10 +00:00
Paul Smith
5f188b39a4 Update copyright years. 2009-10-25 18:56:44 +00:00
Paul Smith
606cf9b169 Various simple code cleanups. 2009-10-25 00:26:34 +00:00
Boris Kolpackov
4254e88cfa Implement the new undefine directive. 2009-10-06 06:56:57 +00:00
Boris Kolpackov
f5891a26d8 Implement the shortest stem first search order for pattern-specific variables and pattern rules. 2009-09-28 12:31:55 +00:00
Paul Smith
8f30b68871 - Add xcalloc() and call it
- Fix memory errors found by valgrind
- Remove multi_glob() and empower parse_file_seq() to do its job:
  the goal here is to remove the confusing reverse/re-reverse we do on
  the file lists: needed for future fixes.
- Add a prefix arg to parse_file_seq()
- Make concat() variadic so it can take arbitrary #'s of strings
2009-09-16 17:07:01 +00:00
Paul Smith
7deb42aafd - Fix Savannah bug #27093
- Fix Savannah bug #27143
- Fix Savannah bug #23960
- Fix Savannah bug #27148
2009-08-02 16:05:42 +00:00
Paul Smith
5b4d419476 Add 'private' variable modifier, feature submitted by Ramon Garcia.
Rework the parser for variables to allow multiple modifiers and also
allow for variables and targets with modifier names, like "export" and
"private".
2009-05-26 01:31:40 +00:00
Paul Smith
14f3f501bc Found this change in an old CVS workspace: rewrite savestring() to the
more standard xstrndup().
2009-05-24 18:31:18 +00:00
Eli Zaretskii
8d5b3d4298 (target_environment): Don't use shell_var if its `value' field is NULL. 2008-01-26 13:51:14 +00:00
Eli Zaretskii
91b016c414 configh.dos.template [__DJGPP__]: Replace HAVE_SYS_SIGLIST with
HAVE_DECL_SYS_SIGLIST.

job.c (child_execute_job): Remove __MSDOS__ because MSDOS/DJGPP build does
not use child_execute_job.

variable.c (define_automatic_variables) [__MSDOS__]: Always export the SHELL
environment variable to the child.
2007-12-22 11:27:02 +00:00
Paul Smith
43d81ff866 New special variable: .RECIPEPREFIX
Allows the user to reset the prefix character for introducing recipe lines
from the default (tab) to any other single character, and back again.
Also, reworked the manual to consistently use the word "recipe" to describe
the set of commands we use to update a target, instead of the various
phrases used in the past: "commands", "command lines", "command scripts",
etc.
2007-11-04 21:54:00 +00:00
Paul Smith
0b17d143ba Windows: allow SHELL to be set to a more complex value by checking its
expansion to see if it's a valid shell, not just the unexpanded value.
2007-10-13 14:46:04 +00:00
Paul Smith
891ebd4d97 * Update to GPLv3
* Update copyright to 2007
* Fix download URL for translation files (thanks to Thiemo Seufer)
2007-07-04 19:35:15 +00:00
Paul Smith
6ccf33cdbd This is a major update, which switches virtually every allocated-but-not-freed
string into the strcache.  As a side-effect, many more structure members and
function arguments can/should be declared const.

As mentioned in the changelog, unfortunately measurement shows that this
change does not yet reduce memory.  The problem is with secondary expansion:
because of this we store all the prerequisites in the string cache twice.
First we store the prerequisite string after initial expansion but before
secondary expansion, then we store each individual file after secondary
expansion and expand_deps().  I plan to change expand_deps() to be callable
in either context (eval or snap_deps) then have non-second-expansion
targets call expand_deps() during eval, so that we only need to store that
dependency list once.
2007-03-20 03:02:26 +00:00
Paul Smith
e4da308580 Fix from Eli for incorrect value of $(MAKE) on Cygwin.
A few changes from char* to void* where appropriate, and removing of
unnecessary casts.

Much more work on const-ifying the codebase.  This round involves some code
changes to make it correct.  NOTE!!  There will almost certainly be problems
on the non-POSIX ports that will need to be addressed after the const changes
are finished: they will need to be const-ified properly and there may need to
be some changes to allocate memory, etc. as well.

The next (last?) big push for this, still to come, is const-ifying the
filenames in struct file, struct dep, etc.  This will allow us to store file
names in the string cache and finally resolve Savannah bug #15182 (make uses
too much memory), among other advantages.
2006-11-18 20:53:44 +00:00
Paul Smith
7595f38f62 Fixed a number of documentation bugs, plus some build/install issues:
16304, 16468, 16577, 17701, 17880, 16051, 16652, 16698
Plus some from the mailing list.

Imported a patch from Eli to allow Cygwin builds to support DOS-style
pathnames.
2006-10-01 05:38:38 +00:00
Paul Smith
c25294ad3b Another round of cleanups:
- Add more warnings.
- Rename variables that mask out-scope vars with the same name.
- Remove all casts of return values from xmalloc, xrealloc, and alloca.
- Remove casts of the first argument to xrealloc.
- Convert all bcopy/bzero/bcmp invocations to use memcp/memmove/memset/memcmp.
2006-04-09 22:09:24 +00:00
Paul Smith
afc4906aca Some test updates for Windows.
Handle SHELL set on the command line properly for windows.
2006-03-08 20:15:08 +00:00
Paul Smith
8af9389f87 Fix a potential core dump when merging aliases. Might fix bug #15818.
Revert intermediate file free code.
Suppress some warnings in VMS builds.
2006-02-21 05:21:19 +00:00
Paul Smith
bde826b18a Make sure we don't introduce a circularity into the variable set linked
list.  Fixes Savannah bug #15757.
2006-02-17 13:29:52 +00:00
Paul Smith
86af3872a9 Some memory leak cleanups (found with valgrind). 2006-02-14 15:42:17 +00:00
Paul Smith
a6bdc58385 Last of the copyright updates. 2006-02-11 22:16:04 +00:00
Paul Smith
586daef9bc Update copyright and license notices on all files.
Added new file strcache.c to various non-UNIX makefiles and build scripts.
2006-02-11 19:02:21 +00:00
Paul Smith
66459baee2 Make sure to assign a boolean value to a 1-bit bitfield. Reported on
the bug-make mailing list.

Fix Savannah bug # 14527: remember to free temporary line constructor
memory if the line is empty.
2005-09-26 05:16:31 +00:00
Paul Smith
dd30b0552f Fix Savannah bug #11913: ensure that scopes such as foreach, etc. take
precedence over the global scope when they're used in a global context
(such as an eval).
2005-06-09 19:19:20 +00:00
Paul Smith
3daf8df6ee Fix some Savannah bugs.
Updates to docs (still need more work here) and NEWS file.
New language.
2005-04-08 12:51:20 +00:00
Paul Smith
d2516343bc * New feature: -L option
* New function: $(info ...)
* Disallow $(eval ...) to create prereq relationships inside command scripts
  (caused core dumps)
* Try to allow more tests to succeed in Windows/DOS by sanitizing CRLF and \
* Various bug fixes and code cleanups (see the ChangeLog entry)
2005-02-28 07:48:22 +00:00
Paul Smith
6c21790595 Fix bug with SHELL handling: make sure the variable struct is initialized. 2004-12-05 18:09:31 +00:00