Compare commits

...

3168 Commits

Author SHA1 Message Date
Paul Smith
d523661ce2 [SV 66499] Detect jobserver values that are too large
Set the jobserver pipe to non-blocking before writing tokens; if a
token write fails the user's jobserver value is too large so fail.

Original implementation: Dmitry Goncharov <dgoncharov@users.sf.net>

* src/posixos.c (set_blocking): Split into force_blocking() which
always enables/disables blocking; set_blocking() may call it.
(jobserver_setup): Set the write side of the pipe to non-blocking
before writing tokens.  If it fails with EAGAIN we know the pipe
is full: create a fatal error.
* tests/scripts/features/jobserver: Test a too-large jobserver.
2024-12-08 23:30:37 -05:00
Paul Smith
f12a4fddce jobserver: Ensure the named pipe is deleted on error
Make sure the jobserver named pipe is deleted even if the
jobserver_setup() function calls fatal() and exits early.

* src/main.c (clean_jobserver): Always reset_jobserver().
* src/posixos.c (jobserver_setup): Set job_root up front.
* tests/test_driver.pl: Print out the logfile pathname on error.
For tests with regex matches this might be the only file available.
Don't print the base filename unless one is created.
2024-12-08 23:30:37 -05:00
Paul Smith
186522e480 * doc/make.texi: [SV 66324] Fix a typo 2024-12-08 23:30:00 -05:00
Dmitry Goncharov
aa8626ce09 [SV 66273] Double-colon targets must not be intermediate
An explicitly mentioned double-colon target cannot be intermediate.

* src/read.c (record_files): Set file->is_explicit in the case of an
explicitly mentioned file built by a double colon rule.
* src/file.c (print_file): Have print_file print whether a file is
explicitly mentioned.
* tests/scripts/features/patternrules: Add tests.
2024-10-01 22:27:25 -04:00
Dmitry Goncharov
93704dd565 [SV 66268] Include newlines in file removal error message
* src/file.c (remove_intermediates): Fix an error message about a
failure to remove an intermediate file.
* tests/scripts/features/patternrules: Add tests.
2024-10-01 22:14:31 -04:00
Paul Smith
101bf5636f * doc/make.texi: Clarify -j versus -jN behavior 2024-09-02 16:23:36 -04:00
Sergei Trofimovich
9251546bac Fix biased shuffle by avoiding already "struck" elements
Artem Klimov noticed that current shuffle implementation suffers from
probability bias due to a typical bug in the shuffling implementation.

When we consider already shuffled element we slightly bias their
propability.

https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
suggests shuffling each "struck" element only once.

Before the change probabilities of 4-element array to land from `i`
index to `j` index are:

          0     1     2     3
      _____ _____ _____ _____
  0 | 25.00 29.30 24.60 21.10
  1 | 25.00 22.25 28.13 24.63
  2 | 25.00 23.44 22.26 29.30
  3 | 25.00 25.01 25.01 24.98

Note that `0->1` probability is almost 29% while `0->3` os only 21%.

After the change probabilities are not as biased:

          0     1     2     3
      _____ _____ _____ _____
  0 | 24.99 24.99 25.01 25.01
  1 | 24.99 25.04 24.99 24.99
  2 | 25.01 25.00 25.00 24.99
  3 | 25.01 24.98 25.00 25.01

* src/shuffle.c (random_shuffle_array): Fix biased shuffle by avoiding
already "struck" elements.
2024-09-02 15:11:36 -04:00
Paul Smith
7dc23aff30 * doc/make.texi: GNUMAKEFLAGS is only read from the environment 2024-09-02 14:54:23 -04:00
Paul Eggert
0267eb64fa Check for snprintf truncation on W32
* src/main.c (find_and_set_default_shell) [MK_OS_W32]:
Do not use a buffer that snprintf truncated.
2024-09-02 14:43:24 -04:00
Paul Eggert
bba4427b5d Fix unlikely pointer overflow in abspath
* src/function.c (abspath): len is now ptrdiff_t,
to avoid GCC warning about comparing signed to unsigned.
It really is a pointer difference, after all.
Rejigger comparision to avoid undefined behavior
if dest + len is an invalid pointer.
2024-09-02 14:43:24 -04:00
Paul Eggert
c23a7e6232 Prefer memcpy to strncpy if either will do
strncpy is trickier and a bit slower.
* src/function.c (func_realpath, func_abspath):
* src/misc.c (xstrndup):
Prefer memcpy or mempcpy to strncpy when the source length is known.
2024-09-02 14:43:24 -04:00
Paul Eggert
4d3bf7838f Omit unused PATH_MAX code
* src/makeint.h (GET_PATH_MAX, PATH_VAR):
Simplify, since PATH_MAX is always defined here.
(NEED_GET_PATH_MAX): Remove.
* src/misc.c (get_path_max) [NEED_GET_PATH_MAX]: Remove.
2024-09-02 14:43:24 -04:00
Paul Eggert
8c8c7fc226 Avoid strlen calls after sprintf
* src/file.c (file_timestamp_sprintf):
* src/function.c (func_words, func_call):
* src/job.c (child_error):
* src/main.c (define_makeflags):
* src/output.c (message, error, fatal):
Use return value from sprintf instead of calling strlen
on the resulting buffer.
2024-09-02 14:43:24 -04:00
Paul Smith
9fee98f843 [SV 65759] Document special handling of "-" command line option
* doc/make.1: Add information on "-" option handling.
* doc/make.texi: Ditto.
2024-09-02 13:48:41 -04:00
Dan D
f800f8bae3 [SV 65777] Add more const
Add more const to static arrays.  On some systems this allows more
data to be placed in RO segments and shared between multiple
instances of the make executable.  Anyway more const is good hygiene.

* src/default.c: Add const to arrays.
* src/function.c: Ditto.
* src/hash.c: Ditto.
* src/hash.h: Ditto.
* src/job.c: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.
* src/rule.c: Ditto.
* src/rule.h: Ditto.
2024-09-02 13:48:30 -04:00
Paul Smith
39a4c81062 Remove obsolete email address for the FSF
* doc/make.texi: Use the newer email address in the manual.
* gl/lib/fnmatch.c: Use a URL instead of a street address.
* gl/lib/fnmatch.in.h: Ditto.
* gl/lib/glob.c: Ditto.
* gl/lib/glob.in.h: Ditto.
2024-09-01 21:12:37 -04:00
Paul Smith
d97e048b08 * bootstrap.conf: Update to newer prerequisites 2024-09-01 21:09:42 -04:00
Paul Smith
c63a5bc6a2 [SV 65917] Mark also_make targets as updated in make -n
Suggested patch by Hannes Domani <ssbssa@yahoo.de>

* src/remake.c (notice_finished_file): When run with -n, mark
also_make targets as updated.
* tests/scripts/options/dash-n: Test pattern and grouped targets.
2024-08-04 23:53:26 -04:00
Paul Smith
bc979e4949 * src/job.c (new_job): [SV-66030] Show all also-make targets 2024-08-04 17:16:23 -04:00
Paul Smith
6970561de0 Don't add a target to its own also_make list
* src/dep.h (copy_dep): Make a copy of one struct dep.
* src/misc.c (copy_dep): Implement the new function.
(copy_dep_chain): Call copy_dep() for each dep in the chain.
* src/read.c (record_files): Write our own copy loop and omit the
current file from its own also_make list.  Since we don't keep
the function's also_make, free it.
2024-08-04 17:13:07 -04:00
Paul Smith
f0db5e321f * doc/make.texi: [SV-65982] Clarify what --debug=makefile does 2024-08-04 16:04:19 -04:00
Paul Smith
8653c25fcf * src/remake.c (update_file_1): [SV 65999] Clarify debug output 2024-08-04 16:02:19 -04:00
Paul Smith
4d883c414d * doc/make.texi: [SV-66018] Mention .ONESHELL in [-+@] docs 2024-08-04 16:02:19 -04:00
Dmitry Goncharov
034f862361 [SV 66037] Avoid hang/crash from MAKEFLAGS=... on command line
Make enters an infinite loop when some option and MAKEFLAGS=<value>
are specified on the command line.  For example,
    $ make -r MAKEFLAGS=hello=world

If decode_switches() runs handle_non_switch_argument() from within
the getopt() loop, it would recursively call decode_switches() to
enter a new getopt() loop, corrupting the state of the outer loop.

* src/main.c (decode_switches): Save up non-option arguments and run
handle_non_switch_argument() only after we're done with getopt().
* tests/scripts/variables/MAKEFLAGS: Add tests.
2024-08-04 16:00:48 -04:00
Paul Smith
49b955a50d * doc/make.texi (Overview): Update reference to POSIX.1-2024 2024-08-04 15:21:59 -04:00
Paul Smith
69038e62e0 * src/warning.h: Put warnings into alphabetical order.
* src/warning.c: Ditto.
* tests/scripts/options/warn: Fix tests for the new order.
2024-08-04 15:21:59 -04:00
Dmitry Goncharov
a9e3eb1eec [SV 65739] Add warning circular-dep.
Add a warning to control circular dependency detection.  Use "warn" as
the default action to be backward-compatible.

* src/warning.h (enum warning_type): Add warning type wt_circular_dep.
* src/warning.c (warn_init): Set default wt_circular_dep to w_warn.
* src/remake.c (update_file_1): Consult the circular-dep warning to
handle circular dependencies.
* tests/scripts/options/warn: Test --warn circular-dep flag.
* tests/scripts/variables/WARNINGS: Test .WARNINGS circular-dep flag.
* doc/make.texi: Document circular-dep warning.
* doc/make.1: Ditto.
2024-08-04 15:21:59 -04:00
Dmitry Goncharov
e3f938caf8 * tests/scripts/functions/shell: [SV 65323] Run huge var test in bash
The long variable name causes ksh to crash.  Some systems use ksh as
/bin/sh, so force bash if it's available else skip the test.
2024-05-06 14:11:17 -04:00
Dmitry Goncharov
40664fef1f [SV 65324] disable_builtins: Don't dereference NULL suffix_file
Make crashes when -r and MAKEFLAGS= are specified on the command line.

On startup make begins to process command line arguments.
During processing of "MAKEFLAGS=" make calls reset_makeflags, which in
turn calls disable_builtins, which dereferences null suffix_file.
Here is the backtrace.

0 disable_builtins main.c:3482
1 reset_makeflags main.c:3104
2 set_special_var variable.c:1325
3 do_variable_definition variable.c:1693
4 try_variable_definition variable.c:1889
5 handle_non_switch_argument main.c:3021
6 decode_switches main.c:3150
7 main main.c:1621

* src/main.c (disable_builtins): Avoid dereferencing null suffix_file.
* tests/scripts/features/suffixrules: Add a test.
2024-05-06 14:11:17 -04:00
Paul Smith
f7985ab827 * make.texi (How to Use Variables): [SV 65536] Rewrite this chapter
Re-reading this chapter I decided it was time to introduce a complete
rewrite, of at least parts of this.  Much of the enhancements added
over the years were in the wrong place or not clear.
2024-05-06 14:11:17 -04:00
Paul Smith
8339232a2f * .dir-locals.el: Correct bug reference regex format 2024-04-14 15:51:23 -04:00
Paul Smith
949952258e [SV 65537] Update to newer gnulib
* bootstrap.conf: Switch to gnulib stable-202401 branch.
* maintMakefile: Support an EXTRA_CFLAGS variable in maintainer mode.
* README.git: Describe how to use it.
2024-04-14 15:27:37 -04:00
Paul Smith
479c54f6ed * NEWS: Clean up UTF-8 issues 2024-04-14 15:27:12 -04:00
Paul Smith
033330e34c * doc/make.texi (Pattern Rules): Clarify that rules must have recipes. 2024-03-28 19:14:25 -04:00
Paul Eggert
61ee4578f5 * src/arscan.c (parse_int): Fix integer overflow test
Use intprops.h macros rather than trying to detect integer overflow by
hand, and doing it incorrectly.  Example of incorrect behavior:
if val == 3689348814741910323, base == 10, UINTMAX_WIDTH == 64, and
 *ptr == '0' then (val*base)+(*ptr-'0') yields 18446744073709551614
which is greater than val even though overflow has occurred.
Fortunately this bug could not be triggered on GNU/Linux hosts,
although it may be possible on platforms (if any) where struct ar_hdr
has members so large that they can represent integers that do not fit
int uintmax_t.
2024-03-28 19:08:13 -04:00
KO Myung-Hun
f289ece6cf * src/makeint.h (JOBSERVER_USE_FIFO): Do not define on OS/2.
mkfifo() on OS/2 is a dummy, it even returns a wrong value on error.
2024-03-28 19:08:13 -04:00
Paul Smith
d791fb4139 * src/variable.c (do_variable_definition) [W32]: Fix bad variable. 2024-03-28 19:08:13 -04:00
Marco Sirabella
0b91f42f58 * src/arscan.c (ar_name_equal): Support GNU ar's -P option. 2024-03-28 19:08:13 -04:00
Marco Sirabella
882d59c672 * tests/README: Fix sample run_make_tests command line. 2024-03-24 16:36:35 -04:00
Paul Smith
5fc62f8295 * doc/make.texi: GNU Make does set GNUMAKEFLAGS, to empty. 2024-03-24 16:29:14 -04:00
Paul Smith
3d4f3e0627 * doc/make.texi: Document temporary file name prefix
* src/posixos.c (jobserver_setup): Set prefix for FIFO temp file.
Ensure it can't conflict with a "normal" temp file.
* src/w32/w32os.c (os_anontmp): Set prefix for anon temp files.
2024-03-24 16:23:28 -04:00
Paul Smith
242603fa46 [SV 65268] Un-set append mode for stdout/stderr on exit
It turns out that options set on stdout/stderr last after exit.
Leaving append-mode enabled can break other facilities, so reset the
flags on stdout/stderr before we exit.

* src/os.h: Add a new fd_reset_append() to reset flags on FDs.
Modify fd_set_append() to return the old flags.
* src/posixos.c (fd_reset_append): Set provided flags on the FD.
(fd_set_append): Return the previous flags set on the FD.
* src/output.c (output_init): Preserve old flags for stdout/stderr.
(output_close): Reset flags for stdout/stderr.
* src/w32/w32os.c: Implement dummy methods.
2024-03-24 15:25:53 -04:00
Paul Smith
b8a2a4424b [SV 65273] configure.ac: Remove check for sys/timeb.h
GNU Make doesn't use ftime(); we only checked for this to work around
an error in the completely obsolete SCO 3.2 system.  Since ftime() is
deprecated, including sys/timeb.h has started throwing warnings on
newer systems so just remove it completely.
Reported by: Collin Funk <collin.funk1@gmail.com>

* configure.ac: Remove the check for sys/timeb.h.
* src/makeint.h: Remove the include of sys/timeb.h.
* src/config.h-vms: Don't define HAVE_SYS_TIMEB_H.
* src/config.h.W32: Ditto.
2024-03-24 15:25:18 -04:00
Jouke Witteveen
bfbf169b63 [SV 65448] intcmp: Compare values instead of magnitudes
* src/function.c (func_intcmp): Reverse comparison direction when
both arguments are negative.
* tests/scripts/functions/intcmp: Add tests and remove useless ones.
2024-03-24 14:08:59 -04:00
Paul Smith
21a538ce8f [SV 65359] doc/make.texi: Describe invalid export variable names 2024-03-24 14:05:45 -04:00
Paul Smith
3176b60566 [SV 64085] Handle .POSIX plus .IGNORE correctly
POSIX requires that a conforming makefile should not use -e if
 1) make is invoked with -i
 2) A .IGNORE target exists with no prerequisites
 3) The current target is a prerequisite of .IGNORE

* src/job.c (start_job_command): Add the target's flags when
constructing argv so it can check (3) above.
(construct_command_argv_internal): Don't set shellflags if it's not
set: this only happens if we're parsing for the slow path and we
don't need them.
(construct_command_argv): Don't allocate buffers if not needed.
When detecting "-ec", check the global ignore_errors_flag and the
current command line flags.
* tests/scripts/targets/IGNORE: Add tests for .IGNORE.
* tests/scripts/targets/POSIX: Add tests for the three cases above.
2024-02-04 19:41:50 -05:00
Dmitry Goncharov
07187db947 [SV 64822, SV 36486] Fix appending to a pattern specific variable
Appending to a pattern specific variable produces an incorrect value
in the presence of a command line definition or an env override of
the variable.  Also, fix pattern/target-specific appending to a
variable with origin override.

* At parse time record_target_var sets the value of a pattern
  specific variable to the value defined on command line or to the
  value of the env override.
* Later, at build time, recursively_expand_for_file appends this
  value of the variable (set in record_target_var) to the command
  line value again, regardless of the origin of the variable.

This patch modifies recursively_expand_for_file to avoid appending,
unless the origin of the variable beats or equals the origin of one
of the parent definitions of this variable.

Reported by Rob <robw9739@gmail.com>,
Brian Vandenberg <phantall@gmail.com>,
Markus Oberhumer <markus@oberhumer.com>.

* NEWS: Note the change.
* src/variable.c (do_variable_definition): Avoid merging a
pattern-specific variable with the parent definition when a command
line or env override is present.
* src/expand.c (recursively_expand_for_file): Avoid appending to a
pattern-specific variable, unless the origin of this pattern-specific
variable beats or equals the origin of one of the parent definitions
of this variable.
* doc/make.texi (Override Directive): Add missing cross-reference.
* tests/scripts/variables/append: Add tests.
2024-02-04 18:26:21 -05:00
Paul Smith
a493d9ab6c * NEWS: Clean up 2024-02-04 11:34:49 -05:00
Dmitry Goncharov
a382ac6cd1 [SV 64803] Set origin for unmodified variables after -e
Ensure the origin of all variables inherited from the environment is
"environment override" if -e is given.  Previously only variables
that were set in the makefile had this origin.

PDS: Most of these changes are from Dmitry but I slightly modified
the algorithm: instead of rearranging the way in which MAKEFLAGS is
parsed we reset the env_override value to the default before we
re-parse MAKEFLAGS, then we set the origin of all env vars to the
correct value based on the new setting.

* NEWS: Mention the change for backward-compatibility.
* src/main.c (main): Ensure MAKEFLAGS is always marked special.
(reset_makeflags): Set env_overrides back to default before parsing
MAKEFLAGS.
(decode_switches): Call reset_env_override() to check for changes.
* src/variable.h (reset_env_override): Declare a new function.
* src/variable.c (reset_env_override): Go through all env variables
and ensure the origin is correct based on env_overrides.
(set_env_override): Helper function for the hash.
* tests/scripts/functions/foreach: Fix tests.
* tests/scripts/functions/let: Ditto.
* tests/scripts/functions/origin: Ditto.
* tests/scripts/options/dash-e: Add tests.
2024-02-04 11:34:49 -05:00
Paul Smith
63b602e74f * tests/test_driver.pl: Add cd to the .run output file 2024-02-04 11:34:49 -05:00
Dmitry Goncharov
ec348f51d0 Replace target_var boolean with enum variable_scope
Replace the target_var boolean with an enum to distinguish between
global, target-specific, and pattern-specific variables when defining.

* src/variable.h (enum variable_scope): Introduce enum variable_scope.
Replace parameter target_var of type int with enum variable_scope.
* src/load.c (load_file): Ditto.
* src/main.c (handle_non_switch_argument): Ditto.
* src/read.c (eval_makefile): Ditto.
(eval): Ditto.
(do_define): Ditto.
(record_target_var): Ditto.
(construct_include_path): Ditto.
* src/variable.c (initialize_file_variables): Ditto.
(shell_result): Ditto.
(try_variable_definition): Ditto.
(do_variable_definition): Ditto.
2024-02-04 11:32:50 -05:00
Paul Smith
51e56a028e * doc/make.texi: Grammar improvements.
Reported-by: David Apps <davidapps3+gnu@gmail.com>
2024-01-28 14:21:00 -05:00
Paul Smith
1eff20f6f6 Support conditional modifiers on all assignment operators
Rework the single "?=" operator to instead allow a "?" modifier to be
prepended to ANY assignment operator.  If "?" is given then the
variable is assigned (using whatever operator comes next) if and only
if the variable is not already defined.  If it is defined then no
action is taken (the right-hand side is not expanded, etc.)

* NEWS: Announce this new feature.
* doc/make.texi: Modify the documentation around assignment operators.
* src/variable.h: Remove the f_conditional variable flavor.
(do_variable_definition): Add an argument specifying conditional.
* src/variable.c (parse_variable_definition): Use the existing flag
"conditional" to remember if we saw "?" rather than the flavor.
When we see "?" skip it and continue trying to parse an assignment.
(try_variable_definition): Pass condition to do_variable_definition().
(initialize_file_variables): Ditto.
(do_variable_definition): Check for conditional up-front: quit if set.
Remove handling of obsolete f_conditional flavor.
* src/read.c (eval_makefile): MAKEFILE_LIST is not conditional.
(do_define): Unset conditional for define with no operator.  Pass the
conditional flag to do_variable_definition().
(construct_include_path): .INCLUDE_DIRS is not conditional.
* src/load.c (load_file): .LOADED is not conditional.
* tests/scripts/variables/conditional: Add new tests.
2024-01-28 14:20:47 -05:00
Paul Smith
82708b3a3a Remove unnecessary parsing during makefile read
* src/read.c (make_word_type): Remove w_varassign from the enum.
(get_next_mword): This function is never called on a string in a place
where we might find a variable assignment.  Any variable assignments
have already been handled via try_variable_definition(), so we don't
need to check for them here.
* tests/scripts/variables/flavors: Check triple-colon assignment in
target-specific variables.
2024-01-27 16:40:36 -05:00
Paul Smith
828906b6dc Create a common method for skipping variable references
* README.git: Add some notes about using ASAN.
* src/makeint.h: Declare skip_references().
* src/misc.c (skip_reference): A new function that will skip over a
variable reference, counting matching open paren/brace characters.
* src/implicit.c (get_next_word): Replace code with skip_reference().
* src/read.c (conditional_line): Ditto.
(find_map_unquote): Ditto.
(get_next_mword): Ditto.
(parse_variable_definition): Ditto.
* src/function.c (handle_function): Make clear that the passed in
pointers are not modified if the function returns false.
* src/expand.c (expand_string_buf): Don't create local variables to
call handle_function() since it doesn't modify its arguments.
* src/job.c (new_job): Small simplifications.
2024-01-27 16:40:36 -05:00
Paul Smith
b936970956 * src/misc.c (writebuf, readbuf): Return a constant -1 2024-01-27 16:40:36 -05:00
Dmitry Goncharov
1e43a5d104 [SV 65211] Fix load and loadapi tests.
* scripts/features/load: Suppress unused variable compiler warnings.
* scripts/features/loadapi: Ditto.
2024-01-27 16:40:36 -05:00
Paul Smith
25049fef16 [SV 65172] Avoid buffer overruns when expanding for $(shell ...)
Reported-by: MIAOW Miao <guoyr_2013@hotmail.com>
Patch from: Henrik Carlqvist <hc981@poolhem.se>
Test from: Dmitry Goncharov <dgoncharov@users.sf.net>

* src/expand.c (recursively_expand_for_file): Check the variable name
before checking for equality so we don't overrun the buffer.
* tests/scripts/functions/shell: Add a test with a very long variable.
2024-01-27 16:40:36 -05:00
Paul Smith
31036e648f [SV 64571] Add --print-targets option
Add an option to print a list of targets defined in the makefiles.
Don't print targets of implicit rules, or special targets.  To
support this remember which files are deemed suffix rule targets.

Add a missing warning for single-suffix targets with prerequisites.

Suggested by many.  Sample implementation by Tim <tdhutt@gmail.com>.

* NEWS: Announce the new option and single-suffix warning.
* doc/make.1: Add --print-targets to the man page.
* doc/make.texi: Add --print-targets to the documentation.  Clean up
the text around the definition of suffix rules.
* src/main.c (print_targets_flag): New variable for --print-targets.
(switches): Add a new long option --print-targets.
(main): If the option was provided call print_targets() and exit.
* src/filedef.h (struct file): Add a "suffix" boolean value.  Remove
print_prereqs() since it's static.  Add new print_targets().
* src/file.c (rehash_file): Merge the new suffix value.
(print_prereqs): Used only locally: change to static.
(print_target): Print targets which are not suffix rule targets and
are not special targets.
(print_targets): Call print_target() on each file.
* src/rule.c (convert_to_pattern): Make maxsuffix local; it doesn't
need to be static.  Emit ignoring prerequisites for single-suffix
rules as well as double-suffix rules.  Remember which files are
actually suffix rules.
* tests/scripts/features/suffixrules: Test single-suffix behavior.
* tests/scripts/options/print-targets: Add tests for --print-targets.
2024-01-08 23:31:58 -05:00
Paul Smith
1ff728bff4 * src/makeint.h: Add an ARRAYLEN macro to compute array sizes
* src/main.c: Replace inline array length computation with ARRAYLEN.
* src/function.c: Ditto.
* src/read.h: Ditto.
2024-01-07 11:28:23 -05:00
Paul Smith
1161779ef8 * doc/make.texi (Text Functions): [SV 64339] Clarify pattern use. 2024-01-07 10:22:20 -05:00
Paul Smith
a80670ad41 * (all): Update Copyright year to 2024 2024-01-06 18:06:09 -05:00
Paul Smith
d86448fe5f [SV 64402] Correct locating "," in ifeq/ifneq conditionals
Ensure that we correctly skip the entirety of a macro or function
reference when searching for the "," separator in an ifeq/ifneq
conditional, including using "$," and also "${foo,bar}".  Note that
this change means that parenthesis OTHER than those used for variable
expansion are not considered special, any longer.

* NEWS: Announce the change.
* src/read.c (conditional_line): Skip variable references when looking
  for "," and ensure that we match closing parens/braces properly.
* tests/scripts/features/conditionals: Add tests for this behavior.
2024-01-06 17:42:40 -05:00
Dmitry Goncharov
33932663b0 [SV 65006] Allow secondary expansion of .EXTRA_PREREQS
* src/rule.c (snap_implicit_rules): Set need_2nd_expansion of each
  prerequisite of global .EXTRA_PREREQS.
* src/file.c (snap_file):  Set need_2nd_expansion of each prerequisite
  of target-specific .EXTRA_PREREQS.
* tests/scripts/variables/EXTRA_PREREQS: Add tests.

Reported by Daniel Gerber <dg@atufi.org>.
2024-01-06 17:39:43 -05:00
Jouke Witteveen
89bea82af3 * src/function.c (func_let): Don't edit nonexistent values
* tests/scripts/functions/let: Test trailing whitespace in value list.
2024-01-01 19:31:37 -05:00
Paul Smith
dd1980426e * doc/make.texi (Text Functions): [SV 64818] Remove redundant text 2024-01-01 19:24:37 -05:00
Paul Smith
2ce7e40822 * .clangd: Add configuration for the clangd LSP server 2024-01-01 19:24:37 -05:00
Paul Smith
b1e240c554 * doc/make.texi: [SV 64924] Add missing parenthesis 2023-11-26 23:21:55 -05:00
Paul Smith
7fa40eb4fc * doc/make.texi: Add a quick reference appendix 2023-11-26 23:21:06 -05:00
Paul Smith
8817efe46a * src/function.c (function_table_entry): Sort 2023-11-26 23:20:22 -05:00
Paul Smith
66adfb7c6f make.texi: Cleanup 2023-09-01 16:57:58 -04:00
Paul Smith
9af3e60f4d make.texi: Add an appendix with troubleshooting tips 2023-08-29 15:39:16 -04:00
Paul Smith
8061929963 doc/make.texi: Clean up references to GNU Make 2023-08-29 15:20:31 -04:00
Paul Smith
cd33c9a1e9 doc/make.texi: Remove unnecessary @node arguments 2023-08-29 14:44:50 -04:00
Paul Smith
c4ecd9d9eb bootstrap.conf: Update to the latest gnulib stable branch 2023-08-25 11:10:14 -04:00
Paul Smith
6b7f35cb0b * AUTHORS: Updates 2023-07-04 14:26:58 -04:00
Torbjörn SVENSSON
1000374759 Fix GCC compile warning for "bad-function-cast" on Windows
Trick the compiler by hiding the cast in a function call.

* src/os.h: Declare the new function.
* src/w32/w32os.c (get_handle_for_fd): Convert and cast a file
descriptor into a Windows HANDLE.
(check_io_state): Call the new function rather than casting.
(osync_release): Ditto.
(fd_inherit): Ditto.
(fd_noinherit): Ditto.
* src/function.c (windows32_openpipe): Ditto.
* src/w32/compat/posixfcn.c (isatty): Ditto.
* src/w32/subproc/sub_proc.c (process_easy): Ditto.
2023-07-04 14:26:58 -04:00
Torbjörn SVENSSON
8d76fb8778 Fix GCC compile warning for "format-signedness" in Windows
* src/job.c (reap_children): Use unsigned int for DWORD.
* src/w32/subproc/sub_proc.c (process_easy): Ditto.
* src/w32/w32os.c (jobserver_setup): Ditto.
(jobserver_release): Ditto.
(jobserver_acquire): Ditto.
2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
ee366afbf1 * src/w32/compat/posixfcn.c (ttyname): Avoid const char* 2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
b686980c66 Fix GCC compile warning for "unused-parameter" on Windows
* src/w32/compat/posixfcn.c (isatty): Avoid unused-parameter warnings.
(jobserver_pre_child): Ditto.
(jobserver_post_child): Ditto.
(jobserver_acquire): Ditto.
(fd_set_append): Ditto.
2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
8e5c96c318 Fix GCC compile warning format-security on Windows
* src/job.c (create_batch_file): Avoid non-static format strings.
* src/main.c (handle_runtime_exceptions): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Ditto.
2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
363bdaef8c Fix GCC compile warning declaration-after-statement on Windows
* src/w32/w32os.c (check_io_state): Move the HANDLE declarations.
2023-07-01 12:49:20 -04:00
Costas Argyris
b2bf660abc Add a UTF-8 resource when building for Windows
If a resource compiler is available, use it to add a UTF-8 resource
to the GNU Make executable on Windows.  As a result, GNU Make will
use UTF-8 as its ANSI code page, enabling it to work with UTF-8
encoded Makefiles, understand UTF-8 paths passed to it, etc.

These build process changes apply to all 3 ways that GNU Make can
be built for Windows:

1) configure
2) Basic.mk
3) build_w32.bat

When building with Visual Studio the resource compiler should always
be available.

When building with GCC or TCC, it depends on the availability of
'windres'.

If a resource compiler is not available, don't fail the build but
just proceed without the UTF-8 resource, effectively ignoring this
feature.

The UTF-8 resource only has an effect when GNU Make is running on a
minimum target version of Windows Version 1903 (May 2019 Update).
When the built GNU Make is running on an earlier version of Windows,
the embedded UTF-8 resource has no effect.

Code page information is added to --version output to tell users what
code pages are being used by any combination of GNU Make build (with
or without the UTF-8 resource) and Windows version that GNU Make is
running on (earlier than 1903 or not).

* README.git: Fix a typo.
* configure.ac: Search for windres and set WINDRES / HAVE_WINDRES.
* Makefile.am: Add manifest and resource files to EXTRA_DIST and
add a windres invocation to build them.
* build_w32.bat: Add support to build resource files.
* src/main.c (print_version): Add codepage info to Windows output.
* src/w32/utf8.manifest: Add a windres manifest file.
* src/w32/utf8.rc: Add a windres resource file.
* Basic.mk.template: Add support for building resource files.
* mk/Windows32.mk: Support windres resource files.
* .gitignore: Ignore TCC output directories.
2023-06-19 13:29:52 -04:00
Paul Smith
04f4c2b8d9 [SV 64124] Avoid stack overflows for large command lines
Modify areas dealing with large command lines to use the heap rather
than relying on alloca / stack space.

* src/main.c (main): Allocate potentially large buffers with xmalloc.
(decode_env_switches): Ditto.
* src/function.c (func_error): Replace alloca with xmalloc/free.
* tests/scripts/features/expand: Add a newline for readable diffs.
2023-06-19 13:27:50 -04:00
Paul Smith
347316fdf6 * po/LINGUAS: Add support for Georgian translation 2023-06-19 10:05:19 -04:00
Paul Smith
1a03888afa * NEWS: Set a prerelease version 2023-06-19 10:05:19 -04:00
Paul Smith
07fcee35f0 [SV 64815] Recipe lines cannot contain conditional statements
* NEWS: Mention this change.
* src/read.c (eval): Check for ignoring for any line even if not
in a rule context.
* tests/scripts/features/conditionals: Write new tests.
2023-05-22 23:36:13 -04:00
Paul Eggert
c85b71a396 make -p now uses consistent timestamp format
* NEWS: mention this.
* src/main.c (safer_ctime, time_now): Remove.
(print_data_base): Use file_timestamp_sprintf to format timestamps.
2023-05-14 18:26:35 -04:00
Paul Eggert
032f784601 make -p buffer overrun fix with outlandish current time
* src/main.c (safer_ctime): New function.
(print_data_base): Use it.
2023-05-14 18:26:35 -04:00
Paul Eggert
78e6a89b19 make -p uses same clock as rest of 'make'
Without this patch, the output of 'make -p' would generate output that
sometimes incorrectly implied that the clock jumped backwards.
* src/main.c (time_now): New function.
(print_data_base): Use it.
2023-05-14 18:26:35 -04:00
Paul Smith
1748e66414 [SV 63219] Support an "unload" function for loaded objects
If a loaded object defines a symbol <object>_gmk_unload, assume it's
a function and invoke it whenever the loaded object is unloaded.
Original implementation by Dmitry Goncharov <dgoncharov@users.sf.net>

* NEWS: Announce the change.
* doc/make.texi: Describe the behavior.
* src/gnumake.h: Add information to the comments.
* src/makeint.h (unload_all): Declare a new function.
* src/main.c (die): Invoke unload_all().
* src/load.c (unload_func_t): Declare a new type for unload.
(struct load_list): Remember the unload symbol if it exists.
(load_object): Move the parsing of the object name from load_file.
Check for the _gmk_unload symbol and if found, remember it.
(load_file): Allow load_object to do object filename parsing.
(unload_file): Remove the load_list entry when unloading the object.
(unload_all): Unload all the loaded objects.
* tests/scripts/features/loadapi: Test the unload function.
2023-05-14 18:26:35 -04:00
Paul Smith
8e0e6c678f Remove the "preview" status from the loaded object feature
Add an ABI version both to the header file and passed to the setup
function.  Unfortunately this itself is an ABI break and I couldn't
find a good way to avoid it.

* NEWS: Announce the ABI is not a preview and the incompatibility.
* doc/make.texi: Remove the preview warnings for object loading.
Document the new ABI version argument.
* src/gnumake.h (GMK_ABI_VERSION): Set the ABI version to 1.
Add comments documenting the format of the setup function.
* src/load.c (setup_func_t): Rename from load_func_t.
(load_file): Pass the ABI version to the setup function.
* tests/scripts/features/load: Rework the setup function.
* tests/scripts/features/loadapi: Ditto.
2023-05-07 16:51:06 -04:00
Paul Smith
3f28ec2f58 * src/read.c (eval): [SV 40942] Allow targets named "load"
Previously "load:" worked but "load :" failed.  Allow the latter as
well.  This doesn't fix all issues; "load foo :" is still treated
as a load operation for "foo" and ":".  Avoids SV 50413 as well.
* tests/scripts/features/load: Write tests.
2023-05-07 16:51:06 -04:00
Paul Smith
24a84f99bb * tests/test_driver.pl: Show info about failed tests
Remove working directories for skipped tests.
We use different directories per test so don't keep rmfiles.
2023-05-07 16:51:06 -04:00
Paul Smith
05c86bfcb2 * tests/scripts/features/comments: Add missing "1;" 2023-05-06 14:45:09 -04:00
Dmitry Goncharov
06c75a35b9 [SV 64124] Avoid use-after-free in expand_variable_buf()
When the expanded value of the variable in buf occupies more space
than available in variable_buffer, function variable_buffer_output
reallocates variable_buffer: return a pointer into the new memory,
not the old memory.

* src/expand.c (expand_variable_buf): Preserve the offset of buf and
return that offset into the (potentially reallocated) buffer.
* tests/scripts/features/expand: Add tests.
2023-04-30 09:41:02 -04:00
Dmitry Goncharov
ebe0a1c9f1 [SV 64115] Suppress warnings about undefined GNUMAKEFLAGS
* src/variable.c (defined_vars): Add GNUMAKEFLAGS to defined variables.
* tests/scripts/options/warn: Add a test.
2023-04-30 09:40:50 -04:00
Dmitry Goncharov
0880e5c86a [SV 64107] Disable builtins immediately on -R or -r
Disable builtin variables and rules immediately, when -R or -r is
added to MAKEFLAGS inside the makefile.

* src/main.c (disable_builtins): Add new function disable_builtins().
(main): Call disable_builtins().
(reset_makeflags): Call disable_builtins().
* tests/scripts/options/dash-r: Add tests.
* tests/scripts/variables/MAKEFLAGS: Update tests.
2023-04-30 09:40:50 -04:00
Paul Smith
0e06c75889 * tests/scripts/features/double_colon: Test parallel double-colon rules
Original test proposed by Dmitry Goncharov <dgoncharov@users.sf.net>
2023-04-30 09:40:50 -04:00
Dmitry Goncharov
5340a3d5d1 * src/remake.c (update_goal_chain): [SV 64016] Avoid double negation 2023-04-30 09:40:47 -04:00
Paul Smith
fec72ea308 * NEWS: Note the change to the tests suite 2023-04-23 11:35:02 -04:00
Paul Smith
6cf6311332 * src/warnings.c (decode_warn_actions): [SV 63990] Handle errors 2023-04-03 08:05:54 -04:00
Paul Smith
c4329fb953 Move local headers after system headers
Avoid compiler warnings on Windows by moving local headers after
system headers.

* src/job.c: Move all headers other than makeint.h.
* src/main.c: Ditto.
* src/read.c: Ditto.
2023-04-03 07:48:51 -04:00
Paul Smith
971b02d58e tests: Run each file in a separate directory
Avoid cross-contamination between test files by creating a new
working directory for each file, and setting it as the current
directory before starting the tests in that file.

Rename the test output as tNNN.{base,log,diff,mk} where NNN is
a test number starting with 001 for the first test.  It is
slightly more annoying to find diff files since you can't use
autocomplete directly but it is simpler to match things.

Detect the source directory as the location of the test_driver.pl
script, so remove the separate -srcdir option.

* Makefile.am: Remove hacks to create symlinks when building
out-of-tree, and remove -srcdir option from run_make_tests.
* tests/test_driver.pl: Locate $srcpath based on __FILE__, then
compute $toppath as its parent.  Set $scriptpath under $srcpath
and $workpath under the current directory.  Toss $*_filename
and modify get_logfile() etc. to use the suffix directly.  Add
a chdir() around the invocation of the test.
* tests/run_make_tests.pl: Throw out the -srcdir option and use
$srcpath set in test_driver.pl.  The #WORK# helper is no longer
useful so remove it.  Set #PWD# to the current working dir. Always
search the local directory and $srcpath for config-flags.pm.
Use $srcpath for finding the thelp.pl script.
* tests/scripts/features/vpath: Don't put things in work/ as it
is no longer a subdirectory.
* tests/scripts/features/vpathgpath: Ditto.
* tests/scripts/features/vpathplus: Ditto.
* tests/scripts/misc/general1: Ditto.
* tests/scripts/misc/general2: Ditto.
* tests/scripts/options/dash-k: Ditto.
* tests/scripts/options/symlinks: Use $testpath as the working
directory.
* tests/scripts/variables/GNUMAKEFLAGS: Use the test helper to
display env var values (grepping for GNUMAKEFLAGS finds extra things
now that it is our current working directory).
2023-04-02 17:32:09 -04:00
Paul Smith
fdd61fc068 * tests/scripts/targets/WAIT: Add whitespace to avoid W32 issues
On Windows systems, "X:" for any "X" is considered a drive letter
so add whitespace.
2023-04-02 17:30:27 -04:00
Dmitry Goncharov
80727d709c [SV 63856] Fix pruning of double-colon rules
Given this setup:

  $ cat Makefile
  A::; @echo A-1 && sleep 1 && echo A-1 done
  A::; @echo A-2 && sleep 1 && echo A-2 done
  A::; @echo A-3 && sleep 1 && echo A-3 done
  B::; @echo B-1 && sleep 1 && echo B-1 done
  B::; @echo B-2 && sleep 1 && echo B-2 done
  B::; @echo B-3 && sleep 1 && echo B-3 done

  $ make -j8 A .WAIT B

All recipes for A should be started sequentially and complete before
any recipe for B is started, then all recipes for B should be started
sequentially.  This wasn't happening because the double-colon target
was getting pruned too early.

* src/remake.c (update_file): Don't prune a target if it's a double
colon rule which is complete, but there are other recipes to run for
this target: we want those other recipes to be run first.
* tests/scripts/targets/WAIT: Test .WAIT with double colon rules.
2023-04-02 11:12:19 -04:00
Dmitry Goncharov
cd46baab90 [SV 63856] Implement .WAIT on the command line
* src/main.c (handle_non_switch_argument): Return 1 if arg is .WAIT.
(decode_switches): Set wait_here for a goal that follows .WAIT.
* src/remake.c (update_goal_chain): Honor wait_here for a command
line goal.  Don't allow double-colon targets to continue if .WAIT is
given for one of them.
* tests/scripts/targets/WAIT: Add .WAIT tests.
2023-04-02 11:12:11 -04:00
Paul Smith
54b3202f8d [SV 63981] Don't warn on explicit -j1
If -j1 is given explicitly on the command line don't warn about it.

* src/main.c (main): Skip the warning if -j1.
* tests/scripts/features/jobserver: Add a test for this behavior.
2023-04-02 10:29:37 -04:00
Paul Smith
5111087e12 * NEWS: Mention the new .WARNINGS variable 2023-04-02 10:29:19 -04:00
Paul Smith
0552b0abc8 * doc/make.texi: Clean up function and variable references
Avoid unnecessary extra remarks in the index and remove duplicates.
2023-04-02 10:02:18 -04:00
Paul Smith
c2792d6129 Adjust output strings to be aligned
Change error and fatal messages to start with lowercase and not
end with a period.  Note a few very common messages were left
as-is, just in case some other tools parse them.

Also modify the test known-good-output to satisfy the messages.
2023-04-02 10:02:18 -04:00
Paul Smith
a0d1e76d60 Add support for .WARNINGS special variable
Create a new special variable, .WARNINGS, to allow per-makefile
control over warnings.  The command line settings will override
this.

Move the handling of warning flags to a new file: src/warning.c.
Allow the decode to work with generic strings, and call it from
decode_switches().

* Makefile.am: Add new file src/warning.c.
* build_w32.bat: Ditto.
* builddos.bat: Ditto.
* po/POTFILES.in: Ditto.
* src/makeint.h: #define for the .WARNINGS variable name.
* src/warning.h: Add declarations for methods moved from main.c.
Rename the enum warning_state to warning_action.
* src/warning.c: New file.  Move all warning encode/decode here
from main.c.
* src/main.c: Move methods into warning.c and call those methods
instead.
(main): Set .WARNINGS as a special variable.
* src/job.c (construct_command_argv): Rename to warning_action.
* src/read.c (tilde_expand): Ditto.
* src/variable.c (set_special_var): Update warnings when the
.WARNINGS special variable is set.
* tests/scripts/options/warn: Check invalid warning options.
* tests/scripts/variables/WARNINGS: Add tests for the .WARNINGS
special variable.
2023-04-02 10:02:18 -04:00
Paul Smith
03ecd94488 Add new warnings invalid-var and invalid-ref
The "invalid-var" warning triggers if the makefile attempts to assign
a value to an invalid variable name (a name containing whitespace).
The "invalid-ref" warning triggers if the makefile attempts to
reference an invalid variable name.  Both new warnings have a default
action of "warn".

* NEWS: Add these new warnings.
* doc/make.1: Document them in the man page.
* doc/make.texi (Warnings): Document them in the user's manual.
* src/warning.h: Add enum values for the new warning types.
* src/main.c (initialize_warnings): Initialize the new warnings.
* src/variable.h (undefine_variable_in_set, undefine_variable_global):
Ask callers to provide a struct floc specifying where the variable
is undefined.
* src/read.c (do_undefine): Pass floc when undefining.
* src/variable.c (check_valid_name): If invalid-var is enabled, check
the variable name.
(define_variable_in_set): Call it.
(undefine_variable_in_set): Ditto.
(check_variable_reference): If invalid-ref is enabled, check the
variable reference.
(lookup_variable): Call it.
(lookup_variable_in_set): Ditto.
* tests/scripts/options/warn: Add tests for the new warning types.
2023-04-01 11:13:12 -04:00
Paul Smith
2611e1991f Introduce a --warn command line option
Replace the singleton --warn-undefined-variables with infrastructure
to manage multiple warnings: the --warn option can take an action
"ignore", "warn", or "error" (which will apply to all warnings), or
a specific warning type and an action for that type.  Multiple
options can be provided and are consolidated.

* NEWS: Announce the new option.
* doc/make.1: Document in the man page.
* doc/make.texi (Warnings): Document in the user's manual.
* Makefile.am: Add new header warning.h.
* src/warning.h: Define enum for actions and warning types, and
macros to test whether they are set.  Keep the default settings
separate so that we can correctly reconstruct MAKEFLAGS.
* src/makeint.h: Remove deprecated warn_undefined_variables_flag.
* src/main.c: Create global variables to hold warning settings.
(switches): Add a new switch for --warn.
(initialize_warnings): Set the default warning actions.
(main): Call initialize_warnings().
(encode_warning_state, decode_warning_state): Convert warning states
between strings and enums.
(encode_warning_name, decode_warning_name): Convert warning names
between strings and enums.
(decode_warn_flags): Convert a --warn option into enum values.  If
deprecated warn_undefined_variables_flag is set convert it to --warn.
(decode_switches): Don't remove duplicates of --warn since order
matters.  Call decode_warn_flags() to handle --warn.
(define_makeflags): Special-case handling of --warn options written
to MAKEFLAGS: write out the current settings.
* src/read.c (tilde_expand): Use new warning control macros.
* src/variable.c (warn_undefined): Ditto.
* src/job.c (construct_command_argv): Ditto.
* tests/scripts/options/warn: Rename from warn-undefined-variables
and add tests for --warn.
* tests/scripts/variables/MAKEFLAGS: Expect the new behavior.
2023-04-01 11:13:12 -04:00
Paul Smith
9db74434cd Clean up memory leak warnings from ASAN and Valgrind
* src/main.c (main): Add "sanitize" to .FEATURES if ASAN is enabled.
* src/expand.c (expand_variable_output): Remember "recursive" setting
in case it's changed by the expansion of the variable.
* src/file.c (rehash_file): If we drop a file from the global 'files'
hash, remember it in rehashed_files.  We can't free it because it's
still being referenced (callers will invoke check_renamed()) but
it will be a leak since it's no longer referenced by 'files'.
* src/remake.c (update_file_1): If we drop a dependency, remember it
in dropped_list.  We can't free it because it's still being referenced
by callers but it will be a leak since it's no longer referenced as
a prerequisite.
* tests/scripts/functions/guile: Don't run Guile tests when ASAN is
enabled.
* tests/scripts/functions/wildcard: Enabling ASAN causes glob(3) to
break!  Don't run this test.
* tests/scripts/features/exec: Valgrind's exec() doesn't support
scripts with no shbang.
* tests/scripts/jobserver: Valgrind fails if TMPDIR is set to an
invalid directory: skip those tests.
* tests/scripts/features/output-sync: Ditto.
* tests/scripts/features/temp_stdin: Ditto.
2023-04-01 11:13:12 -04:00
Paul Smith
23f70b0cb8 Create helper functions for pushing file contexts
* src/variable.h (install_file_context, restore_file_context): Add
declarations for new functions.
* src/variable.c (install_file_context, restore_file_context): Define
the new functions.
(lookup_variable_for_file): Call them.
* src/expand.c (recursively_expand_for_file): Ditto.
(allocated_expand_variable_for_file): Ditto.
(expand_string_for_file): Ditto.
2023-04-01 11:13:12 -04:00
Paul Smith
78c8c44326 Add functions to directly expand variables by name
Replace all locally-created "$("+varname+")" and similar constructs
with calls to these new functions.

* src/expand.c (expand_variable_output): Call expand_string_output()
on the expansion of a variable value.  Replaces reference_variable().
(expand_variable_buf): Like expand_variable_output() but return the
starting location of the result.
(allocated_expand_variable): Like expand_variable_buf() but return
an allocated string.
(expand_string_buf): Call expand_variable_output().
* src/variable.h: Declare the new functions.
* src/function.c (func_call): Call expand_variable_output() instead
of expand_string_buf().
* src/main.c (decode_env_switches): Call expand_variable() instead
of expand_string().
* src/remake.c (library_search): Call allocated_expand_variable()
instead of expand_string() plus xstrdup().
* src/vpath.c (build_vpath_lists): Expand VPATH and GPATH using
expand_variable() instead of expand_string().
* src/w32/subproc/sub_proc.c (process_begin): Use expand_variable()
to expand SHELL.  Also use alloc() in case the result is larger than
PATH_MAX.
2023-04-01 11:13:12 -04:00
Paul Smith
caf1d4c28f Clean up expand.c
Clarify the naming and documentation on functions in src/expand.c:
- variable_expand -> expand_string
- variable_expand_string -> expand_string_buf
- variable_expand_for_file -> expand_string_for_file
- allocated_variable_expand -> allocated_expand_string
- allocated_variable_expand_for_file ->
  allocated_expand_string_for_file
Change all callers to use the new names.

* src/variable.h: Rename the functions and macros.
* src/expand.c: Ditto.
* src/file.c: Use the new function names.
* src/function.c: Ditto.
* src/implicit.c: Ditto.
* src/job.c: Ditto.
* src/loadapi.c: Ditto.
* src/main.c: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.
* src/variable.c: Ditto.
* src/vpath.c: Ditto.
* src/w32/subproc/sub_proc.c: Ditto.
2023-03-26 16:48:48 -04:00
Paul Smith
f99d083418 * src/expand.c (swap_variable_buffer): Swap two variable buffers
Return the current buffer instead of freeing it.
(variable_append): Use install/swap to handle variable buffers.
(allocated_variable_expand_for_file): Ditto.
* src/variable.c (shell_result): Ditto.
* src/variable.h: Declare the new function.
2023-03-26 09:24:49 -04:00
Paul Smith
a367c0640f Ensure variable_buffer is always nul-terminated
* src/expand.c (variable_buffer_output): Allocate an extra byte and
set it to nul.  For safety, add assert() on PTR.
(variable_expand_string): Don't call variable_buffer_output just to
add a nul byte.
(allocated_variable_append): Ditto.
2023-03-26 09:24:06 -04:00
Paul Smith
3088e3e698 [SV 63867] Don't use --sort to generate error report tar files
Older versions of GNU tar parse the TAR_OPTIONS variable, but do not
accept the --sort option: remove it before creating the error report
tar files.  Note we still require a modern GNU tar to create release
tar files.  Reported by Dmitry Goncharov <dgoncharov@users.sf.net>

* Makefile.am (check-regression): Remove --sort from TAR_OPTIONS
2023-03-25 16:02:59 -04:00
Paul Smith
bf7f690202 Directly handle $\ line endings
Previously we used the fact that this line ending expanded to "$ "
which would then expand to the empty string.  This has problems if
you enable warnings for undefined variables, so directly implement
this special (but documented) trick in the GNU Make parser.

As a side-effect this also removes all previous whitespace when
in GNU Make mode (not in POSIX mode) just as it would without "$".

* src/misc.c (collapse_continuations): Check for "$\" and remove it.
* tests/scripts/variables/flavors: Add regression tests including
with previous whitespace, and escaped/unescaped "$"
2023-02-26 17:30:15 -05:00
Paul Smith
5d1fe2b16d * src/main.c (define_makefiles): Simplify by using variable_buffer
Toss the previous implementation which first computed a locally
allocated list of options, then used alloca() to create a buffer
of the right size and populate it.  Instead, use variable_buffer
to append to the string directly.  First add all single-letter
options without arguments, then add options with arguments.
2023-02-26 17:15:56 -05:00
Paul Smith
8285852e55 Clean up some preprocessor operations 2023-01-16 13:01:09 -05:00
Paul Smith
9b9f3351d1 Use MK_OS_OS2 macro instead of __EMX__
* src/makeint.h: Set MK_OS_OS2 to 1 if __EMX__ is set.
* src/*: Convert #if refs to __EMX__, to use MK_OS_OS2.
2023-01-16 00:24:13 -05:00
Paul Smith
6f3e9e9b84 Use MK_OS_DOS macro instead of __MSDOS__
* src/configh.dos: Set MK_OS_DOS to 1
* src/*: Convert #if refs to __MSDOS__, to use MK_OS_DOS.
* gl/lib/*: Ditto.
2023-01-16 00:03:13 -05:00
Paul Smith
6128c3e266 Rename WINDOWS32 macro to MK_OS_W32
* configure.ac: Set MK_OS_W32 to 1 if we're on Windows32.
* src/config.h.W32: Ditto.
* mk/Windows32.mk: Ditto.
* src/makeint.h: Convert #if refs to WINDOWS32, to use MK_OS_W32.
* src/*: Ditto.
* src/w32/*: Ditto.
* gl/lib/*: Ditto.
2023-01-15 18:27:13 -05:00
Paul Smith
ceb52b5d1b Rename VMS macro to MK_OS_VMS
* src/makeint.h: Set MK_OS_VMS to 1 if we're on VMS.
* src/*: Convert all #if references to VMS, to use MK_OS_VMS.
* gl/lib/*: Ditto.
2023-01-15 18:04:36 -05:00
Paul Smith
d4692df20d Remove support for AmigaOS
There is a lot of specialized code for supporting AmigaOS and it has
not been maintained for a number of years.  It's highly unlikely that
the latest versions even compile properly on AmigaOS anymore.  After
requesting that someone step forward to own the maintenance of the
port in the GNU Make 4.4 release and getting no takers, I removed it.

* NEWS: Announce the removal.
* README.in: Remove README.Amiga reference.
* README.Amiga: Remove unused file.
* SCOPTIONS: Ditto.
* src/amiga.c: Ditto.
* src/amiga.h: Ditto.
* src/config.ami: Ditto.
* mk/Amiga.mk: Ditto.
* Makefile.am: Remove references to deleted files.
* Basic.mk.template: Ditto.
* maintMakefile: Ditto.
* src/commands.c: Remove ifdef'd Amiga code.
* src/default.c: Ditto.
* src/dir.c: Ditto.
* src/file.c: Ditto.
* src/function.c: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/main.c: Ditto.
* src/os.h: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.
2023-01-15 17:32:15 -05:00
Paul Smith
e6bd61d949 * README.git: Clarify some release steps
* README.in: Update some info and remove some obsolete notes.
2023-02-26 15:52:25 -05:00
Paul Smith
fcefae5ec9 * NEWS: Update for the next release
* configure.ac: Set the version for the next release.
2023-02-26 15:40:18 -05:00
Paul Smith
d66a65ad5a GNU Make release 4.4.1
* NEWS: Set the release number and date.
* configure.ac: Update the version.
* README.git: Remind to update doc/make.1.
* doc/make.1: Update the date.  Fix some "GNU Make" references.
* doc/make.texi: Update the edition.
2023-02-26 13:46:22 -05:00
Paul Smith
8093e2eee3 * tests/scripts/options/dash-l: Simplify the test via the helper
* tests/thelp.pl: Add "exist" and "noexist" operators.
2023-02-26 13:46:02 -05:00
Paul Smith
74dab224b3 * README.W32: Add Windows 11
* build_w32.bat: Ditto.
2023-02-21 20:54:48 -05:00
Paul Smith
8b8cc3a825 Use a recursive environment if any command needs it
We only create one target environment for all commands in a recipe.
Ensure it's set for recursive make if ANY command is recursive, not
just the first one.

* src/job.c (start_job_command): Check for any recursive command.
* tests/scripts/features/jobserver: Test recursion on second line.
2023-02-21 20:53:48 -05:00
Dmitry Goncharov
9b6fedef1c * src/main.c (main): Install suffix rules near pattern updates 2023-02-21 00:04:13 -05:00
Paul Smith
8ddb628927 * Makefile.am: Add mkconfig.h to the test error file 2023-02-20 23:29:26 -05:00
Dmitry Goncharov
e9dd614d73 [SV 63821] Don't set up default suffix rules if makefile sets -r
When built-in rules are disabled by adding -r to MAKEFLAGS in the
makefile, don't add suffix rules at all so that if suffixes are
added back via .SUFFIXES, the rules are still not there.

* src/main.c (main): Set default suffix rules after parsing makefiles.
* src/default.c (install_default_suffix_rules): Install a default
suffix rule only if there is no user defined rule.
* tests/scripts/features/suffixrules: Add tests.
2023-02-20 15:17:24 -05:00
Paul Smith
f5dc17ac2d * tests/scripts/misc/general4: Only test empty PATH on UNIX 2023-02-20 11:11:59 -05:00
Paul Smith
ac159491da * gl/modules/make-glob: Avoid glibc glob if bug #866 is present 2023-02-19 17:43:12 -05:00
Paul Smith
4436655568 * tests/scripts/features/include [AIX]: Set explicit timestamps 2023-02-19 15:35:22 -05:00
Paul Smith
549fc56102 * tests/scripts/features/archives: Set CC properly 2023-02-19 14:49:56 -05:00
Paul Smith
37e0010743 Prerelease GNU Make 4.4.0.91
* NEWS: Update the date.
* configure.ac: Change the release.
2023-02-19 09:53:26 -05:00
Paul Smith
536c3e2b37 * src/makeint.h [CYGWIN]: Use pipe mode for the jobserver 2023-02-19 08:52:02 -05:00
Paul Smith
4c9b922560 Don't block for child exit if other commands have completed
Running regression tests on a single CPU system shows that if a child
exits while we're checking prerequisites we might not notice it, and
then we might block waiting for the next child to exit before we try
to do more work even though we could.

* src/remake.c (update_goal_chain): Remember the command_count before
we start checking prerequisites and if it is different when we restart
at the top of the goal chain then don't block.
2023-02-19 01:27:22 -05:00
Paul Smith
2449ef3c88 Clean up depth handling in debug output
The indentation shown in debug output was misleading.  Increment the
depth when we are working on a prerequisite, not for the current
target.

* src/remake.c (check_dep): Increment depth only on recursion.
(update_file_1): Ditto.  Don't show "Finished..." if prereqs are
still running.
* src/implicit.c (pattern_search): Increment depth for the entire
search.
* tests/scripts/features/output-sync: Support debug output when run
by hand.
2023-02-19 01:25:57 -05:00
Paul Smith
fbf8c940e5 * src/makeint.h (WIN32_LEAN_AND_MEAN) [Windows]: Don't redefine.
Suggested for tcc builds by Christian Jullien <eligis@orange.fr>.
2023-02-19 01:02:16 -05:00
KO Myung-Hun
62194015fa * src/misc.c (ttyname) [OS/2]: Add an implementation for OS/2 kLIBC 2023-02-19 01:02:16 -05:00
Paul Smith
c85f68c4e9 Allow jobserver style to be forced to "pipe"
Some systems that support mkfifo() don't support the usage that GNU
make wants.  Provide a way to force using "pipe" jobserver mode even
when mkfifo() is available.

* src/makeint.h (MK_OS_HURD): Define if we're on Hurd.
(JOBSERVER_USE_FIFO): Define if we have mkfifo() and we're NOT on
Hurd.
* src/main.c (main): Test JOBSERVER_USE_FIFO not HAVE_MKFIFO.
* src/posixos.c (jobserver_setup): Ditto.
* maintMakefile: Create a config check test for forcing "pipe" mode.
* tests/run_make_tests.pl: Show discovered FEATURES in verbose mode.
2023-02-19 01:02:16 -05:00
Paul Smith
ffa28f3914 [SV 63668] Use autoconf to detect the default C++ compiler
* configure.ac: Add AC_PROG_CXX to search for a C++ compiler.
(MAKE_CXX): Add the discovered compiler to config.h.
* src/default.c (default_variables): Use MAKE_CXX as the C++ compiler.
2023-02-05 10:22:13 -05:00
Paul Smith
8f03e69af0 * doc/make.texi: Fix typo (reported by <mao492479407@163.com>) 2023-02-05 09:42:49 -05:00
Paul Smith
e819fc2022 * tests/scripts/variables/MAKEFLAGS: Fix some Perl warnings 2023-02-04 13:12:32 -05:00
Dmitry Goncharov
f21cd822a3 * doc/make.texi: [SV 63689] Fix typos in examples 2023-01-28 13:09:36 -05:00
Paul Smith
2f336608d8 * src/job.c: Switch from bit operators to flags macros
* src/remake.c: Ditto.
2023-01-28 13:05:08 -05:00
Paul Smith
faedfdb0af [SV 63667] In .POSIX, use shell flags -c when ignoring errors
* src/variable.c (lookup_variable_for_file): New function to retrieve
a variable assignment in a file context.
* src/variable.h (lookup_variable_for_file): Declare it.
* src/job.c (construct_command_argv): Look up .SHELLFLAGS.  If .POSIX
is set and we're using the default value, choose -c if we're ignoring
errors else choose -ec.
(construct_command_argv_internal): Ditto.
* tests/scripts/targets/POSIX: Add tests.
2023-01-28 13:04:47 -05:00
Dmitry Goncharov
9709d273b2 * tests/scripts/features/archives: [SV 63688] Quote cmd line vars 2023-01-28 09:46:23 -05:00
Paul Smith
eb0bd1aaec * README.in: Mention README.z/OS 2023-01-28 09:28:18 -05:00
Paul Smith
d2bf740e77 * tests/test_driver.pl: Convert z/OS answers for regex output
Allow z/OS customizations to apply to regex output matching.
* tests/scripts/features/output-sync: Use a regex for Terminated.
* tests/scripts/features/temp_stdin: Ditto.
2023-01-15 16:35:57 -05:00
Paul Smith
a8890796a4 * tests/scripts/features/archives: Use the configured compiler for CC 2023-01-15 16:35:57 -05:00
Paul Smith
be6bb0fd68 * configure.ac: Delay setting HAVE_GUILE until we're sure 2023-01-15 10:27:34 -05:00
Paul Smith
db351fe85b Prerelease GNU Make 4.4.0.90
* NEWS: Update the date.
* README.git: Fix a typo.
* maintMakefile (check-alt-config): Report success.
(upload-*): Use the gnulib gnupload script for uploads.
2023-01-14 17:07:04 -05:00
Paul Smith
8a0d7fd4ef * tests/scripts/features/reinvoke: Warn about closing STDIN.
* tests/scripts/features/temp_stdin: Ditto.
* tests/scripts/options/dash-f: Ditto.
2023-01-11 20:35:11 -05:00
Eli Zaretskii
f51fc130cc [SV 63638] Fix processing PATH on MS-Windows
* src/variable.c (sync_Path_environment): Pass only the value of
PATH to convert_Path_to_windows32, excluding the "PATH=" part.
2023-01-11 15:44:56 +02:00
Paul Smith
b99b6cdf3c Update support for OS/2
Patches provided by KO Myung-Hun <komh78@gmail.com>

* NEWS: Add a note.
* AUTHORS: Add a new author.
* README.OS2: Updates to build instructions.
* src/dir.c (dir_contents_file_exists_p): Use a stack copy when
modifying a const string.
* src/job.c (construct_command_argv_internal): Ditto.
Reuse variables rather than re-defining them.
(exec_command): Cast a const string (we don't change it anyway).
* src/getopt.c (_getopt_initialize): Reference unused variables.
(_getopt_internal): Add block braces to quiet the compiler.
* src/main.c (main): Cast argument to child_execute_job().
* src/posixos.c (set_blocking): Reference unused variables.
* src/remake.c (f_mtime): Delete useless code.
2023-01-08 18:44:25 -05:00
Paul Smith
36f955b0e8 [SV 17448] Ignore whitespace around $(file ...) names
The other issues related to whitespace reported in this bug are
not addressed by this change.

* src/functions.c (func_file): Strip whitespace from the start and
end of the filename provided to the $(file ...) function.
* tests/scripts/functions/file: Add tests for this.
* tests/test_driver.pl: Use 3-arg version of open().
2023-01-08 18:06:54 -05:00
Paul Smith
a275f4e9ab [SV 61218] Ensure MAKEFLAGS is expanded even with -e
If -e was given we weren't expanding MAKEFLAGS before passing it
through the environment to jobs: we don't expand variables we
receive from the environment and when -e is given we set the
origin of MAKEFLAGS to "environment override".  Check for MAKEFLAGS
specifically, which seems like a hack but I don't have a better
idea offhand.

* src/main.c (main): Drive-by: use o_default for MAKEOVERRIDES.
* src/variable.c (target_environment): Always expand MAKEFLAGS
regardless of the origin type.
* tests/scripts/options/dash-e: Create a test.
2023-01-08 16:40:55 -05:00
Paul Smith
11444fb001 [SV 62654] Support GNU Make on z/OS
Original patches provided by Igor Todorovski <itodorov@ca.ibm.com>
Reworked by Paul Smith <psmith@gnu.org>.
Thanks to IBM for providing a test system.

* NEWS: Announce support.
* AUTHORS: Ditto.
* README.zOS: Provide details on building GNU Make on z/OS.
* build.sh (get_mk_var): z/OS sh has a strange bug which causes it to
generate extra lines of output: rework the function to print output
as we compute it instead of collecting it into a variable, which
works around this bug.
* src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS.
* src/arscan.c: Don't include <ar.h> on z/OS.
* src/job.c: We can't change environ in ASCII mode on z/OS.
* src/main.c: Ditto.  Also we can't use pselect() on z/OS.
* src/posixos.c: pselect() seems to hang on z/OS: don't use it.
* tests/run_make_tests.pl: Handle different exit codes on z/OS.
* tests/test_driver.pl: Preserve some special z/OS env.vars.
Add special checks to output comparisons when on z/OS.
* tests/scripts/features/archives: Don't validate names.  Don't
try to compile empty files as IBM compilers complain.
* tests/scripts/features/shell_assignment: Fix octal value of #.
* tests/scripts/features/temp_stdin: Don't print "term".
* tests/scripts/functions/shell: Handle shell exit codes.
* tests/scripts/targets/ONESHELL: Ditto.
* tests/scripts/targets/POSIX: sh -x prints differently.
* tests/scripts/variables/SHELL: Ditto.
2023-01-08 10:45:38 -05:00
Paul Smith
0de7a0d3bf Create src/mkcustom.h which is included by config.h
Put declarations for missing functions which we create in src/misc.c
into a file which is included by config.h via AH_BOTTOM().  This
ensures those prototypes are available, even in files added to
lib/... from gnulib.

* src/mkcustom.h: Add a new file with function declarations.
* configure.ac: Include src/mkcustom.h in config.h with AH_BOTTOM()
* Makefile.am: Add the header to the SRCS list.
* src/makeint.h: Remove content that we added to src/mkcustom.h.
* src/config.ami: Add #include "mkcustom.h" to specialized config.h.
* src/config.h-vms: Ditto.
* src/config.h.W32: Ditto.
* src/configh.dos: Ditto.
2023-01-08 10:45:24 -05:00
Paul Smith
1656cd051c Include <strings.h> globally
Various code uses str{,n}casecmp() so include <strings.h>, if it
exists, everywhere.

* configure.ac: Check for <strings.h> explicitly.
* src/makeint.h: Include it if HAVE_STRINGS_H, for str{,n}casecmp().
* src/job.c: Remove include of <strings.h>.
* src/main.c: Ditto.
2023-01-08 10:24:09 -05:00
Paul Smith
31a1337c23 * gl/lib/glob.c: Don't try to support _LIBC, don't use __stat() 2023-01-07 22:02:06 -05:00
Paul Smith
5ae02ff8c1 [SV 63609] Avoid buffer overrun in --warn-undefined-variables
Reported by Dmitry Goncharov <dgoncharov@users.sf.net>

* src/variable.c (struct defined_vars): Create a struct that holds the
name and length of each variable name.
(warn_undefined): Check the lengths before comparing the contents.
* tests/scripts/options/warn-undefined-variables: Add a test.
2023-01-03 02:14:24 -05:00
Paul Smith
1ceeb8c64b [SV 14927] Allow parallel builds for archives
Compare the timestamp of the object file (if it exists) with the
archived object and if the object file is newer, ensure it's updated
in the archive.

* NEWS: Announce the new capability.
* doc/make.texi (Dangers When Using Archives): Explain how to enable
parallel builds with archives.
* src/remake.c (f_mtime): For archive element files check the mod
time of the object file (if it exists) against the archive object
(if it exists).
* tests/scripts/features/archives: Add tests for this capability.
2023-01-03 01:57:35 -05:00
Paul Smith
8791d2b38e [SV 61463] Don't export inherited private variables
If a parent target has an exported variable that is private, don't
export it in child targets.

* NEWS: Mention this change.
* src/variable.c (target_environment): Ignore private inherited
variables.
* tests/thelp.pl: Add a new "env" operation to show env.var. values.
* tests/scripts/variables/private: Verify this new behavior.
2023-01-02 23:02:33 -05:00
Paul Smith
f91b8bbb34 Update ancient glob/fnmatch implementations
I looked again at trying to use the latest gnulib implemenentations
of GNU glob and fnmatch, and the effort required to extract them
from gnulib and make them portable to systems which don't support
configure is simply far too daunting for me.  However it's clear
that the previous implementations are growing too long on the tooth
to continue to be used without some maintenance, so perform some
upkeep on them.

- Remove support for pre-ANSI function definitions.
- Remove the obsolete "register" keyword.
- Assume standard ISO C90/C99 header file support.
- Assume standard ISO C "void" and "const" support.
- Avoid symbols prefixed with "__" as they're reserved.

* maintMakefile: Add a rule to verify lib has the latest content.
* src/dir.c: Use void* not __ptr_t which was removed.
* gl/lib/glob.c: See above.
* gl/lib/fnmatch.in.h: See above.
* gl/lib/glob.in.h: See above.
* gl/lib/fnmatch.c: See above.  Remove __strchrnul(): it is not
checked anywhere and is only used in one place anyway.
2023-01-02 22:53:05 -05:00
Paul Smith
8dc66b6c31 * doc/make.texi (Special Targets): Fix minor typo
Reported by Andrey Melnikov <vafilor@gmail.com>.
2023-01-02 00:13:28 -05:00
Paul Smith
ccbaf3861d Don't free uninitialized hash_table
* src/dir.c (clear_directory_contents): We use ht_vec to mark when
we have initialized the hash_table: don't free if it's NULL.
(everywhere): Use NULL instead of 0 when working with pointers.
2023-01-01 17:05:12 -05:00
Paul Smith
c4fbfe8b5e * maintMakefile: Add missing quote 2023-01-01 17:05:12 -05:00
Paul Smith
e7ce3a655e Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
Paul Smith
c580ebae8d Update to the latest gnulib stable branch
* bootstrap.conf: Request the latest gnulib stable branch.
* README.git: Recommend the argument form of autogen/autopull.
* bootstrap: Import the latest version of bootstrap.
* bootstrap-funclib.sh: Ditto.
* autogen.sh: Ditto.
* autopull.sh: Ditto.
2023-01-01 17:05:12 -05:00
Paul Smith
56d2978141 Update the copyright year on all files 2023-01-01 10:06:01 -05:00
Paul Smith
c91b269f66 Apply spelling fixes discovered by Codespell
* maintMakefile: Apply spelling fixes.
* src/file.c: Ditto.
* src/misc.c: Ditto.
* src/remake.c: Ditto.
* src/vmsjobs.c: Ditto.
* src/w32/pathstuff.c: Ditto.
* tests/test_driver.pl: Ditto.
* tests/run_make_tests.com: Ditto
* tests/scripts/features/implicit_search: Ditto
* tests/scripts/features/output-sync: Ditto
* tests/scripts/features/patternrules: Ditto
* tests/scripts/features/se_explicit: Ditto
* tests/scripts/features/statipattrules: Ditto
* tests/scripts/functions/foreach: Ditto
* tests/scripts/variables/MAKEFLAGS: Ditto
2022-12-31 13:21:09 -05:00
Paul Smith
29f453739f Avoid using false(1) in regression tests
The POSIX standard only requires false(1) to return a "non-zero" exit
code; almost all systems return 1 but some (Solaris!!!) return 255 or
possibly even other values.  Use our helper "fail" instead.

* tests/thelp.pl: Have the "fail" command obey -q.
* tests/scripts/features/parallelism: Helper -q no longer prints fail.
* tests/scripts/targets/POSIX: Replace false with #HELPER# -q fail 1.
* tests/scripts/variables/MAKEFLAGS: Ditto.
* tests/scripts/variables/SHELL: Ditto.
2022-12-31 10:51:24 -05:00
Paul Smith
937e9aa32d Make bootstrap.bat more portable
Using backslashes in a sed command line is tricky as different programs
use them differently as escape sequences.  Eli Zaretskii points out
that Windows "echo" doesn't do any processing, so rework all our sed
invocations to use script files created by echo.

* bootstrap.bat: Use echo to create sed script files instead of -e.
* Basic.mk.template: Fix typo in the comments.
* .gitignore: Ignore any .sed scripts.
2022-12-26 13:10:26 -05:00
Paul Smith
8e9c7db1e1 * NEWS: Add a section for the next release
Add a note for the MAKEFLAGS enhancements.
2022-12-24 15:48:48 -05:00
Paul Smith
15dfad96d7 [SV 63439, SV 63452] Don't warn on undefined internal variables
Don't generate undefined variable warnings for variables that are
internal / special to make and where the empty string is valid.
Rather than defining them to empty, which could introduce unwanted
behavior, keep a list of variable names which we should never warn
about.

* src/variable.h (warn_undefined): Convert the macro to a function.
* src/variable.c (defined_vars): Always "defined" variable names.
(warn_undefined): Implement as a function and check against the
defined_vars before generating a warning.
* src/read.c (read_all_makefiles): No need to reset warning flag.
* src/vpath.c (build_vpath_lists): Ditto.
* tests/scripts/options/warn-undefined-variables: Expand all the
pre-defined variables to ensure warnings are not generated.
2022-12-24 10:52:49 -05:00
Paul Smith
76d2e5d98d [SV 63552] Change directories before constructing include paths
* src/makeint.h (reset_makeflags): New function to handle changing
MAKEFLAGS from within makefiles.  Remove decode_env_switches().
* src/variable.c (set_special_var): Call reset_makeflags() instead
of various internal methods.
* src/main.c (decode_env_switches): Only internal now so make static.
(decode_switches): Don't invoke construct_include_path() yet.
(reset_makeflags): Decode env switches and construct include paths.
(main): Construct include paths after we process -C options.
* tests/scripts/options/dash-C: Rewrite to use new test constructs.
Add a test using both -C and -I together.
Add a test for multiple -C options.
2022-12-24 10:52:43 -05:00
Paul Smith
a581146562 tests [WINDOWS32]: Support Strawberry Perl on Windows
Strawberry Perl has some different behaviors from ActiveState Perl
which impact the test suite:

- Avoid Perl's chomp() as it may not remove CRs; chomp() may remove
  only the final NL but not the CR in a CRNL line ending.
- Strawberry Perl doesn't support ActiveState's system(1, ...) form.
- Strawberry Perl (or msys?) does something weird with "/tmp" when
  provided to exec(), replacing it with the user's %TEMP%.
- Strawberry Perl uses msys paths like /c/foo instead of C:\foo.

* tests/test_driver.pl (get_osname): Strawberry Perl uses 'msys' as
its $^O so if we see that use a port of 'W32'.
(_run_with_timeout): Strawberry Perl doesn't support the special
system(1, ...) form of system() so use POSIX standard fork/exec.
(compare_answer): Paths generated by Strawberry Perl use msys path
format (e.g., /c/foo instead of C:\foo); check for those differences
and compare RE against both the unmodified and modified log.
* tests/run_make_tests.pl (set_defaults): Switch from chomp to s///
to remove CRNL and NL line endings.
* tests/scripts/features/errors: Executing directories on Strawberry
will give an error; translate it to Windows error output format.
* tests/scripts/features/output-sync: Ditto.
* tests/scripts/features/temp_stdin: Ditto.
* tests/scripts/functions/realpath: Ditto.
* tests/scripts/options/dash-I: Ditto.
* tests/scripts/variables/INCLUDE_DIRS: Ditto.
* tests/scripts/misc/close_stdout: /dev/full is reported as existing
on Strawberry Perl, but it doesn't do anything.  Skip the test.
* tests/scripts/variables/MAKEFLAGS: When an argument containing
/tmp is passed to a program via exec(), something replaces it with
the expansion of the %TEMP% variable.  Instead of using /tmp create
a local directory to use.
2022-12-20 02:14:18 -05:00
Paul Smith
b2c7446023 * tests/test_driver.pl: Remember if something failed and report it 2022-12-20 02:07:28 -05:00
Paul Smith
89427039c3 [WINDOWS32] Remove CRNL from FormatMessage() result string
Sometimes the error message is expected to contain a newline, other
times it is not.  Also the result of FormatMessage() sometimes ends
in CRNL already: when printed via fprintf() the final newline is
converted to CRNL, giving an output of CRCRNL which causes tests
to fail to match.  Remove any CR/NL chars from the result string.

* src/job.c (reap_children): Add \n to the error message fprintf.
(exec_command): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Remove
any trailing CR or NL from the string before returning.
2022-12-19 00:20:06 -05:00
Dmitry Goncharov
7d8756a4a3 [SV 63537] Document and test flippable switches
* doc/make.texi (Options/Recursion): Clarify that MAKEFLAGS values
from the environment have precedence over those set in the makefile.
* tests/scripts/variables/MAKEFLAGS: Check boolean switches -k/-S,
-w/--no-print-directory and -s/--no-silent as follows:
1. A switch can be enabled or disabled on the command line.
2. A switch can be enabled or disabled in env.
3. A switch can be enabled or disabled in makefile.
4. Command line beats env and makefile.
5. Env beats makefile.
6. MAKEFLAGS contains each specified switch at parse and build time.
7. If switches are specified in multiple origins, MAKEFLAGS contains
   the winning switch at parse and build time.
8. MAKEFLAGS does not contain the losing switch.
Also test that --debug settings from different origins are combined
together into one option.
2022-12-18 20:06:38 -05:00
Dmitry Goncharov
8e805c7ba6 [SV 63537] Pass enabled-by-default switches to submake
Certain switches, such as -S or --no-silent, turn on behavior that is
enabled by default.  When a switch is specified via the command line,
makefile, or env, ensure the switch is added to MAKEFLAGS.

* src/main.c (struct command_switch): Add bit "specified".
(switches): Initialize command_switch->specified.
(decode_switches): Set command_switch->specified.
(define_makeflags): Check command_switch->specified.
2022-12-18 20:06:38 -05:00
Dmitry Goncharov
132528b266 [SV 63537] Remember the origin of command line options
Certain options can be flipped on and off: -k/-S, -s/--no-silent, and
-w/--no-print-directory.  Ensure they behave as follows:
 1. A switch can be enabled or disabled on the command line.
 2. A switch can be enabled or disabled in env.
 3. A switch can be enabled or disabled in makefile.
 4. Command line beats env and makefile.
 5. Env beats makefile.

* src/main.c: Add variables to hold the origin of relevant options.
(struct command_switch): Add origin field.
(switches): Set a pointer to hold the origin of relevant options.
(decode_switches): For any switch that can be specified in makefile or
env, honor the switch only if cs->origin is not set or the specified
origin beats cs->origin.  Set cs->origin when relevant.
2022-12-18 20:06:38 -05:00
Dmitry Goncharov
8f9e7722ff [SV 63537] Fix setting -w in makefiles
* src/makeint.h: Replace print_directory flag with should_print_dir().
* src/main.c (main): Remove print_directory flag and related code.
(should_print_dir): Create.
* src/output.c (output_dump): Use should_print_dir().
(output_start): Ditto.
2022-12-18 20:06:38 -05:00
Dmitry Goncharov
95c2db7b8d [SV 63484] Force included makefiles to be explicit
Ensure included makefiles are not treated as intermediate, even if
they are created by an implicit rule.
Reported by Patrick Oppenlander <patrick.oppenlander@gmail.com>.

* src/read.c (eval_makefile): Mark makefiles as explicit.
* tests/scripts/features/include: Add a test.
2022-12-18 20:06:38 -05:00
Paul Smith
5d1b757517 [SV 63516] [DOS] Support include files with drivespecs
* src/makeint.h (HAVE_DRIVESPEC): Create a macro to check.
* src/main.c (.FEATURES): Add "dospaths" as a feature.
* src/read.c (eval_makefile) [DOS]: If the included makefile name
starts with a drivespec, don't search the include directories.
* doc/make.texi (Include): Document this behavior.
* tests/scripts/features/include: Add a test.
2022-12-18 20:06:38 -05:00
Paul Smith
c0023150f1 * src/job.c (new_job): [SV 63510] Trace phony prerequisite rebuilds 2022-12-18 14:44:17 -05:00
Paul Smith
a89eef87e6 * configure.ac: Update for a new release
* README.git: Add some packages needed for building from Git.
* AUTHORS: Updates.
2022-12-18 14:44:17 -05:00
Dmitry Goncharov
6164608900 [SV 63417] Ensure global .NOTINTERMEDIATE disables all intermediates
Fix .NOTINTERMEDIATE without prerequisites to disable intermediate
status for all targets.

* src/makeint.h: Declare extern no_intermediates.
* src/main.c: Add global definition of no_intermediates.
* src/file.c: Remove static no_intermediates to use global variable.
(remove_intermediates): Check no_intermediates.
* src/implicit.c (pattern_search): For a file found by implicit search
set file->notintermediate if no_intermediates is set.
* src/remake.c (update_file_1): Don't set file->secondary for a
pre-existing file if no_intermediates is set.  The check for
no_intermediates here is redundant, but won't hurt: keep it in case
things change so that it matters.
* tests/scripts/targets/NOTINTERMEDIATE: Fix a test.
2022-11-28 10:50:55 -05:00
Paul Smith
a99183ed2b * doc/make.texi: Use $(firstword) rather than $(word 1,) 2022-11-28 10:50:55 -05:00
Dmitry Goncharov
dc2d963989 [SV 63347] Always add command line variable assignments to MAKEFLAGS
This commit introduces two visible changes:
1. Keep command line variable assignments in MAKEFLAGS at all times,
   even while parsing makefiles.
2. Define makeflags immediately when a makefile modifies MAKEFLAGS.

The new MAKEFLAGS and MAKEOVERRIDES initialization procedure:
1. decode_switches (argc, argv, o_command) is called to parse command
   line variable assignments.
2. Command line variable assignments go through quote_for_env.
   Initialize -*-command-variables-*- to the quoted values.
3. MAKEOVERRIDES is initialized to refer to -*-command-variables-*-
   with origin o_env to keep the definitions in the database intact.
4. define_makeflags() is called which adds MAKEOVERRIDES to MAKEFLAGS.
5. Makefiles are parsed.  If a makefile modifies MAKEFLAGS, the new
   value of MAKEFLAGS is defined right away.
6. Env switches are decoded again as o_env.  The definitions set by
   decode_switches at step 1 stay intact, as o_command beats o_env.

We must preserve the original intact definitions in order to detect
failure cases; for example:
  $ cat makefile
  all:; $(hello)
  $ make hello='$(world'
  makefile:1: *** unterminated variable reference.  Stop.

* src/makeint.h: Declare enum variable_origin, struct variable and
define_makeflags().  Add parameter origin to decode_env_switches().
* src/main.c (define_makeflags): Remove "all". If a variable is
assigned on the command line then append MAKEOVERRIDES to MAKEFLAGS.
(decode_env_switches): Replace parameter env with origin.
(decode_switches): Replace parameter env with origin.
Treat origin == o_command as env == 0.
(handle_non_switch_argument): Replace parameter env with origin.
Treat origin == o_command as env == 0.
(main): Call decode_switches() with origin==o_command before parsing
makefiles.  Call decode_switches() with origin==o_env after parsing
makefiles.
* src/variable.c (set_special_var): Define makeflags at parse time,
each time a makefile modifies MAKEFLAGS.
(do_variable_definition): Strip command line variable assignments from
MAKEFLAGS before appending extra flags.  set_special_var() adds them
back.
* tests/scripts/variables/MAKEFLAGS: Add tests.
2022-11-28 10:50:55 -05:00
Paul Smith
53b8f6a5da * src/main.c (main): [SV 63373] Don't use macros with memcmp()
Reported by djm <mccannd@uk.ibm.com>
2022-11-16 10:00:34 -05:00
Paul Smith
6c1a6dd77c Add specific hints for errors due to invalid conditionals
* src/read.c (eval): If "missing separator" appears to be due to
missing space after ifeq/ifneq, give a hint about the error.
* tests/scripts/misc/failure: Check for these types of failures.
* tests/scripts/variables/special: Move error checking unrelated
to special variables, to misc/failure.
2022-11-15 10:50:34 -05:00
Dmitry Goncharov
1b51ba1f5d [SV 63333] Be more lenient when failing to create temporary files
If make cannot create a temporary lock file for output sync, continue
without output sync enabled rather than dying.

However, if make cannot store a makefile from stdin to a temporary
file that is still a fatal error.

* misc.c (get_tmppath): Keep running on failure to generate a
temporary file name.
(get_tmpfd): Keep running on failure to get a temporary file.
(get_tmpfile): Keep running on failure to open a temporary file.
Ensure memory is freed if we return an error.
* posixos.c (os_anontmp): Keep running on failure to open an
anonymous temporary file.
* output.c (setup_tmpfile): Print an error on failure to create an
output sync lock file.
* main.c (main): Die on failure to store makefile from stdin to a
temporary file.
* tests/scripts/features/output-sync: Add tests.
* tests/scripts/features/temp_stdin: Ditto.
2022-11-13 16:34:01 -05:00
Paul Smith
4c9d87f4ae Keep going if we can't connect to the jobserver
* src/posixos.c (jobserver_parse_auth): Don't invoke fatal() if we
can't connect to an existing jobserver: just keep going without it.
* src/w32/w32os.c (jobserver_parse_auth): Ditto.
* tests/scripts/features/jobserver: Add a test for invalid FIFO
auth files.
2022-11-13 10:39:48 -05:00
Paul Smith
bb5df35133 * src/dir.c (dir_contents_file_exists_p): Show dir name in error.
If we fail to read a directory show the directory name in the error
message.  Pass struct directory instead of directory_contents to
allow that.
(dir_file_exists_p): Change dir_contents_file_exists_p caller.
(open_dirstrem): Ditto.
2022-11-13 10:39:48 -05:00
Paul Smith
92ab2e642d * src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal signal
Always ignoring SIGPIPE is visible to child processes.
2022-11-13 10:39:48 -05:00
Paul Smith
deb4ff272a [SV 63315] tests: Simplify TERM signaling
Tests that try to kill the make process were not behaving as expected
on OpenBSD: the signal was sent from make to its children but the
sleep didn't die.  Something odd about the way the shell treats TERM.
To reduce platform dependencies add "term" to the helper tool and run
that instead of kill / sleep.

* tests/thelp.pl: Add a new operation "term" that takes a PID.
* tests/scripts/features/output-sync: Use it.
* tests/scripts/features/temp_stdin: Ditto.
2022-11-13 10:39:48 -05:00
Paul Smith
e80ce6fc90 [SV 63315] Allocate function names when defining functions
* src/function.c (define_new_function): Don't keep a pointer to the
user-provided name of a user-defined function: if the .so is unloaded
it will point to garbage.  Add the name to the strcache instead.
2022-11-13 10:39:48 -05:00
Paul Smith
d71c0bb0ce tests: Don't convert \ to / when checking regex's
When tests compare the output they will try converting backslashes
to slashes to see if that works.  When we compare using regex's,
we can't do that because backslashes can escape special characters.

* tests/test_driver.pl (compare_output): Clean up this function.
(compare_answer_vms) [VMS]: Comparing answers on VMS is complex;
move all of it into its own function returning 0/1.
(compare_answer): A new function to compare answers: return 0/1.
Remember the CRLF->LF conversion forever; only check \ -> / when
we compare strings, not regex's.
2022-11-13 10:39:48 -05:00
Justine Tunney
090d99dd2d * src/hash.c (jhash_string): Help the compiler optimize the hash
Invoke memcpy() with a constant length, where possible.

Copyright-paperwork-exempt: yes
2022-11-13 10:38:50 -05:00
Paul Smith
6b45f89adb * src/config.h.W32 [TCC]: Only redefine strtoll if not defined 2022-11-12 10:34:35 -05:00
Eli Zaretskii
11f7198f64 * src/config.h.W32: Fix last change. 2022-11-09 15:15:20 +02:00
Eli Zaretskii
4321c5e562 Fix build with Tiny C
* src/config.h.W32 (strtoll, strtoull) [__TINYC__]: Redirect to
_strtoi64 and _strtoui64, respectively.  Reported by Christian
Jullien <eligis@orange.fr>.
2022-11-05 16:46:58 +02:00
Paul Smith
ed493f6c91 Release GNU Make 4.4
* NEWS: Update the version and date.
* configure.ac: Update the version.
* doc/make.texi: Update the EDITION.
2022-10-31 02:23:04 -04:00
Paul Smith
7c3260bbdd * README.git: Update and clarify release operations 2022-10-31 02:23:04 -04:00
Paul Smith
38b19976f5 Fix issues found by ASAN and Coverity
* tests/test_driver.pl: Preserve the LSAN_OPTIONS variable.
* tests/scripts/targets/ONESHELL: Don't set a local variable.
* tests/scripts/functions/let: Test empty let variable.
* src/posixos.c (osync_parse_mutex): Free existing osync_tmpfile.
* src/misc.c (get_tmpfd): Set umask() before invoking mkstemp().
* src/ar.c (ar_parse_name): Check invalid name (shouldn't happen).
* src/function.c (define_new_function): Free previous function entry
when replacing it with a new one.
* src/job.c (child_execute_job): Initialize pid for safety.
(construct_command_argv_internal): In oneshell mode ensure that the
returned argv has the right format (0th element is a pointer to the
entire buffer).
2022-10-31 02:23:04 -04:00
Paul Smith
1dd52ab472 Avoid C99 constructs
Although gnulib requires C99, most of the code does compile with a
C90 compiler (perhaps with a lot of warnings).  Reinstate our C90
configuration test, and clean up a few C99 things that crept in.

* src/job.c (construct_command_argv_internal): Don't use loop-local
variables or C++ comments.
* src/read.c (eval_makefile): Don't use loop-local variables.
2022-10-29 13:36:21 -04:00
Paul Smith
92789aa2e7 * build.sh: Allow a "keep-going" mode during builds 2022-10-29 13:36:21 -04:00
Paul Smith
4e18732a1d tests: Avoid the use of File::Temp->newdir()
This was added in Perl 5.8 but some systems still only provide older
versions such as Perl 5.6.  We don't really need it anyway.
Paul Eggert <eggert@cs.ucla.edu> reported this issue.

* tests/README: Update this to be a bit more modern.
* tests/test_driver.pl: Delete the $TEMPDIR variable.
* tests/scripts/features/temp_stdin: Use $temppath not $TEMPDIR.
2022-10-29 13:36:21 -04:00
Paul Smith
11f9da227e * src/posixos.c (os_anontmp): [SV 63287] Only fail O_TMPFILE once
Reported by Dmitry Goncharov <dgoncharov@users.sf.net>.
2022-10-29 13:36:21 -04:00
Paul Smith
b92340a1ea [SV 62174] Force locale to be "C" before retrieving error messages
We attempt to do this with POSIX::setlocale() but apparently on some
systems (AIX) this isn't sufficient.  So, in addition force the LC
environment variables to use "C".
Reported by Dmitry Goncharov <dgoncharov@users.sf.net>.

* tests/run_make_tests.pl: Move the global setup into set_default().
Force the %ENV locale variables to use the ones we'll use when running
make, then reset them back again after we find error messages.
2022-10-28 17:39:06 -04:00
Paul Smith
8064aee4f9 * src/job.c: [SV 63185] Don't use ifdef with HAVE_DECL_* macros 2022-10-27 15:20:40 -04:00
Paul Smith
cf78e65fda * tests/scripts/features/exec: Don't test with C shells
Using C shells (csh, tcsh) with make is known to be problematic due
to incorrect ways it handles open file descriptors, at least.  If
the user's shell is *csh then don't try it during exec tests.
2022-10-25 14:49:10 -04:00
Paul Smith
04f0d8427f Increase the test framework timeout from 5s to 60s
It seems that some of the test environments hit the 5s timeout on
some tests.  Since it doesn't really matter, as long as we don't
hang forever, increase the timeout to 60s.

* tests/test_driver.pl: Increase $test_timout to 60.  We don't need
to handle VMS timeouts specially anymore.
* tests/scripts/features/parallelism: We don't need to override the
default timeout anymore.
* tests/scripts/features/patternrules: Remove confusing comment.
2022-10-25 14:44:26 -04:00
Paul Smith
f8401ad28b * Makefile.am (check-regression): Add a random suffix to results file
Put the results into a subdirectory for easy unpacking.
* .gitignore: Ignore it.
2022-10-25 14:42:52 -04:00
Paul Smith
e4b3bf7f97 Release GNU Make 4.3.92
* configure.ac: Modify the release version.
* NEWS: Update the version and date.
2022-10-24 02:14:42 -04:00
Paul Smith
d18a87d0a4 [SV 63260] Don't recurse forever if setup_tmpfile() fails
If we fail during setup_tmpfile() we'll try to write an error, which
will invoke setup_tmpfile() again, etc.  Avoid infinite recursion.
Original patch by Dmitry Goncharov <dgoncharov@users.sf.net>

* src/output.c (setup_tmpfile): Remember we're in this function and
return immediately if we enter it during recursion.
(message): Remember the starting location and use that instead of
fmtbuf.buffer.
(error): Ditto.
(fatal): Ditto.
2022-10-24 01:50:12 -04:00
Paul Smith
41c35f2ffe * src/output.c (_outputs): Don't use invalid output sync FDs
Just write to stdout/stderr in this situation.
2022-10-24 01:50:12 -04:00
Paul Smith
deb4a42c3e * src/misc.c (get_tmpdir): Report errors if tmpdirs are invalid
* src/main.c (main): Set up initial temporary directories.
2022-10-24 01:50:12 -04:00
Dmitry Goncharov
252c26bd20 * src/posixos.c (os_anontmp): If O_TMPFILE fails try dup() method. 2022-10-23 18:41:50 -04:00
Paul Smith
6f8da5f4b8 * src/rule.c (get_rule_defn): Don't use STRING_SIZE_TUPLE in mempcpy
If mempcpy() is a macro then STRING_SIZE_TUPLE won't compile.
2022-10-23 18:41:50 -04:00
Paul Smith
c46b5a9e0e Provide a maintainer-only debug method
Generating debug logs to stdout or stderr makes it impossible to
run tests etc. so create a dumb DBG facility to log to a temp file.
This exists only in maintainer mode and the DBG macro gives a
compile error if it's used in non-maintainer mode.

* src/makeint.h (DBG): Call dbg() in maintainer mode, else error.
(dbg): Define it in maintainer mode.
* src/misc.c (dbg): Open a log file for append, write, then close.
2022-10-23 18:41:50 -04:00
Paul Smith
b4157d2ff4 * configure.ac: Check that we can link with Guile
On multi-arch systems we may be able to find the header file but
not successfully link the library.
2022-10-22 22:40:26 -04:00
Paul Smith
f364e0d8d6 Set PATH_MAX on systems without a default value
Some systems (HURD) use fully-dynamic pathnames, with no limit.
We can't support this without significant effort so for now set
PATH_MAX to a large value.

* src/makeint.h: Set PATH_MAX to 4096 if not set and MAXPATHLEN
is also not set.  Remove MAXPATHLEN setting: we won't use it.
* src/misc.c (get_path_max): If we can't get the path max via
pathconf() use the default PATH_MAX.
* src/dir.c (find_directory) [W32]: Use MAX_PATH not MAXPATHLEN.
(local_stat) [W32]: Ditto.
* src/job.c (create_batch_file) [W32]: Ditto.
* src/remake.c (name_mtime) [W32]: Ditto.
* src/w32/w32os.c (os_anontmp) [W32]: Ditto.
2022-10-22 22:40:26 -04:00
Paul Smith
bb0c05a7f0 [SV 63098] Enhance detection of missing peer also-make targets
The previous attempt to detect missing peer targets for implicit
rules had some holes.  Move the detection to notice_finished_file().

* src/remake.c (check_also_make): If we don't have the current mtime
for the file, obtain it.
(update_goal_chain): Don't call check_also_make() here.
(check_dep): Ditto.
(notice_finished_file): If we finished running an implicit rule that
has also_make targets, invoke check_also_make().
2022-10-22 22:40:26 -04:00
Paul Smith
f987d181c4 Collect failure details when the regression tests fail
* README.in: Add a section on running regression tests.
* Makefile.am (check-regression): Capture the test run output, and
on failure collect configure and test results into a tar file.
2022-10-22 22:40:26 -04:00
Paul Smith
cad3ddd165 Enhance tests to work on different systems
The GNU platform testers reported a number of test errors on
different systems; try to address them.

* tests/thelp.pl: A number of tests timed out with a 4-second
timeout.  Increase the default timeout to 10 seconds.
* tests/run_make_tests.pl: Executing directories on cygwin behaves
differently in Perl than make so skip these tests there.
* tests/scripts/options/symlinks: Check for the symlink feature
in make, rather than whether the system supports them.
* tests/scripts/features/implicit_search: On some systems "false"
exits with a different exit code.  Use the helper instead.
* tests/scripts/features/loadapi: Ditto.
* tests/scripts/features/output-sync: Sleep before make -f bar in
the first test as well as the second one.
* tests/scripts/features/exec: Skip on cygwin, which seems to
be "UNIX" but where scripts don't run normally.
* tests/scripts/misc/fopen-fail: Skip on cygwin, where make
eventually exits with exit code 0 and no error messages.
2022-10-22 22:37:49 -04:00
Dmitry Goncharov
54214176b1 [SV 63243] tests: Avoid SIGTERM racing with make error messages
Original patch from Frank Heckenbach <f.heckenbach@fh-soft.de>.

* tests/scripts/features/output-sync: Introduce a sleep to let make
write its error message.  Some systems use different names for
SIGTERM so match with a regex.
* tests/scripts/features/temp_stdin: Ditto.
2022-10-22 10:02:41 -04:00
Dmitry Goncharov
c2f92c980f [SV 63236] Fix getloadavg related error message on AIX
On AIX getloadavg keeps errno intact when it fails, resulting in a
bogus error message from make.

* src/job.c (load_too_high): Reset errno before calling getloadavg.
2022-10-22 09:45:40 -04:00
Dmitry Goncharov
5b1ca277ca [SV 63248] Ignore SIGPIPE
Don't terminate when make's output is redirected to a pipe and the
reader exits early; e.g.:
  $ echo 'all:; sleep 2' | make -f- -j2 -O |:

This lets us unlink temporary files, and tell the user that make was
not able to write its output.
Reported by Frank Heckenbach <f.heckenbach@fh-soft.de>.

* src/main.c (main): Ignore SIGPIPE.
* src/posixos.c (osync_clear): Fix a memory leak.
2022-10-22 09:45:40 -04:00
Paul Smith
7c71df5695 * NEWS: Release GNU make 4.3.91 2022-10-18 14:37:47 -04:00
Paul Smith
a0956c1803 * AUTHORS: Update the authors list. 2022-10-18 14:37:47 -04:00
Paul Smith
4ec74e568d * NEWS: Use GNU Make instead of GNU make
* README.git: Ditto.
* README.Amiga: Ditto.
* README.DOS: Ditto.
* README.OS2: Ditto.
* README.VMS: Ditto.
* README.W32: Ditto.
* README.customs: Ditto.
* make-gdb.py: Ditto.
* tests/run_make_tests.pl: Ditto.
2022-10-18 14:37:47 -04:00
Paul Smith
d9fc1ac5d2 Update URLs to use https rather than http
* (all): Change http:// to https://
* README.W32: Remove invalid link to mingw.org.
2022-10-18 14:37:47 -04:00
Paul Smith
9f55e9fd13 Rework temp file handling to avoid GNU libc warnings
Original patch provided by Paul Eggert <eggert@cs.ucla.edu>.
GNU libc will generate a link-time warning if we use mktemp() even
though we are using it safely (we only use it with mkfifo()).
Avoid this and clean up some handling.

First, check all calls related to temporary files and exit with a
fatal error and a useful message if we can't obtain them.  In some
situations it might be possible to continue with reduced capability
but it's not worth the effort.

On POSIX systems we can create anonymous temp files using O_TMPFILE
if it's supported, else if we're using the default location and we
have dup(2), we can use standard tmpfile() and get an FD from it.

If we need a named temp file and FILE* and we have mkstemp() we can
use that, else if we have fdopen() we can get a temp FD and open it.
If none of those are available all we can do is generate a temp name
then open it with fopen() which is not secure.

* src/makeint.h (get_tmpdir): Declare it for use elsewhere.
* src/misc.c (get_tmpdir): Make it public not static.
(get_tmptemplate): Simplify the implementation.
(get_tmppath): Only define this if we have to have it to avoid
warnings from GNU libc.
(get_tmpfd): Generate fatal errors on error.
(get_tmpfile): Ditto.  Open files in "wb+" mode to match tmpfile().
Require a filename pointer (all callers want it).
* src/os.h (os_anontmp): Implement for posixos.c as well.
* src/posix.c (jobserver_setup): Don't use mktemp to avoid GNU libc
errors.  Instead construct the FIFO name based on the PID.
(osync_setup): get_tmpfd() can't fail so don't check it.
(os_anontmp): If the system supports O_TMPFILE use it.  If not, and
we want to create the temporary file in the default directory, we
can use tmpfile() then use dup() to copy the file descriptor.
* src/main.c (main): get_tmpfile() can't fail.
* src/vmsjobs.c (child_execute_job): get_tmpfile() can't fail.
2022-10-18 14:20:44 -04:00
Paul Smith
7bb7bb4ba4 Add ISDIRSEP() helper macro and use it
Create a ISDIRSEP() macro to check for directory separator chars
using the stopchar_map, and replace inline checks and explicit
STOP_SET calls with this macro.

* src/makeint.h (ISDIRSEP): Create the macro using MAP_DIRSEP.
* src/dir.c (find_directory): Replace inline checks with ISDIRSEP.
(file_exists_p): Ditto.
(file_impossible): Ditto.
(file_impossible_p): Ditto.
(local_stat): Ditto.
* src/file.c (lookup_file): Ditto.
* src/function.c (abspath): Ditto.
* src/job.c (_is_unixy_shell): Ditto.
(is_bourne_compatible_shell): Ditto.
(construct_command_argv): Ditto.
* src/main.c (find_and_set_default_shell): Ditto.
(main): Ditto.
* src/read.c (eval): Ditto.
(parse_file_seq): Ditto.
* src/remake.c (name_mtime): Ditto.
* src/vpath.c (construct_vpath_list): Ditto.
2022-10-18 14:20:44 -04:00
Paul Smith
b79791533b Add preprocessor macros for different platforms
* configure.ac: MK_CONFIGURE shows config.h was generated by configure.
* src/config.ami: Define MK_AMIGAOS.
* src/config.h-vms: Define MK_VMS.
* src/configh.dos: Define MK_DJGPP.
* src/config.h.W32: Define MK_W32 and WINDOWS32.
* src/build_w32.bat: Let WINDOWS32 be defined by config.h.  Remove
unused setting of WIN32.
* src/job.c: Clean up use of WIN32.
* src/main.c: Ditto.
* tests/scripts/features/default_names: Ditto.
2022-10-18 14:20:44 -04:00
Paul Smith
9d24d41801 Check for recipe line count overflow before it overflows
awk 'BEGIN {
       print "x:"
       for (i = 0; i < 65536; i++)
         printf "\techo %d\n", i}
    ' | make -f -

Outputs only "make: 'x' is up to date."  Larger values run only the
lines above 65536.  Reported by Paul Eggert <eggert@cs.ucla.edu>.

* src/commands.c (chop_commands): Check the line count before it has
a chance to overflow.  Use size_t for max count so it can't overflow.
Remove stray 'd' in diagnostic.
2022-10-18 14:20:44 -04:00
Paul Smith
2d943d3d2e Remove template files to simplify distribution creation
The README templates were not useful since the replacement step
didn't have anything to replace: rename them.

Rather than creating template files for the config variants, create
mkconfig.h.in containg PACKAGE_* variables to be replaced, and have
config variant header files include it.  Note on POSIX we don't use
this, and continue to generate a single config.h.in file.

Use config.status to convert the README.in and mkconfig.h.in files
during distribution creation.

Modify all users of VERSION to use PACKAGE_VERSION instead.

* configure.ac: Use GNU Make not GNU make as the package name.
* README.in: Use GNU Make not GNU make.
* README.git: Remove references to README.W32.template.
* .gitignore: Update for new behavior.
* Basic.mk.template: Remove unused posix_SOURCES and VERSION, and
references to unshipped mk/Posix.mk
* Makefile.am: Add src/mkconfig.h as an extra dist file.
* bootstrap.bat: Rewrite mkconfig.h.in to mkconfig.h
* maintMakefile: Remove obsolete template files; add mkconfig.h.in.
* prepare_vms.com: Rewrite mkconfig.h.in to mkconfig.h
* mk/VMS.mk: Fix incorrect header file prerequisite.
* src/mkconfig.h.in: New file containing PACKAGE variables.
* src/config.ami: Include mkconfig.h.
* src/config.h.W32: Ditto.
* src/configh.dos: Ditto.
* src/config.h-vms: Ditto.
* src/version.c: Use PACKAGE_VERSION not VERSION.
2022-10-18 14:20:44 -04:00
Juan M. Guerrero
b16913a67e Support building with DJGPP 2.05
* builddos.bat: Use env var settings for paths.  Fix a typo in
expand.o.  Add the missing load.o compilation and link.  Enable
Guile support.  Copy Basic.mk from the correct location.
* src/configh.dos.templage: DJGPP supports strtoll() and ssize_t
given new enough versions.  Set preprocessor variables to 1 not 0.
2022-10-16 16:19:42 -04:00
Paul Smith
72ee43c473 * src/job.c: [SV 63185] Include sys/loadavg.h if needed. 2022-10-16 16:19:42 -04:00
Paul Smith
e5e538fb7a [SV 63215] Remember the random seed for shuffle mode
Basic fix provided by James Hilliard <james.hilliard1@gmail.com>.
Ensure we remember and propagate the random seed we generate during
shuffle mode.  Also add a debug statement displaying the seed.

* src/shuffle.c (shuffle_set_mode): Init and save the randoms seed.
* src/misc.c (make_rand): Code cleanups.
* src/main.c (main): Show a debug message containing the seed.
2022-10-16 16:18:21 -04:00
Paul Smith
c453f898a0 Use (void) rather than () in function declarations
In C, a function declaration with () allows any set of arguments.
Use (void) to mean "no arguments".

* src/dep.h: Switch () to (void) for functions with no arguments.
* src/makeint.h: Ditto.
* src/os.h: Ditto.
* src/shuffle.h: Ditto.
* src/variable.h: Ditto.
2022-10-15 18:39:32 -04:00
Paul Smith
18c4b508ef [SV 63157] Ensure temporary files are removed when signaled
Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
When handling a fatal signal ensure the temporary files for
stdin and the jobserver fifo (if in use) are deleted.

* src/makeint.h (temp_stdin_unlink): Declare a new method.
* src/main.c (temp_stdin_unlink): Delete the stdin temporary file
if it exists.  If the unlink fails and we're not handling a signal
then show an error.
(main): Call temp_stdin_unlink() instead of unlinking by hand.
* src/commands.c (fatal_error_signal): Invoke cleanup methods if
we're handling a fatal signal.
* tests/scripts/features/output-sync: Test signal handling during
output sync and jobserver with FIFO.
* tests/scripts/features/temp_stdin: Test signal handling when
makefiles are read from stdin.
2022-10-15 18:39:32 -04:00
Paul Smith
383eb3a923 * src/posixos.c (job_root): Remember root jobserver instances
(jobserver_setup): Set job_root to true.
(jobserver_clear): if we're the root instance and we're using a
FIFO, unlink it.  If we're not in a signal handler, free memory.
(jobserver_acquire_all): Call jobserver_clear().
(sync_root): Rename from sync_parent for consistency.
2022-10-15 18:39:32 -04:00
Paul Smith
01b1d4f401 Set the proper type for variables set in signal handlers
* bootstrap.conf: Get gnulib's sig_atomic_t type checking M4 macro.
* configure.ac: Invoke it.
* src/makeint.h (handling_fatal_signal): Set the type correctly.
* src/commands.c (handling_fatal_signal): Ditto.
2022-10-15 18:39:32 -04:00
Dmitry Goncharov
bf2d71498c * tests/test_driver.pl (toplevel): [SV 63156] Keep temp env vars 2022-10-08 11:53:19 -04:00
Paul Smith
3e20e376b7 Clean up some warnings on Windows builds
* src/arscan.c (parse_int): Avoid conversion from int to char and
check for overflow given a max value.
(ar_scan): Check intmax sizes then cast to the proper type.
(ar_member_touch): Get proper return type from ar_scan and cast it
to off_t.
* src/function.c (a_word_hash_cmp): Don't cast from size_t to int.
(func_filter_filterout): Count using unsigned long to avoid casts.
(construct_include_path): Explicitly cast to void*.
* src/shuffle.c (reverse_shuffle_array): Use size_t index.
* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
Initialize the return value in case the count is 0.
2022-10-03 16:08:14 -04:00
Paul Smith
7ddfc42ee3 * src/misc.c (make_lltoa): Use printf format macro from makeint.h
(make_ulltoa): Ditto.
2022-10-03 15:11:57 -04:00
Paul Smith
ca92d83cde * src/arscan.c (ar_scan): Avoid sign comparison warnings
Pacify 12.2.1 20220819 (Red Hat 12.2.1-2) -Wsign-compare by checking
the readbuf() return explicitly for errors then casting from ssize_t.
Initial patch provided by Paul Eggert <eggert@cs.ucla.edu>.
2022-10-03 15:11:57 -04:00
Paul Eggert
ae80eefe65 Support systems with 32-bit long and 64-bit time_t
Don't assume that time_t fits in long, as some hosts (e.g.,
glibc x86 -D_TIME_BITS=64) have 32-bit long and 64-bit time_t.

* bootstrap.conf (gnulib_modules): Add largefile, to support files
with timestamps after Y2038 on hosts with 32-bit long.
* configure.ac: Do not call AC_SYS_LARGEFILE, as the largefile module
does that for us.
* src/makeint.h (PRIdMAX, PRIuMAX, SCNdMAX): Define if not already
defined (taken from gnulib).
* src/ar.c: Include intprops.h, for TYPE_MAXIMUM, as
INTEGER_TYPE_MAXIMUM does not work on time_t without issuing a bunch
of warnings.
(ar_member_date): Check that result is in time_t range.
(ar_member_date_1): Use intmax_t to hold the date.
(ar_glob_match): Ditto.
* src/arscan.c (VMS_function, VMS_function_ret, ar_scan)
(parse_int, ar_scan, ar_member_pos, ar_member_touch)
(describe_member): Convert long int to intmax_t.
* src/file.c (file_timestamp_sprintf): Use intmax_t/uintmax_t instead
of long/unsigned long for values that might be time_t.
* src/arscan.c (ar_member_touch): Fix buffer overrun if the timestamp
is too large.
2022-10-03 15:11:57 -04:00
Paul Smith
01142a53c9 Add support for intmax_t
* configure.ac: Ask autoconf to detect it.
* src/config.ami.template: Add #define intmax_t for AmigaOS.
* src/config.h-vms.template: Add #define intmax_t for VMS.
* src/config.h.W32.template: Add #define intmax_t for Windows.
* src/configh.dos.template: Add #define intmax_t for MS-DOS/DJPP.
2022-10-03 15:11:57 -04:00
Paul Smith
dee6af912a * NEWS: Deprecate Xenix 2022-10-03 15:11:57 -04:00
Paul Smith
7296991d6c [SV 63098] Temporarily revert the change to pattern rule behavior
The fix for SV 12078 caused a backward-compatibility issue with some
makefiles.  In order to allow users to resolve this issue, revert
that change for this release cycle: it will be reinstated in the
next release cycle.  Introduce a warning if we detect that the recipe
of a multi-target pattern rule doesn't create all the targets.

* NEWS: Announce the future backward-incompatibility.
* doc/make.texi (Pattern Intro): Describe the behavior and that it
will change in the future.
* src/remake.c (check_also_make): Check for also_make targets that
were not created and generate a warning.
(update_goal_chain): Call the new function.
(check_dep): Ditto.
(update_file_1): Defer implicit rule detection until after we check
all the also_make files (as it used to be).
* tests/scripts/features/patternrules: Add tests of the new warning.
Skip the tests for SV 12078.
2022-10-02 10:18:21 -04:00
Paul Smith
d51ac70122 * doc/make.texi (Prerequisite Types): [SV 58056] Clarify ordering. 2022-10-02 09:30:20 -04:00
Paul Smith
3cb84fe933 * src/filedef.h (is_ordinary_mtime): Check for "ordinary" mod time.
* src/remake.c (update_file_1): Use the new macro.
2022-10-02 08:55:29 -04:00
Paul Smith
ad84ec2fdc * src/remake.c (update_file_1): Return valid enum element, not 0. 2022-10-02 08:55:29 -04:00
Paul Smith
26b9f30714 * NEWS: Announce deprecation of OS/2 and AmigaOS ports 2022-10-02 08:55:29 -04:00
Paul Smith
5ac80176a3 * src/main.c (main): Add debug output for jobserver and osync.
* src/posixos.c (jobserver_setup): Remove redundant debug output.
(jobserver_parse_auth): Ditto.
2022-10-02 08:46:00 -04:00
Andreas Schwab
c801a7fb67 [SV 63111] Ensure output-sync is cleaned on re-exec and recursion
Now that output-sync is using a separate file as a mutex rather than
stdout, ensure the new file descriptor is closed before re-exec and
not inherited by children.

* src/main.c (main): Call osync_clear() before re-exec.
* src/posixos.c (osync_setup): Reset output-sync handle inheritance.
(osync_parse_mutex): Ditto.

Copyright-paperwork-exempt: yes
2022-10-02 08:46:00 -04:00
Paul Smith
c2eddf9be2 * src/function.c: Change int to uint to align with gmk_func_ptr 2022-10-01 11:47:41 -04:00
Dmitry Goncharov
f8852311cc * doc/make.texi (Loaded Object API): [SV 63126] Fix typos and examples 2022-10-01 11:47:41 -04:00
Paul Smith
a99378ebe4 Implement a simple xorshift 32bit random number generator
Avoid relying on the system random number generator for our random
shuffle, so that the same seed gives the same results on all systems.
This generator doesn't need to be amazing, just pretty good, so don't
bother with xorshift* or xorshift+, etc.

* src/makeint.h: Declare make_seed() and make_rand().
* src/misc.c (make_seed): Set the seed value for the RNG.
(make_rand): Return the next random number.  If the seed was not set
initialize it first.
* src/shuffle.c (shuffle_set_mode): If we don't get a seed from the
user just leave it unset (0).
(shuffle_deps_recursive): Use make_seed() not srand().
(random_shuffle_array): Use make_rand() not rand().
2022-10-01 11:45:39 -04:00
Dmitry Goncharov
6c87f3fb85 [SV 63100] Set the floc of every created goal dep struct
* src/read.c (eval): Initialize the goaldep floc pointer.
* tests/scripts/features/loadapi: Verify that the floc is set after
unloading and reloading dynamic objects.
2022-09-25 17:09:08 -04:00
Paul Smith
38116baee9 * doc/make.texi: Update out of date behavior for grouped targets. 2022-09-25 16:58:36 -04:00
Paul Smith
614033f8c6 * README.git: Announce releases to the platform-testers list 2022-09-25 16:57:31 -04:00
Paul Smith
f3640ecf4f Provide new functions to convert long long to string
The previous attempt to use PRI* macros to avoid compiler-specific
printf format specifiers didn't work because we are using raw
long long type, not the uintX_t types.  On systems where long and
long long are the same size, uint64_t might be type "long" and PRId64
is just "ld".

Instead write new functions that convert [unsigned] long long to a
string and call those instead.

* src/makeint.h: Declare make_lltoa() and make_ulltoa().
* src/misc.c (make_lltoa): New function that writes a long long value
into a provided buffer.  Return the buffer for ease-of-use.
(make_ulltoa): Ditto, for unsigned long long.
* src/function.c (func_wordlist): Call these new methods.  Also
rework the error strings so we share the translated string.
* src/dir.c (print_dir_data_base): Call the new methods instead of
using MSVC macros.
2022-09-25 16:57:31 -04:00
Paul Smith
c4e232e44f Always restore global environ if we use vfork
We may change the global environ variable in the child; when using
vfork() this also sets it in the parent.  Preserve the parent's
environ in child_execute_job() so it takes effect for all callers.

Reported by Denis Excoffier <bug-tar@Denis-Excoffier.org>
Root cause found by Martin Dorey <Martin.Dorey@hitachivantara.com>

* src/job.c (start_job_command): Remove save/restore of the parent
environment.
(child_execute_job): Add save/restore of the parent environment,
if we use vfork().
* tests/scripts/functions/shell: Add a test the crashes if we don't
reset environ after we run $(shell ...).
2022-09-25 16:57:31 -04:00
Dmitry Goncharov
aa99e810a9 * configure.ac: [SV 63070] Clean up the test program for posix_spawn. 2022-09-25 16:57:13 -04:00
Paul Smith
8f49029561 * src/posixos.c (osync_clear): Don't close invalid FDs. 2022-09-25 13:37:12 -04:00
Paul Smith
f7ed583675 * maintMakefile: Use gnulib ncftpput-ftp if ncftpput is missing. 2022-09-25 13:37:12 -04:00
Paul Smith
cf7f7de7ae * src/misc.c (strncasecmp): Use size_t for length to match std.
* src/misc.h (strncasecmp): Fix the declaration.
2022-09-25 13:37:12 -04:00
Paul Smith
d4cb7ae6d4 * configure.ac: Update to GNU make 4.3.91
* NEWS: Update the version and clarify some backward-compat issues.
2022-09-25 13:37:12 -04:00
Eli Zaretskii
387d349dc8 Fix compiler warnings in the MS-Windows build.
* src/w32/w32os.c (osync_get_mutex, osync_parse_mutex): Cast to
DWORD_PTR when converting integers to HANDLEs and vice versa.

* src/w32/pathstuff.c (w32ify): Pacify compiler warnings about
'strncpy'.

* src/makeint.h (PRId64) [!HAVE_INTTYPES_H]: Define if undefined.
* src/function.c (func_wordlist): Use PRId64 instead of %lld.
2022-09-25 17:11:12 +03:00
Eli Zaretskii
caad0e2181 Avoid compilation warnings
* src/implicit.c: (pattern_search):
* src/main.c: (main): Avoid compilation warnings for variables
only used when compiling a debug version with assertions.
2022-09-24 21:15:41 +03:00
Paul Smith
990d6f9b9a Release GNU make 4.3.90
* NEWS: Update for the prerelease.
* bootstrap.conf: Choose the latest stable gnulib.
* README.git: Updates.
2022-09-20 13:23:44 -04:00
Paul Smith
134480787e * tests/script/parallelism: Force wait to remove races. 2022-09-20 13:23:44 -04:00
Dmitry Goncharov
a9a4919909 [SV 56301] Fail if an included makefile can't be built
Fail if a mandatory include file fails to be built even if it's
built as part of a grouped target where the other include file
is optional.

* src/main.c (main): If a makefile doesn't build set any_failed.
* tests/scripts/features/include: Add tests.
* tests/scripts/options/dash-k: Stop after include build failure.
2022-09-20 03:55:39 -04:00
Paul Smith
d12ff78cb2 * tests/scripts/features/statipattrules: [SV 17374] Add test
Verify that double-colon static pattern rules work.
2022-09-20 03:55:39 -04:00
Paul Smith
fabb03eac4 [SV 12078, SV 62809] Rebuild grouped targets if any is missing
If any of a set of grouped targets is missing or out of date, even
if make is not trying to build that target, rebuild them all.
Ensure this is true for explicit grouped targets as well as pattern
rule grouped targets.

Original patch by Jonathan Gravel <jo@stashed.dev>

* src/remake.c (update_file_1): After matching any pattern rules,
go through the also_make targets and set noexist as needed.  Also
compute the oldest this_mtime.
* tests/scripts/features/grouped_targets: Add regression tests.
* tests/scripts/features/patternrules: Ditto.
* tests/features/vpath: Rewrite to use modern run_make_test().
Add a test that we check for VPATH before implicit rule search.
Move the tests in vpath2 and vpath3 into this suite.
* tests/features/vpathplus: Rewrite to use modern run_make_test().
2022-09-20 03:55:39 -04:00
Dmitry Goncharov
618c53a225 * tests/scripts/targets/WAIT: [SV 63071] Remove possible test races. 2022-09-17 13:22:35 -04:00
Paul Smith
88d126d6c4 * doc/make.texi (Parallel Disable): Add clarifications.
* NEWS: Suggest how to change makefiles that use $(MAKEFLAGS).
2022-09-13 18:22:29 -04:00
Paul Smith
f6ea899d83 [SV 13862] Implement the .WAIT special target
The next version of the POSIX standard defines parallel execution
and requires the .WAIT special target as is implemented in some other
versions of make.

This implementation behaves similarly to others in that it does not
create a relationship between targets in the dependency graph, so
that the same two targets may be run in parallel if they appear as
prerequisites elsewhere without .WAIT between them.

Now that we support .WAIT it's trivial to also support prerequisites
of the .NOTPARALLEL special target, which forces the prerequisites of
those targets to be run serially (as if .WAIT was specified between
each one).

* NEWS: Announce the new .WAIT and .NOTPARALLEL support.
* doc/make.texi (Parallel Disable): A new section to discuss ways in
which parallel execution can be controlled.  Modify cross-refs to
refer to this section.
* src/dep.h (struct dep): Add a new wait_here boolean.
(parse_file_seq): Add PARSEFS_WAIT to check for .WAIT dependencies.
* src/file.c (split_prereqs): Use PARSEFS_WAIT.
(snap_deps): If .NOTPARALLEL has prerequisites, set .WAIT between
each of _their_ prerequisites.
(print_prereqs): Add back in .WAIT when printing prerequisites.
* src/implicit.c (struct patdeps): Preserve wait_here.
(pattern_search): Ditto.  Use PARSEFS_WAIT when parsing prereqs for
pattern rule expansion.
* src/read.c (check_specials): Don't give up early: remembering to
update these options is not worth the rare speedup.
(check_special_file): If .WAIT is given as a target show an error--
once--if it has prereqs or commands.
(record_files): Call check_special_file on each target.
(parse_file_seq): If PARSEFS_WAIT is given, look for .WAIT prereqs.
If we see one assume that we are building a struct dep chain and set
the wait_here option while not putting it into the list.
* src/remake.c (update_file_1): If wait_here is set and we are still
running, then stop trying to build this target's prerequisites.
* src/rule.c (get_rule_defn): Add .WAIT to the prerequisite list.
* src/shuffle.c (shuffle_deps): Don't shuffle the prerequisite list
if .WAIT appears anywhere in it.
* tests/scripts/targets/WAIT: Add a test suite for this feature.
2022-09-12 18:35:29 -04:00
Dmitry Goncharov
ee861a4e9f [SV 63045] Reload each intact unloaded shared object
If makefile rules do not update an unloaded shared object, load it
again.  Avoid double loading of the same object if the setup function
returns -1.

* src/filedef.h (struct file): Add "unloaded" flag.
* src/makeint.h (load_file): Take struct file *.
(unload_file): Return int.
* src/main.c (main): Reload unloaded shared objects if they weren't
updated.
* src/commands.c (execute_file_commands): Set "unloaded" and reset
"loaded" when a shared object is unloaded.
* src/read.c (eval): Set "loaded" and reset "unloaded" when a shared
object is loaded.  Add successfully loaded files to the db.
* src/load.c (load_file): Check "loaded" to avoid double loading the
same object.  Fix a memory leak of string loaded.  Return -1, rather
than 1, if the object is already loaded. This fixes double loading of
the same object when the setup routine returns -1.
(load_object): Add a log message.
(unload_file): Return an error on dlclose failure.  Log a message.
* tests/scripts/features/loadapi: Add new tests.
2022-09-12 02:05:18 -04:00
Sergei Trofimovich
ca4234c4b5 [SV 63047] Fix shuffle of SECONDEXPANSION prerequisites
Commit 07eea3aa4 `make --shuffle` prevented shuffling prerequisites
that use .SECONDEXPANSION, since shuffle happens before expansion.
This has two problems:
1. No shuffling happens for such prerequisites.
2. Use-after-free when outdated '->shuf' links are used.

Add a reshuffle into expansion phase right after dependency changes.

* src/file.c (expand_deps): Add reshuffle if dependencies change.
* src/shuffle.c (identity_shuffle_array): Fix comment typo.
* tests/scripts/options/shuffle: Add new SECONDEXPANSION test.
2022-09-12 01:05:31 -04:00
Paul Smith
257b82ac1f * doc/make.texi (How Make Works): Clarify default goal exceptions. 2022-09-11 15:09:13 -04:00
Paul Smith
aac4004444 * src/shuffle.c: Minor coding changes. 2022-09-11 14:04:58 -04:00
Paul Smith
86fc644dcc Support the MAKE_TMPDIR environment variable
Allow build systems to choose an alternative location for make to
store its temporary files.

* NEWS: Announce the new environment variable.
* doc/make.texi (Temporary Files): Provide documentation.
* src/misc.c (get_tmpdir): Split into a new function.  Compute the
temporary directory and store it in a static location.
* tests/scripts/features/jobserver: Add a test of MAKE_TMPDIR.
2022-09-11 10:56:08 -04:00
Paul Smith
02b3a6ad46 [SV 62898] Document ways to hide special chars from make functions
* doc/make.texi (Function Call Syntax): Add a subsubheading describing
which special characters may need to be hidden from make functions.
2022-09-10 23:14:02 -04:00
Dmitry Goncharov
77734be2af [SV 63044] load: Update .LOADED if the setup function returns -1
* src/load.c (load_file): Update .LOADED if setup returns non-0.
* tests/scripts/features/load: Change the return value based on an
environment variable.  Ensure that returning -1 still adds to
.LOADED.  Also add a test that verifies that make doesn't try to
rebuild the loaded file if -1 is returned.
2022-09-10 22:42:28 -04:00
Paul Smith
820210ab85 Enhance the make.texi formatting
Notes provided by Tzvetelin Katchov <katchov@gnu.org>.

* doc/make.texi: Remove obsolete @refill statements.  Add some breaks
to overfull lines.  Fix up some example text.
2022-09-10 18:35:47 -04:00
Paul Smith
77706874a7 Clean up maintMakefile
Notes provided by Tzvetelin Katchov <katchov@gnu.org>

* maintMakefile (git-very-clean): Add -x to git clean.
(GNULIBDIR): Use GNULIB_SRCDIR, or the local module if not set.
2022-09-10 18:35:41 -04:00
Paul Smith
a9548aeb8f [SV 63037] Fix tests for newer OS / compiler
* tests/scripts/features/load: Add function prototypes.
* tests/scripts/features/temp_stdin: Only set user execute bits.
Some configurations don't allow changing the group bits...??
2022-09-10 17:15:23 -04:00
Paul Smith
70ba0357a0 [SV 63040] shell: Fall back to the callers environment
If we detect a recursive variable reference when constructing the
environment for the shell function, return the original value from the
caller's environment.  Other options such as failing, returning the
empty string, or returning the unexpanded make variable value have
been shown to not behave well in real-world environments.  If the
variable doesn't exist in the caller's environment, return the empty
string.

Found by Sergei Trofimovich <slyich@gmail.com> when testing older
versions of autoconf.

* NEWS: Clarify this behavior.
* doc/make.texi (Shell Function): Ditto.  Also add info about !=.
* src/expand.c (recursively_expand_for_file): Search the caller's
environment if we detect a recursive variable expansion.
* tests/scripts/functions/shell: Add tests for this behavior.
2022-09-10 16:27:47 -04:00
Paul Smith
7d48401707 [SV 63016] Don't fail exporting to $(shell ...)
The fix for SV 10593 caused recursive expansion errors when exporting
a variable that contains a $(shell ...) invocation.  If we see this
type of recursion, ignore it and expand to the empty string rather
than failing.

* src/variable.h (env_recursion): New global variable.
* src/variable.c (target_environment): If creating the environment
for a $(shell ...) function increment env_recursion.  Remove the
check for expansion in a shell function context.
* src/expand.c (recursively_expand_for_file): Check for recursive
expansion in a $(shell ...) environment context and if present,
show the verbose message and return the empty string.
* tests/scripts/functions/shell: Add a test for this situation.
2022-09-08 03:04:15 -04:00
Paul Smith
1fc13bf576 Ensure debug output ends in newline
* src/load.c (load_object): Debug output strings must include \n.
* src/variable.c (target_environment): Ditto.
* src/posixos.c: Remove extra newlines.
2022-09-08 03:04:15 -04:00
Paul Smith
896908180e Sanitize tar file ownership, mode, and order
For reproducibility ensure all files in the dist tar file are owned by
root, and sorted by name.  Force the mode on all files to be writable
by the owner and not writable by group or user, by default.

Remove unnecessary execute permissions from build_w32.bat.

Recommended by Tzvetelin Katchov <katchov@gnu.org>.
2022-09-08 03:04:15 -04:00
Paul Smith
80e9a422e4 bootstrap: Update to the latest gnulib bootstrap model
* README.git: Document the changes.
* bootstrap.conf: Set GNULIB_REVISION to avoid random updates.
* configure.ac: Set the minimum autoconf version back to 2.69:
that's the most common version deployed today, and it still works.
* bootstrap: Copy the latest from gnulib.
* autogen.sh: Ditto.
* autopull.sh: Ditto.
* bootstrap-funclib.sh: Ditto.
2022-09-08 03:04:04 -04:00
Paul Smith
15a7e3830f Fix tests for MacOS and Windows
* maintMakefile: Remove the template headers as prerequisites.
* tests/scripts/features/jobserver: Only test fifo if enabled.
* tests/scripts/variables/INCLUDE_DIRS: On MacOS none of the default
directories exist so .INCLUDE_DIRS is empty by default.
* tests/scripts/features/se_explicit: Fail via exit.  cp will show
different error messages on different systems.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/se_statpat: Ditto.
2022-08-30 21:05:34 -04:00
Paul Smith
26e359c71d [SV 62840] Don't change IO buffering before printing version
If users run 'make --version | head -n1' they expect make to exit
with a success (0) code.  This works because the pipe forces the
default buffering on stdout to be fully buffered so all the output
is printed to the pipe in a single write(2) and won't fail.  However
due to output sync we forcibly set stdout to line buffered, which
means if the reader closes the pipe fast enough make will exit with
an error code because the write to stdout failed.

Move the setup done in output_init() back into main() where it can
be done in a proper order.  Rework the order of operations during
startup so that we check for help and version flags before we change
the buffering.  Clean up the behavior of print_usage().

Original changes from Dmitry Goncharov <dgoncharov@users.sf.net>.

* src/main.c (switches): Don't send --version in the environment.
(print_usage): Add a blank line after the version before the usage.
Move the die() into this function since we always die() afterward.
Note the die will flush so no need to do it explicitly.
(print_version): The caller will fflush when appropriate.
(close_stdout): Move from output.c so it is installed early.
(decode_switches): Only call print_usage on error, not for --help.
(main): Install the close_stdout handler immediately after start.
Move the calls to print_usage() due to --help and --version to be
called immediately after we decode the switches.  Move the buffer set
here from output_init(), immediately after we know we'll be running.
* src/output.c (output_init): Move buffer setting to main().
(close_stdout): Move to main().
2022-08-30 21:04:48 -04:00
Paul Smith
4da2055a10 Rework output sync to lock a temp file on POSIX
Some POSIX systems do not allow locks to be taken on non-files, such
as pipes.  This is a problem since very often make is invoked with
its stdout redirected to a pipe.  Also, if stdout is redirected to a
file that already has a lock on it for some other reason (perhaps a
shared file such as /dev/null) it can cause a hang.

This means our previous method of locking stdout, although it had some
nice advantages, is not portable enough.  Instead, use a temporary
file and take the lock on that.  We pass the name of the file to child
make processes.  On Windows we continue to use a shared mutex for
output sync.

Remove POSIX emulation functions like fcntl from Windows; instead
follow the lead of the jobserver and create an interface in os.h for
output sync, and move the OS-specific content to posixos.c and
w32os.c.

* NEWS: Add a note.
* src/makeint.h (ALL_SET): Check that all bits are set.
* src/os.h: Add bits for checking the state of stdin/stdout/stderr.
Add prototypes for OS-specific output sync methods.
* src/posixos.c (check_io_state): Determine the status of stdin,
stdout, stderr an return a suite of bits describing them.
(osync_enabled): If the global variable holding the FD of the lock
file (osync_handle) is valid return true.
(osync_setup): Create a temporary file and remember its name in a
global variable (osync_tmpfile), and set osync_handle.
(osync_get_mutex): If output sync is enabled, return the filename
of the lock file prefixed with "fnm:" to denote a filename.
(osync_parse_mutex): If the provided filename has the wrong format
disable output sync.  Else open the lock file and set osync_handle.
(osync_clear): Close osync_handle.  If we're the parent make, then
also unlink the temporary file.
(osync_acquire): Take a lock on the osync_handle descriptor.
(osync_release): Release the lock on the osync_handle descriptor.
(fd_set_append): Add APPEND mode to a file descriptor.
* src/w32/w32os.c: Perform the same actions as posixos.c, copying
the details from src/w32/compat/posixfcn.c.  Use a mutex rather
than locking a temporary file.
* src/output.h: Remove all the OS-specific content.
* src/output.c: Remove all the OS-specific content.
(set_append_mode): Remove and replace with fd_set_append().
(sync_init): Remove and replace with check_io_state().
(acquire_semaphore): Remove and replace with osync_acquire().
(release_semaphore): Remove and replace with osync_release().
(setup_tmpfile): If the IO state is not obtained, get it.  If stdout
and/or stderr are valid, set up a tempfile to capture them.
(output_init): Set io_state if not set already, and check it when
deciding whether to close stdout on exit.
* src/main.c (main): If we're syncing, set up the mutex using the
new osync_setup() / osync_parse_mutex() methods.
(prepare_mutex_handl_string): Replace with osync_parse_mutex().
(die): Call osync_clear().
* src/w32/compat/posixfcn.c: Remove implementations of fcntl(),
record_sync_mutex(), create_mutex(), and same_stream().
2022-08-30 15:44:43 -04:00
Paul Smith
a2ba5ccbda Add get_tmpfd() and allow anonymous temp files
The output sync feature wants a file descriptor not a FILE*.  We were
using tmpfile() but this returns FILE* which means we needed to dup()
the descriptor then fclose() the original, which is just unnecessary
overhead for every command we run.

Create a get_tmpfd() method that returns a file descriptor directly
by using mkstemp() if available, else do the best we can.

Also allow anonymous temp files if the filename pointer is NULL.
This causes the file to be unlinked.  On Windows this requires a
special open so add an os_anontmp() method to handle this.

* src/makeint.h: Add prototype for get_tmpfd().
* src/misc.c (get_tmpfd): If we have mkstemp() use that, else just
open(2).  If we don't want to keep the filename, unlink the file.
(get_tmpfile): Use get_tmpfd() if we have fdopen(), else use fopen().
* src/output.c (output_tmpfd): Call get_tmpfd() with NULL.
* src/os.h (os_anontmp): On Windows make this a function, else fails.
* src/w32/compat/posixcfn.c (tmpfile): Move to w32os.c:os_anontmp().
* src/w32/w32os.c (os_anontmp): Create a temp file that will be deleted
when the process exits, and return a file descriptor to it.
2022-08-30 15:39:02 -04:00
Paul Smith
5eff618c8c test_driver: check for leftover temp files after each test
Reset the temp directory for every test to a local directory, then
after each test see if any new temp files were created and not
deleted: if they were then fail the test.  Rather than delete the
temp files we leave them there and avoid reporting files that were
seen before, so the user can investigate them.

Rewrite the temp_stdin tests to rely on this built-in behavior
rather than implementing the checks directly.

* tests/test_driver.pl: Create a $TEMPDIR variable pointing to a
temporary directory outside the test temp directory.
(toplevel) Before starting any tests create a temp directory and set
the POSIX and Windows temp directory environment variables to use it.
(compare_output) Check the contents of the temp directory.  If any
new files have appeared, fail the test.
* tests/scripts/features/temp_stdin: Remove check_tempfile() and
all users of it, plus setting of temp environment variables.
2022-08-29 00:09:10 -04:00
Dmitry Goncharov
10e130b207 [SV 62908] Don't free fifo_name twice during error handling
* src/posixos.c (jobserver_setup): Set fifo_name to NULL after free.
* tests/scripts/features/jobserver: Add tests.
2022-08-22 21:27:08 -04:00
Paul Smith
62da1c45e5 Fix bootstrap.bat for bootstrapping on Windows
* README.git: Clarify that these methods are lightly tested.
* build_w32.bat: Don't support any config step: fail if not completed.
Move the config steps into bootstrap.bat.  Don't print compile lines
by default and add a --verbose option to show them.
* bootstrap.bat: Ensure we have curl and sed before we do anything.
Pull the latest necessary files from gnulib.  Create a convert.sed
script that can update the various template files, and update
Basic.mk, config.h.W32, and gmk-default.h.
* tests/run_make_tests.pl: Remove CRLF rather than using chop.  If we
run perl in Git for Bash it seems to handle newlines differently.
* tests/scripts/features/temp_stdin: Remove the make copy and close
STDIN so we can delete the temp file on Windows.
* .gitignore: Ignore the convert.sed script.
2022-08-22 21:19:18 -04:00
Paul Smith
ab31f0b594 * doc/make.texi (Variables/Recursion): [SV 56446] Clarify export docs 2022-08-14 14:06:31 -04:00
Paul Smith
8f1b6bca46 * doc/make.texi (Goals): [SV 51306] Improve MAKECMDGOALS example 2022-08-07 17:32:07 -04:00
Dmitry Goncharov
6faa02247e * doc/make.texi (Remaking Makefiles): [SV 61623] Add optimization 2022-08-07 17:31:50 -04:00
Paul Smith
c72e1ec446 * doc/make.texi (Chained Rules): [SV 61957] Clarify NOTINTERMEDIATE 2022-08-03 00:13:34 -04:00
Paul Smith
91d87ccf32 [SV 62496] Fix example of testing MAKEFLAGS
* doc/make.texi (Options/Recursion): Define the layout of MAKEFLAGS.
(Testing Flags): Fix the example to test the first word.
2022-08-03 00:05:39 -04:00
Paul Smith
7ad2593b2d Support implementing the jobserver using named pipes
Using anonymous pipes for jobserver support has some advantages:
for example there is nothing on disk that needs to be cleaned up.
However it has many obscure problems, related to the fact that in
order for it to work we need to ensure these resources are properly
passed through to child processes that want to use the jobserver.
At the same time we don't want to pass the pipe to process which
DON'T know about the jobserver.

Other processes can open file descriptors which we then think are
our jobserver, but aren't.  And, we open the pipe file descriptors
in blocking mode which doesn't work for all users.

See issues such as SV 57178, SV 57242, and SV 62397

To avoid these issues, use named pipes (on systems where they are
available) instead of anonoymous pipes.  This simplifies many things:
we never need to pass open file descriptors to our children; they
can open the jobserver named pipe.  We don't need to worry about
recursive vs. non-recursive children.  Users don't have to "pass
through" the resources if they are invoking sub-makes.  Each child
can open its own file descriptor and set blocking as needed.

The downside is the named pipe exists on disk and so must be cleaned
up when the "top-level" make instance exits.

In order to allow make to continue to be used in build systems where
older versions of GNU make, or other tools that want to use the
jobserver, but don't understand named pipes, introduce a new option
--jobserver-style that allows the user to choose anonymous pipes.

* NEWS: Announce the change and the --jobserver-style option.
* doc/make.1: Add --jobserver-style documentation.
* doc/make.texi (Special Variables): Add missing items to .FEATURES.
(Options Summary): Add --jobserver-style.
(POSIX Jobserver): Named pipes, changes to --jobserver-auth, and the
--jobserver-style option.
(Windows Jobserver): Document --jobserver-style for Windows.
* configure.ac: Check for mkfifo.
* src/config.h-vms.template: Undefined HAVE_MKFIFO.
* src/config.h.W32.template: Ditto.
* src/main.c: Add jobserver-style as a new command line option.
(main): Add jobserver-fifo to .FEATURES if supported.  Pass the style
option to jobserver_setup().
* src/os.h (jobserver_setup): Accept a style string option.
* src/posixos.c (enum js_type): Enumeration of the jobserver style.
(js_type): Which style we are currently using.
(fifo_name): The path to the named pipe (if in use).
(jobserver_setup): If no style is given, or "fifo" is given, set up a
named pipe: get a temporary file and use mkfifo() on it, then open it
for reading and writing.  If something fails fall back to anonymous
pipes.
(jobserver_parse_auth): Parse jobserver-auth to determine the style.
If we are using a named pipe, open it.  If we're using anonymous pipes
ensure they're valid as before.
(jobserver_get_invalid_auth): Don't invalidate the jobserver when
using named pipes.
(jobserver_clear): Clean up memory used for named pipes.
(jobserver_acquire_all): Unlink the named pipe when done.
* src/w32/w32os.c (jobserver_setup): Check the style argument.
* tests/scripts/features/jobserver: Use --jobserver-style to test
the anonymous pipe behavior, and also test named pipe/semaphore
behavior.  Check invalid jobserver-style options.
* tests/scripts/functions/shell: Use --jobserver-style to test the
anonymous pipe behavior, and also test named pipe/semaphore
behavior.
2022-08-02 23:36:35 -04:00
Paul Smith
09cce75c30 Enhance get_tmpfile() and add get_tmppath()
Move all the logic on creating temporary files into misc.c, and add
a new function get_tmppath() that returns the pathname to a temporary
file without creating or opening it.

* src/makeint.h: Add a declaration for get_tmppath().  Remove the
template argument from get_tmpfile(): it will compute its own.
* src/main.c (main): Remove the logic for computing templates.
* src/vmsjobs.c (child_execute_job): Ditto.
* src/misc.c (get_tmptemplate): New function to return an allocated
template string for use with various mktemp-style functions.
(get_tmppath): Return an allocated path to a temporary file, but do
not create it.  Generally this should be avoided due to TOCTOU issues.
(get_tmpfile): Use get_tmptemplate() to generate a template rather
than using one passed in.  If we don't have mkstemp() then use
get_tmppath() to compute the path of a temp file.
2022-08-02 23:36:35 -04:00
Dmitry Goncharov
07eea3aa49 [SV 62706] Only second-expand targets that might be built
Second-expand only the prerequisites of the targets being built.
Defer second-expanding the prerequisites of targets until we need
to decide if they should be built.

* NEWS: Mention the change in behavior.
* doc/make.texi (Secondary Expansion): Document the new behavior.
* src/filedef.h (struct file): Add flag snapped.
(expand_deps): Declare a function to second expand the
prerequisites of a target.
* src/file.c (rehash_file): Merge flag snapped.
(expand_deps): Remove qualifier static. Check flag snapped.
(snap_deps): Remove the loop which performed second expansion for all
targets.
* src/remake.c (update_file_1): Second expand the prerequisites of
the considered target.
* tests/scripts/features/se_explicit: Add tests.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/se_statpat: Ditto.
2022-07-30 18:40:28 -04:00
Paul Smith
16e14b4114 Disable the jobserver in non-recursive children
Savannah issues such as SV 57242 and SV 62397 show how passing
references to closed file descriptors via the --jobserver-auth option
in MAKEFLAGS can lead to problematic outcomes.

When computing the child environment for a non-recursive shell, add
an extra option to MAKEFLAGS to disable the file descriptors for the
jobserver.

Unfortunately this doesn't modify the value of the make variable
MAKEFLAGS, it only modifies the value of the sub-shell environment
variable MAKEFLAGS.  This can lead to confusion if the user is not
considering the distinction.

* src/makeint.h: Publish the jobserver-auth value.  Add a global
definition of the name of the command line option.
* src/os.h (jobserver_get_invalid_auth): New function to return a
string invalidating the jobserver-auth option.
* src/w32/w32os.c (jobserver_get_invaid_auth): Implement it.  On
Windows we use a semaphore so there's no need to invalidate.
* src/posixos.c (jobserver_parse_auth): If we parse the invalid
auth string, don't set up the jobserver.
(jobserver_get_invalid_auth): Return an invalid option.
* src/variable.h (target_environment): Specify if the target
environment is for a recursive shell or non-recursive shell.
* src/variable.c (target_environment): Move checking for MAKELEVEL
into the loop rather than doing it at the end.
Along with this, check for MAKEFLAGS and MFLAGS, and update them
based on whether we're invoking a recursive or non-recursive child,
and also on whether it's necessary to invalidate the jobserver.
* src/function.c (func_shell_base): Shell functions can never be
recursive to pass 0 to target_environment().
* src/job.c (start_job_command): Specify whether the child is
recursive when calling target_environment().
* src/main.c: Export jobserver_auth.  sync_mutex doesn't need to
be exported.  Use the global definition for the option name.
* tests/scripts/variables/MAKEFLAGS: Add tests for $MAKEFLAGS.
2022-07-30 18:40:28 -04:00
Paul Smith
77881d2281 Ensure that MAKEFLAGS is set when invoking $(shell ...)
* src/main.c (main): Don't reset the jobserver if the number of
slots has not changed.
(define_makeflags): Add all normal flags even when ALL is not set.
* tests/scripts/functions/shell: Test invoking make in $(shell ...).
* tests/scripts/variables/MAKEFLAGS: Test the value of MAKEFLAGS in
$(shell ...).
2022-07-30 18:40:28 -04:00
Paul Smith
2fe96e4a41 Take advantage of mempcpy() and stpcpy()
* src/makeint.h (stpcpy): Add missing declaration.
* src/amiga.c (MyExecute): Avoid extra strlen using stpcpy.
* src/function.c (func_shell_base): Ditto.
(func_error): Use memcpy() not strcpy() when we know the length.
* src/job.c (construct_command_argv_internal): Use stpcpy().
* src/main.c (main): Ditto.
(define_makeflags): Ditto.
* src/variable.c (print_target_variables): Use memcpy() when we know
the length.
* src/commands.c (set_file_variables): Use mempcpy().
* src/expand.c (variable_buffer_output): Ditto.
* src/file.c (expand_deps): Ditto.
* src/function.c (abspath): Ditto.
(handle_function): Ditto.
* src/implicit.c (pattern_search): Ditto.
* src/job.c (construct_command_argv_internal): Use mempcpy() and
don't add multiple spaces when there are no shell flags.
* src/main.c (decode_env_switches): Use mempcpy() to simplify.
(define_makeflags): Ditto.
* src/variable.c (selective_vpath_search): Ditto.
2022-07-30 18:40:21 -04:00
Paul Smith
dd24a4c1cf Convert HAVE_GETLOADAVG to HAVE_DECL_GETLOADAVG
We want to know if getloadavg() is declared, not if we have it.

* configure.ac: Add it as a define (why is this not the default?)
* src/job.c: Conditionalize declaration on HAVE_DECL_GETLOADAVG.
* config.ami.template: Rename HAVE_GETLOADAVG to HAVE_DECL_GETLOADAVG.
* config.h-vms.template: Ditto.
* config.h.W32.template: Ditto.
Clean up and add new elements from latest config.h.
2022-07-09 11:09:17 -04:00
Paul Smith
f36c6c7347 Merge in the latest gnulib findprog-in module 2022-07-09 11:08:49 -04:00
Paul Smith
87d24154af Merge in the latest gnulib concat-filename module 2022-07-09 11:07:23 -04:00
Paul Smith
614557d04c Merge in the latest gnulib getloadavg module 2022-07-09 11:05:14 -04:00
Paul Smith
047544785b Initial merge of the gnulib-port branch 2022-07-09 10:56:05 -04:00
Paul Smith
73b08af181 Move our local m4 macros to gl/m4
The gl subdirectory contains our local versions of gnulib module
implementations, so move m4/acinclude.m4 and m4/dospaths.m4 there.

* gl/modules/make-macros: Create a new module to handle the macros.
* bootstrap.conf: Add the new module.
* configure.ac: Macro invocation is moved to make-macros.
* m4/.gitignore: Delete unnecessary ignore file: m4 is empty.
* .gitignore: Add m4/ as an ignored directory.
2022-07-09 10:47:13 -04:00
Paul Smith
5c1d9e54c7 Move our fnmatch/glob implementation into gl/lib
The gl subdirectory contains our local versions of gnulib module
implementations, so move fnmatch* and glob* from lib to gl/lib.

* gl/modules/make-glob: Add a proper Files: section.
* lib/.gitignore: Delete unnecessary ignore file: lib is empty.
* .gitignore: Add lib/ as an ignored directory.
2022-07-09 10:47:13 -04:00
Paul Smith
2d7b5d6d80 * tests/run_make_tests.pl: Exit 1 if we detect an error. 2022-07-09 10:47:13 -04:00
Paul Smith
5dc7358547 * configure.ac: Remove AC_FUNC_SETVBUF_REVERSED.
This macro is obsolete: no useful system has this problem anymore.
* src/output.c (output_init): Remove reference to SETVBUF_REVERSED.
* src/config.ami.template: Remove undef of SETVBUF_REVERSED.
* src/config.h-vms.template: Ditto.
* src/config.h.W32.template: Ditto.
2022-07-09 10:47:13 -04:00
Paul Smith
e33af0fb4a * configure.ac: Check for stpcpy() support.
* src/misc.c (stpcpy): Define it if not provided.
2022-07-09 10:47:13 -04:00
Paul Smith
6f7e06ec4e getloadavg: Remove support for privileged invocation
This was needed when getloadavg required privileged access; in this
case GNU make needed to be installed as a setgid program.  But this
hasn't been supported by gnulib getloadavg() since 2011 and systems
are no longer using it, so remove it.

* src/makeint.h (user_access): Remove unnecessary function.
(make_access): Ditto.
(child_access): Ditto.
* src/misc.c: Remove implementations of the *_access() functions.
* src/main.c (main): Remove unneeded call to user_access().
* src/job.c (load_too_high): Remove calls to {make,user}_access().
(exec_command): Remove call to child_access().
* src/remote-cstms.c: Remove calls to these methods.  I suppose it
might be possible this is needed and was piggy-backing on the
privileged setting but since that's been broken for a while I doubt
this is needed.  If so we can bring back the implementation into
this source file.
* src/config.h.W32.template: Remove GETLOADAVG_PRIVILEGED undef.
* src/config.h-vms.template: Ditto.
* src/config.ami.template: Ditto.
2022-07-09 10:47:13 -04:00
Paul Smith
3f3eecc115 * maintMakefile: Allow checkcfg rules to succeed.
We can no longer pass our mondo-warnings options to the builds,
as these will impact all the code including gnulib code, and this
won't work.  Also allow the caller to disable either the build.sh
or makefile invocation, for testing.
* Makefile.am: Allow the caller to reset the path to the make
binary to be tested.  Remove c90 test: gnulib doesn't support it.
2022-07-09 10:46:47 -04:00
Paul Smith
b09e9af0b8 * build.sh: Manage libgnu_a-prefixed source files 2022-07-09 10:46:47 -04:00
Paul Smith
9992cb0b83 bootstrap: Remove strerror()
* bootstrap.conf: Remove strerror module
* configure.ac: Add a check for strerror
* src/misc.c: Add a default strerror() if not found
2022-07-09 10:46:47 -04:00
Paul Smith
0cbee1b475 bootstrap: Remove strtoll()
This pulls in entirely too much stuff we don't need.  Instead grab
just the gnulib source file, then include it in src/misc.c.

* bootstrap.conf: Add just the lib/strtol.c source file.
* configure.ac: Check for strtoll.
* src/misc.c: Include strtol.c, with QUAD set, if needed.
2022-07-09 10:46:47 -04:00
Paul Smith
d63925d863 bootstrap: Remove gnulib version of mempcpy()
This pulls in a metric ton of stuff that we otherwise don't need, just
for a one-liner that we already have a replacement for in src/misc.c.

* bootstrap.conf: Remove mempcpy
* configure.ac: Add mempcpy to AC_CHECK_FUNCS
2022-07-09 10:46:47 -04:00
Paul Smith
0793658c09 Run autoupdate and clean up autoconf usage
We can assume that the return type of a signal handler is void.
We can assume that, if sys/time.h exists, it can be included
with time.h.

* bootstrap: Get the latest version
* configure.ac: Require a newer version of autoconf.
Remove unnecessary AC_PROG_CC_C99 (already have AC_PROC_CC).
Remove unnecessary AC_AIX, AC_ISC_POSIX, AC_MINIX.
Remove unnecessary AC_HEADER_STDC, AC_HEADER_TIME, AC_TYPE_SIGNAL.
Use strerror to search for the cposix library.
* src/commands.c (fatal_error_signal): Assume return type is void.
* src/commands.h: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/main.c: Ditto.
* src/makeint.h: Ditto.
Don't bother with TIME_WITH_SYS_TIME.
* src/remote-cstms.c: Check HAVE_SYS_TIME_H.
* src/config.ami.template: Remove RETSIGTYPE.
* src/config.h-vms.template: Ditto.
* src/config.h.W32.template: Ditto.
Remove TIME_WITH_SYS_TIME.
2022-07-09 10:46:47 -04:00
Paul Smith
98da874c43 [SV 10593] Export variables to $(shell ...) commands
Export all variables, including exported makefile variables, when
invoking a shell for the $(shell ...) function.  If we detect a
recursive variable expansion, silently ignore that variable and do
not export it.  We do print a debug message.

* NEWS: Announce the potential backward-incompatibility.
* doc/make.texi (Shell Function): Document the export behavior.
* src/main.c (main): Add "shell-export" to .FEATURES.
* src/job.h: New function to free struct childbase.
* src/job.c (free_childbase): Implement it; call from free_child.
* src/function.c (func_shell_base): Use target_environment() to
obtain the proper environment for the shell function.
Use free_childbase() to free memory.
(windows32_openpipe): Don't reset the environment: the caller
already provided a proper PATH variable in envp.
* src/variable.c (target_environment): If we detect a recursive
expansion and we're called from func_shell, ignore the variable.
(sync_Path_environment): Simplify and reduce memory allocation.
* tests/scripts/functions/shell: Add tests for this.
2022-07-09 10:44:21 -04:00
Dmitry Goncharov
88d6c22a48 [SV 62650] Show correct warning when combining targets
* src/file.c (rehash_file): Fix warning message.
(rehash_file): Fix comment to match the behavior.
* tests/scripts/features/se_explicit: Fix test.
* tests/scripts/features/mult_rules: Add a new test.
2022-07-09 10:44:00 -04:00
Dmitry Goncharov
c3b39d0654 [SV 62514] Honor command line interface flags
Commit f2771aa614 introduced a bug where some switches were left out
of MAKEFLAGS.  Instead of resetting switches, get the same results by
filtering out duplicates.

* src/makeint.h: Remove reset_switches.
* src/main.c: (reset_switches): Remove reset_switches.
* (main): Remove call to reset_switches.
* (decode_switches): Filter out duplicate flags.
* src/variable.c: (set_special_var):  Remove call to reset_switches.
* tests/scripts/variables/MAKEFLAGS: Verify that duplicate flags are
properly filtered out.
2022-07-09 10:43:33 -04:00
Paul Smith
fe55d6e1e3 Add gnulib findprog-in 2022-07-07 02:12:54 -04:00
Paul Smith
768f287a06 Add gnulib concat-filename 2022-07-07 02:12:54 -04:00
Paul Smith
8dd302cda6 Add gnulib getloadavg 2022-07-07 01:53:08 -04:00
Paul Smith
df75efb114 Initial gnulib-port branch commit 2022-07-07 01:53:08 -04:00
Paul Smith
3ec497f8f8 Don't add GNUMAKEFLAGS to the environment
If GNUMAKEFLAGS was not present in the environment when we started,
don't add it.

* src/main.c (main): Don't mess with GNUMAKEFLAGS unless it exists.
* tests/scripts/variables/GNUMAKEFLAGS: Test this behavior.
2022-06-19 14:35:27 -04:00
Paul Smith
84ed34ba5a * tests/test_driver.pl: Don't freak if diff can't be found 2022-06-18 16:42:37 -04:00
Paul Smith
08c964b4ac * build_w32.bat [WIN]: Use call for all invocations 2022-06-18 16:42:11 -04:00
Paul Smith
97e51c0285 Avoid overwriting buffers with long pathnames
Reported, with initial patch, by Gisle Vanem <gvanem@online.no>

* src/main.c (find_and_set_default_shell) [W32]: Pass search_token
directly to w32ify: no need to make a copy first.  When we need to
construct a path, use snprintf() to be sure we don't overwrite
the locally-allocated buffer.
* src/w32/pathstuff.c (w32ify) [W32]: Use the malloc version of
_fullpath(), followed by strncpy(), to avoid overwriting buffers.
2022-06-17 19:55:11 -04:00
Paul Smith
59abb46bc9 * tests/scripts/features/temp_stdin: Remove nested "my"
* tests/scripts/features/statipattrules: Remove unset variable refs.
2022-06-04 19:04:37 -04:00
Dmitry Goncharov
6d6f12b0c3 * tests/scripts/features/archives: Fix typo 2022-06-04 19:04:37 -04:00
Sergei Trofimovich
621d3196fa [SV 62100] Add '--shuffle' option support
Introduce non-deterministic ordering into goal and prerequisite
traversal to help tease out inconsistent failures that may happen
when running in parallel build mode.

Introduce second order into each dependency chain:
1. Existing order is syntactic order reachable via 'dep->next'
2. New order is shuffled order stored as 'dep->shuf' in each 'dep'

When updating goals and prerequisites and '--shuffle' is provided,
use the shuffled order to walk the graph.  When automatic variable
are set always use the syntactic order of parameters.

* Makefile.am: Add new src/shuffle.c and src/shuffle.h file.
* build_w32.bat: Ditto.
* builddos.bat: Ditto.
* makefile.com: Ditto.
* po/POTFILES.in: Ditto.
* doc/make.texi: Add documentation for --shuffle.
* doc/make.1: Ditto.
* src/dep.h (DEP): Add the shuf pointer.
* src/filedef.h (struct file): Add was_shuffled flag.
* src/main.c: (shuffle_mode): Global flag for the shuffle mode.
(usage): Add the --shuffle option.
(switches): Ditto.
(main): Set shuffle_mode based on the command line parameter.
Reshuffle prerequisites if requested.
* src/remake.c (update_goal_chain): Walk the shuffled list if enabled.
(update_file_1): Ditto.
* src/shuffle.h: Provide an interface for shuffling prerequisites.
* src/shuffle.c: Implement option parsing and prerequisite shuffling.
* tests/scripts/options/shuffle: Test shuffle option and modes.
2022-06-04 19:04:37 -04:00
Paul Smith
e4b7ac21dc * src/misc.c (make_toui): Parse a string into an unsigned int
* src/makeint.h: Declare it.
* src/arscan.c (ar_scan): Replace atoi() calls with make_toui().
Modify some integral types to be more correct.
* src/job.c (load_too_high): Replace atoi() calls with make_toui().
* src/main.c (main): Ditto.
(decode_switches): Ditto.
2022-06-04 18:34:15 -04:00
Paul Smith
d444b87173 * src/misc.c (make_pid): A function to return the PID
* src/makeint.h: Declare it.
* src/commands.c (fatal_error_signal): Call it.
2022-06-04 17:04:38 -04:00
Paul Smith
1c179f9636 * po/LINGUAS: Add a translation for Romanian 2022-06-04 17:04:38 -04:00
Noah Goldstein
5690084634 Replace strcmp() with memcmp() where possible
memcmp() is always faster than strcmp().  In places where we already
know that both buffers have sufficient size, replace strcmp() with
memcmp().

* src/main.c (main): Replace strncmp() with memcmp()==0.
* src/read.c (word1eq): Ditto.
* src/commands.c (set_file_variables): Ditto.
* src/function.c (func_filter_filterout): Ditto.
(a_word_hash_cmp): Use STRING_N_COMPARE since we know the length.
(func_sort): Replace strcmp() with memcmp().
2022-04-24 17:52:54 -04:00
Noah Goldstein
9fa63eb918 hash: Remove unnecessary isupper() check before tolower()
The standard requires that tolower() returns its argument if there's
no valid lowercase conversion: it's not necessary to check isupper()
before invoking tolower().

Comparing the performance of the old ISTRING_HASH to the new one
on all the files present in GLIBC.

  Data Type            Old Time   New Time
  Alternating case    24985.754  13883.422
  random case         35211.777  13569.051
  all lower           18818.974  13706.645
  all upper           38859.454  13506.315

* src/hash.h (ISTRING_HASH_1): Omit isupper() check.
(ISTRING_HASH_2): Ditto.
2022-04-24 17:52:54 -04:00
Dmitry Goncharov
668eda0527 [SV 62206] Fix %-substitution in second expansion of pattern rules
During second expansion of pattern rules only the first pattern in
each "group" was being substituted.  E.g. in this makefile:

  .SECONDEXPANSION:
  all: hello.x
  %.x: $$(wordlist 1, 99, %.1 %.%.2) ; $(info $@ from $^)
  hello.1 hello.\%.2 \%.1 \%.\%.2: ;

the output would build "hello.1" and "%.%.2" because each function
is considered a single "word" and only the first pattern is replaced.

Fix the expansion so each whitespace-separated string is considered a
word and the first pattern is replaced, giving "hello.1" and
"hello.%.2".

* src/rule.c (snap_implicit_rules): Keep enough space to replace %
with $(*F) if necessary.
* src/implicit.c (pattern_search): During second expansion break each
get_next_word result into individual words and replace the first % in
each with $* or $(*F) as needed.
* tests/scripts/features/patternrules: Add tests for variations.
2022-04-24 17:52:07 -04:00
Dmitry Goncharov
4e1be4a60c [SV 62175] Rework secondary expansion tests
The hash function we use can yield different results on big- and
little-endian systems which makes test output different.  Choose
names to avoid this.

* tests/scripts/features/patternrules: Choose portable target names.
* tests/scripts/features/se_explicit: Ditto.
* tests/scripts/features/se_implicit: Ditto.
2022-04-24 14:56:26 -04:00
Paul Smith
5b1e871d2d * Makefile.am (check-regression): Rename jhelp to thelp 2022-04-24 13:48:03 -04:00
Paul Smith
2da3bb46f2 * tests/scripts/options/dash-f: [SV 62118] Close STDIN
On Windows we can't delete open files, so close STDIN before
removing the temporary input file.
2022-04-24 13:48:03 -04:00
Paul Smith
b264d3d4f8 * tests/scripts/features/reinvoke: [SV 62088] Close STDIN
On Windows we can't delete open files, so close STDIN before
removing the temporary input file.
2022-04-24 13:48:03 -04:00
Paul Smith
51c1c07e7a * tests/test_driver.pl (run_all_tests): Keep one copy of STDIN 2022-04-24 13:48:03 -04:00
Paul Smith
700af780af * Makefile.am: Add INSTALL to the EXTRA_DIST files 2022-04-24 10:39:32 -04:00
Dmitry Goncharov
f14824878d [SV 62356] If -R is set in the makefile, disable -r
If -R is given on the command line it implies -r as well; make this
same assumption if -R is provided in MAKEFLAGS set in the makefile.

* src/main.c (main): Check no_builtin_variables_flag after reading
makefiles.
* tests/scripts/options/dash-r: Add a test.
2022-04-24 10:39:32 -04:00
Dmitry Goncharov
8c2aa889bb [SV 62324] Simplify set_file_variables by passing in the stem
Previously we always used the file->stem value as our stem in
set_file_variables(); when that wasn't correct we had to temporarily
set that value while the function was called, then reset it afterward.
This led to issues (for example when we assumed the stem was a cached
string but it wasn't).

Avoid this by passing in the stem as an argument so that different
values can be provided.

Add tests to verify this.

* src/commands.c (set_file_variables): Take second parameter stem to
relieve the callers of set_file_variables() from setting/restoring
file->stem.
* src/commands.h (set_file_variables): Ditto.
(execute_file_commands): Pass file->stem to set_file_variables().
* src/file.c (expand_deps): Pass d->stem to set_file_variables() and
remove set and restore of file->stem.
* src/implicit.c (pattern_search): Pass stem to set_file_variables()
and remove set and restore of file->stem.
* tests/scripts/features/se_explicit: Add new tests.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/se_statpat: Ditto.
* tests/scripts/variables/automatic: Ditto.
2022-04-24 10:39:32 -04:00
Dmitry Goncharov
bb21dd4d2d [SV 62278] Only expand the first pattern during secondary expansion
During normal pattern rule expansion only the first pattern (%) is
expanded; however during secondary expansion all patterns were
expanded.  Modify secondary expansion to match the behavior of normal
expansion.

Implementation tweaked by Paul Smith <psmith@gnu.org>

* src/file.c (expand_deps): Don't use subst_expand() which replaces
all % with $*: instead replace only the first one, by hand.
Fix a memory leak where the dep structure was not always freed.
* tests/scripts/features/statipattrules: Use .RECIPEPREFIX not TAB.
Add a series of tests verifying that static pattern rules with and
without secondary expansion both return the same results.
2022-04-24 10:39:32 -04:00
Paul Smith
93fd0c0c9a * src/commands.h: [SV 62213] Forward-declare struct file / child 2022-04-24 10:39:32 -04:00
Paul Smith
cf56036c60 * tests/test_driver.pl (toplevel): [SV 62174] Enforce the C locale 2022-04-24 10:39:32 -04:00
Paul Smith
88ceff8b2f [SV 62173] Fix archive tests for non-GNU systems
Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>

Fix the ar flags to match the default values in make.  If the
U option is supported, add it to the end not the beginning,
since ARFLAGS now starts with a "-".

* tests/test_driver.pl: Add defaults for global variables.
(get_osname): Preserve $osname if it's set from $^O
* tests/scripts/features/archive: Set the default arflags.
If "U" is available add it to the end of the flags.
2022-04-24 10:39:32 -04:00
Dmitry Goncharov
9755d4c09c * tests/scripts/options/dash-l: [SV 62172] Skip if not available 2022-04-24 10:39:32 -04:00
Dmitry Goncharov
634ef057ad * src/read.c (check_specials): [SV 62171] Reset ARFLAGS under .POSIX 2022-04-24 10:39:32 -04:00
Dmitry Goncharov
949c0464a9 [SV 62145] Remove a stdin temp file on re-exec failure.
If the re-exec fails, be sure to remove a temp makefile that was
created to read from stdin.

* src/job.c (exec_command): Return on failure.
(child_execute_job): Call exit if exec_command returns.
* src/job.h (exec_command): Don't mark as NORETURN.
* src/main.c (main): Unlink stdin temporary file if re-exec fails.
* tests/run_make_tests.pl: Get value for ERR_nonexe_file/ERR_exe_dir.
* tests/scripts/features/temp_stdin: Test that temp file unlink works.
2022-04-24 10:39:32 -04:00
Paul Smith
416664b1e7 * tests/scripts/features/errors: Fix Perl warnings
* tests/scripts/options/dash-f: Ditto.
2022-04-18 16:57:06 -04:00
Paul Smith
667d70eac2 [SV 62118] Correctly handle -f- options on re-exec
The -f, -file, and --makefile options were not properly handled when
re-exec'ing due to makefile updates.  This problem, plus a patch and
tests, was reported by Dmitry Goncharov <dgoncharov@users.sf.net>.

While examining this I found another bug: after re-exec we forgot the
batch file was temporary and never deleted it.

I decided to fix all these problems at once using a different fix
than Dmitry's: I created a new internal-only command-line option,
--temp-stdin.  When reconstructing the make options for a re-exec,
replace the -f/--file/--makefile option that reads from stdin with
--temp-stdin=<filename> so that the re-exec'd version of make knows
it's a temporary batch file and will delete it.

We no longer need to add the -o options because the re-exec'd make
knows this is a temporary makefile and treats it as such.

To simplify, replace the --file and --makefile options taking a
filename, with just -f<filename> on re-exec.

Some examples of the rewrite:

  User command line               Re-exec command line
  -----------------               --------------------
  -f-                             --temp-stdin=<batch>
  --file -                        --temp-stdin=<batch>
  -f - --makefile a.mk            --temp-stdin=<batch> -fa.mk
  --file=a.mk                     -fa.mk
  -fa.mk                          -fa.mk
  -Rf a.mk                        -Rf a.mk
  -Rf-                            -R --temp-stdin=<batch>

* src/main.c (stdin_offset): Remember the offset into the makefiles
list of the batch file read from stdin.  Remove stdin_nm.
(struct command_switch): Create a new --temp-stdin option, which
also updates the makefiles list.
(main): Add the temporary filename to the string cache.
Move the tempfile handling after checking makefile arguments for "-"
so that files provided via --temp-stdin are also handled specially.
When rewriting re-exec options, we may need one more than we had
originally so create a new argv list.  Walk through the original
list and convert it to the new list, following the above process.
(decode_switches): Set the stdin_offset flag if we see --temp-stdin.
* tests/scripts/options/dash-f: Add many more tests, provided by
Dmitry Goncharov <dgoncharov@users.sf.net>.
2022-02-27 18:01:13 -05:00
Paul Smith
b9078e5bd3 * tests/scripts/variables/MAKE_RESTARTS: Remove TAB chars 2022-02-27 18:01:13 -05:00
Paul Smith
0de7b74896 * README.git: Fix compiler options for ASAN 2022-02-27 18:01:13 -05:00
Paul Smith
236589642e Remove extraneous characters from fatal() calls
The fatal() method adds ".  Stop.\n" to every message.

* src/amiga.c (MyExecute): Remove newline from fatal() message.
* src/job.c (<various>): Ditto.
* src/file.c (snap_deps): Remove "." from fatal() message.
* src/main.c (main): Ditto.
* src/load.c: Ditto.
* tests/scripts/targets/NOTINTERMEDIATE: Fix expected output.
2022-02-27 18:01:13 -05:00
Paul Smith
cb9ac2b0cc * src/main.c: Ensure the stdin temp file is deleted when dying. 2022-02-27 18:01:13 -05:00
Dmitry Goncharov
40a6751abf [SV 62088] Avoid re-exec due to stdin.
The fix for SV 60595 causes make to re-execute when the makefile is
read from stdin.  E.g.
    $ printf 'all:; $(info hello)' | make -sf -

Reported by Sergei Trofimovich <siarheit@google.com>
Test added by Paul Smith <psmith@gnu.org>

* src/main.c (main): Set the mtime of the stdin temporary file.
* tests/scripts/features/reinvoke: Add a test.
2022-02-27 18:00:47 -05:00
Paul Smith
1bc35a7ae7 tests: Allow run_make_test() to avoid passing -f
We already use undef makefile strings to mean "re-use the previous
makefile", so if the string is empty we'll assume it means "don't
use a makefile at all" (don't add -f).

* tests/run_make_tests.pl (run_make_test): If the makefile string
is empty, don't create a makefile or add -f.
* tests/scripts/features/include: Change empty makefile to "\n".
* tests/scripts/misc/close_stdout: Ditto.
* tests/scripts/options/dash-r: Ditto.
2022-02-27 17:47:42 -05:00
Paul Smith
8cdaabbf8e tests: Preserve Windows temp environment variables
* src/main.c (main): Show the temp filename on error.  Also on
Windows prefer TMP, then TEMP, and only lastly TMPDIR.
* tests/test_driver.pl: Add TMP, TEMP, and USERPROFILE to the list
of environment variables to preserve.
2022-02-27 17:47:19 -05:00
Paul Smith
2be8661433 * tests/test_driver.pl: Support STDIN redirection.
Before running tests, duplicate STDIN then reset it after the test
completes.  Also when -keep is provided, preserve the base and run
files.
2022-02-26 17:19:26 -05:00
Paul Smith
8b3e678ace Ensure buffers are large enough for integer values
Issue raised by Sergei Trofimovich <siarheit@google.com>

* src/makeint.h (INTSTR_LENGTH): Update for unsigned values.
* src/function.c (func_lastword): Use INTSTR_LENGTH as buffer size.
(shell_function_completed): Ditto.
(func_call): Ditto.
* src/remote-cstms.c (start_remote_job): Ditto.
2022-02-21 09:29:41 -05:00
Paul Smith
ec09ec775a * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
Paul Smith
bdaeca49e9 * doc/make.1: Use "target" from the SYNOPSIS.
Reported by Helge Kreutzmann <debian@helgefjell.de>
2022-02-06 18:46:32 -05:00
Paul Smith
342a9bb54b Don't write $(shell ...) stdout to stderr on failure
If a $(shell ...) invocation failed due to a command-not-found error,
make wrote the stdout of that shell to our stderr for some reason.
That seems very wrong.

If the command's stderr was not redirected then its output would have
already been written to its stderr, and if it was redirected then we
shouldn't take it upon ourselves to force it to go to stderr!

* src/function.c (func_shell_base): Append shell stdout even if the
shell command failed.
* tests/run_make_tests.pl: Determine the error generated for
command-not-found situations.
* tests/scripts/functions/shell: Verify that redirecting stderr to
stdout will behave properly if the command is not found.
2022-02-06 18:46:32 -05:00
Paul Smith
6761122be0 * Basic.mk.template: Allow arguments to the check target. 2022-02-06 18:46:32 -05:00
Dmitry Goncharov
1fd0bfaf1e [SV 61805] Support quoted whitespace in .SHELLFLAGS with .ONESHELL
* src/job.c (construct_command_argv_internal): Call recursively to
parse .SHELLFLAGS when .ONESHELL is active.
* tests/scripts/targets/ONESHELL: Add tests.
2022-02-06 18:46:32 -05:00
Paul Smith
8eb171e469 * tests/scripts/features/double_colon: Update for modern tests. 2022-02-06 18:46:32 -05:00
Paul Smith
7154e316b7 * tests/scripts/features/implicit_search: Add -r for safety. 2022-02-06 18:46:32 -05:00
Dmitry Goncharov
f3e345c869 [SV 48643] Add more tests of intermediates and unrelated targets
If a prereq of a pattern is explicitly mentioned as a prereq of an
unrelated rule, it should not be considered an intermediate file.

* tests/scripts/features/double_colon: Add tests mentioning unrelated
explicit targets.
* tests/scripts/features/grouped_targets: Ditto.
* tests/scripts/features/implicit_search: Ditto.
* tests/scripts/features/patternrules: Ditto.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/statipattrules: Ditto.
2022-02-06 18:46:32 -05:00
Dmitry Goncharov
d34f46c1f3 [SV 48643] Make prereqs mentioned in unrelated rules explicit
* src/implicit.c (pattern_search): Set is_explicit when a prereq
is mentioned in an unrelated rule.
2022-02-06 18:46:32 -05:00
Dmitry Goncharov
f0ab709640 * src/implicit.c (pattern_search): [SV 61864] Fix debug output. 2022-02-06 18:46:32 -05:00
Paul Smith
5f2d114c6d Avoid interleaved $(info ) output
Since $(info ) function output is written using two system calls for
the message and the newline, it's possible for output from another
parallel make job to sneak in between them.

Reported by Paul Eggert <eggert@cs.ucla.edu>, who saw the report from
Lars Ingebrigtsen <https://bugs.gnu.org/53358>.

* src/function.c (func_error): Paul provided a fix but instead I
rewrote the entire function: it's not possible for it to be invoked
with anything other than exactly one argument so don't worry about
re-combining the arguments.
2022-02-06 18:46:32 -05:00
Paul Smith
cbe0d2e47f * tests/scripts/features/implicit_search: [SV 48643] Cleanups. 2022-02-06 18:46:32 -05:00
Paul Smith
f485881d4a * src/implicit.c (pattern_search): Use const ptrs when possible.
Change suggested by Joe Filion <joefilion4@gmail.com>
2022-02-06 18:46:32 -05:00
Paul Smith
15db387f18 * src/job.c (load_too_high): Re-enable Linux /proc/loadavg checks.
Further experimentation shows that my previous thinking that there
was a problem using this was woefully mistaken.  The value generated
by the kernel shows runn*ABLE* processes not runn*ING* processes.
* NEWS: Announce the change.
2022-02-06 18:46:32 -05:00
Paul Smith
aab51f7ef2 * doc/make.texi (Using One Shell): Correct example to use $<. 2022-02-06 18:46:29 -05:00
Jouke Witteveen
2b25eac587 * src/function.c (parse_textint): Handle ints without 0 properly.
* tests/scripts/functions/intcmp: Add tests for values without 0.
2022-01-17 19:11:59 -05:00
Paul Smith
e72c5e021f [SV 61226] Revert changes to detect missing included files
The fix for SV 60595 introduced a backward-incompatibility: rules that
purported to rebuild included files, but didn't actually do so, were
treated as errors whereas before they were ignored.  This breaks a
common idiom in makefiles where an empty recipe is created for an
included makefile so make doesn't complain if it doesn't exist.

Unfortunately this means make cannot diagnose some types of errors.

Extra tests supplied by Dmitry Goncharov <dgoncharov@users.sf.net>.

* doc/make.texi (Including Other Makefiles): Clarify this behavior.
* src/main.c (main): Don't run the new check-for-errors behavior.
* tests/scripts/features/reinvoke: Reset tests of the "old" behavior
and add new tests for this situation.
2022-01-17 18:45:47 -05:00
Paul Smith
b6a779d262 Ensure that loaded functions increment the command count
Since we don't know what a loaded function (via Guile or load) may
do, increment the command count just in case.

* src/function.c (struct file_table_entry): New adds_command bool.
(FT_ENTRY): Initialize it to 0 for built-in functions.
(expand_builtin_function): If adds_command, increment the count.
(define_new_function): Set adds_command for loaded functions.
2022-01-17 18:45:47 -05:00
Paul Smith
26f4bb89bd * src/read.c (tilde_expand): Put back '/' before returning.
Joe Filion <joefilion4@gmail.com> noted that the string is modified,
and Henrik Carlqvist <hc94@poolhem.se> noticed that it wasn't put
back in all cases.
2022-01-17 18:38:32 -05:00
Paul Smith
320714ae85 * tests/scripts/targets/INTERMEDIATE: Rewrite for new test method 2021-12-29 15:27:04 -05:00
Paul Smith
6682fbc2cb Do not force targets to be SECONDARY
In SV 43677 we forced targets to be secondary if we found an
intermediate file that was listed as a prerequisite of another
target.  This overrides .INTERMEDIATE settings, so doesn't work.
Now that we have an is_explicit flag in targets, use that instead.

* src/implicit.c (pattern_search): Remove setting of secondary.
Preserve the value of the is_explicit flag when creating a new
file target, and consider it when setting the intermediate flag.
* tests/scripts/features/patternrules: Add a test w/out INTERMEDIATE
* tests/scripts/targets/INTERMEDIATE: Add a test with INTERMEDIATE
2021-12-29 15:26:56 -05:00
Dmitry Goncharov
f2b130bda8 [SV 48643] Preserve target-specific variables on intermediate files
Target-specific variables used to define the target as "ought to
exist" so they could never be intermediate.  Now they can be, so
merge the target-specific variables from the intermediate target
so they're not lost.

* src/implicit.c (pattern_search): Use merge_variable_set_lists
to merge target-specific variables.
* tests/scripts/features/implicit_search: Add tests of target-
specific variable assignments and implicit rules.
2021-12-29 15:26:56 -05:00
Paul Smith
8aba33a8bd * README.template: Clean up patch submission information 2021-12-29 15:26:54 -05:00
Jouke Witteveen
d365bdfdbc * src/read.c (find_percent_cached): [SV 60798] Silence GCC11 warnings 2021-12-19 16:55:50 -05:00
Jouke Witteveen
f440c3ebe2 [SV 60798] Silence bogus GCC10 and GCC11 warnings
* src/main.c (main): Use a separate variable to track final character.
* src/read.c (eval): Track the semicolon position not one beyond it.
* src/variable.c (do_variable_definition): Include a default switch
case to ease the work of the exhaustiveness prover.
2021-12-19 16:55:50 -05:00
Paul Smith
3efba8a145 Update documentation with instructions for patch submission
* README.template: Add notes on how to submit patches.
* README.git: Point to the README.
* doc/make.texi: Ditto.
2021-12-19 16:55:50 -05:00
Paul Smith
e7b2f6818c Change HTTP URLs to use HTTPS instead
Also remove unnecessary tests/COPYING file.

* README.template: Change http: to https:
* README.git: Ditto
* doc/make.texi: Ditto
* doc/make.1: Ditto
* src/main.c: Ditto
* maintMakefile: Remove invalid URL
2021-12-19 16:55:50 -05:00
Paul Smith
c90db9276a * src/makeint.h: Compute INTSTR_LENGTH based on size of intmax_t
Math suggested by Edward Welbourne <edward.welbourne@qt.io>
2021-12-19 16:55:47 -05:00
Paul Eggert
7192d0ec4a Remove arbitrary limits on intcmp integers
We don't need to parse strings into C integer values to compare them.

* src/function.c (parse_textint): Find boundaries of a numeric string.
(func_intcmp): Use parse_textint() to compare integers textually.
* tests/scripts/functions/intcmp: Test with extra-large numbers.
2021-12-19 16:34:19 -05:00
Paul Smith
9230bfb9ae Use a well-known error string for out-of-bound function arguments
* src/function.c (parse_numeric): Check for empty value and error.
If we find ERANGE just print our own error, not strerror.
(func_word): Use a generic "not good" error message.
(func_wordlist): Ditto
(func_intcmp): Ditto
* tests/run_make_tests.pl: Remove code to find strerror(ERANGE)
* tests/scrips/functions/intcmp: Update the error message.
* tests/scrips/functions/word: Ditto.
2021-12-19 16:34:19 -05:00
Paul Smith
55b993ae09 * doc/make.text (Wildcards): Document that glob results are sorted. 2021-12-19 16:34:19 -05:00
Paul Smith
1d20aa7247 [SV 61621] Don't use POSIX_SPAWN_RESETIDS with posix_spawn()
When make is invoked in a environment where the user namespace is
restricted, such as under unshare(1) (on GNU/Linux), it won't be able
to find its real UID so the effective UID can't be set to it and
posix_spawn() will fail with EINVAL.

It's not less safe to run recipe jobs using the same UID values that
make was invoked with, so don't worry about this flag.

* src/job.c (child_execute_job): Don't set POSIX_SPAWN_RESETIDS flag.
2021-12-19 16:34:10 -05:00
Paul Smith
21f7ac8f47 * .gitignore: Ignore patch files. 2021-12-05 14:22:37 -05:00
U2FsdGVkX1
aa376ad638 * src/commands.c (fatal_error_signal) [W32]: Use %lu for DWORD.
* src/function.c (windows32_openpipe) [W32]: Ditto.

Copyright-paperwork-exempt: yes
2021-11-28 15:51:37 -05:00
Paul Smith
35b51df110 * NEWS: Update with author details 2021-11-28 14:34:05 -05:00
Paul Smith
e62f4cf9a2 Special-case Windows error results
* tests/scripts/features/errors: Match Windows-specific errors.
* tests/scripts/features/targetvars: Match Windows-specific errors.
* tests/scripts/misc/general4: Match Windows-specific errors.
2021-11-28 14:27:10 -05:00
Paul Smith
116767901f Convert word, wordlist, and intcmp functions to use long long
Modify make functions that parse integer values to use long long
values instead of long: on Windows long is the same as int (4 bytes)
and we don't want behavior to differ between different platforms.

* bootstrap.conf: Change strtol module to strtoll module.
* src/function.c (parse_numeric): Use strtoll() and return long long.
(func_word): Use long long.
(func_wordlist): Use long long.  Verify second argument is >= 0.
(func_intcmp): Use long long.
* src/config.ami.template: Don't define HAVE_STRTOLL.
* src/config-vms.template: Define HAVE_STRTOLL.
* src/config.W32.template: Define HAVE_STRTOLL.
* tests/run_make_tests.pl: Set $ERR_out_of_range to the proper string.
* tests/scripts/functions/word: Rework to use the new style and avoid
TAB characters.  Verify trailing whitespace is ignored.  Add a test
for a negative second argument to wordlist.  Add tests for max signed
integer values.  Use $ERR_out_of_range for the error string.
* tests/scripts/functions/intcmp: Add tests for min and max signed
integer values.  Use $ERR_out_of_range for the error string.
2021-11-28 14:27:10 -05:00
Jouke Witteveen
71eb0a8038 Introduce $(intcmp ...) for numerical comparison
Numbers can come from $(words ...), automatic variables such as
$(MAKELEVEL), from environment variables, or from shell output such as
through $(shell expr ...).  The $(intcmp ...) function allows
conditional evaluation controlled by numerical variables.

* NEWS: Announce this feature.
* doc/make.texi (Functions for Conditionals): Document 'intcmp'.
* src/function.c (func_intcmp): Create the 'intcmp' built-in function.
* tests/scripts/functions/intcmp: Test the 'intcmp' built-in function.
2021-11-28 14:27:10 -05:00
Jouke Witteveen
d9291d09b8 Use strtol() instead of atoi()
strtol() is part of C89 and a fallback is provided by gnulib.

* src/function.c (func_word, func_wordlist): Change atoi to strtol.
* test/scripts/functions/word: Add out-of-range verification testing.
2021-11-28 14:26:28 -05:00
Jouke Witteveen
f3ad572099 * src/makeint.h: Removed unused atol declaration 2021-11-27 22:05:29 -05:00
Paul Smith
cefe747e85 * src/implicit.c (pattern_search): Fix text for easier translation. 2021-11-27 22:00:12 -05:00
Paul Smith
3ecf97d3af [SV 48643] Update the implicit rule search docs
* NEWS: Announce the change.
* doc/make.texi (Implicit Rule Search): Update the definition of
"ought to exist" and add the extra step for compatibility mode.
2021-11-27 22:00:12 -05:00
Dmitry Goncharov
21d3865973 [SV 48643] Enhance "ought to exist" definition
The traditional definition of "ought to exist" in the user's manual can
lead to make choosing a poor series of chained implicit rules.  Modify
that rule so that we first attempt to resolve implicit rules by
considering targets which are only (a) targets or (b) explicit
prerequisites of the current target.

For backward-compatibility, if we don't find a solution using that
algorithm use the previous definition where "ought to exist" means
"mentioned as a prerequisite of any target".

* src/implicit.c (pattern_search): An extra argument controls whether
to perform the backward-compatible rule search or not.  If a prereq is
a target, or if it's a prerequisite of THIS target, then choose it.
If we get to the end and haven't found a match, but we have found a
potential compatibility rule, then retry with compat rules enabled.
If we're searching with compat rules enabled and we find a file
mentioned as a prerequisite of ANY target, then use it.
* tests/features/implicit_search: Provide a large suite of tests for
different steps of implicit rule search.
2021-11-27 22:00:05 -05:00
Paul Smith
29d92d4091 tests: Enhance output to contain filename/line number info
* tests/scripts/options/dash-I: Use string comparison operator.
* tests/test_driver.pl (cmd2str): New method to convert a
command line to a string with proper quoting.
* tests/run_make_tests.pl (create_command): Call cmd2str() to format
the command.  Add the filename/line number to the output.
2021-11-27 14:03:44 -05:00
Dmitry Goncharov
f8f9d371ff [SV 61042] Enhance logging of implicit rule search
Logging of implicit rule search gives limited information as to why a
given implicit rule was rejected, and if no implicit rule is found we
get the confusing "No rule to make target" result when the real issue
is that some prerequisite of some implicit rule could not be built.

Enhance logging around implicit rule search as follows:
1. The messages which refer to a rule print a description (the targets
   and prerequisites) of the rule.
2. A new message tells when a rule is rejected, along with the reason.
3. The 'Looking for an implicit rule...' message is printed for every
   prerequisite, not just the top-level target.
4. "Trying harder" message is printed, when intermediate prerequisites
   are going to be searched.
5. The 'No rule found...' and 'Found implicit rule...' messages are
   printed for every prerequisite, not just the top-level target.
6. "Ought to exist...", "Found..." or "Not found..." message is
   printed for each prerequisite.

* src/rule.h (struct rule): Remember the definition of the rule.
* src/rule.c (get_rule_defn): Compute the definition of a rule.
(install_pattern_rule): Initialize the definition to empty.
(create_pattern_rule): Ditto.
(freerule): Free the definition.
(print_rule): Use the definition when printing rules.
* src/remake.c (update_file_1): Push debug output down into
try_implicit_rule().
* src/implicit.c (try_implicit_rule): Add debugging
(pattern_search): Show the rule definition in various debug output.
Add new debug messages for implicit rule search.

Additional changes by Paul Smith <psmith@gnu.org>:

Since we usually don't need the rule definition, defer computing it
until we do.

* bootstrap.conf: Include the mempcpy Gnulib module.
* src/makeint.h (mempcpy): Declare mempcpy if not available.
* src/misc.c (mempcpy): Define mempcpy if not available.
* src/config.h-vms.template: Don't set HAVE_MEMPCPY.
* src/config.h.W32.template: Ditto.
* src/rule.h (get_rule_defn): Return the definition of a rule.
* src/rule.c (get_rule_defn): If we don't have a definition compute
it; either way return it.
* src/implicit.c (pattern_search): Rework the handling of explicit
prerequisites to pattern rules to be more clear.  There is no change
in behavior.
2021-10-18 23:00:21 -04:00
Dmitry Goncharov
f5af979357 * doc/make.texi (Special Targets): [SV 61122] Add .SECONDARY example 2021-10-17 19:08:16 -04:00
Paul Smith
76cb186732 * README.git: Update C version prerequisite 2021-10-17 19:08:16 -04:00
Paul Smith
6c06c547dc Add support for the POSIX :::= assignment operator.
POSIX Issue 8 will require a new assignment operator, :::=.
This operator behaves similarly to the BSD make := operator: the
right-hand side is expanded immediately, but then the value is
re-escaped (all '$' are converted to '$$') and the resulting variable
is considered a recursive variable: the value is re-expanded on use.

* src/variable.h (enum variable_flavor): Add f_expand flavor.
* src/variable.c (do_variable_definition): When defining f_expand,
post-process the result to re-escape '$' characters.
Remove default: to the compiler warns about un-handled enum values.
Set recursive values for both f_recursive and f_expand.
(parse_variable_definition): Rewrite this method.
The previous version was annoying to extend to ':::='.
(print_variable): Remove default: so the compiler warns us about
un-handled enum values.
* src/function.c (func_origin): Remove default: so the compiler warns
us about un-handled enum values.
* doc/make.texi: Add documentation for :::=.
* tests/scripts/variables/define: Add a test for define :::=.
* tests/scripts/variables/flavors: Add tests for :::=.
* tests/scripts/variables/negative: Add tests for :::=.
2021-09-20 00:29:31 -04:00
Paul Smith
c5d4b7b2f2 Clean up more Windows warnings.
* src/config.h.W32.template: Re-enable warnings that we don't violate.
Add a new disabled warning: 4130 (logical operation on address of
string constant).
* src/w32/compat/posixfcn.c: Make makeint.h the first included header.
* src/w32/subproc/sub_proc.c: Ditto.  It includes config.h already.
2021-09-07 01:14:33 -04:00
Dmitry Goncharov
9e4b3d3f4c [SV 60435] Ensure intermediate grouped files are removed
If multiple intermediate files are built together be sure all of them
are removed after make is finished.  Continue to ensure that targets
that exist before make starts are not removed even if they appear to be
intermediate.

Add a number of tests to pattern rules to verify this behavior.

* src/filedef.h (struct file): Add a new is_explicit bitfield.
* src/file.c (rehash_file): Merge the is_explicit bit.
(enter_prereqs): Set is_explicit if the file is explicitly mentioned.
* src/implicit.c (pattern_search): Set intermediate on the file if it's
not explicit.
(record_files): Set is_explicit if a file is mentioned as a target.
* src/remake.c (update_file_1): Set secondary on files that already
exist so they won't be removed.
* tests/scripts/features/double_colon: Add a test for double-colon
pattern rules.
* tests/scripts/features/patternrules: Update KGO for tests where more
files are removed.
Add new tests to verify handling removal of intermediate files in the
context of grouped pattern targets.
2021-09-07 01:14:20 -04:00
Paul Smith
5a96d5a066 * src/default.c (default_variables): Use CPP in PREPROCESS.S. 2021-09-06 20:42:34 -04:00
Dmitry Goncharov
4488592dda * src/main.c (decode_debug_flags): [SV 607777] Preserve -d options
* tests/scripts/options/dash-d: Test that -d --trace keeps -d.
2021-09-06 20:36:15 -04:00
Dmitry Goncharov
e7eb8b5962 [SV 57778] Don't ignore included makefiles that can't be read
If we find an included makefile but it's not readable, stop
immediately with an error rather than continuing to look in other
directories.

* src/read.c (eval_makefile): Only keep searching if the fopen error
is ENOENT, else stop and fail.
* tests/scripts/features/include: Add tests to verify this behavior.
2021-09-06 20:20:28 -04:00
Paul Smith
0c2fc00544 [SV 60795] Don't remake phony included makefiles and show errors
Change the handling of included makefiles which are phony targets to
be similar to double-colon rules with no prerequisites: simply don't
build them at all during the remake a makefile phase.

Ensure that any included makefile which is needed but not built
results in an error.

Update the documentation to make this clear.
Add tests to verify this behavior.

* doc/make.texi (Remaking Makefiles): Clarify double-colon exception.
Document that phony targets are handled the same way.
(Phony Targets): Ditto.
* src/main.c (main): Check for phony targets when skipping goals.
Rather than throwing out skipped but failed goals keep them
separately then report them as errors.
* src/read.c (eval): Set the file location on included makefiles even
when there's no error.
* tests/scripts/features/include: Add tests for handling included
makefiles with both phony and double-colon rules to rebuild them.
2021-09-06 18:49:08 -04:00
Paul Smith
214df0e92a * doc/make.texi (Environment): [SV 60841] Clarify variable exporting. 2021-09-06 10:57:43 -04:00
Paul Smith
b2e898d0bf * doc/make.texi (Chained Rules): [SV 60904] Clarify intermediate files. 2021-09-06 10:46:52 -04:00
Paul Smith
abb1e8d10b Remove UBSAN issues discovered via fuzzing tests.
The arithmetic conversions in C say that if a binary operator has an
unsigned and signed type as operands and the unsigned type has a greater
rank then the signed value is converted to unsigned.  This is bad if the
signed value is negative.

There are a few places in the code which have this situation; convert
the signed value to positive and add instead of subtracting.

Reported by He Jingxuan <jingxuan.he@inf.ethz.ch>

* src/read.c (find_map_unquote): Use a positive int in memmove().
(find_char_unquote): Ditto.
(find_percent_cached): Ditto.
2021-09-06 00:14:57 -04:00
Paul Smith
cc6dc70b16 * doc/make.texi (Prerequisite Types): [SV 61069] Mention PHONY prereqs 2021-09-05 23:29:33 -04:00
Paul Smith
2638552859 * doc/make.1: Clean up man page text. 2021-09-05 23:17:26 -04:00
Paul Smith
de48d6a4f7 * README.git: Add a section on ways to test. 2021-09-05 22:28:36 -04:00
Paul Smith
55f06bdc3f * src/main.c (decode_switches): Fix memory leak. 2021-09-05 22:28:10 -04:00
Paul Smith
0d367bbe6e Clean up a few Windows build warnings (not all!)
* build_w32.bat: Quote uses of %VSWHERE% so it can contain spaces
* src/hash.c (hash_init): Avoid use of an undefined struct.
(hash_rehash): Ditto.
* src/vpath.c (construct_vpath_list): Cast explicitly to void*.
2021-09-05 21:09:27 -04:00
Paul Smith
f4b8ddf260 [SV 45211] Parse MAKEFLAGS immediately when it's reset
When MAKEFLAGS is set in a makefile, reparse it immediately rather
than waiting until after all makefiles have been read and parsed.
This change doesn't actually fix the SV bug referenced because, even
though we do reparse MAKEFLAGS, we don't handle the -r or -R options
immediately.  Doing this will require more effort.

* NEWS: Announce the change.
* src/makeint.h: Publish reset_switches() and decode_env_switches()
from main.c
* src/main.c (main): Don't call construct_include_path(); it will be
invoked decode_switches().
Preserve the old values of builtin_rules, builtin_variables, and
job_slots before we read makefiles since they can be changed now.
(reset_switches): Publish (remove static).  Set the initial value of
the stringlist list to NULL.
(decode_switches): Call construct_include_path() after decoding.
(decode_env_switches): Publish (remove static).
(define_makeflags): Set the MAKEFLAGS variable for special handling.
* src/read.c (eval_makefile): Check for empty include_directories.
(construct_include_path): Clear any old value of .INCLUDE_DIRS before
appending new values.  Free the previous include_directories.
* src/variable.c (lookup_special_var): When MAKEFLAGS is set, first
reset the switches then re-parse the variable.
* tests/run_make_tests.pl: Memo-ize some default variable values.
* tests/scripts/options/dash-r: Create tests for setting -r and -R.
* tests/scripts/variables/MAKEFLAGS: Test that resetting -I from
within the makefile takes effect immediately.
2021-09-05 21:08:59 -04:00
Paul Smith
e13fd5c83d * make-gdb.py: Add pretty-printers and clean up.
Create a pretty-printer for next-pointer lists.
Create a pretty-printer for stringlists.
Change showargv from a function to a command (easier to use).

Clean up some Python PEP violations.  Add support for testing null
pointers and caching gdb.Types.
2021-09-05 20:05:02 -04:00
Paul Smith
7c4e6b0299 [SV 60595] Restart whenever any makefile is rebuilt
Previously if an included makefile was rebuilt as a prerequisite of
another included makefile which didn't need to be rebuilt, make would
not realize that it needed to re-exec itself.

Ensure that if any included makefile target is rebuilt we re-exec.
Also ensure that if an included makefile is not readable, and our rule
for rebuilding it doesn't actually change it, we will still fail.

* src/remake.c (update_goal_chain): If a goal's update was successful
then check its status, even if no actual commands were run because it
was already up to date.
(show_goal_error): Remove superfluous cast.
* src/main.c (main): If the makefile remake did nothing, check that we
were able to successfully include all the makefiles we care about; if
not fail.  When generating error messages about included makefiles be
sure to show the filename/linenumber information.
* test/scripts/features/reinvoke: Add tests for this behavior.
* test/scripts/options/dash-k: Update error messages.
2021-09-03 12:08:11 -04:00
Paul Smith
b9c4fc441b [SV 60412] Allow -I- to throw out the current directory path
Accept a "-" directory value to the -I option to clear the set of
directories to be searched up to that point, including the default
directories.

* NEWS: Announce the change.
* doc/make.texi (Summary of Options): Add documentation.
* src/read.c (construct_include_path): Check for '-' and if found,
clear the list of directories to be searched.
* tests/scripts/options/dash-I: Add tests for -I-.
* tests/scripts/variables/INCLUDE_DIRS: Add tests for -I-.
2021-09-03 12:08:11 -04:00
Dmitry Goncharov
65b73ce434 [SV 60699] Avoid calling strlen() repeatedly in a loop
* src/variable.c (lookup_pattern_var): Accept target length parameter.
(initialize_file_variables): Pass computed target length to lookup.
2021-07-25 17:15:38 -04:00
Paul Smith
2d73c9bf25 * NEWS: Add a few missing attributions
* AUTHORS: Add some missing attributions
2021-07-25 17:15:38 -04:00
Dmitry Goncharov
33468b3f31 [SV 60297] Add .NOTINTERMEDIATE special target
Support a new special target, .NOTINTERMEDIATE.  Any file or pattern
prerequisite of this target will never be considered intermediate.
This differs from .SECONDARY in that .SECONDARY files won't be deleted
but they will still not be built if they are missing.

.NOTINTERMEDIATE files are treated the same way as a target which is
explicitly mentioned in the makefile.  This is mostly useful with
patterns; obviously mentioning a target explicitly here is enough in
and of itself to make something not intermediate.

Some adjustments made by psmith@gnu.org

* NEWS: Announce the new feature.
* doc/make.texi (Special Targets): Document .NOTINTERMEDIATE.
(Chained Rules): Describe how to use .NOTINTERMEDIATE.
* src/main.c (main): Add "notintermediate" to the .FEATURES variable.
* src/filedef.h (struct file): Add "notintermediate" flag.
* src/file.c (no_intermediates): Mark global .NOTINTERMEDIATE.
(snap_file): Support .NOTINTERMEDIATE special target.  Throw an error
if the same target is marked both .NOTINTERMEDIATE and .SECONDARY or
.INTERMEDIATE.
(rehash_file): Merge intermediate, notintermediate, secondary flags.
(remove_intermediates): Check notintermediate flag before removing.
(print_file):
* src/implicit.c (pattern_search): Set notintermediate based on the
pattern.
* tests/scripts/targets/NOTINTERMEDIATE: Add a new test suite.
2021-07-25 17:15:38 -04:00
Paul Smith
1cffd0a203 * make.texi (Reading Makefiles): != creates recursive variables.
Reported by Ronald Hoogenboom <RHoogenboom@irdeto.com>.
2021-05-30 15:53:51 -04:00
Dmitry Goncharov
b580949ae0 [SV 60659] Set $$< properly in second expansion
Set the $$< automatic variable as best we can during secondary
expansion of prerequisites.

* src/commands.c (set_file_variables): Don't break without setting
'less' if secondary expansion is enabled.
* tests/scripts/features/se_explicit: Test secondary expansion results.
* tests/scripts/features/se_implicit: Test secondary expansion results.
2021-05-30 15:53:41 -04:00
Paul Smith
f2771aa614 [SV 58341] Add non-trivial options to $(MAKEFLAGS)
Previously only trivial (single-letter) options were available in
$(MAKEFLAGS) when it is examined from inside a makefile (the full
value was set before expanding recipes).

Ensure that all options (but, not command line variable overrides!)
are visible in the $(MAKEFLAGS) variable.  In order to do this
reset the default values of options, particularly options which are
lists, before re-reading MAKEFLAGS after makefiles have been read.
Otherwise we'll get duplicate values for options such as -I.

Unfortunately there are complications here as well: sometimes (for
jobserver options in particular) we modify the values of these
options while running: we must not reset these modifications.

* NEWS: Announce this change
* src/main.c (main): Call new reset_switches() before re-parsing
MAKEFLAGS.
(reset_switches): Reset the value of non-special options to their
defaults.
(define_makeflags): Add non-special options into MAKEFLAGS even
if 'all' is not set.
2021-05-30 15:11:30 -04:00
Dmitry Goncharov
5e829188d3 [SV 60378] Don't add duplicate default search directories
Depending on how make was configured it may add duplicate
directories in the default include search path: avoid this.

(Tweaked by psmith@gnu.org)

* configure.ac: Set AM variable KNOWN_PREFIX if --prefix is known
* Makefile.am: Only set INCLUDEDIR if prefix is not known
* read.c [default_include_directories]: Only add INCLUDEDIR if set
2021-05-30 15:11:30 -04:00
Dmitry Goncharov
297cb5adb7 * tests/scripts/targets/INTERMEDIATE: [SV 60188] Add one more test 2021-05-30 15:11:14 -04:00
Eli Zaretskii
012918bf11 [SV 58656] Fix mtime for large files on MS-Windows
In MSVC builds, 'stat' fails when called on files larger than
2GB.  Call '_stat64' instead to work around this.

* src/remake.c (STAT): Define to '_stat64' for MSVC builds.
(name_mtime) [WINDOWS32]: Use STAT instead of 'stat'.
Suggested by Makoto Kato <m_kato@ga2.so-net.ne.jp>.
2021-05-29 11:37:09 +03:00
Paul Smith
1ae90c030d Fix build and test issues on Windows
* src/dep.h (DEP): Remove extraneous semicolon.
* src/dir.c (find_directory) [W32]: Replace removed variable.
* tests/scripts/features/include: Allow the extra default makefile
searched for on Windows.
* tests/scripts/functions/file: Use $(info ...) to avoid "command
too long" errors on Windows.
2021-03-28 16:25:52 -04:00
Tobias Stoeckmann
0fb6f2d985 * src/remake.c (name_mtime): Reserve space for nul in readlink result
Copyright-paperwork-exempt: yes
2021-03-28 14:45:16 -04:00
Cao jin
97a8d9b45a * doc/make.texi (Call Function): Apply consistent formatting
Copyright-paperwork-exempt: yes
2021-03-25 14:38:58 -04:00
Pete Dietl
c5c02accb7 * src/job.c (child_execute_job): Update gnulib find_in_given_path()
Copyright-paperwork-exempt: yes
2021-03-25 14:25:26 -04:00
Mike Frysinger
76a099997b * doc/make.texi (Automatic Variables): Relocate the $? example
Copyright-paperwork-exempt: yes
2021-03-25 13:10:29 -04:00
Paul Smith
c5319e75f5 [SV 58497] Ensure $(file <) newline removal succeeds
Keep a count of bytes read rather than comparing pointers since the
variable_buffer might get reallocated.

Bug and patch by Ken Tossell <ken@tossell.net>
Regression tests by Dmitry Goncharov <dgoncharov@users.sf.net>
Tweaked by Paul Smith <psmith@gnu.org>

* src/function.c (func_file): Use bytes read rather than a pointer.
* tests/scripts/functions/file: Provide various tests for reading
empty files, files with/without newlines, and large files.
2021-03-15 03:28:11 -04:00
Dmitry Goncharov
510e5ce801 [SV 60188] Explicit prereqs cannot be intermediate files
If a prereq of a pattern is an explicit target, it should not be
considered an intermediate file.

(Minor tweaks by Paul Smith <psmith@gnu.org>)

* src/dep.h (struct nameseq): Add is_explicit flag.
* src/implicit.c (struct patdeps): Ditto.
(pattern_search): Set the is_explicit flag appropriately for each
prerequisite, based on whether it contained a pattern or not.
Update the help output to note implicit vs. explicit prereqs.
* tests/scripts/features/double_colon: Add tests.
* tests/scripts/features/grouped_targets: Ditto.
* tests/scripts/features/patternrules: Ditto.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/statipattrules: Ditto.
2021-03-15 02:10:49 -04:00
Paul Smith
144f436c4b * tests/scripts/features/exec: Small cleanup 2021-03-15 01:17:06 -04:00
Paul Smith
52056d7b2c Ensure variable_buffer is always set.
Initialize the global variable_buffer in main() so that it is never
a null pointer.  Then invoking variable_expand("") is never needed:
simply use the variable_buffer pointer when we want to restart the
variable buffer.  The main point of this simplification is not to
keep a separate pointer to the beginning of the buffer: this is
dangerous because the buffer may be re-allocated.  Instead always
use the variable_buffer pointer itself.

* src/variable.h (initialize_variable_output): Publish.
* src/expand.c (initialize_variable_output): Remove static.
* src/main.c (main): Initialize variable_buffer.
* src/file.c (enter_prereqs): Don't call variable_expand("") and
don't save a separate buffer pointer than might be outdated.
(expand_deps): Ditto.
* src/read.c (record_files): Ditto.
* src/remake.c (library_search): Ditto.
2021-03-15 01:17:06 -04:00
Paul Smith
c66ec5fa20 [SV 59881] Handle vertical TAB consistently
While parsing makefiles get_next_mword() was treating VTAB as a word
character rather than a word separator.  However, when using
find_next_token(), for example in patsubst_expand_pat(), we treated
VTAB as a word separator causing multiple words to appear where we
didn't expect them.

* src/makeint.h (END_OF_TOKEN): Change from a loop to a boolean check.
* src/misc.c (end_of_token): Move the loop here.
* src/read.c (get_next_mword): Skip whitespace, not just blank, to
find the start of the word and use END_OF_TOKEN() to decide when the
current word is finished.
2021-03-15 01:16:32 -04:00
Paul Smith
da6fc6aae2 [SV 59870] define/undefine prerequisites are not target-specific vars
* src/read.c (parse_var_assignment): If called in a target-specific
variable context don't allow define/undefine as variable assignments.
* test/scripts/variables/define: Add a test.
* test/scripts/variables/undefine: Add a test.
2021-03-14 16:35:38 -04:00
Paul Smith
d9aff6b817 * maintMakefile: Don't make .check-git-HEAD .PHONY 2021-03-14 15:53:45 -04:00
Jouke Witteveen
e5f6dc54b9 More correctly describe the scope of variables
* NEWS: Use "local" instead of the incorrect "lexically-scoped".
* doc/make.texi: Refer to let/foreach variables as local variables.
2021-03-07 19:06:59 -05:00
Paul Smith
88732a29f2 * doc/make.text: Clarify that patsubst doesn't touch unmatched words 2021-03-07 19:05:20 -05:00
Paul Smith
7b0a741857 * .dir-locals.el: Update for newer LSP config 2021-03-07 19:04:48 -05:00
Paul Smith
74bd8b3aa5 * file.c (remove_intermediates): Restart "rm ..." on error 2021-03-07 19:04:22 -05:00
Paul Smith
9043b28250 * doc/make.texi (How Patterns Match): [SV 58639] Fix chaining info. 2020-12-07 01:03:11 -05:00
Jouke Witteveen
fcc11d05a6 Create $(let ...) providing lexically scoped variables
Add a new function $(let ...) which allows lexically scoped variables.

* NEWS: Add information on this feature.
* doc/make.texi (Let Function): Document the 'let' function.
* src/function.c (func_let): Create the 'let' built-in function.
* tests/scripts/functions/let: Test the 'let' built-in function.
2020-12-06 18:30:58 -05:00
Paul Smith
a8f4669b23 * doc/make.texi (Phony Targets): [SV 58961] Clarify pattern handling 2020-12-06 15:21:23 -05:00
Paul Smith
bd4829096c * doc/make.texi (Synchronized Terminal Output): [SV 58960] Fix link 2020-12-06 10:14:15 -05:00
Paul Smith
7044e0c93c [SV 59169] Add --debug=why and --debug=print options
Add debug options to print recipes even if they would otherwise be
silent, and to print the reason that a target was considered out of
date.

Modify --trace to simply be a shorthand for --debug=print,why.

* NEWS: Announce changes.
* doc/make.texi (Summary of Options): Document the new options.
* doc/make.1: Ditto.
* src/debug.h: Add new flags DB_PRINT and DB_WHY.
* src/makeint.h: Remove the trace_flag variable.
* src/job.c (start_job_command): Check debug flags not trace_flag.
(new_job): Ditto.
* src/main.c (trace_flag): Make a static variable for switches.
(decode_debug_flags): Set DB_PRINT and DB_WHY if trace_flag is set.
* tests/scripts/variables/GNUMAKEFLAGS: Update known-good messages.
* tests/scripts/variables/MAKEFLAGS: Ditto.
2020-12-05 16:25:12 -05:00
Paul Smith
94d9077691 * configure.ac: [SV 58836] Copy build.sh to the build directory 2020-12-05 15:11:52 -05:00
Paul Smith
c4cc2e9595 [SV 57676] Support included files being built after failing
If a -include file does not exist, then some subsequent operation
creates it, then allow it to be successfully included.

* src/read.c (eval_makefile): If our last mtime was NONEXISTENT then
reset it to 0 so we'll check it again.
* tests/scripts/features/include: Add a test for this behavior.
2020-12-05 15:06:25 -05:00
Paul Smith
5e234e4048 * src/makeint.h (free_alloca): Check for builtin alloca 2020-12-02 17:29:16 -05:00
Paul Smith
950f3d305f * src/main.c (main): [SV 59601] Check for malformed env. variables 2020-12-02 17:27:55 -05:00
Paul Smith
58a37927e6 * maintMakefile: [SV 58794] Check for file existence in the release 2020-11-29 17:59:40 -05:00
Paul Smith
ec272f3a9c * Makefile.am (HAVE_GUILE): Only use Guile options if HAVE_GUILE. 2020-11-29 17:59:40 -05:00
Paul Smith
ef6aca5a38 * tests/scripts/features/vpathgpath: Avoid duplicate function name. 2020-11-29 17:59:40 -05:00
Paul Smith
b262ea5d8f Resolve unused-result warnings for alloca(0)
* src/makeint.h (free_alloca): New macro to defeat warn_unused_result.
* src/read.c (eval_makefile): Call it.
(eval_buffer): Ditto.
* src/remake.c (update_file): Ditto.
2020-11-29 17:59:40 -05:00
Paul Smith
cc20f90507 Avoid some valgrind warnings
Using sscanf() to parse archive header values (struct ar_hdr) can lead
to valgrind warnings which are probably bogus but are annoying.
To be safer, create a local method to convert the ASCII integer
strings into integers.

* src/arscan.c (parse_int): Turn integer strings into integers.
(ar_scan): Initialize struct ar_hdr memory.
Call parse_int() rather than sscanf/atol.
2020-11-29 17:59:40 -05:00
Paul Smith
9e2fa24649 [SV 41273] Allow the directory cache to be invalidated
Each time we invoke a command it's possible that it will change the
filesystem in ways that were not described by the target.  If that
happens but we have cached previous directory contents then we may
make decisions or report results based on obsolete information.

Keep a count of how many commands we've invoked, and remember the
current command count every time we load the contents of a directory.
If we request the directory and the current command count has changed
we know the cache is outdated so reload from scratch.

* NEWS: Announce the change.
* src/makeint.h (command_count): Create a global counter.
* src/main.c (command_count): Ditto.
* src/job.c (reap_children): Increment the counter on job completion.
* src/function.c (func_file): Increment if we write a file.
* src/dir.c (clear_directory_contents): Clear the current contents of
a cached directory.
(struct directory_contents): Remember the counter value.
(struct directory): Remember the counter value for non-existing dirs.
(find_directory): If we have a cached directory and the count hasn't
changed then return it.  Else, clear the previous contents and re-read
from scratch.
* tests/scripts/features/dircache: Add tests of the directory cache.
2020-11-29 17:59:16 -05:00
Paul Smith
2dc0280d82 Support "unexport" in target-specific variables.
Rewrite the environment variable algorithm to correctly inherit
export settings from parent variable sets.  The new algorithm
for computing the table of environment variables is:

- Start with the most local variable set and proceed to global.
- If the variable already exists in the table and we don't know
  its export status, update it with the current variable's status.
- If the variable is not in the table and it's not global, add it
  regardless of its status so if it's unexported we remember that.
- If the variable is not in the table and is global, check its
  export status and don't add it if we won't export it.

Then when generating the environment variables, check the export
status of each variable in case it was a target-specific variable
and we have determined it should not be exported.

Rework SHELL handling to check at the end whether we added it or
not and if we didn't, add the value from the environment.

* NEWS: Announce support for target-specific "unexport"."
* doc/make.texi (Target-specific): Document the support.
* src/variable.h (enum variable_export): Make into a global type.
* src/read.c (struct vmodifiers): Use enum variable_export rather
than individual booleans.
(parse_var_assignment): Parse the "unexport" keyword.
(eval): Remember the vmodifier value in the variable.
(record_target_var): Ditto.
* src/variable.c (should_export): Check if the variable should be
exported.
(target_environment): Implement the above algorithm.
* tests/scripts/features/export: Test export/unexport with variable
assignments on the same line.
* tests/scripts/features/targetvars: Add a comprehensive suite of
tests for different types of target-specific export / unexport.
* tests/scripts/variables/SHELL: Update the comment.
2020-11-29 17:57:33 -05:00
Dmitry Goncharov
90959b8b70 [SV 59230] Preserve export settings for target-specific vars
* src/read.c (record_target_var): Don't overwrite pre-existing export
flag unless we're changing it.
* tests/scripts/features/targetvars: Add a test.
2020-11-29 17:55:32 -05:00
Paul Smith
19ae6fe72a [SV 59230] Ensure environment variables are exportable
When checking for invalid environment variable names we searched the
entire name string instead of just the first LENGTH chars; this could
cause us to incorrectly decide the variable was not exportable.

Dmitry Goncharov <dgoncharov@users.sf.net> found this bug and
provided a test case and sample fix: I used the test but chose a
slightly different fix.

* src/variable.c (define_variable_in_set): check the variable name
not the input string.
* tests/scripts/features/targetvars: Ensure environment variable
values are exported.
2020-11-29 17:55:32 -05:00
Paul Smith
0e020bbc24 * src/default.c (default_variables) [AIX]: [SV 59096] Fix ARFLAGS
Reported by Dmitry Goncharov <dgoncharov@users.sf.net>, with a patch
changing the pattern rule for building archives.  I decided to
change the default value of ARFLAGS on AIX instead.
2020-11-29 17:55:32 -05:00
Paul Smith
c01222c018 [SV 35711] Check for special targets earlier
GNU make must recognize some special targets as they are defined.
Because of the way targets are defined, we were not recognizing these
special targets until we were handling the NEXT statement.  However
that's too late for some special targets such as .POSIX etc. which can
change the behavior of make during parsing.

Check for special targets earlier, as soon as we've finished parsing
the target introduction line (before we've even parsed the recipe).

* NEWS: Mention the change.
* src/read.c (check_specials): New function to look for special
targets.  Move checks from eval() and record_files() to this new
function.
(eval): Call check_specials() after we've completed parsing the target
introduction line.  Move default goal detection to check_specials().
(record_files): Move handling of .POSIX, .SECONDEXPANSION, and
.ONESHELL to check_specials().
* tests/scripts/misc/bs-nl: Remove workaround for late .POSIX issue.
* tests/scripts/targets/POSIX: Add a comment.
2020-11-29 17:55:02 -05:00
Paul Smith
957aa450a0 * .ccls: Disable clang compare against static string warning 2020-11-29 10:02:45 -05:00
Paul Smith
e49e11e069 [SV 59093] Rewrite filter/filter-out to avoid large stack usage
* src/function.c (func_filter_filterout): Allocate arrays to hold
pattern and word information rather than creating linked lists on
the stack.
* tests/scripts/functions/filter-out: Test large filters.
2020-11-13 00:44:24 -05:00
Paul Smith
f4f353bb54 * doc/make.texi (Include): Update behavior for missing included files 2020-10-28 11:10:52 -04:00
Paul Smith
a80b0096f5 * NEWS: [SV 58435] Document minimum C compiler version requirement
* configure.ac: Require c99 via AC_PROG_CC_C99
2020-07-19 18:59:06 -04:00
Paul Smith
62e8f029e9 [SV 58735] Define the order that makefiles are rebuilt.
Ensure that makefiles are rebuilt in the order in which make first
considered them, and document this behavior in the manual.

* NEWS: Add a note about the new behavior
* doc/make.text (How make Processes a Makefile): Document it.
* main.c (main): Inverse the list of makefile goals.
* read.c (read_all_makefiles): Add default makefiles to the list at
the front in reverse order, the same way other makefiles are added.
* tests/scripts/features/include: Add tests to verify rebuild order.
2020-07-19 13:56:23 -04:00
Paul Smith
db7658e042 * src/makeint.h: [ARM] [SV 58347] Don't assume ARM is not POSIX 2020-07-10 11:59:40 -04:00
Paul Smith
fa7f95c66c * src/job.c (unblock_sigs): [!POSIX] [SV 58743] Fix syntax errors 2020-07-10 11:59:38 -04:00
Paul Smith
df5f30a76a * NEWS: Fix some tortured grammar. 2020-05-14 01:00:28 -04:00
Paul Smith
1770540217 [SV 57930] Cast char to unsigned char to call ctype functions
This cast was already done almost everywhere: fix some stragglers.

* src/load.c (load_file): Cast char to unsigned char.
* src/misc.c (strcasecmp, strncasecmp): [!POSIX] Ditto.
* src/dir.c (vms_hash): [VMS] Ditto.
* src/vms_progname.c (set_program_name): [VMS] Ditto.
* src/vms_jobs.c (posix_parse_dq): [VMS] Ditto.
(posix_parse_dollar): [VMS] Ditto.
(build_vms_cmd): [VMS] Ditto.
(child_execute_job): [VMS] Ditto.
2020-05-03 14:54:56 -04:00
Paul Smith
c8a6263eb5 Convert [ ... ] to test ... in scripting.
The "[" link may be missing during OS boostrapping.

* build.sh: Convert "[ ... ]" to "test ..."
* maintMakefile: Ditto.
* scripts/copyright-update: Ditto
* tests/scripts/features/reinvoke: Ditto
* tests/scripts/features/targetvars: Ditto
2020-05-03 14:23:56 -04:00
Paul Smith
a015d1f822 * maintMakefile: Clean up output 2020-05-03 14:23:56 -04:00
Paul Smith
c604e53a45 * mainMakefile: Check that INSTALL exists in the dist file
For some reason the INSTALL file symlinked to gnulib was omitted from
the 4.3 release package: I can't reproduce this but check for it.
2020-05-03 14:23:40 -04:00
Kevin Buettner
d79fe162c0 [SV 58232] Disable inheritance of jobserver FDs for recursive make
A parent make will invoke a sub-make with close-on-exec disabled for
the jobserver pipe FDs.  Force close-on-exec to be to be enabled in
the sub-make so the pipe is not always passed to child jobs.

I have a test case which, when invoked with a suitable -j switch,
will hang if the recipe inherits the jobserver pipe.  This test case
was inspired by a real world case in which testing GDB on Fedora
would hang due to some poorly written test GDB cases having been
passed the jobserver file descriptors.

* src/posixos.c (jobserver_parse_auth): Call fd_noinherit() for
jobserver pipe descriptors.

Copyright-paperwork-exempt: yes
2020-05-02 20:09:29 -04:00
Paul Smith
0c326a66c9 [SV 57674] Use the system default PATH if $PATH is not set
When using execvp() if $PATH is not present in the environment
it will automatically search the system default PATH string.  Emulate
this by passing the system default PATH to find_in_given_path() if
we don't find PATH in the environment.

* src/job.c (child_execute_job): Use confstr(_CS_PATH) if PATH is not
found.
2020-04-01 02:02:57 -04:00
Paul Smith
f79bde1a6d tests: Simplify customization of %ENV
Rather than having an %extraENV that is added to the default %ENV
and resetting %ENV _before_ each test, allow the test setup to
modify %ENV directly as needed then reset %ENV _after_ each test.

* tests/test_driver.pl: Remove unused %extraENV.
(resetENV): Don't add in %extraENV.
(_run_command): Reset after we run the command rather than before.
* tests/scripts/features/export: Convert %extraENV to %ENV
* tests/scripts/features/jobserver: Ditto
* tests/scripts/features/parallelism: Ditto
* tests/scripts/features/targetvars: Ditto
* tests/scripts/functions/eval: Ditto
* tests/scripts/functions/foreach: Ditto
* tests/scripts/functions/origin: Ditto
* tests/scripts/misc/general4: Ditto
* tests/scripts/options/dash-e: Ditto
* tests/scripts/targets/POSIX: Ditto
* tests/scripts/variables/GNUMAKEFLAGS: Ditto
* tests/scripts/variables/SHELL: Ditto
2020-04-01 02:02:57 -04:00
Jens Rehsack
289108cc9b * src/output.h: [WINDOWS32] [SV 57888] Use gnulib fcntl if available
If gnulib fcntl is available (for MinGW32) use it rather than our
homegrown version.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Copyright-paperwork-exempt: yes
2020-03-31 01:07:43 -04:00
Jens Rehsack
61c413d5ea * src/w32/compat/dirent.c: [SV 57888] Use gnulib opendir on MinGW32
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Copyright-paperwork-exempt: yes
2020-03-31 00:50:21 -04:00
Jens Rehsack
d3a53d5d16 * src/dir.c (local_stat): [WINDOWS32] Fix buffer-overflow warning.
[SV 57888] Provide space for the path to use MAXPATHLEN plus nul.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Copyright-paperwork-exempt: yes
2020-03-31 00:48:57 -04:00
Paul Smith
1306023a4f [SV 57896] Change directories before checking jobserver auth
We want to process -C options as early as possible, before we might
write informational messages, so that Entering/Leaving messages have
the correct directory.

* src/main.c (main): Move code dealing with changing directories
before parsing of the jobserver auth flag.
* tests/scripts/features/jobserver: Test the order of enter/leave.
2020-03-31 00:33:13 -04:00
Paul Smith
80b90b7866 [SV 57967] Only set APPEND mode for regular files
APPEND is a permanent mode shared by all users of a file.  If we
set it on a tty, pipe, etc. it will stay in effect even after make
exits, which can cause problems.

Patch provided by 0xef967c36@gmail.com

* src/output.c (set_append_mode): Check for a regular file.

Copyright-paperwork-exempt: yes
2020-03-31 00:19:20 -04:00
Paul Smith
8e024a2532 Obey order of multiple print/no-print directory options
Previously if --no-print-directory was seen anywhere even once
(environment, command line, etc.) it would always take precedence
over any --print-directory option.  Change this so that the last
seen option (which will be the command line, if present there) takes
precedence.

* NEWS: Mark this change in behavior.
* src/makeint.h (print_directory): A new variable to control printing.
* src/output.c (output_dump): Use the new variable.
(output_start): Ditto.
* src/main.c: Add a new variable print_directory.  Use -1 for
print_directory_flag so we know of the option was seen or not.  Add a
new default_print_directory_flag set to -1 to keep options from being
added.
(switches): Use flag_off for --no-print-directory, rather than a
separate inhibit_print_directory_flag.
(main): If print_directory_flag was set by the user, use that for
print_directory.  If not, compute the print_directory value based on
-s, -C, and sub-makes as before.
* tests/scripts/variables/GNUMAKEFLAGS: -w is not added automatically
* tests/scripts/options/print-directory: Add tests for overriding
print-directory options.
2020-03-31 00:17:49 -04:00
Paul Smith
660a2eafe5 * NEWS: Update 4.3 with information on .SILENT / -s 2020-03-29 17:50:34 -04:00
Eli Zaretskii
8277806db6 * NEWS: Mention the new tcc support. 2020-02-29 11:16:19 +02:00
Christian Jullien
6ba5ea022a Add support for building with Tiny C for MS-Windows
* src/config.h.W32.template (HAVE_DIRECT_H, HAVE_STRCASECMP)
(HAVE_STRNCASECMP, HAVE_UMASK): Add __TINYC__ to MinGW condition.
(BATCH_MODE_ONLY_SHELL): Make this the default for Tiny C.

* build_w32.bat: Support building with Tiny C's tcc compiler.
2020-02-29 11:14:46 +02:00
Paul Smith
4533348826 Apply spelling corrections from Fossies spellcheck
See https://fossies.org/features.html#codespell
Spelling issues in Git commit messages or lib/* source are not applied.

* README.OS2.template: Apply spelling corrections.
* README.VMS: Ditto.
* src/commands.c: Ditto.
* src/config.ami.template: Ditto.
* src/configh.dos.template: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/read.c: Ditto.
* src/variable.c: Ditto.
* src/vms_exit.c: Ditto.
* src/vms_export_symbol.c: Ditto.
* src/vms_progname.c: Ditto.
* src/vmsfunctions.c: Ditto.
* src/vmsjobs.c: Ditto.
* src/w32/pathstuff.c: Ditto.
* tests/scripts/variables/automatic: Ditto.
* tests/test_driver.pl: Ditto.
2020-01-20 19:25:54 -05:00
Paul Smith
68fbad6667 Update to GNU make 4.3.90
* NEWS: Add a 4.3.90 section and update Savannah bug URL
* configure.ac (AC_INIT): Change release to 4.3.90
2020-01-20 19:25:54 -05:00
Paul Smith
f430a65ccb GNU Make release 4.3
* NEWS: Update for the release
* configure.ac: New release number
* doc/make.texi: New edition number
2020-01-19 17:04:52 -05:00
Paul Smith
c30da63fd2 * configure.ac (guile): Check for Guile 3.0 installations 2020-01-19 17:04:52 -05:00
Paul Smith
3fb7312e9f * src/job.c (sh_cmds): [SV 57625] Update builtin shell command list 2020-01-19 17:04:52 -05:00
Paul Smith
dd6adfa454 Resolve some documentation issues
* doc/make.texi (Interrupts): [SV 46193] Recommend defensive recipes
* doc/make.texi: [SV 49262] Clarify interaction of prerequisites and
non-terminal match-anything rules.
2020-01-19 17:04:52 -05:00
Paul Smith
3b5e47b2e2 [SV 40657] Reinstate old behavior for suffix rules with prereqs
POSIX says that suffix rules cannot have prerequisites, but after
making this change we observed a number of makefiles "in the wild"
that were relying on this behavior and failed.

For .POSIX: makefiles, obey POSIX.  Otherwise preserve the old
behavior.  However, generate a warning so users know this is a
problem.  In a future version we will change all behavior to be
POSIX-conforming.

* NEWS: describe the change
* src/rule.c (convert_to_pattern): If posix_pedantic don't make a
pattern rule if prereqs exist.  Otherwise show a warning.
* tests/scripts/features/suffixrules: Add tests for the new behavior
including .POSIX vs. non-.POSIX.
2020-01-19 17:04:52 -05:00
Dmitry Goncharov
4e277f6fbd * tests/test_driver.pl: Enhance error messages 2020-01-05 10:46:58 -05:00
Paul Smith
ec946d7e21 * doc/make.texi: Change the GFDL to an Appendix 2020-01-04 13:24:39 -05:00
Paul Smith
16d06006a4 * NEWS: Clarify authorship of new features. 2020-01-04 13:24:39 -05:00
Paul Smith
b774aebffa Enable compilation with C90 compilers
* configure.ac: Try compiling Guile headers: they don't work with C90.
* maintMakefile: Simplify config checks via target-specific variables.
* src/makeint.h: Use ATTRIBUTE rather than defining __attribute__,
as that causes compile issues with system headers.
(ENUM_BITFIELD): Don't use enum bitfields in ANSI mode.
* src/main.c: Use ATTRIBUTE instead of __attribute__.
* src/job.h: Ditto.
* src/file.c: Don't define variables inside for loops.
* src/rule.c: Ditto.
* src/dep.h (SI): Only use static inline in non-ANSI mode.
2020-01-04 13:23:23 -05:00
Paul Smith
06de697268 * bootstrap: Update to the latest gnulib version 2020-01-03 15:44:13 -05:00
Paul Smith
fdfe0446b6 Release GNU make 4.2.93
* NEWS: Update the release and date
* configure.ac: Update the release number
2020-01-03 02:08:59 -05:00
Paul Smith
12b14f0484 Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
Paul Smith
4e12a5fa45 Support the .EXTRA_PREREQS special variable
Initial implementation by Christof Warlich <cwarlich@gmx.de>

* NEWS: Announce the new feature.
* doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
* src/dep.h (struct dep): New flag to note extra prereq deps.
* src/filedef.h (expand_extra_prereqs): Declare a function to expand
the value of .EXTRA_PREREQS.
* src/file.c (expand_extra_prereqs): Given a struct variable lookup
of .EXTRA_PREREQS, convert it into a list of deps and for each one
make sure it has a struct file and has the new flag set.
(snap_file): A new function invoked by hash_map that will perform
per-file operations: set up second expansion, intermediate, and also
.EXTRA_PREREQS.  Manage circular dependencies by ignoring them.
(snap_deps): Defer per-file operations until the end.  Look up the
global .EXTRA_PREREQS and pass it along to snap_file for each file.
* src/implicit.c (struct patdeps): Remember the extra prereqs flag.
(pattern_search): Transfer extra prereqs flag settings into the
matched pattern rule.
* src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
snap_implicit_rules since we now do more than count.
* src/rule.c (snap_implicit_rules): As we walk through all the pattern
rules, add in any global .EXTRA_PREREQS to the dep list.  Ensure we
take them into account for the max number of prereqs and name length.
* src/main.c (main): Add extra-prereqs to .FEATURES.
Call the renamed snap_implicit_rules.
* tests/scripts/variables/EXTRA_PREREQS: Add tests.
2020-01-03 02:08:59 -05:00
Paul Smith
e56243fe57 * tests/scripts/features/patternrules: Use Windows-compatible quoting 2020-01-03 02:08:59 -05:00
Paul Smith
7449abfe1b * tests/test_driver.pl: Compute full path to Perl interpreter 2020-01-03 02:08:59 -05:00
Paul Smith
53b9770b40 * tests/scripts/features/exec: Don't use $ENV in the description 2020-01-03 02:08:59 -05:00
Paul Smith
766baeef0a * src/makeint.h: Add a declaration for memrchr() 2020-01-03 02:08:59 -05:00
Paul Smith
ee204c78f2 * NEWS: Remove info about disabled /proc/loadavg usage. 2019-12-27 01:42:25 -05:00
Paul Smith
e64674b718 [SV 57022] Avoid posix_spawn which fails asynchronously
Avoid using posix_spawn implementations that fail asynchronously when
the spawned program can't be invoked: this means instead of getting
an error such as "No such file or directory" we get just "Exit 127".

Original implementation of the configure.ac macro provided by
Martin Dorey <martin.dorey@hds.com>

Original implementation of the regression tests provided by
Dmitry Goncharov <dgoncharov@users.sf.net>

* configure.ac: Test whether posix_spawn fails asynchronously.  In a
cross-compilation environment, assume that it does not.  If we detect
that it does, fall back to fork/exec.
* tests/scripts/features/exec: Add regression tests for different
shebang invocation methods.
2019-12-27 01:37:17 -05:00
Paul Smith
564fb212a7 [SV 56655] Allow pattern expansion to contain spaces
* src/dep.h: Add a new flag PARSEFS_ONEWORD
* src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the
entire incoming string as a single pattern.
* src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing
patterns for wildcards.
* tests/scripts/features/patternrules: Add a new test.
2019-12-26 18:39:56 -05:00
Ben Wijen
30cc10093b * src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep() 2019-12-18 09:05:40 -05:00
Ben Wijen
69c5a2128b * bootstrap.bat: Fix typo in batch file name 2019-12-18 09:05:40 -05:00
Paul Smith
577dd1ff6d * src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type 2019-12-18 09:05:40 -05:00
Jouke Witteveen
86f2f8bcb5 [SV 54161] Fix second expansion of $* for paths
If the stem matches a path containing a directory not just a
filename, make sure the second expansion of $* in the
prerequisites matches $* in the recipe.  This requires using
$(*F) when replacing % in the first expansion to preserve the
simple filename.

* src/implicit.c (pattern_search): If lastslash is set prepend
the directory onto the stem.  Then use $(*F) when expanding %.
* tests/scripts/features/se_implicit: Add a test case
2019-12-18 09:05:17 -05:00
Jouke Witteveen
c72205b28b * src/implicit.c (pattern_search): Set lastslash correctly
If filename contained multiple slashes lastslash is wrongly set to 0.
* configure.ac: Check for the GNU memrchr() extension function.
* src/misc.c (memrchr): Supply memrchr() if not available.
2019-12-17 15:06:28 -05:00
Jouke Witteveen
057e33d6b5 * src/implicit.c (pattern-search): Remove unneeded 'dir' variable 2019-12-17 15:06:28 -05:00
Paul Smith
e4499a1fb5 * Makefile.am: Build lzip package instead of bzip2
* README.git: Mention changed requirements.
2019-12-17 15:06:28 -05:00
Paul Smith
57b043c7fb * src/job.c (load_too_high): Disable Linux /proc/loadavg for now
This new feature has a problem: if you provide a load which is
larger than the number of cores then it will always run every job.
Before we can enable it we need to at the least learn how to clamp
this value to the number of cores.  To experiment with it, set
PROC_FD_INIT to -2 in job.c to re-enable the feature.
2019-12-17 15:06:28 -05:00
Paul Smith
f389aabde6 * tests/run_make_tests.pl (set_more_defaults): Fix typo 2019-12-17 15:06:28 -05:00
Paul Smith
acbef3f612 * tests/run_make_tests.pl (subst_make_string): Force use of /
On Windows the path to the helper tool will contain '\': this will
fail if recipes are run with a POSIX shell.  Convert '\' to '/'
on Windows.  While here, escape any spaces in the path as well.
2019-12-16 16:18:58 -05:00
Paul Smith
3822f77c1d Rename jhelp.pl to thelp.pl and make it a generic test helper.
* tests/thelp.pl: Rename from tests/jhelp.pl.
(op): Use names instead of options for the operations.
(op): Add new operations for sleep, mkdir, and rm.
(op): Enhance wait to time out
* tests/run_make_tests.pl: Add a new #HELPER# replacement
(subst_make_string): Use fully-qualified path to thelp.pl
* tests/scripts/features/parallelism: Update to use thelp.pl
and the new named operations.  Use thelp.pl sleep instead of
system-specific sleep commands.
* tests/scripts/features/output-sync: Update to use thelp.pl
instead of complex shell scripts.
* Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl
2019-12-16 09:31:31 -05:00
Paul Eggert
1cf3932a39 Port functions/shell test to Solaris 10
* tests/scripts/functions/shell: Port exit-status calculation
to Solaris 10 with Perl 5.8.4.
2019-10-10 18:31:50 -04:00
Paul Smith
33bda40086 Release GNU make 4.2.92
* NEWS: Update the release and date
* configure.ac: Update the release number
2019-10-08 08:35:39 -04:00
Paul Smith
e666a6a021 * doc/make.text (Reading Makefiles): Rewrite to be more clear. 2019-10-06 15:48:53 -04:00
Paul Smith
5920d6d2b3 * Makefile.am (check-regression): Use PERLFLAGS when running Perl
* maintMakefile: Set PERLFLAGS to enable warnings.
* tests/run_make_tests.pl: Clean up issues pointed out by perl -w.
2019-10-05 17:48:19 -04:00
Paul Smith
2e6468c811 * tests/scripts/functions/wildcard: Skip slash tests for local glob. 2019-10-05 17:48:19 -04:00
Paul Smith
393d2a2d4a tests: Convert %CONFIG_FLAGS to get_config()
* tests/config-flags.pm.W32: Create a predefined Windows file.
* Makefile.am (test_FILES): Add it to the distribution.
* build_w32.bat: Install tests/config-flags.pm if not existing.
* tests/run_make_tests.pl (get_config): Create new function.
* tests/scripts/features/archives: Call get_config() rather than
using %CONFIG_FLAGS directly.
* tests/scripts/features/load: Ditto.
* tests/scripts/features/loadapi: Ditto.
* tests/scripts/functions/wildcard: Ditto.
2019-10-05 17:47:52 -04:00
Paul Smith
bd7d03f8cd * src/hash.c (jhash_string): Don't read past end of string.
Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
2019-10-05 11:23:31 -04:00
Paul Smith
a4a173928f * tests/run_make_tests.pl (valid_option): Add missing File::Spec 2019-10-05 07:43:52 -04:00
Paul Smith
0e113897f7 * src/function.c (func_realpath) [AIX]: Remove trailing slashes. 2019-09-23 00:34:12 -04:00
Paul Smith
b0eab8ecb9 * tests/scripts/features/vpathplus: Fix output for big-endian systems.
Our hashing algorithm gives different ordering on LE vs BE systems.
Patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
2019-09-22 17:35:51 -04:00
Florian Weimer
f84821b249 * configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.
Copyright-paperwork-exempt: yes
2019-09-22 17:32:29 -04:00
Paul Smith
99d1423059 * test/test_driver.el (_run_with_timeout): Show error message. 2019-09-22 17:03:05 -04:00
Paul Smith
7fbd58cd6b * job.c (child_error): Modify error message string.
This reverts commit 6264deece3bb77798240a906ceed79097adbcf48.
Further investigation discovers that the real issue is that
GNU Emacs compile mode doesn't have a matching regex for GNU
make error messages generated when targets fail.  I submitted
a patch to GNU Emacs adding a matcher for compile mode.
2019-09-22 17:02:57 -04:00
Paul Smith
3ede0b96ac * tests: Convert from File::Spec::Functions to File::Spec.
Users report the Functions version doesn't work correctly for some
older versions of Perl.
2019-09-21 16:37:56 -04:00
Paul Smith
1d289b424a * tests/scripts/function/guile: Valgrind doesn't work with Guile. 2019-09-21 15:38:52 -04:00
Paul Smith
96285f875b * src/job.c (child_execute_job): Allocate space for argv NULL. 2019-09-21 15:38:52 -04:00
Paul Smith
bd4ce86785 [SV 56918] Compute job slots properly on failing command
Ensure we properly reduce job_slots_used if a command fails because
it doesn't exist/can't be started.

* src/job.h (struct child): Add a field jobslot to be set when using
a job slot.
* src/job.c (start_waiting_job): Remember if we are using a job slot.
(reap_children): Reduce number of job slots used by jobslot.
2019-09-21 15:38:48 -04:00
Paul Smith
e1c072aa7e * src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode. 2019-09-21 15:13:32 -04:00
Paul Smith
af0074547d * tests/scripts/functions/shell: Detect correct SHELLSTATUS code. 2019-09-21 15:13:32 -04:00
Paul Smith
4a7a8278e8 * tests/run_make_test.pl: Fix support for valgrind.
Change the variable holding the make command to be a list that can
hold extra commands and options, not just a string.
2019-09-21 15:13:24 -04:00
Paul Smith
00fa3ca3a5 * tests/run_make_tests.pl (find_prog): Fix syntax error. 2019-09-21 12:39:07 -04:00
Paul Smith
00e590fdef * NEWS: Update date and clarify -l change. 2019-09-16 08:25:34 -04:00
Paul Smith
4c64a5f986 * tests/run_make_tests.pl: Create $scriptsuffix for Windows/VMS.
* tests/scripts/features/targetvars: Add a suffix to scripts.
* tests/scripts/misc/general4: Ditto.
2019-09-16 08:25:33 -04:00
Paul Smith
414af96a50 Refresh the test suite framework implementation.
Go through both run_make_tests.pl and test_driver.pl and slightly
modernize the Perl and clean up indentation etc.  Fix a number of
warnings in the test scripts detected by running with -w.

* tests/test_driver.pl: Move make error string detection out of the
base test driver.
(run_all_tests): Ensure that we always look for tests in the cwd.
* tests/run_make_tests.pl: Use File::Spec for path manipulations.
Correctly use setlocale() when detecting error strings.
Get configuration from the config-flags.pm file not config.status.
* tests/scripts/features/archives: Use new $cwddir variable.
* tests/scripts/features/reinvoke: Add missing semicolon.
* tests/scripts/features/vpath2: Avoid non-existent variable.
* tests/scripts/functions/foreach: Escape variables.
* tests/scripts/misc/bs-nl: Remove non-existing \v escape sequence.
* tests/scripts/misc/general4: Use handy create_file().
* tests/scripts/options/dash-C: Use Cwd/$cwddir.
* tests/scripts/options/dash-I: Use subst_make_string() and #PWD#.
* tests/scripts/options/symlinks: Use File::Spec.
* tests/scripts/targets/DEFAULT: Use create_file and run_make_test.
* tests/scripts/variables/CURDIR: Use run_make_test.
* tests/scripts/variables/automatic: Remove extraneous "\".
* tests/scripts/vms/library: Remove extra "my" and extraneous "\".
2019-09-16 08:25:33 -04:00
Paul Smith
1b976397e5 * tests/config-flags.pm.in: Add USE_SYSTEM_GLOB.
* tests/config_flags_pm.com [VMS]: Ditto.
2019-09-16 08:25:33 -04:00
Paul Smith
9bc5491712 * README.git: [SV 56895] Provide more info about "maintainer mode".
* src/read.c (get_next_mword) [HAVE_DOS_PATHS]: Don't fall through to
parsing variable references if we find a drivespec in a word!
2019-09-16 08:25:33 -04:00
Paul Smith
57b13c8020 * tests/test_driver.pl: Remember error for "running" a directory.
* tests/scripts/features/errors: Check errors "running" a directory.
2019-09-16 08:25:33 -04:00
Paul Smith
02a4c2913a * src/job.c (child_execute_job): Use errno from find_in_given_path().
* tests/test_driver.pl: Determine non-executable error message.
* tests/scripts/features/errors: Use the local non-executable error.
2019-09-16 08:25:33 -04:00
Paul Smith
8acb89c8c4 * src/job.c (child_execute_job): Use newer gnulib findprog version. 2019-09-16 08:25:33 -04:00
Eli Zaretskii
271e572ba2 Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command"
This reverts commit 38e96eadea6e2cd42a0f414959bac327de9f468a.
Per discussion on Savannah, the modified behavior matches
the way % is handled in batch files, but not in cmd command
lines.  And since Make mostly tries to emulate the command
line, the new behavior is unexpected and backward-incompatible.
2019-09-10 19:09:39 +03:00
Paul Smith
bde990bfea Rework the creation of build.sh so it's not a template.
* build.sh: Rename from build.template.  Get the list of objects
from the Makefile.  Move configure-replaced variables ...
* build.cfg.in: to this new .in file.
* configure.ac: Remove special handling of build.sh.in and add
build.cfg as a generated file.
* Makefile.am (EXTRA_DIST): Remove build.sh.in and add build.sh
and build.cfg.in for build.sh.in.
* maintMakefile: Remove handling for build.template.  Treat
build.sh as a source file, not a generated file.
* .gitignore: Ignore generated build.cfg file.
2019-09-09 18:38:31 -04:00
Paul Smith
60e54608bd * gl/modules/make-glob: Move local glob configure.ac to here
* configure.ac: from here.
2019-09-08 15:17:06 -04:00
Paul Smith
60905a8afb [SV 56834] Support local PATH search with posix_spawnp
When using exec we install the child's environment before invoking
execlp(), so commands are found on the child's PATH.  posix_spawnp
searches on the parent's PATH, which we don't want.

Import gnulib's findprog-in module and use it to search the child's
PATH, then use posix_spawn() to run it.

Also, posix_spawn() does not fall back to trying sh on ENOEXEC, as
execlp() does, so implement that as well.

* bootstrap.conf: Add the findprog-in gnulib module
* src/job.c: Include findprog.h if we're using posix_spawn.
(start_job_command): Remove the handling of child->cmd_name,
(child_execute_job): and add it here.  Look up the command to be
run in the child's path and invoke it if found.  If it fails with
ENOEXEC then retry it as an argument to the default shell.
* tests/scripts/misc/general4: Test makefile PATH assignments.
* tests/scripts/features/targetvars: Ditto, for target variables.
2019-09-08 15:12:40 -04:00
Paul Smith
ebe1d37104 * doc/make.texi (Recipe Execution): Correct example to use $(<[DF]) 2019-09-07 20:12:44 -04:00
Paul Smith
c0cb9c8b3d * configure.ac: Check whether struct dirent has a d_type field
* src/dir.c (dir_contents_file_exists_p): Use the autoconf macro
HAVE_STRUCT_DIRENT_D_TYPE rather than relying on the GNU libc-
specific _DIRENT_HAVE_D_TYPE.
* lib/glob.c: Set HAVE_D_TYPE if HAVE_STRUCT_DIRENT_D_TYPE.
2019-09-07 20:12:44 -04:00
Paul Smith
34ee9adaed * src/config.h.W32.template [W32]: Add support for dirent.d_type
* src/w32/include/dirent.h: Add DT_* values for dirent.d_type
(struct dirent): Add d_type
* src/w32/compat/durent.c (readdir): Set dirent.d_type based on
Windows file attributes.
2019-09-07 20:12:44 -04:00
Paul Smith
64f5375fe0 * src/makeint.h: Add typedef for mode_t if !HAVE_UMASK 2019-09-07 20:12:44 -04:00
Paul Smith
da81e0815f * build.template: Rewrite to allow gnulib support. 2019-09-07 20:12:44 -04:00
Paul Smith
9be3c0e2b2 * doc/make.texi: Clarify that the jobserver pipe is "blocking" 2019-09-07 18:27:26 -04:00
Paul Smith
9da708772c Align child_execute_job among different ports
Create a struct childbase which is the basics of struct child needed
to invoke child_execute_job(), and can be cast back and forth to a
struct child.  Ensure all implementations of child_execute_job() take
the same arguments.

* src/job.h (CHILDBASE): Create a macro to hold the base parts.
(struct childbase): A structure containing CHILDBASE.
(struct child): Use CHILDBASE as the initial part of child.
[VMS]: Remove declaration of VMS version of child_execute_job.
* src/job.c (start_job_command): Use new child_execute_job() call.
(child_execute_job) [__EMX__]: Implement new calling signature.
(child_execute_job): Implement new calling signature.
* src/main.c (main) [__EMX__]: Use new child_execute_job() call.
* src/function.c (func_shell_base): Use new child_execute_job() call.
* src/vmsjobs.c (vmsHandleChildTerm): Accept struct childbase.
* src/vmsjobs.c (child_execute_job): Implement new calling signature.
Modify the return value to be pid_t, not a boolean, and return the
PID rather than setting it in the child.  This is OK because our only
caller immediately reset PID to -1 anyway if we return 0.
2019-09-07 18:27:26 -04:00
Paul Smith
0967624050 * doc/make.tex (Substitution Refs): Clarify patsubst relationship. 2019-09-07 18:27:26 -04:00
Paul Smith
ba950a796a * src/job.c (start_job_command) [VMS]: Correct VMS comment. 2019-09-07 18:27:26 -04:00
Paul Smith
005a251689 Show useful errors when posix_spawn() doesn't do so
The posix_spawn() function may not detect that the command to run is
invalid when it's invoked.  Instead, it will run then exit with
error code 127.  If that happens do our best to present the user
with a useful error message.

* src/job.h (struct child): Add cmd_name to hold the command we ran.
* src/job.c (start_job_command): On success, remember the cmd_name.
(reap_children): On exit 127, stat cmd_name and show a useful error.
(free_child): Free cmd_name.
2019-09-07 18:27:26 -04:00
Paul Smith
76b6e668a6 * README.git: Describe GCC and GNU make requirements
* maintMakefile: Put custom C flags into a separate variable
so they can be overridden more easily on the command line.
2019-09-07 18:27:26 -04:00
Paul Smith
5ff6ae6177 * tests/scripts/features/archives: Fix expected long ar name output. 2019-09-07 18:27:26 -04:00
Paul Smith
7c202b50fa * tetss/run_make_test.pl: Avoid 'sh -c' for Windows portability. 2019-09-07 18:27:26 -04:00
Paul Smith
f0182df865 Update to GNU make release candidate 4.2.91 2019-09-07 18:27:26 -04:00
Paul Smith
0a6c38eff8 * tests/scripts/functions/wildcard: Skip dangling symlink test.
The built-in glob implementation does not correctly handle dangling
symlinks.  This needs to be fixed by switching to the latest glob
implementation from gnulib but that's a big job: for now avoid the
test if we know it will fail.
2019-09-07 18:27:26 -04:00
Paul Smith
4b45e2828d * maintMakefile: Use check-local when testing build.sh.
Running 'make check' will rebuild 'make' so we're not testing the
build.sh-generated make binary.
2019-09-07 18:27:26 -04:00
Paul Smith
4f3a41c60a Don't reset stack size when using posix_spawn()
There's no way to run setrlimit() from posix_spawn() so we can't reset
the stack limit in children; thus, don't change it in the parent.

* src/makeint.h (SET_STACK_SIZE): Don't set this when HAVE_POSIX_SPAWN.
* src/job.c (child_execute_job): Remove useless comment.
2019-09-07 18:27:26 -04:00
Paul Smith
757a9d06e3 * configure.ac: Remove redundant getloadavg gnulib support 2019-09-07 18:27:26 -04:00
Paul Smith
31394f7f53 * src/dir.c (dir_setup_glob): Initialize unused gl_offs.
* tests/scripts/functions/wildcard: Add trailing slash tests.
Initial changes by Dmitry Goncharov <dgoncharov@users.sf.net>
2019-09-07 18:27:26 -04:00
Paul Eggert
b6884c73b7 Pacify Oracle Studio c99
* src/dep.h (DEP):
* src/function.c (struct function_table_entry):
Use unsigned int, not unsigned short.  Without this patch, c99
complains ‘warning: nonportable bit-field type’.
2019-09-02 11:11:26 -04:00
Paul Eggert
8bffc8d53c Port grouped_targets test to Solaris 10
* tests/scripts/features/grouped_targets: Use ‘printf ''’
instead of ‘echo -n’, as POSIX says the latter is not portable.
2019-09-02 11:11:26 -04:00
Paul Eggert
a9609084f4 Remove useless code in eval
* src/read.c (eval): Remove useless code.  Without this patch,
Oracle Studio 12.6 complains ‘"src/read.c", line 1405: warning:
loop not entered at top’.
2019-09-02 11:11:26 -04:00
Paul Eggert
8d820d57f6 Pacify Oracle Studio 12.6 in init_switches
* src/main.c (init_switches): Use a cast to convert char const *
to char *.  Without this patch, the compiler complains
‘"src/main.c", line 2643: warning: assignment type mismatch:
pointer to char "=" pointer to const char’.
2019-09-02 11:11:26 -04:00
Paul Eggert
73e11a5024 Pacify Oracle Studio 12.6
* src/arscan.c [VMS]: Use ‘#if !defined LBR$_HDRTRUNC’ instead
of ‘#ifndef LBR$_HDRTRUNC’ to pacify Oracle Studio 12.6, which
looks inside unused #if branches for preprocessor syntax errors.
Without this patch it complains ‘"src/arscan.c", line 43: warning:
tokens ignored at end of directive line’.
2019-09-02 11:11:26 -04:00
Paul Smith
85cdc9e9ae * NEWS: Fix incorrect notes. 2019-09-02 11:11:26 -04:00
Paul Smith
7e60ffe83e * src/read.c (parse_file_seq): [SV 52076] Don't reverse glob() results. 2019-09-02 11:11:26 -04:00
Eli Zaretskii
715c787dc6 Fix MS-Windows MinGW build
* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
Fix format specifier for GetLastError's value.

* src/job.c (reap_children): Define the 'remote_status_lose' label
only for Posix platforms, to avoid compiler warning.

* build_w32.bat (LNKOUT): New variable, using forward slashes.
Use forward slashes in calls to :Compile, so that linking with GNU
ld works.

* src/makeint.h [!HAVE_UMASK]: Prototype for 'umask'.
(UMASK, MODE_T): Don't define.

* src/misc.c (get_tmpfile): Don't call UMASK, call umask, to
avoid compilation warning on !HAVE_UMASK platforms.
* src/output.c (output_tmpfd): Likewise.

* src/misc.c (umask) [!HAVE_UMASK]: New no-op function.

* src/config.h.W32.template (__USE_MINGW_ANSI_STDIO)
[__MINGW32__]: Define to 1, to force Make use ANSI-compatible
stdio functions, which also support the non-standard 'Id' and 'Ix'
specifiers.
(HAVE_UMASK) [__MINGW32__]: Define to 1.

* src/arscan.c (ar_member_touch): Type-cast argument of strlen to
avoid compiler warnings.
2019-08-28 17:45:49 +03:00
Paul Smith
e304a03b6d * NEWS: Update for pre-release 2019-08-26 07:54:09 -04:00
Paul Smith
2273ab7069 Update maintainer mode to support debug wait points.
Make a spin() method available when compiled in maintainer mode.
If a file exists in the working directory with a specific name,
make will sleep until the file is deleted.

Ensure that maintainer mode is enabled on Windows, using the same
algorithm we use on POSIX / autoconf systems.

* build_w32.bat: If maintMakefile exists, enable maintainer mode.
* src/main.c (main): Replace Windows-only suspend flag with spin().
* src/makeint.h: A SPIN() macro calls spin() in maintainer mode.
* src/misc.c (spin): If a spin file exists sleep until it's deleted.
2019-08-26 07:54:09 -04:00
Paul Smith
2e388a18a1 * tests/scripts/features/archives: [SV 54395] Support non-GNU ar. 2019-08-26 07:54:09 -04:00
Paul Smith
39bf50b2da * tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS 2019-08-26 07:54:09 -04:00
Paul Smith
a0c17b5af1 * src/job.c (construct_command_argv): Remove unused VMS code 2019-08-25 17:17:36 -04:00
Paul Smith
a483334f97 * src/job.c (child_execute_job): Set pid to -1 on posix_spawn failure. 2019-08-25 17:16:40 -04:00
Paul Smith
069f2bca99 * bootstrap: Update from latest gnulib version 2019-08-24 14:56:33 -04:00
Paul Smith
40847ce9b8 * scripts/copyright-update: Use git ls-files for controlled files 2019-08-24 14:41:10 -04:00
Paul Smith
a01c5bee02 * po/LINGUAS: Add a translation for Bulgarian. 2019-08-24 14:13:59 -04:00
Christian Eggers
38e96eadea [SV 56449] (Windows) Use slow path if '%' appears in the command
* src/job.c (sh_chars_dos): Add '%' as a special character
* src/job.c (construct_command_argv_internal): Check for '%' in quotes

For the windows version of make, a recipe line cannot be executed
diretly by make (without a shell) if a '%' character is present. This
character starts a cmd.exe escape sequence.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Copyright-paperwork-exempt: yes
2019-07-14 09:28:31 -04:00
Paul Smith
d7cfbf1961 * src/read.c (parse_file_seq): Update comments. 2019-07-14 09:20:14 -04:00
Mike Haboustak
ee167c650e [SV 28456] Don't override $< when no default rule has been defined
The check for matching a file's command to the default rule's command
does not account for null. If no .DEFAULT is defined a rule with no
recipe has it's $< variable set to the value of $@. This breaks second
expansion, particularly when used with pattern rules.

* src/commands.c [set_file_variables]: Check that cmds is set
* tests/scripts/features/se_explicit: Test case
* tests/scripts/features/se_implicit: Test case

Copyright-paperwork-exempt: yes
2019-07-13 11:47:26 -04:00
Paul Smith
4d00ceba26 Switch to the gnulib version of strerror()
* bootstrap.conf: Add strerror module
* configure.ac: Remove strerror check
* src/misc.c: Remove local strerror() implementation
* src/config.ami.template: Remove HAVE_STRERROR
* src/config.h-vms.template: Ditto.
* src/config.h.W32.template: Ditto.
2019-07-13 08:47:19 -04:00
Paul Smith
1c045bca52 * doc/make.texi: [SV 51974] Clarify makefile parsing operations. 2019-05-19 19:25:50 -04:00
Paul Smith
4ed31830cb * doc/make.texi: [SV 54116] Document whitespace removal trick.
Discovered and explained by Michael Henry <gnu@drmikehenry.com>
* tests/scripts/variables/flavors: Add a test to preserve the behavior.
2019-05-19 19:25:50 -04:00
Paul Smith
d7ff21ecd7 [SV 46013] Allow recursive variable overrides from Makefiles
Ensure that variable overrides are passed to recursive make instances
even if no overrides were provided on the command line.
Fix suggested by Rici Lake <ricilake@gmail.com>

* src/main.c (define_makeflags): Add overrides without respect to the
value of command_variables.
* tests/scripts/features/recursion: Add a test.
2019-05-19 19:25:50 -04:00
Paul Smith
da2b275658 Update developer customizations
* .ccls: Remove -std=c99: it disables __attribute__ causing warnings.
* .dir-locals.el: Force the C coding style to "gnu".
* make-gdb.py: Add GDB macros for pretty-printing GNU make structs.
* scripts/copyright-update: Use GNULIB_SRCDIR to find update-copyright.
2019-05-19 15:27:26 -04:00
Paul Smith
f32ca1666f [SV 54549] Don't free used set_lists during merge
When merging the variable_set_lists for two targets it could be
that the "from" set list is a subset of the "to" set list: check
for this situation to avoid freeing used memory.

* src/variable.c (merge_variable_set_lists): Walk the "to" list and
if the "from" list is contained in it, nothing to do.
* tests/scripts/features/se_explicit: Add a test.
2019-05-19 15:27:26 -04:00
Paul Smith
9ce370249b * src/hash.c (jash_string): [SV 54980] Avoid ASAN error 2019-05-19 15:27:26 -04:00
Paul Smith
b5de783f77 [SV 54740] Ensure .SILENT settings do not leak into sub-makes
Create a new variable run_silent to hold the current instance's global
silence setting, allowing silent_flag to represent only whether the -s
option was provided on the command line.

* src/makeint.h: Change silent_flag variable to run_silent.
* src/job.c: Ditto.
* src/remake.c: Ditto.
* src/file.c: Ditto.
* src/main.c: Add a new global variable run_silent.
(decode_switches): After switches are decoded, initialize run_silent.
* tests/scripts/targets/SILENT: Add a test for recursive behavior.
2019-05-19 15:27:26 -04:00
Paul Smith
389dcb608f Update copyright statements for 2019 2019-05-19 15:27:26 -04:00
Kaz Kylheku
8c888d95f6 [SV 8297] Implement "grouped targets" for explicit rules.
This patch allows "grouped targets" using the &: syntax:

  tgt1 tgt2 ... tgtn &: pre1 pre2 ...
        recipe

When the &: separator is used (in single or double colon forms), all
the targets are understood to be built by a single invocation of the
recipe.  This is accomplished by piggy-backing on the already-existing
pattern rule feature, using the file's "also_make" list.

* NEWS: Add information about grouped targets.
* doc/make.texi (Multiple Targets): Add information on grouped targets.
(Pattern Intro): Refer to the new section to discuss multiple patterns.
* src/main.c (main): Add "grouped-targets" to .FEATURES
* src/read.c (make_word_type): Add new types for &: and &::.
(eval): Recognize the &: and &:: separator and remember when used.
(record_files): Accept an indicator of whether the rule is grouped.
If so, update also_make for each file to depend on the other files.
(get_next_mword): Recognize the &: and &:: word types.
* tests/scripts/features/grouped_targets: New test script.
* AUTHORS: Add Kaz Kylheku
2019-05-12 16:29:20 -04:00
Paul Smith
1710573272 * variable.c (define_variable_in_set): Clear new structs 2019-05-12 16:28:26 -04:00
Paul Smith
80ca781adf * po/LINGUAS: Add Portuguese translation 2019-05-12 16:28:26 -04:00
Paul Smith
4a31ca461f Add developer customizations
* .ccls: Configure the ccls LSP server
* .dir-locals.el: Reset some parameters for ccls and lsp-mode
* .gitignore: Update for GTAGS and ccls
* maintMakefile: Don't search hidden directories for sources
2019-05-12 16:28:26 -04:00
Paul Smith
214865ed5c * src/arscan.c (ar_member_touch): [SV 54533] Stop \0 in archive headers 2018-09-16 01:10:57 -04:00
Paul Smith
5d6508a475 Change output_write() to writebuf(), add readbuf() helper.
* src/misc.c (writebuf, readbuf): Create helper functions that will
reliably write a buffer to a file descriptor in the face of EINTR
causing short writes, and read from a file descriptor into a buffer
in the face of EINTR causing short reads.
* src/makeint.h: Declare these functions.
* src/output.c: Remove output_write() and replace with writebuf().
(_outputs, out_of_memory): Call writebuf(), not output_write().
* src/arscan.c (ar_scan): Call readbuf() instead of read(2).
(ar_member_touch): Remove duplicate header write, call writebuf()
instead of output_write(), and readbuf() instead of read(2).
2018-09-16 01:04:10 -04:00
Paul Smith
ac11ec5497 * doc/make.texi (Remaking Makefiles): [SV 52273] Note MAKE_RESTARTS 2018-09-15 16:12:44 -04:00
Paul Smith
d603b2e6ac * src/main.c (main): Set jobserver permissions before re-execing
Fixes an issue seen in the Linux kernel build system, reported by
Masahiro Yamada <yamada.masahiro@socionext.com>.  Fix suggested
on the bug-make mailing list by Mike Shal <marfey@gmail.com>.
* tests/scripts/features/parallelism: Add a test to verify this.
2018-09-15 15:08:47 -04:00
Paul Smith
8fd614e238 * doc/make.texi: [SV 48970] Clarify the value of $? 2018-09-15 15:08:47 -04:00
Paul Smith
92032bc16a * doc/make.text: [SV 54360] Weaken "obsolete" language in the manual.
There's no need to frighten users away from capabilities which are
perfectly reasonable and definitely not going away, by calling them
obsolete or discouraged in the manual.
2018-09-15 15:08:47 -04:00
Paul Smith
67e6d81256 [SV 40657] Don't create pattern rules for suffix rules with deps.
* NEWS: Update with a backward-compatibility warning.
* src/rule.c (convert_to_pattern): If a suffix rule has dependencies,
do not create a pattern rule for it.  According to the manual suffix
rules with prerequisites are treated as normal targets.
* tests/scrips/features/suffixrules: Create some regression tests for
.SUFFIXES and suffix rules.
2018-09-15 15:08:29 -04:00
Paul Smith
a1bb739165 * NEWS: Update for the latest changes. 2018-08-04 19:20:58 -04:00
Paul Smith
05769ca009 [SV 54233] Preserve higher command_state values on also_make targets.
If multiple pattern rules have the same pattern as also-make targets
and we attempt to run them at the same time, we might downgrade the
command state from 'running' to 'deps_running'; this will prevent
that also_make from being considered complete causing make to wait
forever for it to finish.

Ensure that set_command_state never downgrades the state of a target.

* src/file.c (set_command_state): Don't downgrade command_state.
* src/filedef.h (struct file): Document the order prerequisite.
* test/scripts/features/patternrules: Test the behavior.
2018-08-04 19:07:59 -04:00
Paul Smith
e2234bc1ab * src/job.c (reap_children): Fix inverted win/lose message. 2018-08-04 19:05:29 -04:00
Paul Smith
f9ba22e029 * tests/scripts/functions/wildcard: [SV 52018] Test dangling symlink. 2018-08-04 17:35:10 -04:00
Bernhard M. Wiedemann
eedea52afb * src/read.c (parse_file_seq): [SV 52076] Sort wildcard results. 2018-08-04 17:21:15 -04:00
Paul Smith
a9975756d0 * tests/scripts/features/archives: [SV 54395] Test long archive names. 2018-08-04 17:02:25 -04:00
Ben Hutchings
a37fa47e32 * src/arscan.c (ar_scan): [SV 54395] Allow long names in archives.
Commit bc9d72beb0cb "Resolve issues discovered by static code
analysis." added range checks on archive member name length.  However,
on non-AIX systems it also checked BSD-style long names against the
short name limits and and checked the *offset* for GNU-style long
names against the short name limits.  This caused valid long names to
be rejected.

* Record the size of the GNU name map and validate offsets against it
* Ensure that the last entry in the name map is null-terminated
* Apply a maximum length of INT_MAX for element sizes

Reported-by: Philipp Wolski <philipp.wolski@kisters.de>
2018-08-04 17:02:21 -04:00
Paul Smith
9ff4d6af92 * lib/glob.c (glob_in_dir): [SV 53465] Allow symlinks to directories.
Fix from Rich Felker <bugdal@aerifal.cx> on the musl mailing list.
* tests/scripts/functions/wildcard: Create a regression test for this.
2018-08-04 14:26:10 -04:00
Paul Smith
a370268739 * configure.ac: Add --disable-posix-spawn option
* maintMakefile: Add a test for the option
* src/job.c: Change HAVE_* preprocessor checks to USE_POSIX_SPAWN
2018-08-04 12:37:19 -04:00
Paul Smith
1129df27b8 * src/job.c (child_execute_job): Clean up posix_spawn invocation 2018-08-04 12:37:19 -04:00
Aron Barath
749a54d7a4 * job.c (child_execute_job): Prefer posix_spawn() over fork()/exec() 2018-08-04 12:37:19 -04:00
Paul Smith
fa937343f5 Clean up errors for invalid commands and add regression tests.
* src/function.c (func_shell_base): Use error() instead of recreating
the error output.
* src/job.c (exec_command): Show more standard error messages.
* src/load.c (unload_file): Fix whitespace in the error message.
* tests/scripts/features/errors: Add tests for starting non-
existent commands and new error message formats.
* tests/scripts/features/output-sync: New error message formats.
* tests/scripts/functions/shell: Ditto.
2018-08-04 12:37:19 -04:00
Paul Smith
3112c87993 Queue failed fork() (etc.) to be handled like any other failed job.
If we failed to fork() we were essentially exiting make immediately
without respect to ignore flags, etc.  On one hand that makes sense
because if you can't fork you're in real trouble, but it doesn't
work so well on systems where we don't fork at all.  Instead, treat
a fork error like any other error by delaying the handling until
the next call to reap_children().  Any child with a PID of -1 is
considered to have died before starting so check these first without
waiting for them.

* src/commands.c (fatal_error_signal): Don't kill children that
never started.
* src/function.c (func_shell_base): Handle cleanup properly if the
child doesn't start.
* src/job.c (reap_children): Check for children that died before
starting and handle them without waiting for the PID.
(start_job_command): Free memory when the child doesn't start.
(start_waiting_job): Don't manage children who never started.
(child_execute_job): If the fork fails return PID -1.
* src/vmsjobs.c: Check for children that never started.
* tests/run_make_tests.pl: Parse config.status to get all options.
2018-08-04 12:18:39 -04:00
Aron Barath
8bde7db16f * configure.ac: Check for posix_spawnattr_setsigmask 2018-08-02 20:59:02 -04:00
Aron Barath
5d985c2851 * configure.ac: Check for spawn.h and posix_spawn() 2018-08-02 20:59:02 -04:00
Aron Barath
3f194b69e3 * src/makeint.h: Use pid_t to store PIDs, of int.
* src/commands.c (getpid): Ditto.
* src/job.h (*): Ditto.
* src/job.c (*): Ditto.
* src/main.c (main): Ditto.
* src/remote-cstms.c (start_remote_job): Ditto.
* src/remote-stub.c (start_remote_job): Ditto.
2018-08-02 20:59:02 -04:00
spagoveanu@gmail.com
b7acb10e86 * src/dir.c: Preserve glob d_type field
When using GNU make on a system with glibc glob a pattern ending in
a slash is also matching regular files, but only in subdirectories:

$ mkdir -p dir/subdir
$ cd dir
$ touch file1 subdir/file2
$ echo 'test:; @echo $(wildcard */ */*/)' | make -f -
subdir/ subdir/file2
$ echo 'test: */ */*/; @echo "$?" != */ */*/' | make -f -
subdir/ subdir/file2 != subdir/ */*/

It happens because in the gl->gl_readdir callback supplied to glob(),
dirent->d_type is set to DT_UNKNOWN, and the glob() implementation
in glibc assumes that such a directory entry *cannot* possibly be a
regular file.

Pass the actual d_type down to glob(); this is the right thing to do
even if glibc is fixed, because it saves an extra stat() syscall for
each dirent.

Copyright-paperwork-exempt: yes
2018-08-02 20:59:02 -04:00
Paul Smith
b36a8ec92a * src/read.c(unescape_char): Use C comments not C++ comments.
* src/posixos.c(set_blocking): Ditto.
* src/w32/subproc/sub_proc.c(process_init): Ditto
2018-08-02 20:59:02 -04:00
Paul Smith
23554ee658 Enhance the Basic.mk environment to work with Gnulib
* maintMakefile: Omit generated headers from Basic.mk prerequisites.
* Basic.mk.template: Rework commands to use with $(call ...) macros.
* mk/Amiga.mk: Ditto.
* mk/VMS.mk: Ditto.
* mk/Windows32.mk: Ditto, plus P2W to convert POSIX to Windows paths.
* mk/msdosdjgpp.mk: Ditto.
2018-08-02 20:55:34 -04:00
Paul Smith
0ce880e5ee Resolve most of the Windows Visual Studio warnings.
* Convert integer types to size_t where necessary.
* Align other integral types to avoid casts and type warnings.
2018-07-02 07:54:07 -04:00
Paul Smith
c808f10d08 Update regression tests for Windows.
* tests/scripts/features/jobserver: Windows doesn't use pipes
* tests/scripts/functions/shell: Don't test kill -2 on Windows
* tests/scripts/misc/bs-nl: Windows doesn't handle single quotes
* tests/scripts/misc/general3: Ditto.
2018-07-02 07:54:07 -04:00
Paul Smith
1dfd55ca36 * maintMakefile: Preserve comments during compilation 2018-07-02 07:54:07 -04:00
Paul Smith
0bc699a761 * function.c(abspath): Use memcpy() to avoid GCC 8.1 warnings 2018-07-02 07:54:07 -04:00
Paul Smith
63b42fa235 Convert GNU make to use the gnulib portability library
Move content from glob/* and config/* into standard GNU directory
locations lib/* and m4/*.

Install the gnulib bootstrap script and its configuration file, and
create a bootstrap.bat file for Windows.  Update the README.git file
with new requirements and instructions for building from Git.

At this point we only install the alloca, getloadavg, and FDL modules
from gnulib.  We keep our old glob/fnmatch implementation since the
gnulib versions require significant amounts of infrastructure which
doesn't exist on Windows yet.  Further work is required here.

Due to a problem with gnulib's version of getloadavg, we need to bump
the minimum required version of automake to 1.16.1 unfortunately.

* README.git: Update instructions
* NEWS: Move developer news to a separate section
* configure.ac: Update for use with gnulib modules

* bootstrap: Bootstrap from Git workspace (import from gnulib)
* bootstrap.conf: Bootstrap configuration for GNU make
* bootstrap.bat: Bootstrap from Git workspace for Windows
* gl/modules/make-glob: Support our local fnmatch/glob implementation

* config/acinclude.m4: Move to m4/
* config/dospaths.m4: Move to m4/
* glob/fnmatch.c: Move to lib/
* glob/fnmatch.h.in: Move to lib/
* glob/glob.c: Move to lib/
* glob/glob.h.in: Move to lib/

* Makefile.am: Update for new directories
* build.template: Update for new directories
* build_w32.bat: Update for new directories
* builddos.bat: Update for new directories
* maintMakefile: Update for new directories
* makefile.com: Update for new directories
* mk/Amiga.mk: Update for new directories
* mk/Posix.mk.in: Update for new directories
* mk/VMS.mk: Update for new directories
* mk/Windows32.mk: Update for new directories
* mk/msdosdjgpp.mk: Update for new directories

* po/LINGUAS: One language per line (needed by gnulib)

* INSTALL: Remove (obtained from gnulib)
* src/alloca.c: Remove (obtained from gnulib)
* src/getloadavg.c: Remove (obtained from gnulib)
* po/Makevars: Remove (created by bootstrap)
* config/*: Remove leftover files
* glob/*: Remove leftover files
2018-07-02 07:54:07 -04:00
Paul Smith
a7b0dfddac * Makefile.ami, glob/Makefile.ami: Remove obsolete files 2018-07-01 13:25:16 -04:00
Ola Olsson
73ac4526b9 * doc/make.texi: Updated language 2018-07-01 12:23:09 -04:00
Paul Smith
afbecbd9dc * all: Update Copyright statements for 2018 2018-07-01 12:22:04 -04:00
Paul Smith
192469952f * scripts/copyright-update: Maintainer's script for copyright mgmt 2018-07-01 12:22:03 -04:00
Paul Smith
8a731d1b2c * build_w32.bat: Support Visual Studio 17. 2018-02-10 15:34:53 -05:00
Paul Smith
48c8a116a9 * configure.ac: Support GLIBC glob interface version 2 2017-11-19 15:17:47 -05:00
Paul Smith
fb779d2f1e Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.

* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-19 14:07:22 -05:00
Paul Smith
1af314465e * job.c: Add "command" as a known shell built-in.
This is not a POSIX shell built-in but it's common in UNIX shells.
Reported by Nick Bowler <nbowler@draconx.ca>.
2017-11-18 09:31:31 -05:00
Paul Smith
b80837c553 * tests/scripts/features/output-sync: Revert bad change in 0c5a9f9b92a 2017-11-18 09:31:31 -05:00
Paul Smith
aa44e66c8f Remove unsupported build facilities.
Over time the non-standard build and install systems (nmake files,
smake files, Visual Studio project files, etc.) have atrophied and
maintaining them is not worth the effort, for such a simple utility
as make.  Remove all the non-standard build tool support and unify
OS-specific build rules under a basic set of (GNU make) makefiles.

Preserve the existing bootstrapping scripts (for POSIX, Windows,
and MS-DOS).  Also the existing VMS build scripts are left unchanged:
I don't have enough experience with VMS to venture into this area.
Perhaps one of the VMS maintainers might like to determine whether
conversion would be appropriate.

Rather than create libraries for w32 and glob (non-POSIX), simply
link the object files directly to remove the complexity.

* NEWS: Update with user-facing notes.
* Makefile.am: Clean up to use the latest automake best practices.
Build Windows code directly from the root makefile to avoid recursion.
* README.Amiga, README.DOS.template, README.W32.template: Updated.
* INSTALL: Point readers at the README.git file.
* maintMakefile: Remove obsolete files.  Create Basic.mk file.
* Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles.
* build_w32.bat: Copy Basic.mk to Makefile
* configure.ac: We no longer need AM_PROG_AR.
* dosbuild.bat: Rename to builddos.bat.  Incorporate configure.bat.
* Makefile.DOS.template: Remove.
* NMakefile.template, w32/subproc/NMakefile: Remove.
* SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove.
* configure.bat, glob/configure.bat: Remove.
* w32/Makefile.am: Remove.
* make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.
2017-11-18 09:31:31 -05:00
Paul Smith
a7e0dd98e4 * Makefile.am: Add jhelp.pl to remote test setup. 2017-11-11 13:12:28 -05:00
Paolo Bonzini
0c44ca2683 Do not use STOP_SET for singleton compares.
Compare against '$' directly rather than using MAP_VARIABLE.
This saves ~10% for find_map_function, which is the top hotspot in
QEMU's no-op build.  The build is sped up overall by about 1.5%
more (from 11.1s to 10.95s).

* read.c (find_map_function): Do not compare against singleton sets.
2017-11-11 10:08:30 -05:00
Paolo Bonzini
b280989ab7 Speedup parsing of functions.
Use the stopchar map to quickly jump over everything that is
not an open/close brace, an open/close parenthesis or a comma.

This saves 1% on QEMU's noop build (from 11.23s to 11.1s).

* function.c (find_next_argument, handle_function): Check
with STOP_SET before comparing against individual characters.
* main.c (initialize_stopchar_map): Initialize MAP_VARSEP
mappings in stopchar_map.
* makeint.h (MAP_VARSEP): New.
2017-11-11 10:08:30 -05:00
Paolo Bonzini
9860296198 Remove MAP_PERCENT as strchr is faster.
* read.c (find_percent_cached): Use strchr instead of STOP_SET
to find % or nul.
* makeint.h (MAP_PERCENT): Remove.
* main.c (initialize_stopchar_map): Remove.
2017-11-11 10:08:30 -05:00
Paolo Bonzini
4fd56724ad Use Jenkins hash.
This is about twice as fast as the current hash, and removes the
need for double hashing (improving locality of reference).  The
hash function is based on Bob Jenkins' design, slightly adapted
wherever Make needs to hash NUL-terminated strings.  The old hash
function is kept for case-insensitive hashing.

This saves 8.5% on QEMU's no-op build (from 12.87s to 11.78s).

* configure.ac: Check endianness.
* hash.c (rol32, jhash_mix, jhash_final, JHASH_INITVAL,
sum_get_unaligned_32, jhash): New.
* hash.h (STRING_HASH_1, STRING_N_HASH_1): Use jhash.
(STRING_HASH_2, STRING_N_HASH_2): Return a dummy value.
(STRING_N_COMPARE, return_STRING_N_COMPARE): Prefer memcmp to strncmp.
2017-11-11 10:08:30 -05:00
Paolo Bonzini
0ca31088dc Use strchr for simple case of find_char_unquote.
In most cases, find_char_unquote has a single stopchar.  In that
case we can look for it using strchr's optimized implementation.

This saves 3.5% on QEMU's noop build (from 11.78s to 11.37s).

* read.c (find_char_unquote): Rename to find_map_unquote.  Replace
with an implementation optimized for the case where the stopchar
is a singleton.  Adjust all callers.
2017-11-11 09:38:51 -05:00
Paolo Bonzini
ef7a1b7d6e Use strchr/memmove in collapse_continuations.
collapse_continuations is already using strchr to speed up the
common case of no backslash-newline sequence, but on modern
processors it is faster to scan the string twice with
strchr+memmove (or strlen+memmove) than to move bytes manually.

Saves about 1.5% on QEMU's no-op build (from 11.37s to 11.23s).

* misc.c (collapse_continuations): Rewrite the scanning of LINE.
2017-11-11 09:37:55 -05:00
Paul Smith
0c5a9f9b92 * main.c (main): [SV 48274] Allow -j in makefile MAKEFLAGS variable.
* tests/jhelp.pl: New file to allow testing parallelism without sleep.
* tests/scripts/features/parallelism: Test this.
* tests/scripts/features/jobserver: Update tests.
* tests/scripts/features/output-sync: Remove useless rm command.
2017-10-31 01:08:57 -04:00
Paul Smith
6264deece3 * job.c (child_error): Modify error message string.
Ensure Emacs compile-mode's next-error doesn't match target failure
messages.  Syntax errors in makefiles are still matched.
2017-10-30 17:07:21 -04:00
Paul Smith
b9c25de370 * function.c (func_if): Check the first character of condition.
Reported by Rob W <robw9739@gmail.com>
2017-10-30 17:07:21 -04:00
Paul Eggert
193f1e81ed glob: Do not assume glibc glob internals.
It has been proposed that glibc glob start using gl_lstat,
which the API allows it to do.  GNU 'make' should not get in
the way of this.  See:
https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html

* dir.c (local_lstat): New function, like local_stat.
(dir_setup_glob): Use it to initialize gl_lstat too, as the API
requires.
2017-10-30 17:07:21 -04:00
Paul Smith
d8728efc80 Compute load from number of running processes.
* job.c (load_too_high): If /proc/loadavg is available, compare the
maximum load against the number of processes currently running.  If
we can't parse /proc/loadavg, use the previous algorithm.

Concept and initial patch from Sven C. Dack <sven.c.dack@sky.com>
2017-10-30 17:07:21 -04:00
Eli Zaretskii
baa57d2cf9 Fix checking existence of directories on MS-Windows
* remake.c (name_mtime) [WINDOWS32]: Emulate Posix behavior of
'stat' with the likes of "foo/" and "foo/.".
2017-09-30 10:56:39 +03:00
Paul Smith
7ef56bc8dc Update copyright statements for 2017. 2017-07-09 21:52:28 -04:00
Paul Smith
ac97214635 Remove uses of unnecessary "register" keyword. 2017-07-09 21:24:41 -04:00
Paul Smith
22fd578693 * variable.c (create_pattern_var): [SV 51266] Create with xcalloc().
Reported by Chris Metcalf <cmetcalf@mellanox.com>
2017-07-09 21:14:15 -04:00
Paul Smith
78b5fec689 [SV 51400] Only unblock fatal signals after child invocation
* job.c (unblock_sigs): Only unblock fatal signals not all signals.
(unblock_all_sigs): Unblock all signals not just fatal signals.
(child_execute_job): Call unblock_all_sigs() in child process.
* job.h: Remove unused function definitions.
* remote-cstms.c (start_remote_job): Call unblock_all_sigs() in
child process.
Reported by Koen Van Hoof <koen.van_hoof@nokia.com>
2017-07-09 21:14:15 -04:00
Paul Smith
75b5268faf * function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS
* tests/scripts/functions/shell: Verify that .SHELLSTATUS contains
a non-0 value when the shell exits due to a signal.
2017-07-01 19:40:21 -04:00
Eli Zaretskii
66a9b5c3ba Avoid crashes when SHELL=abcde is specified on the command line
* variable.c (do_variable_definition): If $SHELL was not found,
process "SHELL=foo" as any other variable definition.  This avoids
segfaults when SHELL=foo is specified on the Make command line.
Reported by Orgad Shaneh <orgads@gmail.com>.
2017-06-07 08:32:35 +03:00
Paul Smith
b552b05251 [SV 51159] Use a non-blocking read with pselect to avoid hangs.
* posixos.c (set_blocking): Set blocking on a file descriptor.
(jobserver_setup): Set non-blocking on the jobserver read side.
(jobserver_parse_auth): Ditto.
(jobserver_acquire_all): Set blocking to avoid a busy-wait loop.
(jobserver_acquire): If the non-blocking read() returns without
taking a token then try again.
2017-06-04 18:37:21 -04:00
Paul Smith
5345adf82f [SV 50823] Support filenames containing '$' in MAKEFILE_LIST
* variable.h (enum variable_flavor: Add a new flavor for appended
values that shouldn't be expanded.
* variable.c (do_variable_definition): If given this new flavor,
do not expand the value before appending it.
* read.c (eval_makefile): Use this new flavor for MAKEFILE_LIST
* tests/scripts/variables/MFILE_LIST: Test filenames containing '$'.
2017-06-04 18:37:21 -04:00
Paul Smith
248f70510e * tests/test_driver.pl: Useful error if given an invalid test name. 2017-06-04 18:37:21 -04:00
Paul Smith
b90fabc8d6 * NEWS: Do not insert a space during '+=' if the value is empty.
* doc/make.texi (Appending): Document this behavior.
* variable.c (do_variable_definition): Only add a space if the variable
value is not empty.
* tests/scripts/variables/flavors: Test this behavior.
2017-06-04 18:37:21 -04:00
Enrique Olaizola
816a867ff5 * read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache
Copyright-paperwork-exempt: yes
2017-06-04 18:37:21 -04:00
Paul Smith
8ff529b1cb * po/LINGUAS: Add support for traditional Chinese (zh_TW) 2017-06-04 18:37:21 -04:00
Paul Smith
5acc59c704 Rename output_tmpfile() to a misc function get_tmpfile()
* output.c: Remove output_tmpfile() and umask handling.
* output.h: Ditto.
* misc.c: Add get_tmpfile() and umask handling.
* makeint.h: Ditto.
* function.c: Rename output_tmpfile() to get_tmpfile().
* main.c: Ditto.
* vmsjobs.c: Ditto.
2017-06-04 18:37:21 -04:00
Paul Smith
68be4f74fc [SV 13651] Handle out-of-memory conditions slightly more gracefully.
* makeint.h: Change OUT_OF_MEM() macro to out_of_memory() function.
* output.h, job.h: Move FD_* macros from job.h to output.h.
* output.c (output_write): Write a buffer to an FD directly.
(out_of_memory): Use output_write() to avoid allocating more
memory while writing the error, and call exit() instead of die().
This does mean we can't translate the error string, though.
* misc.c (xmalloc, xcalloc, xrealloc, xstrdup, xstrndup): Call new
out_of_memory() rather than OUT_OF_MEM().
* read.c (parse_file_seq): Ditto.
2017-06-04 18:37:20 -04:00
Paul Smith
2b8e3bb23f Clean up close-on-exec, particularly with jobserver pipes.
* configure.ac: Check sys/file.h and assume fileno() always exists.
* output.h: Move output-specific content from job.h to output.h.
* os.h (fd_inherit, fd_noinherit): New functions manage FD inheritance.
* posixos.c (fd_inherit, fd_noinherit): Implement for POSIX systems.
(jobserver_setup): Force jobserver FDs to not be inherited by default.
(jobserver_pre_child): Enable inheritance in recursive invocations.
(jobserver_post_child): Disable inheritance after recursive invocations.
* w32/w32os.c (fd_inherit, fd_noinherit): Implement for W32 systems.
* job.h (CLOSE_ON_EXEC): Remove macro in deference to new fd_noinherit.
* function.c (func_shell_base): Convert CLOSE_ON_EXEC to fd_noinherit.
* job.c (child_execute_job): Ditto.
* output.c (setup_tmpfile): Ditto.
* read.c (eval_makefile): Ditto, plus remove HAVE_FILENO check.
* w32/include/sub_proc.h: Remove process_noinherit for fd_noinherit.
* w32/subproc/sub_proc.c: Ditto.
2017-06-04 18:37:20 -04:00
Paul Smith
c4f30e6012 [SV 50300] Use CFLAGS value of "-O1" in POSIX mode.
* read.c (record_files): Use "-O1" not "-O" for CFLAGS and FFLAGS.
* tests/scripts/targets/POSIX: Test for the new value.
2017-06-04 18:37:20 -04:00
Paul Smith
fbf71ec25a * configure.ac: [SV 50648] Detect Guile 2.2 packages. 2017-06-04 18:37:20 -04:00
Paul Smith
e20c48e385 * doc/make.texi: [SV 50304] Add missing close parenthesis. 2017-06-04 18:37:20 -04:00
Paul Smith
fda00f88d3 Add test suite support to Windows
* main.c (main): Sanitize program name detection on Windows.
* makeint.h: 'program' is a const string on all platforms now.
* tests/run_make_tests.bat: Windows bat file to invoke tests
* tests/test_driver.pl: Obtain system-specific error messages.
(get_osname): Compute the $port_type here.  Add more $osname checks
for different Windows Perl ports.
(_run_command): Rewrite the timeout capability to work properly
with Windows.  Don't use Perl fork/exec; instead use system(1,...)
which allows a more reliable/proper kill operation.
Also, allow options to be given as a list instead of a string, to
allow more complex quoting of command-line arguments.
* tests/run_make_tests.pl (run_make_with_options): Allow options
to be provided as a list in addition to a simple string.
(set_more_defaults): Write sample makefiles and run make on them
instead of trying to run echo and invoking make with -f-, to avoid
relying on shell and echo to get basic configuration values.  Also
create a $sh_name variable instead of hard-coding /bin/sh.
* tests/scripts/features/archives: Skip on Windows.
* tests/scripts/features/escape: Use list method for passing options.
* tests/scripts/features/include: Use system-specific error messages.
* tests/scripts/features/output-sync: "Command not found" errors
generate very different / odd output on Windows.  This needs to be
addressed but for now disable these tests on Windows.
* tests/scripts/functions/abspath: Disable on Windows.
* tests/scripts/functions/file: Use system-specific error messages.
* tests/scripts/functions/shell: "Command not found" errors generate
very different / odd output on Windows.  This needs to be addressed
but for now disable these tests on Windows.
* tests/scripts/misc/close_stdout: Disable on Windows.
* tests/scripts/options/dash-k: Use system-specific error messages.
* tests/scripts/options/dash-l: Disable on Windows.
* tests/scripts/options/eval: Use list method for passing options.
* tests/scripts/options/general: Skip some non-portable tests.
* tests/scripts/targets/ONESHELL: Skip some non-portable tests.
* tests/scripts/targets/POSIX: Skip some non-portable tests.
* tests/scripts/variables/MAKEFILES: Skip some non-portable tests.
* tests/scripts/variables/SHELL: Use a makefile not -f- for testing.
2017-06-04 18:37:20 -04:00
Enrique Olaizola
d9d4e06084 * tests/run_make_tests.pl: [SV 50902] Find Perl modules 2017-06-04 10:19:57 -04:00
Eli Zaretskii
a95cb30ab5 [SV 50021] Avoid infloop on MS-Windows with short scripts
* job.c (reap_children) [WINDOWS32]: Avoid recursive call to
reap_children when the argument passed to
map_windows32_error_to_string is negative or too large.
2017-01-11 20:43:41 +02:00
Paul Smith
d351c1fef2 * main.c (switches): Add -E as an alias for --eval.
* make.1: Document the -E and --eval options.
* doc/make.texi: Document the -E option.
* tests/scripts/options/eval: Test the -E option and MAKEFILES.
* NEWS: Add information about the new option.
2016-12-28 09:25:51 -05:00
Paul Smith
3daaa4dd3e * main.c (switches): Add --no-silent to undo -s options.
* make.1: Document the new flag.
* doc/make.texi: Document the new flag.  Remove suggestions that the
.SILENT special target is deprecated or should not be used.
* tests/scripts/options/dash-s: Test the -s and --no-silent options.
* NEWS: Add information about the new option.
2016-12-28 09:25:34 -05:00
Martin Dorey
a359e32eb5 * job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning. 2016-12-26 14:09:38 -05:00
Martin Dorey
bee153c762 * main.c (main): [SV 49935] Fix uninitialized variable. 2016-12-26 13:26:44 -05:00
Paul Smith
c5ccc4930c [SV 40236] Handle included file open failures properly.
* read.c (eval_makefile): Set deps->error if we discovered any
error reading makefiles, and set NONEXISTENT_MTIME so we know
it needs to be rebuilt.
* main.c (main): Clean up management of makefile_mtimes.
* tests/scripts/features/include: Add open failure testcases.
2016-12-26 09:01:59 -05:00
Paul Smith
45bf0e3a67 Portability changes for the test suite.
* tests/test_driver.pl: Save error strings for later comparison.
* tests/run_make_tests.pl: Create portable commands for later use.
* tests/*: Use these new variables.
2016-12-26 09:01:59 -05:00
Paul Smith
c6966b3238 [SV 20513] Un-escaped # are not comments in function invocations
* NEWS: Document the change, as a backward-incompatible change.
* main.c (main): Add 'nocomment' to the .FEATURES variable.
* read.c (remove_comments): Skip variable references during remove.
(find_char_unquote): Fix comments for new STOPMAP support.
* tests/scripts/features/escape: Test new escape syntax.
* tests/scripts/functions/guile: Ditto.
* tests/scripts/functions/shell: Ditto.
2016-12-26 09:01:59 -05:00
Paul Smith
0029ea8941 * main.c (main): [SV 40234] Show correct error message. 2016-12-26 09:01:59 -05:00
Christoph Schulz
053d49367c * main.c (switches): [SV 48809] Accept obsolete jobserver flag. 2016-12-26 09:01:59 -05:00
Paul Smith
80861cce43 * read.c (get_next_mword): [SV 49865] Make fallthrough explicit. 2016-12-26 09:01:59 -05:00
Paul Smith
72af7ce8af [SV 49114] Remove support for the NO_FLOAT compile flag.
* makeint.h (max_load_average): Always a double.
* main.c (max_load_average, default_load_average): Always doubles.
(switches): -l option is a "floating" format.
(decode_switches, define_makeflags): Support "floating" format.
* remake.c (f_mtime): Show time skew as double.
* rule.c (print_rule_data_base): Show percentages as double.
* Makefile.ami, README.DOS.template, SMakefile.template: Remove
references to NO_FLOAT.
* SCOPTIONS, glob/SCOPTIONS: Remove NO_FLOAT settings.
2016-12-26 09:01:58 -05:00
Paul Smith
e4a9c9b825 [SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.
* read.c (parse_file_seq) [WINDOWS32]: Only consider a colon part of
a path if it's in a valid Windows drivespec.
2016-12-26 08:59:58 -05:00
Paul Smith
3d7c17c5a9 [SV 49116] Check potential null pointer dereference.
* w32/subproc/sub_proc.c (make_command_line): Simplify cygwin shell
check for correctness.
2016-12-25 18:18:45 -05:00
Jaak Ristioja
9c487cc537 * expand.c (variable_append): [SV 49113] Possible null ptr deref 2016-12-25 18:18:45 -05:00
Jaak Ristioja
1c9790e6f5 * w32/*/dirent.*: [SV 49111] Remove unused telldir() 2016-12-25 18:18:45 -05:00
Paul Smith
b13dcfe501 Add more GCC warnings to the maintainer build.
* arscan.c: [SV 49112] Correct TEST printf() formatting.
Recommended by Jaak Ristioja <jaak@ristioja.ee>
* hash.c: Correct fprintf() formatting.
* maintMakefile: Add extra GCC warning flags.
2016-12-25 18:18:45 -05:00
Paul Smith
212cb00923 * po/Makevars, makeint.h, debug.h: Add xgettext C format flags. 2016-12-25 18:18:45 -05:00
Paul Smith
ac90d80b2a * po/LINGUAS: Added Serbian translation. 2016-12-25 18:18:45 -05:00
Paul Smith
a3f6e49705 * README.template: Clarify some items in the README 2016-12-25 18:18:45 -05:00
Paul Smith
db72ca1b7d * doc/make.texi: [SV 48951] Fix documentation typo. 2016-12-25 18:18:45 -05:00
Paul Smith
8d0aff7e81 * maintMakefile: Update default GPG ID for new key. 2016-12-25 18:18:03 -05:00
Paul Smith
bc9d72beb0 Resolve issues discovered by static code analysis.
* maintMakefile: Add a rule to submit code for analysis.
* configure.ac: Check for availability of the umask() function.
* output.c (output_tmpfd, output_tmpfile): Use umask on temp files.
* makeint.h (PATH_VAR): Reserve an extra character for nul bytes.
* function.c (func_error): Initialize buffer to empty string.
* job.c (child_execute_job): Verify validity of fdin.
* main.c (main): Simplify code for makefile updating algorithm.
* arscan.c (ar_scan): Verify member name length before reading.
* read.c (readline): Cast pointer arithmetic to avoid warnings.
* remake.c (update_file): Remove unreachable code.
(name_mtime): Verify symlink name length.
2016-12-14 17:56:24 -05:00
Eli Zaretskii
d3bba301ce * NEWS: Mention the extended support for -jN on MS-Windows. 2016-11-12 11:03:14 +02:00
Marc Ullman
15066b73f4 Support more than 63 jobs on MS-Windows
* job.c (start_waiting_job, load_too_high):
* w32/w32os.c (jobserver_setup, jobserver_acquire): Abstracted out
MAXIMUM_WAIT_OBJECTS.  Call process_table_full instead.
* w32/include/sub_proc.h: Update and add prototypes.
* w32/subproc/sub_proc.c (GMAKE_MAXIMUM_WAIT_OBJECTS): New macro.
(process_wait_for_multiple_objects): Drop-in replacement for Windows
API WaitForMultipleOjects.
(process_wait_for_any_private): Replaced MAXIMUM_WAIT_OBJECTS with
GMAKE_MAXIMUM_WAIT_OBJECTS.
(process_table_full): Replacement for process_used_slots.
(process_used_slots): Removed, as no longer needed.
(process_table_usable_size): Returns maximum usable size of process
table.
(process_table_actual_size): Returns actual size of process table.
(process_register): Added assertion.
(process_easy): Abstracted out MAXIMUM_WAIT_OBJECTS.
2016-11-12 10:53:28 +02:00
Eli Zaretskii
7ed37f0166 Only include strings.h in MinGW builds
* main.c:
* job.c: Include strings.h only if HAVE_STRINGS_H is defined.

* config.h.W32.template (HAVE_STRINGS_H): Define only for MinGW,
as MSVC doesn't have this header.
2016-10-09 16:09:52 +03:00
Eli Zaretskii
912a0df127 Update the Guile version tested with the MS-Windows build. 2016-10-06 22:41:47 +03:00
Eli Zaretskii
0b41373312 Avoid compiler warnings with MinGW runtime 3.22.2
* main.c:
* job.c: Include strings.h, to get the prototypes of strcasecmp
and strncasecmp with latest MinGW runtime versions.
* config.h.W32.template (HAVE_STRINGS_H): Define.
2016-10-06 22:39:14 +03:00
Paul Smith
6f339b22eb * README.W32.template: Update the build documentation.
* build_w32.bat: Fix issues with Visual Studio builds.  Fix an error
that always created Debug builds.  Support 32bit and 64bit builds.
2016-06-24 20:50:42 -04:00
Paul Smith
e26560508c * Update to pre-release version 4.2.90. 2016-06-24 20:50:40 -04:00
Paul Smith
9ab8af7cd8 GNU Make release 4.2.1. 2016-06-10 19:02:10 -04:00
Paul Smith
f522852f07 * maintMakefile: TP recommends rsync for retrieving PO files. 2016-06-06 08:32:00 -04:00
Jeremy Devenport
a3d8c086d5 * main.c (main): [SV 48009] Reset stack limit for make re-exec.
Copyright-paperwork-exempt: yes
2016-05-31 03:17:26 -04:00
Paul Smith
4762480ae9 [SV 47995] Ensure forced double-colon rules work with -j.
The fix for SV 44742 had a side-effect that some double-colon targets
were skipped.  This happens because the "considered" facility assumed
that all targets would be visited on each walk through the dependency
graph: we used a bit for considered and toggled it on each pass; if
we didn't walk the entire graph on every pass the bit would get out
of sync.  The new behavior after SV 44742 might return early without
walking the entire graph.  To fix this I changed the considered value
to an integer which is monotonically increasing: it is then never
possible to incorrectly determine that a previous pass through the
graph already considered the current target.

* filedef.h (struct file): make CONSIDERED an unsigned int.
* main.c (main): No longer need to reset CONSIDERED.
* remake.c (update_goal_chain): increment CONSIDERED rather than
inverting it between 0<->1.
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
(check_dep): Ditto.
* tests/scripts/features/double_colon: Add a regression test.
2016-05-31 03:17:26 -04:00
Paul Smith
ef6c059e1e * DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.
Reported by Joel Fredrikson <Joel.Fredrikson@it.uu.se>
2016-05-31 03:17:26 -04:00
Paul Smith
cf4ed2ebe8 * w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank(). 2016-05-31 03:17:26 -04:00
Eli Zaretskii
5a4f9a67a3 Fix printing time stamps on MS-Windows
* dir.c (print_dir_data_base) [WINDOWS32]: Use %I64u format for
printing unsigned 64-bit data types, as %ull is not universally
supported.
2016-05-28 12:53:02 +03:00
Luke Allardyce
2987163ac4 [SV 48037] Fix MinGW build with Posix configury tools
* w32/Makefile.am (libw32_a_CPPFLAGS): Add -I$(srcdir)/glob.

Copyright-paperwork-exempt: yes
2016-05-27 22:39:55 +03:00
Paul Smith
ec61980122 GNU Make release 4.2. 2016-05-22 09:25:55 -04:00
Joe Crayne
9bb994e831 [SV 44742] Fix double-colon rules plus parallel builds.
* remake.c (update_file): Don't update double-colon target status
if we're still building targets.
(ftime_t): Don't propagate timestamps for double-colon targets that
we've not examined yet.
* tests/scripts/features/double_colon: Add parallel build tests.

Copyright-paperwork-exempt: yes
2016-05-21 17:34:45 -04:00
Paul Smith
e2ebea35f1 * read.c (eval): [SV 47960] Skip record waiting files when ignoring.
* tests/scripts/features/conditionals: Test this scenario.
2016-05-21 16:22:32 -04:00
Paul Smith
c73ed7dd1c Separate the GNU make load ABI from internal types.
Create an internal type "floc" and convert all users to that type.
* gnumake.h (gmk_floc): Remove the offset field from this type.
* loadapi.c (gmk_eval): Convert gmk_floc to internal floc.
2016-05-21 16:22:32 -04:00
Paul Eggert
ba8383efd8 Fixes for enhanced GCC warnings.
Move function prototypes into header files and out of .c files.
Use void argument lists for functions that accept no args.
Remove unused macros.  Make private functions static.  Align
types with printf format characters.
2016-05-21 16:22:25 -04:00
Paul Smith
6f7fb050b4 Fix compile issues with Windows and VMS.
* main.c (initialize_stopchar_map): isblank() is not part of C89.
Install bits for space and tab directly.
* makeint.h: Don't define vfork; autoconf handles this for us.
* vmsjobs.c: Rename NEXT_TOKEN to V_NEXT_TOKEN to avoid conflicts.
* dir.c (print_dir_data_base): Visual Studio C doesn't have int64_t.
* w32/subproc/sub_proc.c (process_begin): Missing arg to memset().
* build_w32.bat: Don't use obsolete Visual Studio flags.
2016-05-21 16:21:31 -04:00
Paul Smith
45200a42d3 Allow compiling with an ISO C 1989/1990 compiler.
* posixos.c (jobserver_post_child): Use C89 for loop syntax.
* remake.c (update_goal_chain): Ditto.
* variable.c (parse_variable_definition): Ditto.
2016-05-21 14:30:37 -04:00
Eli Zaretskii
4c9e10fd94 [SV 47942] Avoid random crashes in subordinate programs on MS-Windows
* w32/subproc/sub_proc.c (process_begin): Zero out startInfo
before using it.  Fixes crashes in Intel Fortran compiler invoked
by Make.
2016-05-17 18:15:26 +03:00
Eli Zaretskii
6e640321fd Fix the MS-Windows MinGW build
* build_w32.bat (GccCompile): Use -std=gnu99, as some code uses
C99 features ('for' loop initial declarations).

* dir.c (print_dir_data_base) [WINDOWS32]: Cast 'mtime' to
'int64_t', and use %I64d to print it, to avoid compile-time
warning about printing a 'time_t' value, which could be either
a 32-bit or a 64 bit integral type.
2016-04-24 09:53:38 +03:00
Paul Smith
7241d136f4 * tests/scripts/features/output-sync: increase test timeout.
I'm getting random failures with a timeout of 10s; increase to 30s.
2016-04-23 11:21:36 -04:00
Paul Smith
c2be1df880 * NEWS: Update for pre-release 2016-04-11 07:51:05 -04:00
Paul Smith
f1a9625001 * dep.h, makeint.h (show_goal_error): Move to makeint.h. 2016-04-11 07:51:05 -04:00
Paul Smith
047bd5a16f [SV 46433] Show recipe line offsets in line number messages.
While displaying line numbers, show the relevant line number inside
the recipe not just the first line of the entire recipe.
Sample changes suggested by Brian Vandenberg <phantall@gmail.com>

* gnumake.h (gmk_floc): Add an 'offset' to track the recipe offset.
* read.c (eval, eval_makefile, eval_buffer): Initialize 'offset'.
(record_files, install_pattern_rule): Ditto.
* job.c (new_job, job_next_command): Update 'offset' based on the
line of the recipe we're expanding or invoking.
(child_error): Add 'offset' when showing the line number.
* function.c (func_shell_base): Ditto.
* output.c (error, fatal): Ditto.
* NEWS: Mention the new ability.
* tests/scripts/features/errors: Check the line number on errors.
* tests/scripts/functions/warning: Check the line number on warnings.
* tests/scripts/features/output-sync,
tests/scripts/features/parallelism, tests/scripts/functions/shell,
tests/scripts/functions/error: Update line numbers.
2016-04-11 07:51:05 -04:00
Paul Smith
3fc99a48e1 * maintMakefile: Add a rule for storing preprocessor output. 2016-04-09 20:06:46 -04:00
Paul Smith
87a5f98d24 [SV 102] Don't show unnecessary include file errors.
Delay the generation of error messages for included files until we
are sure that we can't rebuild that included file.
* dep.h (struct dep): Don't reuse "changed"; make a separate field
to keep "flags".  Get rid of dontcare and use the flag.
(struct goaldep): Create a new structure for goal prereqs
that tracks an errno value and the floc where the include happened.
Rework the structures to ensure they are supersets as expected.
In maintainer mode with GCC, use inline to get type checking.
* read.c (eval_makefile): Return a struct goaldep for the new
makefile.  Ensure errno is set properly to denote a failure.
(read_all_makefiles): Switch to goaldep and check errno.
(eval): Don't show included file errors; instead remember them.
* remake.c (update_goal_chain): Set global variables to the current
goaldep we're building, and the entire chain.
(show_goal_error): Check if the current failure is a consequence
of building an included makefile and if so print an error.
(complain): Call show_goal_error() on rule failure.
* job.c (child_error): Call show_goal_error() on child error.
* main.c (main): Switch from struct dep to goaldep.
* misc.c (free_dep_chain): Not used; make into a macro.
* tests/scripts/features/include: Update and include new tests.
* tests/scripts/options/dash-B, tests/scripts/options/dash-W,
tests/scripts/options/print-directory,
tests/scripts/variables/MAKE_RESTARTS: Update known-good-output.
2016-04-09 20:06:46 -04:00
Paul Smith
53554e41e8 * job.c (child_error): Add filename length to output length.
Reported by Dale Stimson <dale@riyescott.com>
2016-04-09 09:25:50 -04:00
Paul Smith
5bd7ad2b22 Preserve the real value of -jN in MAKEFLAGS using jobserver.
Previously if the jobserver was active, MAKEFLAGS would contain only
the -j option but not the number (not -j5 or whatever) so users
could not discover that value.  Allow that value to be provided in
MAKEFLAGS without error but still give warnings if -jN is provided
on the command line if the jobserver is already activated.

* NEWS: Discuss the new behavior.
* os.h, posixos.c, w32/w32os.c: Return success/failure from
jobserver_setup() and jobserver_parse_auth().
* main.c (main): Separate the command line storage of job slots (now
in arg_job_slots) from the control storage (in job_slots).  Make a
distinction between -jN flags read from MAKEFLAGS and those seen
on the command line: for the latter if the jobserver is enabled then
warn and disable it, as before.
* tests/scripts/features/jobserver: Add new testing.
2016-04-04 01:38:37 -04:00
Paul Smith
65115e7095 * tests/run_make_tests.pl: Add file/lineno info to .run file. 2016-04-04 01:38:37 -04:00
Paul Smith
75dd0bd8bc * maintMakefile: Fix logging of check-alt-config target. 2016-04-04 01:38:37 -04:00
Paul Smith
8b54c5cff9 * job.c (child_execute_job): Fix $(shell...) under NO_OUTPUT_SYNC.
* main.c (decode_output_sync_flags): Use NONE for NO_OUTPUT_SYNC.
2016-04-04 01:38:32 -04:00
Paul Smith
65c447289e * main.c (main): Restrict disabling debugging for MAKEFILES. 2016-04-04 01:36:08 -04:00
Paul Smith
86b20728fe * Makefile.am, w32/Makefile.am: Fix *os.c for Windows builds.
Original change provided by Luke Allardyce <lukeallardyce@gmail.com>
2016-04-04 01:36:08 -04:00
Paul Smith
b8a8af6550 * make.texi: Confirm that CURDIR contains an absolute path. 2016-04-04 01:36:08 -04:00
Paul Smith
360b76af84 * docs/make.texi: [SV 47392] Add "Integrating make" chapter. 2016-04-04 01:36:08 -04:00
Paul Smith
c9e6ab9ac7 Change --jobserver-fds to more generic --jobserver-auth.
* NEWS: Mention the change.
* main.c: Rename jobserver_fds variable to jobserver_auth and
--jobserver-fds option to --jobserver-auth.
* os.h, posixos.c, w32/w32os.c: Rename jobserver_parse_arg() and
jobserver_get_arg() to jobserver_parse_auth()/jobserver_get_auth().
2016-04-04 01:36:08 -04:00
Paul Smith
40277b8850 * tests/run_make_tests.pl: Preserve $make_command
* tests/scripts/options/dash-n: Use $make_command.  This fixes
a spurious failure when running tests with valgrind enabled.
2016-03-23 01:26:55 -04:00
Paul Smith
35047f824a * variable.c: Clean up some memory leaks. 2016-03-23 01:26:04 -04:00
Paul Smith
e97159745d [SV 46995] Strip leading/trailing space from variable names
* makeint.h: Change MAP_SPACE to MAP_NEWLINE, and add MAP_PATHSEP
and MAP_SPACE which is now MAP_BLANK|MAP_NEWLINE.  Create
NEW_TOKEN(), END_OF_TOKEN(), ISBLANK(), ISSPACE() macros.
* main.c (initialize_stopchar_map): Set MAP_NEWLINE only for
newline characters.
* Convert all uses of isblank() and isspace() to macros.
* Examine all uses of isblank() (doesn't accept newlines) and
change them wherever possible to ISSPACE() (does accept newlines).
* function.c (func_foreach): Strip leading/trailing space.
* variable.c (parse_variable_definition): Clean up.
* tests/scripts/functions/foreach: Test settings and errors.
* tests/scripts/functions/call: Rewrite to new-style.
* tests/scripts/misc/bs-nl: Add many more tests for newlines.
2016-03-23 01:25:51 -04:00
Paul Smith
2b9dd215d5 * function.c (func_file): Support reading from files.
* NEWS: Add information about reading files.
* make.texi (File Function): Describe reading files.
* tests/scripts/functions/file: Test new features for $(file ...)
2016-03-21 00:44:53 -04:00
Paul Smith
fc2ddebdae * doc/make.texi (Setting Variables): Fix typo (add comma). 2016-03-20 14:23:46 -04:00
Paul Smith
b4682cb479 * job.c (child_error): Combine file info with error message.
* tests/scripts/...: Update error message matches.
2016-03-20 14:23:22 -04:00
Paul Smith
09202bc880 * variable.c: Align type of variable_changenum. 2016-03-19 17:23:19 -04:00
Paul Smith
9ae02b7916 [SV 45728] Detect changes in .VARIABLES more accurately.
For performance, we only recompute .VARIABLES when (a) it's expanded
and (b) when its value will change from a previous expansion.  To
determine (b) we were checking the number of entries in the hash
table which used to work until we started undefining entries: now if
you undefine and redefine the same number of entries in between
expanding .VARIABLES, it doesn't detect any change.  Instead, keep
an increasing change number.
* variables.c: Add variable_changenum.
(define_variable_in_set, merge_variable_sets): Increment
variable_changenum if adding a new variable to the global set.
(undefine_variable_in_set): Increment variable_changenum if
undefining a variable from the global set.
(lookup_special_var): Test variable_changenum not the hash table.
* tests/scripts/variables/special: Test undefining variables.
2016-03-13 18:23:20 -04:00
Paul Smith
247b71e690 * main.c(main): Disable output sync without parallel builds. 2016-03-13 15:59:12 -04:00
Paul Smith
e33f3d72bf [SV 46581] Pre-define .LOADED to avoid warnings.
* main.c (main): Pre-define .LOADED as a default-level variable.
* load.c (load_file): Set the value rather than append it.  Avoid
adding an extra initial whitespace.
* tests/scripts/features/load: Run with --warn-undefined-variables.
2016-03-13 03:02:00 -04:00
Paul Smith
fd1dd7c398 [SV 44555] Use vfork() instead of fork() where available.
Testing has shown that vfork() is actually significantly
more efficient on systems where it's supported, even for
copy-on-write implementations.  If make is big enough,
duplicating the page tables is significant overhead.

* configure.ac: Check for fork/vfork.
* makeint.h: Include vfork.h and set up #define for it.
* os.h, posixos.c (get_bad_stdin): For children who can't use
the normal stdin file descriptor, get a broken one.
* job.c (start_job_command): Avoid so many ifdefs and simplify
the invocation of child_execute_job()
(child_execute_job): move the fork operation here so it can
return early for the parent process.  Switch to use vfork().
* function.c (func_shell_base): Use new child_execute_job() and
simplify ifdefs.
* job.h, main.c, remote-cstms.c, vmsjobs.c, w32os.c: Update
declarations and calls.
2016-03-13 01:12:07 -05:00
Paul Smith
14b2d7effb * job.c (exec_command): [SV 47365] Show error on exec failure. 2016-03-09 00:18:57 -05:00
Paul Smith
85c788572d [SV 46261] Use pselect() for jobserver where supported.
* Makefile.am, configure.ac: Check for pselect() and sys/select.h.
* main.c (main): Block SIGCHLD if we have pselect() support.
* posixos.c (jobserver_acquire): If we support pselect() then use
it to query the jobserver pipe, while also listening for SIGCHLD.
Also pselect() supports a timeout so avoid alarm() calls.
2016-03-08 23:40:46 -05:00
Paul Smith
8164c8ab3d Clean up some compiler warnings.
* commands.c, commands.h: Use unsigned char for flags.
* dir.c: Use time_t and size_t, and char for a boolean value.
* job.c: Use unsigned and char.
* read.c: Return a signed type since -1 is a valid return code.
2016-03-08 23:40:46 -05:00
Paul Smith
fb7a7adc8a Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-08 23:40:46 -05:00
Paul Smith
4f8be4bb28 [SV 46261] Add more EINTRLOOP wrappers.
This cannot be a perfect solution because there are always other
possible places EINTR can happen, including external libraries
such as gettext, Guile etc.
2016-03-08 00:31:47 -05:00
Paul Smith
e2b39edc22 * strcache.c (add_hugestring): [SV 46832] Support huge strings.
The strcache was limited to strings of length 65535 or less,
because the length is kept in an unsigned short.  To support
huge strings add a new simple linked list, which we don't try
to hash.
2016-02-29 01:35:02 -05:00
Paul Smith
8530d77c68 * strcache.c (add_string): [SV 47071] Handle huge initial string.
If the very first string added to the string cache is more than
half the maximum size, we failed when moving the only strcache
buffer to the full list.
2016-02-29 01:35:02 -05:00
Paul Smith
89e18c12eb [SV 47151] Exit with 1 when checking recursive make -q
* job.h (struct child): New bit to mark recursive command lines.
* job.c (start_job_command): Set the recursive command line bit.
(reap_children): If the child is a recursive command and it exits
with 1 during question mode, don't print an error and exit with 1.
* tests/scripts/options/dash-q: Add a regression test.
2016-02-29 01:33:50 -05:00
Paul Smith
bccd01354b * main.c (define_makeflags): Add parens to avoid GCC warning. 2016-02-29 01:32:12 -05:00
Paul Smith
5f9d341160 * tests/scripts/features/archives: Handle deterministic archives.
Newer versions of binutils allow ar to be compiled to generate
"deterministic archives" by default: in this mode no timestamp
information is generated in the static archive, which utterly
breaks GNU make's archive updating capability.  Debian and Ubuntu
have turned this feature on by default in their distributions
which causes the regression tests to fail.

Update the regression tests to check for the availability of the
"U" option to ar which disables deterministic archives and allows
GNU make's archive support to work properly again.
2016-02-29 01:31:16 -05:00
Paul Smith
798ebd241b Update Copyright statements for the new year. 2016-02-28 12:55:20 -05:00
Paul Smith
4db6d0c694 * doc/make.texi: [SV 47163] Fix typo in 'ifdef' documentation. 2016-02-28 12:41:41 -05:00
Paul Smith
b754a35df7 * doc/make.texi: [SV 35455] Add more uses for Empty Recipes. 2016-02-28 12:35:15 -05:00
Gisle Vanem
168f12375d Fix diagnostics on MS-Windows when environment is too large
* w32/subproc/sub_proc.c (process_begin): Fix test of the error
	cause when the environment block is too large.

Copyright-paperwork-exempt: yes.
2015-11-07 11:27:03 +02:00
Eli Zaretskii
83443c706a Update README.W32.template
* README.W32.template: Update for latest developments.  Make it
clear we don't recommend using HAVE_CASE_INSENSITIVE_FS in
general.
2015-10-27 20:51:43 +02:00
Eli Zaretskii
4a5377aef7 [SV 46304] Don't invoke C++ compiler on C sources on MS-Windows
* default.c (default_variables) [HAVE_CASE_INSENSITIVE_FS]: Make
COMPILE.C and LINK.C be synonyms for COMPILE.c and LINK.c,
respectively.
2015-10-27 20:47:27 +02:00
Eli Zaretskii
48391c2817 [SV 45838] When invoking w32 programs, don't use free'd memory.
* w32/subproc/sub_proc.c (process_begin): Freeing argv[0] makes
the other argv[i] pointers invalid, so need to allocate a new
array and copy argv[i] for i != 0 first, replacing argv[0] with
the batch file name, before we can free argv[0].
2015-09-23 11:42:53 +03:00
Paul Smith
42745a900f * implicit.c (pattern_search): [SV 43677] Mark files secondary.
In order to fix SV 12267 we were marking the prerequisites of
implicit (pattern) targets that existed elsewhere in the makefile
as precious to keep them from being deleted as intermediate files.
However this also keeps them from being deleted on error.  Instead
mark them as secondary.
* tests/scripts/targets/DELETE_ON_ERROR: Test DELETE_ON_ERROR.
2015-07-13 00:51:35 -04:00
Paul Smith
43181f1f82 [SV 28092] Preserve the exit status of the $(shell...) function.
Add a new variable .SHELLSTATUS which holds the exit status of the
last-invoked shell function or != assignment.

* NEWS, doc/make.texi: Document the change.
* function.c (shell_completed, msdos_openpipe, func_shell_base): Add
shell_completed() to handle the completion of the shell, by setting
.SHELLSTATUS.  Call it where needed.
* job.c (child_handler): Call shell_completed().
* tests/scripts/functions/shell: Add tests for .SHELLSTATUS.
2015-07-12 21:03:24 -04:00
Paul Smith
c18b23f7b2 * tests/scripts/misc/fopen-fail: [SV 42390] Increase test timeout.
* Makefile.am (check-regression): Force ulimit -n for fopen-fail test.
2015-07-12 18:19:01 -04:00
Paul Smith
fe5585528f * job.c: [SV 43936] Check sigaction for error return. 2015-07-12 17:29:05 -04:00
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
Paul Smith
9ef06be018 * read.c (unescape_char): [SV 45050] Handle final backslashes.
If the last thing in the string to be unescaped is a backslash,
stop without reading beyond the end of the string.
2015-07-12 12:39:59 -04:00
Paul Smith
ac9a39dad7 * strcache.c: [SV 45275] Handle very long strings.
Our previous behavior for handling too-long strings involved
increasing the size of the default string cache buffer, but the
implementation was incomplete.  Instead, create a one-off large
string cache entry and add it directly to the full cache list
without changing the default buffer size.
2015-07-12 00:14:19 -04:00
Duncan Moore
c6ac580785 * job.c [RISCOS]: Remove logic that is no longer required.
Signed-off-by: Paul Smith <psmith@gnu.org>
Copyright-paperwork-exempt: yes
2015-07-12 00:14:19 -04:00
Paul Smith
9efd477e98 * remake.c (update_file): [SV 44742] Keep double-colon rule status.
Fix suggested by Everett Boyer <EvBoyer@aol.com>
2015-07-12 00:14:14 -04:00
James Johnston
5036dd120a [SVN 45515] Check exit status of sub-make in subproc.bat
* subproc.bat: Exit when sub-make invocation fails.

Copyright-paperwork-exempt: yes
2015-07-10 09:56:27 +03:00
Eli Zaretskii
7e849f3b81 [SV 45515] Ignore Windows-specific build artifacts
* .gitignore: Ignore *.exe, *.dll.a, *.lib, *pdb, and a few more MSVC
specific artifacts.
Suggested by James Johnston <johnstonj.public@codenest.com>
2015-07-10 09:50:27 +03:00
Eli Zaretskii
a80a8b8a10 [SV 44348] Fix handling of shell widlcards on MS-Windows.
* job.c (construct_command_argv_internal): If shell wildcard
	characters are found inside a string quoted with "..", give up the
	fast route and go through the shell.  Fixes Savannah bug #44348.
2015-02-28 14:34:51 +02: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
Christian Boos
1fae20a2b7 Fix $(shell) on hosts with 64-bit pid_t.
* function.c: Use pid_t for shell_function_pid.
* job.c: Likewise.

Copyright-paperwork-exempt: yes
2014-12-27 10:55:01 +02:00
Paul Smith
292da6f686 * main.c (main): [SV 43434] Handle NULL returns from ttyname(). 2014-10-20 01:54:56 -04:00
Benedikt Morbach
3c487e7ed5 * tests/scripts/features/archives: [SV 43405] override AR variable.
Copyright-paperwork-exempt: yes
2014-10-20 01:45:09 -04:00
John Malmberg
c0380823a2 Fix VMS implicit rules and UNIX paths.
This fixes VMS implicit rules and UNIX style pathname handling.
It also fixes some of the VMS style pathname handling, more work
there will be needed later.
TODO: There are other case insensitive platforms besides VMS.
We need to find out why there is extra VMS code for this.  This
indicates either the extra VMS code is not needed, or the case
insensitive support may not be complete on the other case
insensitive platforms.

* default.c: Add missing definitions to default_suffix_rules[] and
default_variables[].
TODO: As it is important that VMS DCL mode definitions must always
be a superset of UNIX definitions, a better way of maintaining the
VMS DCL mode definitions should be devised.
* dir.c (downcase_inplace): Add a reentrant downcase() routine.
Add future support for VMS 8.2+ _USE_STD_STAT macro which will
disable a lot of VMS specific code from compiling.
(dir_file_exists_p): vmsify filename only if directory name has VMS
directory delimiters.
(file_exists_p): Handle both VMS and UNIX directories.
(file_impossible): Handle both VMS and Unix directories.  Track
whether a VMS format path is needed for the return value.
* file.c (lookup_file): Check if vmsify is needed; handle UNIX paths.
* implicit.c (pattern_search): Enable UNIX paths.
* read.c (parse_file_seq): Enable UNIX paths.
* remake.c (f_mtime): Fix gpath_search call for VMS paths.
* rule.c (count_implicit_rule): Enable UNIX paths, Fix VMS paths.
* vpath.c (selective_vpath_search): Enable UNIX paths.
2014-10-20 01:31:42 -04:00
John Malmberg
1faae1d4ed Update README.VMS and move news to the NEWS file
* NEWS: Merge in VMS history.
* README.VMS: Remove VMS history, document current behavior and
known issues.
2014-10-20 01:31:42 -04:00
John Malmberg
18eb093f56 [SV 41758]: Fix archive support for VMS.
Upated to match change to run_make_tests and some future fixes to
make on VMS.

* arscan.c: Use ANSI compatible pragmas instead of VAX C extensions.
* tests/scripts/features/archives: Fix tests to use VMS rules and
answers when running on VMS and using DCL as a shell.
* tests/scripts/features/vpath3: Fix epected answer on test when
run on VMS.
* tests/scripts/vms/library: (New) Test the VMS library rules that
are not tested by existing tests.
2014-10-20 01:31:42 -04:00
John Malmberg
894ee7f6c8 [SV 42447]: VMS simulate exporting symbols
This also includes fixing the most of the exit handling code for VMS.

Self tests:
 Previously about 94 Tests in 36 categories fail.
 Now about 45 tests in 22 categories fail.

Because some tests do not properly clean up, the number of tests that
fail can vary by one or two test cases between consecutive runs.

* Makefile.am: Add new VMS files.
* job.c: add prototype for vms_strsignal().
* job.c: (child_error): Remove VMS specific code as no longer needed.
* job.c: (reap_children): The VMS specific code was setting the
status to 0 instead of setting it to the proper exit status.
* job.h: Add vms_launch_status to struct child.
* main.c: (main): Use environment variables for options to use MCR
* instead of a foreign command, and to always use command files for
subprocesses.
For VMS use (set_program_name) routine which is common to ports of
other GNU packages to VMS to set the program name used internally.
Use (vms_putenv_symbol) to set up symbols to be visible in child
programs, including recursive make launched by execve()
Start of Bash shell detection code for VMS.
* makefile.com: Need nested_include=none for building on VMS search
lists.  Add vms_progname, vms_exit, and vms_export_symbol.
* makefile.vms: Need nested_include=none for building on VMS search
lists.  Add vms_progname, vms_exit, vms_export_symbol.
* makeint.h: Make sure non-standard "VMS" macro is defined.  Add
prototypes for new VMS routines.  Remove VMS-specific failure codes.
* vmsjobs.c: Add VMS POSIX exit code constants.
(_is_unixy_shell): Detect Bash shell.
(vms_strsignal): simulate strsignal() on VMS.
(vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit
status codes.  Remove code that duplicated code in job.c.
(child_execute_job): Export environment symbols before spawning a
child and restore afterward unless option to use command files for
subprocesses is set.  Improve handling of UNIX null commands ":".
* vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX
or VMS, and converts the UNIX code into a VMS exit code.
* vms_export_symbol.c: Routines to create DCL symbols that work like
shell aliases or exported shell symbols and clean them up on exit.
* vms_export_symbol_test.com: Unit test for vms_export_symbol.c
* vms_progname.c: New file: VMS specific replace for progname.c that
is used in some GNU projects.
2014-10-20 01:28:46 -04:00
John Malmberg
e75662bc6a Set up for running tests on VMS.
* run_make_tests.pl: set $port_type to be 'VMS-DCL' when the test are
run from the VMS DCL Interpreter.  When the tests are run from GNV
on VMS, the $port_type will be 'UNIX'.
* run_make_tests.com: VMS search list support.  This is needed for
using a search list such as prj_root = lcl_root:,vms_root:,src_root:
for building and testing.
2014-10-20 01:23:47 -04:00
Paul Smith
d1df4b21f3 * configure.ac, NEWS, README.git: Set up for the next release. 2014-10-09 02:06:53 -04:00
Paul Smith
a66bf2d736 GNU Make release 4.1. 2014-10-05 12:18:08 -04:00
Eli Zaretskii
31c2024b2e Fix Cygwin compilation error.
* job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]: Fix
initializer for sh_chars_sh.
Reported by Denis Excoffier<cygwin@Denis-Excoffier.org>.
2014-10-02 18:11:43 +03:00
Gisle Vanem
7df0fe77d8 Fix last commit. 2014-10-01 20:43:12 +03:00
Gisle Vanem
9fc787c658 * makeint.h (ftruncate): Define also for __WATCOMC__.
Copyright-paperwork-exempt: yes.
2014-10-01 20:41:28 +03:00
Eli Zaretskii
1afb0ad372 Avoid compilation warnings.
* main.c (find_and_set_default_shell, main) [WINDOWS32]: Declare
variables 'const char *' to avoid compiler warnings.
* job.c (construct_command_argv_internal) [!NDEBUG]: Declare 'end'
and set it only if NDEBUG is not defined, to avoid compiler
warnings.
2014-10-01 18:34:29 +03:00
Eli Zaretskii
86a058029b Treat redirection of standard handles on Windows as it is done on Unix.
* job.c (start_job_command) [WINDOWS32]: Compute outfd and errfd
as on Posix platforms, and pass the results to process_easy.
* function.c (windows32_openpipe) [WINDOWS32]: Accept an
additional argument ERRFD and use it for redirecting the standard
error handle passed to the subprocess.
(func_shell_base) [WINDOWS32]: Pass the computed errfd to
windows32_openpipe.
2014-10-01 18:26:28 +03:00
Paul Smith
0a3a0756b9 Update Copyright statements for 2014. 2014-09-30 09:32:42 -04:00
Paul Smith
3712e8a819 * tests/scripts/features/load: Avoid unused variable warnings. 2014-09-30 09:32:41 -04:00
Paul Smith
9ed452b041 * loadapi.c (gmk_eval): Use C90 syntax. 2014-09-30 08:32:06 -04:00
Hartmut Becker
b11bef0bea * job.c: fix make action continuation lines.
* vmsjobs.c: fix writing DCL command files when trimming (white
  spaces and $ signs) especially after a split (command continuation).
2014-09-30 08:12:46 -04:00
Bernhard Reutner-Fischer
bd716a1ec1 * configure.ac: Fix spacing in helptext of customs
Copyright-paperwork-exempt: yes
2014-09-15 14:17:49 -04:00
Eli Zaretskii
b484efca56 Support MAKE_TERMOUT and MAKE_TERMERR on MS-Windows.
* w32/compat/posixfcn.c (isatty, ttyname): New functions.
* config.h.W32.template (HAVE_TTYNAME): Define.  Add a prototype
for ttyname.
2014-09-15 19:51:41 +03:00
Paul Smith
562344122f * loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval. 2014-09-15 09:42:52 -04:00
Paul Smith
9a2451af0b * main.c, NEWS, doc/make.text: Rename MAKE_TTY* to MAKE_TERM* 2014-09-15 09:30:40 -04:00
Paul Smith
7f9ce6e97b * main.c (main): Set MAKE_TTYOUT and MAKE_TTYERR.
* configure.ac: Test for isatty() and ttyname()
* makeint.h: provide a substitute for ttyname() if it's not available.
* config.ami.template, config.h-vms.template, config.h.W32.template:
define/undefine HAVE_ISATTY/HAVE_TTYNAME macros.
* NEWS, doc/make.texi: Document these new variables.
2014-09-14 01:03:19 -04:00
Paul Smith
621e9edfe9 * tests/config-flags.pm.in, tests/scripts/features/archives: [SV 43046]
Use the "ar" program detected by configure when running the test suite.
2014-09-07 20:14:26 -04:00
Paul Smith
986632ec23 * doc/make.texi: Clarify implicit rule lookup of phony targets
Reported by Frank Heckenbach <f.heckenbach@fh-soft.de>
2014-09-07 20:02:31 -04:00
Hartmut Becker
95ffcda425 Fix and enhance VMS library support.
* ar.c: fix VMS library search for members, which do not have
suffixes, aka filename extensions.
* arscan.c: fix time conversion and library callback routines.
* default.c: more suffixes and automatically create the VMS library
if it doesn't exists.
2014-09-07 18:11:36 -04:00
Hartmut Becker
dcca1b5b0e Enhance VMS exporting make environment variables.
* config.h-vms.template: add feature macro USE_DCL_COM_FILE to always
write a DCL command file, enabled by default.
* vmsjobs.c: with USE_DCL_COM_FILE enabled write make variables as DCL
symbol assignments into the command file.  This enables printing
directory and make level info for recursive use of make. This also
enables forced DCL symbol substitution in the actions.
2014-09-07 18:10:11 -04:00
Hartmut Becker
9cad73ad82 Fix VMS automatic variable expansion
* function.c: add VMS code to func_notdir_suffix and func_basename_dir
to work on comma separated lists; this fixes the expansion of
$(^D), $(+D) and the F variants for VMS.
2014-09-07 18:03:45 -04:00
Hartmut Becker
8e7a28a6a4 * main.c [VMS]: Say that parallel jobs (-j) are not supported on VMS 2014-09-07 18:02:10 -04:00
Hartmut Becker
98de32a681 Enhance/fix VMS ONESHELL implementation and command execution
* job.c, vmsjobs.c: fix some double quote and new line handling;
implement ONESHELL with writing multiple lines into one DCL command
procedure; in ONESHELL allow VMS/make internal redirection only on the
first line; fix the created DCL command procedure, which didn't abort
on errors; return correct exit status from the DCL command procedure;
preserve current procedure verification; make the generated command
procedure more robust.
2014-09-07 18:01:35 -04:00
Hartmut Becker
5369be5079 Enhance/fix VMS setting of program name, MAKE/MAKE_COMMAND variables
* default.c, main.c, makeint.h, vmsfunctions.c: prefix argv[0] with
"mcr " for MAKE/MAKE_COMMAND and set the program name to the image
filename (without the .exe;version)
* vmsfunctions.c: remove obsolete code
* vmsify: use xmalloc
2014-09-07 17:48:14 -04:00
Hartmut Becker
8de07f3e4a Enhance/fix VMS exit code handling.
* commands.c, function.c, hash.c, job.c, main.c, output.c:
use MAKE exit codes.
* makeint.h: encode make exit codes so that they are VMS compatible.
* job.c: check child exit code for VMS style exit codes.
* vmsjobs.c: save and return VMS style exit code.
2014-09-07 17:41:59 -04:00
Hartmut Becker
f970315766 Enhance/fix VMS multi-line support.
* job.c: split the command line at a newline.
* default.c, vmsjobs.c: change ECHO variable to a pseudo builtin,
which ensures that the VMS/DCL ECHO ("write sys$output") is used
and is correctly quoted.
* vmsjobs.c: remove unused builtin 'rm'.
2014-09-07 17:40:28 -04:00
Hartmut Becker
579ee85941 * config_flags_pm.com, [RENAMED test_make.com] run_make_tests.com:
Moved into tests directory.
2014-09-07 17:30:37 -04:00
Hartmut Becker
7e51810bb5 Enhance/fix VMS build environment
* config.h-vms.template: make sure the CRTL version is known
* makefile.com: always compile/link the guile module, remove VAXCRTL
parameter, new LIST parameter
* makefile.vms: always compile/link the guile module, use more
complete dependencies
* prepare_vms.com: helper to create a VMS config file when building
from a snapshot of the repository
2014-09-07 17:13:56 -04:00
Paul Smith
bd30df4478 * configure.ac, maintMakefile, w32/Makefile.am: Fix autotools issues.
Reported by Paul Eggert <eggert@cs.ucla.edu>
2014-09-07 16:59:37 -04:00
Eli Zaretskii
1f2fd22fec Change the order of "makefile" and "Makefile" to match the manual. 2014-08-30 10:43:34 +03:00
Eli Zaretskii
ab1210b1fe Fix regression with "makefile" not being found on MS-Windows.
* read.c (read_all_makefiles) [WINDOWS32]: Recognize "makefile",
all-lowercase, as a makefile.  Reported by Michael Waeber
<waeber@gmail.com>.
2014-08-30 10:40:12 +03:00
Eli Zaretskii
241787d8e4 Fix compilation on MS-Windows.
* makeint.h [WINDOWS32]: Don't declare 'program' as 'const char *',
since it is modified in 'main'.
2014-07-16 18:23:04 +03:00
Eli Zaretskii
faeeb27166 [SV 42695] Fix compilation error on MS-Windows.
* main.c [WINDOWS32]: Don't declare 'program' as 'const char *',
since it is modified in 'main'.
2014-07-12 13:01:18 +03:00
Jonny Grant
cab353d1dd Fix defalt_makefiles[] for MS-Windows.
* read.c (read_all_makefiles) [WINDOWS32]: Remove the redundant
"makefile" and add "makefile.mak".

Copyright-paperwork-exempt: yes
2014-07-12 12:53:59 +03:00
Fredrik Fornwall
8b01e6bebf * arscan.c [ANDROID]: Android has no ar.h but supports archives.
Copyright-paperwork-exempt: yes
2014-07-07 03:56:17 -04:00
Paul Smith
55c00544cc * read.c (eval): [SV 41677] Correct test for TAB vs. 8 spaces. 2014-07-07 03:43:57 -04:00
Piotr Jaroszynski
8d577c2ff4 * output.c (pump_from_tmp): [SV 42378] Flush the output file regularly.
Copyright-paperwork-exempt: yes
2014-07-07 03:10:17 -04:00
John Malmberg
e44d6a12bb Update the regression test harness to support VMS.
* config_flags_pm.com, test_make.com: set up and run the regression
test environment on VMS.
* tests/run_make_tests.pl [VMS]: Use an alternate rmdir()
implementation on VMS.
(run_make_with_options) [VMS]: Provide VMS-specific quoting and shell
invocations.
(set_more_defaults) [VMS]: Set default values when running on VMS.
* tests/test_driver.pl (vms_get_process_logicals) [VMS]: Retrieve the
proper values from %ENV on VMS.
(resetENV) [VMS]: Use it.
(toplevel) [VMS]: Fix a bug with opendir() on some logical_devices.
(compare_output) [VMS]: Convert VMS test output to a "standard" format.
(_run_command) [VMS]: Handle signals and exit codes the VMS way.
(remove_directory_tree_inner) [VMS]: Unlink all versions of the file.
2014-07-07 02:47:30 -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
e364498113 [SV 41983] Support omitting the text argument to $(file ...)
Reported by Tim Murphy <tnmurphy@gmail.com>
* function.c (func_file): Only write TEXT if it is not NULL.
* NEWS, doc/make.texi: Document the new feature
* tests/scripts/functions/file: Verify that the no-text version of
  $(file ...) works and doesn't add a newline.
2014-07-07 01:59:03 -04:00
Jacques Germishuys
85047eb904 NMakefile.template ($(OUTDIR)/posixfcn.obj): Fix a typo.
Copyright-paperwork-exempt: yes.
2014-05-13 20:30:47 +03:00
Paul Smith
0faa98a0bb [SV 42249] Propagate correct rule status results.
* remake.c (update_file, update_file_1, check_dep): Return an enum
  update_status value instead of an int, and keep the highest value we
  find as we walk the graph so that the ultimate status is correct.
* tests/scripts/options/dash-q: Add a test for updating prerequisites.
2014-05-01 09:51:04 -04:00
Paul Smith
8411528fdd * Rename MAP_PATHSEP to MAP_DIRSEP. 2014-02-08 16:01:10 -05:00
Paul Smith
d2a3e9ca9c * configure.ac: Fixup for newer autoconf/automake 2014-02-08 16:01:10 -05:00
Ray Donnelly
e1863c05d8 * output.c: Ensure space for final nul byte in fmtbuf.
Copyright-paperwork-exempt: yes
2014-02-08 16:01:10 -05:00
Gisle Vanem
b981bfd197 Improve error reporting in the Windows port when env size is too large.
w32/subproc/misc.c (arr2envblk): Compute and return the size of
the environment passed to child process.

w32/subproc/sub_proc.c (process_begin): If the call to
CreateProcess failed with EINVAL, and the required environment
size was larger than 32KB, assume it's a Windows XP limitation,
and display an error message to that effect.

w32/subproc/proc.h (arr2envblk): Update prototype.

Copyright-paperwork-exempt: yes
2014-02-07 11:15:56 +02:00
Paul Smith
88713683fe * job.c (set_child_handler_action_flags): [SV 41341]
Ensure signal handler is in place before alarm(1).
2014-02-01 23:12:04 -05:00
Alan Hourihane
a7cac0f0e3 * configure.ac: [SV 40790] Fix load autoconf variables.
Copyright-paperwork-exempt: yes
2014-01-20 00:17:44 -05:00
Pavel Fedin
165ccf3137 Allow the EMX build to use output_sync.
job.c (start_job_command): Move the child output diversion out
of non-EMX branch.
[__EMX__]: Don't use fixed FD_STDOUT and FD_STDERR in the call to
child_execute_job.

Copyright-paperwork-exempt: yes
2014-01-17 09:51:28 +02:00
Paul Smith
24620378ba * commands.c: [SV 40789] Remove unneeded header dlfcn.h 2014-01-12 10:54:59 -05:00
Paul Smith
9c8b68a905 * main.c (die): Close output_context AND make_sync.
die() can be invoked inside a separate output_context, if the
$(error ...) function is expanded as part of a recipe.
2014-01-12 10:54:29 -05:00
Pavel Fedin
432cb6575d Fix .LIBPATTERNS for MS-Windows builds.
default.c (.LIBPATTERNS) [__CYGWIN__ || WINDOWS32]: Provide
library patterns for MS-Windows.

Copyright-paperwork-exempt: yes
2014-01-11 22:28:48 +02:00
Paul Smith
a4937bc897 * w32/*: Remove TABs from the source code.
I know whitespace commits are annoying, but having these TABs is
causing me to miss things when I search through the code.  This
doesn't try to change the w32 code to meet GNU coding standards.
2013-11-27 19:43:33 -05:00
Paul Smith
889303cdfe * main.c (decode_env_switches): Ensure we have enough space.
Reported (with patch) by Gerte Hoogewerf <g.hoogewerf@gmail.com>
2013-11-27 19:06:45 -05:00
Stephan T. Lavavej
99385ee6f7 Solve some Windows build issues.
* main.c (main): Use ONS(), not OSN().
(prepare_mutex_handle_string) [WINDOWS32]: Use %Ix formatting to
support both 32bit and 64bit systems.
* job.c (free_child, new_job): Use ONS(), not OSN().
* w32/subproc/w32err.c (map_windws32_error_to_string): Use O() when
calling fatal().

Copyright-paperwork-exempt: yes
2013-11-27 10:57:37 -05:00
Paul Smith
f5f5adb62c * features/loadapi (test_expand): Allocate memory for the nul byte. 2013-11-24 04:08:30 -05:00
Paul Smith
865d90bb1e * load.c (load_file): Reset the name length minus the symbol. 2013-11-24 04:03:19 -05:00
Paul Smith
30b25acc4e * read.c (unescape_char): Use memmove() for overlapping memory. 2013-11-24 03:45:38 -05:00
Paul Smith
f8905059c3 Fix memory leak during environment option decoding.
* main.c (decode_switches): Always make a copy of option arguments.
(decode_env_switches): Use a stack buffer to convert environment
switches for parsing.
2013-11-24 03:45:02 -05:00
Paul Smith
12a3104c3d [SV 40226] Add a new type of switch: single-string options
* main.c (struct command_switch): Change the "string" types to "strlist"
and make "string" be a single-valued string instead.
(output_sync_option, jobserver_fds, sync_mutex): Change to string type.
(decode_output_sync_flags): Handle single strings instead of lists.
(prepare_mutex_handle_string): Ditto.
(main): Ditto.
(clean_jobserver): Ditto.
(init_switches): Handle the new type.
(decode_switches): Ditto.
(define_makeflags): Ditto.
2013-11-24 03:21:40 -05:00
Daniel Richard G
7b485daffb * load.c: [SV 40515] Define RTLD_GLOBAL if not set.
Copyright-paperwork-exempt: yes
2013-11-23 22:39:39 -05: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
9d58570c77 * makeint.h (STOP_SET): [SV 40371] Cast to unsigned char.
* tests/scripts/misc/utf8: Test variable names with characters >127.
Fix suggested by Robert Bogomip <bob.bogo@milohedge.com>
2013-10-27 17:43:21 -04:00
Gerte Hoogewerf
d49ab08ae0 Fix MS Visual Studio NET2003 build.
* make_msvc_net2003.vcproj: Do not exclude guile.c from compilation.
Copyright-paperwork-exempt: Yes.
2013-10-24 21:20:36 +03:00
Christian Boos
10a4b120bd Fix SV bug #40227 with respect to stack size set for the MSVC build.
* NMakefile.template (/STACK): Increase to 0x400000, mainly for
the 64-bit builds.  Fixes SV bug #40227.
Copyright-paperwork-exempt: Yes.
(guile): Uncomment.
2013-10-23 19:56:18 +03:00
Eli Zaretskii
309768aff1 Fix the MS-Windows build: now guile.c must always be compiled in.
* build_w32.bat: Always compile guile.c and link against guile.o.
  Reported by Alexey Pavlov <alexpux@gmail.com>.

* makeint.h (guile_gmake_setup): Define prototype unconditionally,
to avoid compiler warnings.
2013-10-23 19:28:38 +03:00
Eli Zaretskii
9c28d5125d Fix Savannah bug #31150 with failures due to setting window title.
* sub_proc.c (process_begin): Don't set startInfo.lpTitle, it
reportedly causes SV bug #31150, and according to MSDN it's a
no-no.
2013-10-22 19:04:34 +03:00
Eli Zaretskii
a7794f483b Fix Savannah bug 40241 with Unixy file names as commands to MSYS shell.
* sub_proc.c: Include filedef.h and variable.h.
(process_begin): If exec_path was not found, but its first
character is '/', assume there's some shell magic, and invoke the
command through '$(SHELL) -c "COMMAND"'.  Fixes SV bug#40241.
(make_command_line): Kludgey feature: if full_exec_path is "-c",
assume that argv[0] is not to be skipped, as it holds the command
string to be passed to the shell.
2013-10-22 18:55:38 +03:00
Paul Smith
5d653b535a * glob.c (glob) [SV 18123]: Cherry-pick glibc fix
Apply commit a471e96a5352a5f0bde6d32dd36d33524811a2b1 from
git://sourceware.org/git/glibc.git to fix
https://sourceware.org/bugzilla/show_bug.cgi?id=10278
2013-10-20 13:18:50 -04:00
Paul Smith
53b4a9e668 * read.c (record_files): [SV 33034] Change fatal() to error()
Allows deprecated syntax.  However we don't guarantee this syntax
will continue to be legal in the future.
Change suggested by David Boyce <david.s.boyce@gmail.com>
2013-10-20 13:08:27 -04:00
Paul Smith
d4723d643d * README.git: Add some missing release steps. 2013-10-20 13:08:27 -04:00
Paul Smith
107ab16bf6 [SV 40240] Use configure info to build load test shared libs
* tests/config-flags.pm.in: A new file containing variable assignments
for the test suite; these variables are set by configure to contain
the values detected there for compilers, flags, etc.
* tests/run_make_tests.pl: Require the config-flags.pm file
* tests/scripts/features/load, tests/scripts/features/loadapi: Use the
configure-provided values when building the shared test library.
* configure.ac: Replace tests/config-flags.pm.in
* Makefile.am: Make sure tests/config-flags.pm is up to date
2013-10-19 15:39:15 -04:00
Paul Smith
07f2666b91 * maintMakefile (checkcfg.%): Add testing of build.sh 2013-10-19 12:25:09 -04:00
Paul Smith
f4b746b8c2 [SV 40254] Modify build.sh to work properly with Guile support.
* guile.c (guile_gmake_setup) [HAVE_GUILE]: Define a stub function
when Guile support is not enabled.
* main.c (main) [HAVE_GUILE]: Always invoke guile_gmake_setup().
* Makefile.am: Make guile.c standard, not optional.
* build.template: Add the Guile compiler and linker flags.
2013-10-19 12:24:14 -04:00
Paul Smith
d7f25cfda5 * maintMakefile: Accept variable overrides from the environment. 2013-10-19 12:09:13 -04:00
Paul Smith
b9a01a8b3b * NEWS: Fix version so we can build a distfile. 2013-10-19 12:08:04 -04:00
Paul Smith
d654bff457 * read.c (eval): Avoid GCC warning to add braces. 2013-10-19 12:07:31 -04:00
Paul Smith
74ed682c54 * GNUMAKEFLAGS: Remove -O so it passes in NO_OUTPUT_SYNC mode. 2013-10-19 12:05:58 -04:00
Christian Boos
e498e464dc Fix initialization of stringlist variables for jobserver_fds and sync_mutex.
(tiny change)

 main.c (prepare_mutex_handle_string, main): Initialize
 stringlist variables with at least 2 members, as one member is not
 currently supported.
2013-10-18 13:23:43 +03:00
Eli Zaretskii
d1d737d0fa Fix MinGW64 problem with non-compliant vsnprintf.
makeint.h (__USE_MINGW_ANSI_STDIO) [__MINGW64_VERSION_MAJOR]:
 Define for MinGW64, to force it to use an ANSI-compliant
 implementation of vsnprintf.  Reported by Christian Boos
 <cboos@edgewall.org>.
2013-10-18 13:12:22 +03:00
Eli Zaretskii
87e5b64f41 Fix the MSVC build on MS-Windows.
output.c (vsnprintf) [_MSC_VER]: Define, instead of defining
 snprintf, which isn't used.  Reported by Christian Boos
 <cboos@edgewall.org>.
 NMakefile.template (OBJS): Add load.obj and posixfcn.obj.
 ($(OUTDIR)/pathstuff.obj): New dependency.
 Suggested by Christian Boos <cboos@edgewall.org>.
2013-10-18 13:08:12 +03:00
Paul Smith
70df3c35bf [SV 40139] Modify "missing separator" for better translation 2013-10-13 16:48:23 -04:00
Paul Smith
01a745025d Add support for updating the GNU make web pages.
Add makefile rules for updating the http://www.gnu.org/software/make
web pages, including the online GNU make manual.
2013-10-13 16:48:22 -04:00
Paul Smith
4792e154b6 Convert to auto-generated ChangeLog files.
Rename existing ChangeLog files so they won't be distributed.
Add targets to maintMakefile to generate ChangeLog from the Git
repository.  This will require a version of gnulib be available.
Because ChangeLog is auto-generated, we have to switch our
automake mode to "foreign" or it will complain and fail.
2013-10-13 16:48:22 -04:00
Paul Smith
188b2a0f23 Set up for the next release. 2013-10-13 16:48:22 -04:00
Paul Smith
52191d9d61 GNU Make release 4.0. 2013-10-09 02:09:21 -04:00
Paul Smith
dc9ae5e017 [SV 39709] Fix some typos. 2013-10-09 01:53:55 -04:00
Eli Zaretskii
723e047428 Untabify posixfcn.c. 2013-10-07 19:16:11 +03:00
Eli Zaretskii
b69b04dc8c Foix compilation with MSVC.
w32/compat/posixfcn.c (tmpfile): Move declaration of h before
 the first executable statement.  Reported by Gisle Vanem <gvanem@yahoo.no>.
2013-10-07 19:14:01 +03:00
Paul Smith
b539908f73 Clean up some tests for use on Windows. 2013-10-05 19:30:48 -04:00
Paul Smith
2fb91e19a0 Sanitize the registered function interface.
Expand the characters which are legal in a function name, and check
the name for validity.  Create a type for the function pointer.
Convert the last argument from a boolean to flags, to allow for expansion.
2013-10-05 16:10:30 -04:00
Eli Zaretskii
f96c114e22 function.c (abspath): Reset root_len to one for Cygwin only when
HAVE_DOS_PATHS is defined.  Suggested by Christopher Faylor.
2013-10-03 19:02:14 +03:00
Eli Zaretskii
98197303b1 Fix tmpfile on MS-Windows.
w32/compat/posixfcn.c (tmpfile): New function, a replacement for
 the Windows libc version.
2013-10-02 19:48:21 +03:00
Eli Zaretskii
f8786092ad Fix $abspath on Cygwin when HAVE_DOS_PATHS is in effect.
function.c (IS_ABSOLUTE) [__CYGWIN__]: Special definition for Cygwin.
 (abspath) [__CYGWIN__]: Reset root_len to 1 if the absolute file name
 has the Posix /foo/bar form.
 [HAVE_DOS_PATHS]: Use root_len instead of hard-coded 2.
2013-10-02 19:39:53 +03:00
Paul Smith
1d4c15b4e1 Release GNU Make version 3.99.93. 2013-10-01 00:33:01 -04:00
Paul Smith
b1c7f0df4e Fix portability issues for Guile 1.8. 2013-09-30 10:56:20 -04:00
Paul Smith
8e12202870 Final fixes for obscure output-sync errors. 2013-09-30 00:12:36 -04:00
Paul Smith
1f4ca0539b Fixes for building with MSVC. 2013-09-30 00:12:36 -04:00
Paul Smith
d0944ee2e8 Solaris /bin/sh can't handle multiple options ("-e -c"). 2013-09-30 00:12:18 -04:00
Paul Smith
38066b6f19 Fix build failures on EMX for output-sync support. 2013-09-29 13:17:56 -04:00
Paul Smith
3bf3fde984 Portability for Guile 1.8. Force UTF-8 encoding. 2013-09-29 13:16:21 -04:00
Paul Smith
543521cd47 Reset GNUMAKEFLAGS after parsing.
If we don't do this we'll continually add flags on recursion.  This
is mainly for users to set in their environment before invoking make.
2013-09-29 13:15:00 -04:00
Paul Smith
e8122ecb5d Rename dash-w to print-directory.
Avoid conflicts with dash-W on case-insensitive filesystems.
2013-09-23 11:24:51 -04:00
Eli Zaretskii
55a0c0e414 Fix broken w32 build due to OUTPUT_SYNC -> NO_OUTPUT_SYNC inversion.
w32/compat/posixfcn.c: Fix the forgotten OUTPUT_SYNC conditional.
 job.h: Ditto, but in a comment.
2013-09-23 10:56:51 +03:00
Paul Smith
8a3436c65d Release GNU Make version 3.99.92. 2013-09-23 00:55:55 -04:00
Paul Smith
fd30db1290 [SV 31155] Parse order-only tokens in second expansion results. 2013-09-22 17:10:35 -04:00
Paul Smith
c3524b83b9 Use explicit cast between void* and pointer-to-function. 2013-09-22 17:10:35 -04:00
Paul Smith
0296e40fc7 Allow loaded objects to opt out of the "auto-rebuild" feature. 2013-09-22 17:10:35 -04:00
Paul Smith
f69922b335 Defer Guile initialization until the first $(guile...) call. 2013-09-22 17:10:35 -04:00
Paul Smith
65931ce7a9 Regression test portability to Solaris. 2013-09-22 17:10:34 -04:00
Paul Smith
1a991ada47 Add VMS port updates from Hartmut Becker. 2013-09-22 17:10:34 -04:00
Paul Smith
7e77685bc3 Portability enhancements for Mac OSX.
Don't dup stdout into stderr in the test suite.
Don't rely on $port_type eq "UNIX" to mean case-preserving.
Check against the real output of ar when creating archives.
2013-09-22 17:09:46 -04:00
Paul Smith
300d1296fb Create a target that tests alternative configurations. 2013-09-21 18:10:08 -04:00
Paul Smith
822f8dae41 Remove obsolete tests. 2013-09-21 17:41:11 -04:00
Paul Smith
d2d44f76c4 Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC 2013-09-21 17:37:59 -04:00
Paul Smith
6c3e88e60f Ensure that output generated while reading makefiles is synced. 2013-09-21 17:24:59 -04:00
Paul Smith
9cd01958da Ensure that stderr from shell functions in recipes is synced. 2013-09-21 17:08:42 -04:00
Paul Smith
4120f91846 Don't write "Entering" every time we re-exec for remake makefiles. 2013-09-21 14:24:44 -04:00
Paul Smith
30a5ee0d85 [SV 40043] Set the current directory before printing errors. 2013-09-18 19:29:28 -04:00
Eli Zaretskii
8a6205b43f Fix a typo in a comment. 2013-09-16 11:42:20 +03:00
Eli Zaretskii
bc120f27bd Avoid compiler warnings in output.c on MS-Windows.
output.c [WINDOWS32]: Include windows.h and sub_proc.h, to avoid
 compiler warnings for CLOSE_ON_EXEC.
2013-09-16 11:30:01 +03:00
Paul Smith
5c0fba7240 Release GNU Make version 3.99.91. 2013-09-16 00:30:01 -04:00
Paul Smith
fa0f2c516a Small cleanup defining MAKEFLAGS. 2013-09-16 00:12:09 -04:00
Paul Smith
20ecc58126 [SV 31326] Enhance the info on static pattern errors. 2013-09-15 17:53:30 -04:00
Paul Smith
1b90248893 [SV 27374] Fatal immediately on unrecoverable fopen() errors. 2013-09-15 17:09:01 -04:00
Paul Smith
a4d8444b59 [SV 39934] Verify jobserver FDs before something else uses them. 2013-09-15 15:21:33 -04:00
Paul Smith
0a81d50d66 [SV 39203] Don't set MAKEFLAGS when restarting.
We are restarting with the original command line flags, so if we set
MAKEFLAGS as well that will cause double flags.
2013-09-15 13:30:21 -04:00
Paul Smith
3aa2aa7e82 [SV 35248] Add --debug "n" flag to turn off current debug options. 2013-09-14 21:01:10 -04:00
Paul Smith
29a94ceb76 [SV 33134] Don't try to close stdout when it's already closed. 2013-09-14 20:40:30 -04:00
Petr Machata
ab78cbc71c [SV 39851] Reinstate stack size limit for processes spawned via $(shell) 2013-09-14 20:38:06 -04:00
Paul Smith
c5bfa40044 Support the -Orecurse option properly.
In this mode we still collect all the output from a given target and
dump it at once.  However we don't treat recursive lines any differently
from non-recursive lines.  Also we don't print enter/leave messages
after every dump.  However we do ensure that we always print them once
to stdout, so the parent make will collect it properly.
2013-09-14 01:04:04 -04:00
Paul Smith
deff9dacc9 Enhance the output sync mode.
Create a new file, output.c, and collect functions that generate output there.
We introduce a new global context specifying where output should go (to stdout
or to a sync file), and the lowest level output generator chooses where to
write output based on that context.

This allows us to set the context globally, and all operations that write
output (including functions like $(info ...) etc.) will use it.

Removed the "--trace=dir" capability.  It was too confusing.  If you have
directory tracking enabled then output sync will print the enter/leave message
for each synchronized block.  If you don't want that, disable directory
tracking.
2013-09-12 04:07:52 -04:00
Paul Smith
40a49f244d [Bug #39310] Parse simple pattern prereqs for globbing.
We tried to get some efficiency by avoiding a parse_file_seq() for simple
pattern prerequisites, but this also means no wildcard expansion was
happening, so add it back.  Add regression tests for wildcards in target and
prerequisite lists.
2013-07-22 02:23:02 -04:00
Paul Smith
87ac68fe79 [Bug #39158] Source cleanups suggested by cppcheck utility. 2013-07-21 17:52:13 -04:00
Paul Smith
72462ef1e1 Safety cleanups: ensure OUTFD is -1 when closed. 2013-07-21 16:56:00 -04:00
Paul Smith
f80222c15b Notify the compiler that exec_command() won't return. 2013-07-14 19:18:46 -04:00
Paul Smith
4b81f5ca92 Modify the update_status field in struct file to be an enum.
Makes the code a little clearer/cleaner, and solves a problem on systems
where a char is unsigned by default.
2013-07-14 19:18:21 -04:00
Paul Smith
5601726151 Keep a local count of the max dependency list size.
This global variable could be modified during recursion so keep our
own local copy to compare against.
2013-07-09 19:14:40 -04:00
Paul Smith
9453a7451d Set O_APPEND mode for stdout/stderr and output-sync temporary files.
POSIX does not guarantee that writes will be atomic if a file is
opened for normal (non-append) output.  That means if multiple processes
are writing to the same file, output could be lost.  I can't think of
a real use-case where we would NOT want append for stdout/stderr, so
force it if we can.
2013-06-28 21:57:59 -04:00
Eli Zaretskii
5e7bf7c554 Minor fix in build_w32.bat.
build_w32.bat (LinkGCC): Prevent a comment from being displayed
 at build time.
2013-06-22 17:32:46 +03:00
Eli Zaretskii
138d020e1b Compare internal commands of non-Unix shells on Windows case-insensitively.
job.c (construct_command_argv_internal) [WINDOWS32]: Use
 case-insensitive comparison with internal commands of non-Unix
 shells.
2013-06-22 16:22:25 +03:00
Eli Zaretskii
5b65c5b916 Fix a fatal error at startup on Windows due to non-ASCII characters in PATH.
main.c (find_and_set_default_shell): Don't use file_exists_p or
 dir_file_exists_p, as those call readdir, which can fail if PATH
 includes directories with non-ASCII characters, and that would
 cause Make to fail at startup with confusing diagnostics.  See
 https://sourceforge.net/mailarchive/message.php?msg_id=30846737
 for the details.
2013-06-22 16:16:56 +03: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
bee4d93a59 Disable database verification unless debug enabled.
The database verification can take a long time.  Only enable it if debug mode
is enabled.  If MAKE_MAINTAINER_MODE is set, it's also enabled by default.
2013-06-21 23:59:38 -04:00
Paul Smith
353fcfdb30 Add job.h to POTFILES as it now has a translation. 2013-06-21 21:57:35 -04:00
Paul Smith
d4043519f7 Cleanups. 2013-05-27 13:52:15 -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
e8f5d322cf Porting to VMS, from Hartmut Becker. 2013-05-27 13:01:48 -04:00
Paul Smith
dc922e3f4c [SV #38442] Add library names to the string cache. 2013-05-26 16:53:17 -04:00
Paul Smith
c11024b3b3 [SV #38945] Copy the entire buffer back when overwriting CR 2013-05-26 14:41:45 -04:00
Paul Smith
2fc0f614be [SV #39028] Fix some small typos in messages. 2013-05-26 14:06:25 -04:00
Paul Smith
bf60bbd67a [SV #39035] Compare OUT to the beginning of the OUT var/func, not IN. 2013-05-26 13:56:51 -04:00
Paul Smith
d2eaed1f0a Add dates to the NEWS file to make things simpler. 2013-05-26 13:53:21 -04:00
Paul Smith
8ab3564a71 Fix regression tests after MAKEFLAGS enhancements. 2013-05-22 07:51:46 -04:00
Paul Smith
ecf307bb0b Force version printing whenever we print the database. 2013-05-22 02:51:45 -04:00
Paul Smith
a674abe702 Make MFLAGS and MAKEFLAGS more reliable and predictable.
Ensure all simple flags are kept in the initial batch of flags.
Do not allow any flags with options in that batch.
If there are only non-simple flags ensure MAKEFLAGS begins with " ".
Don't let MFLAGS start with "- ".
2013-05-22 02:14:19 -04:00
Alexey Pavlov
80183457ad Fix the MS-Windows build using the Posix configury.
w32/Makefile.am (libw32_a_SOURCES): Add compat/posixfcn.c.

 configure.ac (OUTPUT_SYNC): Define for mingw32 target.
2013-05-18 17:58:10 +03:00
Eli Zaretskii
cece7ad61f Support "move" as internal shell command on Windows with cmd.exe.
job.c (construct_command_argv_internal) <sh_cmds_dos> [WINDOWS32]: Add
 "move".  Fixes Savannah bug #30714.
2013-05-18 14:07:36 +03:00
Eli Zaretskii
943c06de47 Fix MS-Windows build with Guile.
guile.c: Move inclusion of makeint.h before gnumake.h.  This
 order must be observed when building Make, because gnumake.h must
 be included with GMK_BUILDING_MAKE defined, which makeint.h
 already does.  Otherwise, the linker will look for, and fail to
 find, gmk_* functions in some external dynamic library.
2013-05-18 14:03:26 +03:00
Eli Zaretskii
171eb41908 Fix MS-Windows compilation when OUTPUT_SYNC is not defined.
main.c (prepare_mutex_handle_string): Define conditioned on OUTPUT_SYNC.
2013-05-17 16:24:13 +03:00
Eli Zaretskii
9babfe49a5 Fix a bug in build_w32.bat when building a released tarball.
build_w32.bat: Copy config.h.W32 to config.h regardless of
 whether or not we are building from SCM.
2013-05-17 13:34:24 +03:00
Paul Smith
b16852a77f Update for GNU make release candidate 3.99.90. 2013-05-17 02:40:37 -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
398058a873 Use xcalloc() in hash.c to handle out of memory errors. 2013-05-17 01:24:19 -04:00
Paul Smith
b730fbc6b8 Remove the dlopen() pointer from struct filedef.
This pointer is almost never needed, and it increases the size of the filedef
struct for all files (of which there are a huge number for large builds).
Instead keep a bit field marking whether the file is a loaded object and if so
call a new function to unload it.  In load.c we keep a simple linked list of
loaded objects (of which there will be very few typically) and their dlopen()
pointers.
2013-05-17 01:20:39 -04:00
Paul Smith
c21c1455fd Add requirement for plugin_is_GPL_compatible symbol in loaded objects. 2013-05-14 22:53: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
c7732bd5ad Add a new variable: GNUMAKEFLAGS
This allows you to write portable makefiles that set GNU make-specific command
line options in the environment or makefile: add them to GNUMAKEFLAGS instead
of MAKEFLAGS and they will be seen by GNU make but ignored by other
implementations of make.
2013-05-13 02:48:18 -04:00
Paul Smith
2627d83221 Use level o_env_override for MAKEFLAGS so it's reset even with -e.
Fixes Savannah bug #2216.
2013-05-13 02:30:14 -04:00
Paul Smith
381baeef7a Add new --trace[=MODE] flags, with --trace=dir
This mode replaces the previous heuristic setting enabled with -O, where we
would log directory enter/leave for each synchronized output.  Now we only
do that if --trace=dir is given.
2013-05-13 01:30:24 -04:00
Eli Zaretskii
5367d393dd Avoid printing stdout and stderr messages without a newline between them.
job.c (child_out): Output the newline following the message
 before fllush-ing the stream.  Avoids displaying the following
 failure message, which goes to stderr, on the same line.
2013-05-11 17:42:56 +03:00
Eli Zaretskii
f0529daced Rearrange dllimport/dllexport declarations for MS-Windows.
gnumake.h (GMK_EXPORT) [_WIN32]: Move the dllexport declaration
 here from makeint.h.
 makeint.h (GMK_BUILDING_MAKE) [WINDOWS32]: Define before
 including gnumake.h.
2013-05-06 20:18:58 +03:00
Eli Zaretskii
a668c520b2 doc/make.texi (Loaded Object Example): Add a note about building
shared objects on MS-Windows.
2013-05-06 20:16:40 +03:00
Stefano Lattarini
c8bf04e141 build: enable 'subdir-objects' and 'silent-rules' automake options
On 04/30/2013 05:11 PM, Stefano Lattarini wrote:
> * configure.ac (AM_INIT_AUTOMAKE): Here.  The future major Automake
> version 2.0 (ETA about one, one and half year from now) will likely
> enable them by default, so better prepare ourselves.
>
Please drop this patch.  Enabling 'subdir-objects' would require
sublter changes to several other parts of the build system that I
don't know how to test properly.  We should only enable the
'silent-rules' option for the moment.  The updated patch below
does this.

Sorry for the noise,
  Stefano

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

>From 46623411f017a447caa8fe75b3b42ec2fbeac458 Mon Sep 17 00:00:00 2001
Message-Id: <46623411f017a447caa8fe75b3b42ec2fbeac458.1367335124.git.stefano.lattarini@gmail.com>
From: Stefano Lattarini <stefano.lattarini@gmail.com>
Date: Tue, 30 Apr 2013 16:30:04 +0200
Subject: [PATCH] build: enable the 'silent-rules' automake options

* configure.ac (AM_INIT_AUTOMAKE): Here.  The future major Automake
version 2.0 (ETA about one, one and half year from now) will enable
it by default, so better prepare ourselves.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-06 00:30:19 -04:00
Stefano Lattarini
0a56034aac build: require Autoconf >= 2.62 and Automake >= 1.11.1
Older versions of those tools should be considered fully obsolete.
Also, GNU make already requires Gettext >= 0.18.1, which has been
released six months after Automake 1.11.1 and two years after
Autoconf 2.62; so the new requirement shouldn't be problematic
for people already bootstrapping GNU make from the Git repository.

* configure.ac (AC_PREREQ): Require Autoconf 2.62 or later.
(AM_INIT_AUTOMAKE): Require Automake 1.11.1 or later (1.11 had
some serious bugs, and should not be used).

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-06 00:26:29 -04:00
Paul Smith
94735f0ad7 Remove use of vfork().
GCC was giving us warnings, most OS's now just run fork() when you call
vfork(), and looking at the standard definition of vfork() we are a long way
from using it safely anyway: you're not allowed to even call a function before
you exec().
2013-05-06 00:22:27 -04:00
Stefano Lattarini
7c77486d1f docs: port manual to Texinfo 5.x
* doc/make.texi: Here.  It was sufficient to change an '@itemx'
into an '@item'.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 20:51:05 -04:00
Stefano Lattarini
13f13b96b3 cosmetics: fix few innocuous typos
Most of these were found using Lucas De Marchi's 'codespell' tool.

* ChangeLog: Fix minor typos.
* ChangeLog.2: Likewise.
* README.Amiga: Likewise.
* TODO.private: Likewise.
* function.c: Likewise.
* glob/glob.h: Likewise.
* job.c: Likewise.
* main.c: Likewise.
* readme.vms: Likewise.
* remake.c: Likewise.
* tests/ChangeLog: Likewise.
* tests/NEWS: Likewise.
* tests/README: Likewise.
* tests/scripts/variables/private: Likewise.
* vmsdir.h: Likewise.
* signame.c: Likewise.  While at it, improve line wrapping in the
touched comment.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 20:50:37 -04:00
Stefano Lattarini
c3cd78066c build: get rid of 'HAVE_ANSI_COMPILER' C preprocessor conditional
GNU make already assume C89 or later throughout the codebase, and
that preprocessor conditional was no longer used anyway.

* configure.ac: Remove AC_DEFINE of HAVE_ANSI_COMPILER.
* config.ami.template: Remove #define of HAVE_ANSI_COMPILER.
* config.h-vms.template: Likewise.
* config.h.W32.template: Likewise.
* configh.dos.template: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 20:45:44 -04:00
Paul Smith
15f7957939 Rename the -O "job" mode to "line" and "make" to "recurse". 2013-05-05 20:19:00 -04:00
Paul Smith
1d992d8fe7 Ensure command lines are written synchronously with -O.
If output-sync is enabled, have make write the command line to the temp file
instead of printing it directly to the screen to ensure that the output is
ordered properly.  Also, remove extraneous enter/leave operations by having
them printed directly when dumping temp file output.
2013-05-05 17:03:51 -04:00
Paul Smith
3484c9675a Add memory allocation cleanup to loadable objects.
Add gmk_alloc() and gmk_free() functions so loadable objects can access our
memory model.  Also provide a more extensive example in the manual.
2013-05-04 17:38:53 -04:00
Paul Smith
a0c5d0c63f Don't pump output to the descriptor, as we use FILE* elsewhere. 2013-05-04 17:31:20 -04:00
Eli Zaretskii
64dd61bcb8 Minor portabiulity fixes for MS-Windows.
makeint.h (ftruncate) [_MSC_VER]: Redirect to _chsize.
 (_S_ISDIR): If not defined (MinGW64), define to S_ISDIR.
2013-05-04 21:03:55 +03:00
Paul Smith
75336026ae Merge branch 'master' of git.savannah.gnu.org:/srv/git/make 2013-05-04 13:14:39 -04:00
Paul Smith
b8467292c9 Improve sync handling for -Ojob/-Otarget and recursion.
If we are not going to sync a command line then dump any collected output
first to preserve ordering.  Do some code cleanup:
  * Move the handle init to a separate function.
  * Move the temp file truncation to the output function.
  * Remember whether we sync in a variable for readability.
  * Handle EINTR and short writes in child_out().
  * Always call sync_output() in case output_sync was changed due to error.
2013-05-04 13:10:56 -04:00
Eli Zaretskii
e44c51ce41 Fix a typo in the manual. 2013-05-04 17:19:56 +03:00
Eli Zaretskii
cb2be0db36 Fix a possibly confusing comment at end of pump_from_tmp_fd. 2013-05-04 10:56:32 +03:00
Eli Zaretskii
01bad6f73a Fix the MS-Windows branch of output_sync code.
job.c (start_job_command): Make the condition for creating a
 temporary output file be identical to the Posix code branch.
 Suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
2013-05-04 10:41:11 +03:00
Eli Zaretskii
82793f85f5 Fix invocation of Windows batch files with whitespace in their names.
w32/subproc/sub_proc.c: Include makeint.h.  Remove a private
 incompatible prototype of xmalloc.
 (batch_file_with_spaces): New function, detects Windows batch
 files whose names include whitespace characters.
 (process_begin): If exec_name is a batch file with whitespace
 characters in its name, pass NULL as the first argument to
 CreateProcess.  This avoids weird failures due to buggy quoting by
 CreateProcess.  For the details, see the discussion starting at
 http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
2013-05-03 16:24:24 +03:00
Eli Zaretskii
a66469e003 Fix interfacing with and remaking dynamic objects on MS-Windows.
load.c (load_object, load_file): Accept an additional argument
 DLP and return in it a pointer that can be used to unload the
 dynamic object.
 read.c (eval): Call load_file with an additional argument, and
 record the pointer returned there in the 'struct file' object of
 dynamic objects in that object's 'struct file'.
 commands.c (execute_file_commands): Unload dynamic objects
 before remaking them, to avoid failure to remake if the OS doesn't
 allow overwriting objects that are in use.
 filedef.h (struct file): New member dlopen_ptr.
 gnumake.h (GMK_EXPORT): Define to dllexport/dllimport
 decorations for Windows and to nothing on other platforms.
 (gmk_eval, gmk_expand, gmk_add_function): Add GMK_EXPORT qualifier
 to prototypes.
 makeint.h (MAIN): Define before including gnumake.h, to give
 correct dllexport decorations to exported functions.
 (load_file): Adjust prototype.
 loadapi.c: Don't include gnumake.h, since makeint.h already
 includes it, and takes care of defining MAIN before doing so.
 build_w32.bat (LinkGCC): Produce an import library for functions
 exported by Make for loadable dynamic objects.

 w32/compat/posixfcn.c (dlclose): New function.
 w32/include/dlfcn.h (dlclose): Add prototype.

 scripts/features/load: Fix signatures of testload_gmk_setup and
 explicit_setup, to bring them in line with the documentation.
2013-05-03 16:09:12 +03:00
Eli Zaretskii
b5ea49bae7 Mention in NEWS change on Windows with quotes in command lines. 2013-05-01 18:41:14 +03:00
Eli Zaretskii
2926f7b466 Fix treatment of whitespace after a backslash on MS-Windows.
job.c (construct_command_argv_internal): Don't treat a backslash as an
 escape character before whitespace, if the shell is not a Posix
 shell.   For the description of the problem, see
 http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
2013-05-01 18:31:53 +03:00
Eli Zaretskii
a87ff20158 job.c (start_job_command) [WINDOWS32]: Make the same fix for
MS-Windows as the previous commit did for Posix platforms.
2013-05-01 18:15:16 +03:00
Paul Smith
9acb657eb1 Don't synchronize output for recursive make unless -Omake 2013-05-01 07:59:24 -04:00
Eli Zaretskii
19a69bafc0 Support dynamic object loading on MS-Windows.
w32/include/dlfcn.h: New file.
 w32/compat/posixfcn.c: Include dlfcn.h.
 (dlopen, dlerror, dlsym) [MAKE_LOAD]: New functions, in support of
 dynamic loading.

 config.h.W32.template (MAKE_LOAD): Define.
 load.c (load_object) [HAVE_DOS_PATHS]: Support backslashes and
 drive letters in file names of dynamic objects.
2013-04-29 19:26:06 +03:00
Eli Zaretskii
9a7fe22b19 Fix the .ONESHELL operation on MS-Windows.
job.c (construct_command_argv_internal) [WINDOWS32]: Return
 right after generating new_argv for one_shell case.  This fixes
 the Windows build for both Unixy shell and stock Windows shells.
2013-04-29 19:17:07 +03:00
Paul Smith
9253a34a57 Merge branch 'master' of git.savannah.gnu.org:/srv/git/make 2013-04-28 19:25:24 -04:00
Paul Smith
f88eb23b02 Ensure error messages are printed with sync'd output.
Enhance the child_error() function so that it will write error output to the
child's sync output buffer, if it exists.  If it doesn't the output goes to
stdout/stderr.
2013-04-28 19:09:20 -04:00
Paul Smith
441b643355 Remove support for pre-ANSI variadic function calls.
We've required support for ANSI C (ISO C 89) or better for quite a while.  Get
rid of the old varags.h, doprnt() stuff and simply assume ANSI C variadic
function capability and basic C runtime library support (vfprintf, vsprintf,
etc.)
2013-04-28 17:59:28 -04:00
Paul Smith
8b034b7d18 Small cleanups and fixes. 2013-04-28 17:31:46 -04:00
Eli Zaretskii
5667376edc Fix Savannah bug #37065 with $(wildcard foo/*/.) returning non-directories.
dir.c (local_stat) [WINDOWS32]: Use the wrapper on MS-Windows.
 If the argument ends in "dir/.", make sure the parent dir exists
 and is indeed a directory.  Fixes Savannah bug #37065.
2013-04-28 20:53:36 +03:00
Paul Smith
93843ccd08 Fix a few compiler warnings found by Eli. 2013-04-28 01:41:47 -04:00
Paul Smith
7f01830927 Add support for per-job output sync.
A new flag to the -O/--output-sync, "job", selects a per-job (that is, per
line of a recipe) output synchronization.  To support this move the close of
the temp file out of the sync_output() function and don't do it until we free
the child, since we may call sync_output() multiple times in a given recipe.
When we set up for a new temp file, if we're in per-job mode we truncate the
file and seek to the beginning to re-use it for every job.
2013-04-28 01:19:19 -04:00
Paul Smith
30843dea3a Fix support for .ONESHELL when dealing with non-POSIX shells. 2013-04-27 17:28:05 -04:00
Paul Smith
14d7654551 Rework the implementation of load.c to increase portability.
It should be sufficient, now, to write a new version of the load_object()
function.  That function won't be called unless we really want to load, so all
checking and parsing is taken care of before that.
2013-04-27 16:57:05 -04:00
Paul Smith
054d6d91e7 Merge branch 'master' of git.savannah.gnu.org:/srv/git/make 2013-04-27 16:24:08 -04:00
Eli Zaretskii
e56aad4061 Support .ONESHELL on MS-Windows, for default Windows shells.
read.c (record_files): Pay attention to .ONESHELL in MS-Windows.
 job.c (construct_command_argv_internal): Support .ONESHELL on
 MS-Windows, when the shell is not a Unixy shell.
2013-04-27 19:12:01 +03:00
Eli Zaretskii
049f8e88fc job.c: Fix compilation error on GNU/Linux due to "label at end of compound statement". 2013-04-27 14:30:01 +03:00
Eli Zaretskii
da7df54309 Support --output-sync on MS-Windows.
w32/compat/posixfcn.c: New file, with emulations of Posix
 functions and Posix functionality for MS-Windows.
 w32/subproc/sub_proc.c: Include io.h.
 (process_noinherit): New function, forces a file descriptor to not
 be inherited by child processes.
 (process_easy): Accept two additional arguments, and use them to
 set up the standard output and standard error handles of the child
 process.
 w32/include/sub_proc.h (process_easy): Adjust prototype.
 (process_noinherit): Add prototype.

 read.c [WINDOWS32]: Include windows.h and sub_proc.h.
 makeint.h (LOCALEDIR) [WINDOWS32}: Define to NULL if not
 defined.  This is needed because the MS-Windows build doesn't have
 a canonical place for LOCALEDIR.
 (WIN32_LEAN_AND_MEAN) [WINDOWS32]: Define, to avoid getting from
 windows.h header too much stuff that could conflict with the code.
 main.c <sync_mutex>: New static variable.
 <switches>: Add support for "--sync-mutex" switch.
 (decode_output_sync_flags): Decode the --sync-mutex= switch.
 (prepare_mutex_handle_string) [WINDOWS32]: New function.
 (main): Add "output-sync" to .FEATURES.
 job.h (CLOSE_ON_EXEC) [WINDOWS32]: Define to call
 process_noinherit.
 (F_GETFD, F_SETLKW, F_WRLCK, F_UNLCK, struct flock) [WINDOWS32]:
 New macros.
 (RECORD_SYNC_MUTEX): New macro, a no-op for Posix platforms.
 (sync_handle_t): New typedef.
 job.c <sync_handle>: Change type to sync_handle_t.
 (FD_NOT_EMPTY): Seek to the file's end.  Suggested by Frank
 Heckenbach <f.heckenbach@fh-soft.de>.
 (pump_from_tmp_fd) [WINDOWS32]: Switch to_fd to binary mode for
 the duration of this function, and then change back before
 returning.
 (start_job_command) [WINDOWS32]: Support output_sync mode on
 MS-Windows.  Use a system-wide mutex instead of locking
 stdout/stderr.  Call process_easy with two additional arguments:
 child->outfd and child->errfd.
 (exec_command) [WINDOWS32]: Pass two additional arguments, both
 -1, to process_easy, to adjust for the changed function signature.
 function.c (windows32_openpipe) [WINDOWS32]: This function now
 returns an int, which is -1 if it fails and zero otherwise.  It
 also calls 'error' instead of 'fatal', to avoid exiting
 prematurely.
 (func_shell_base) [WINDOWS32]: Call perror_with_name if
 windows32_openpipe fails, now that it always returns.  This avoids
 a compiler warning that error_prefix is not used in the MS-Windows
 build.
 config.h.W32.template (OUTPUT_SYNC): Define.
 build_w32.bat: Add w32/compat/posixfcn.c to compilation and
 linking commands.

 From Frank Heckenbach <f.heckenbach@fh-soft.de>:
 job.c (sync_output): Don't discard the output if
 acquire_semaphore fails; instead, dump the output unsynchronized.
2013-04-27 14:20:49 +03:00
Eli Zaretskii
f3a4b4ce6f Improve MS-Windows build scripts.
build_w32.bat: Improve.  Remove 'setlocal', as it isn't
 supported on Windows 9X.  Add --help and usage instructions.
 Support both debug and optimized builds with GCC under --debug.
 If building out of Git repo, always produce config.h, and edit
 gmk-default.scm into gmk-default.h.
 w32/subproc/build.bat: Support debug and optimized builds with
 GCC.
2013-04-25 20:41:53 +03:00
Stefano Lattarini
0daa9d37c4 Reflect the 'configure.in' -> 'configure.ac' rename throughout
In README, code comments, and auxiliary files.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-04-21 19:21:43 -04:00
Paul Smith
50e2cb1b1a Some cleanups for Windows builds after the output-sync option.
Note currently output-sync is not supported on Windows.
2013-04-16 19:51:29 -04:00
Paul Smith
330d97a9ba Cleanup some source and fix autoconf warnings. 2013-04-16 01:47:05 -04:00
Paul Smith
b5d017c624 Create an open_tmpfd() function to return temp files by FD. Use it. 2013-04-16 01:03:59 -04:00
Paul Smith
79e9347892 Save the output from the entire recipe, not per-job. 2013-04-15 19:17:19 -04:00
Paul Smith
2bd957a89d Change the arg option for -O from numeric to string. 2013-04-15 13:22:51 -04:00
Paul Smith
7f7e6f80c5 Modify output-sync tests to be more reliable. 2013-04-15 10:33:42 -04:00
Paul Smith
af87d56157 Handle test timeouts in a more understandable way. 2013-04-14 19:11:47 -04:00
Paul Smith
4bf3c33f83 Rename the "parallel-sync" option to "output-sync". 2013-04-14 16:31:18 -04:00
Frank Heckenbach
cb64352c75 Initial patch for output synchronization. See Savannah bug #33138.
Based on work by David Boyce <David.S.Boyce@gmail.com>.
2013-04-14 15:38:07 -04:00
Paul Smith
6a52395ed1 Clarify LDFLAGS vs. LDLIBS. Fixes Savannah bug #37970. 2013-04-06 10:51:57 -04:00
Paul Smith
29cd1e9699 Reconsider targets waiting for prerequisites. Fixes Savannah bug #37703. 2013-04-06 10:29:20 -04:00
Paul Smith
450b7e1a3d Use ENULLLOOP to handle EINTR during realpath(). Fixes Savannah bug #38420 2013-02-28 00:55:15 -05:00
Paul Smith
5058a94ee7 Expand the loadable object support.
Provide a simple API for loaded objects to interact with GNU make.  I still
won't guarantee that this API won't change but it's much closer to something
that's supported and provides easy-to-use interfaces with a public header
file.
2013-02-25 01:38:36 -05:00
Paul Smith
4baf9ab456 Adding new file. 2013-01-20 16:36:28 -05:00
Paul Smith
ac1c6b404a Create externally referencable header file "gnumake.h".
Move the gmk_floc type to gnumake.h.
2013-01-20 13:39:54 -05: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
b70aa3709e Allow dynamically loaded objects to be rebuilt by make. 2013-01-20 00:55:57 -05:00
Paul Smith
8e0a5645b8 Add more documentation on Git workflow and rules. 2013-01-19 17:11:23 -05:00
Eli Zaretskii
7899c6f383 Fix a typo in ChangeLog. 2013-01-18 18:02:16 +02:00
Paul Smith
6ca41d9b17 [SV #37878] Add a check for targets with parens that are not archives. 2013-01-13 12:40:13 -05:00
Paul Smith
686a74bfb2 [SV #38051] Recover all MAKEFLAGS after makefile rebuild step is complete.
Patch suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
2013-01-13 12:21:01 -05:00
Paul Smith
ca17e5538f Add ChangeLog entries for Git migration. 2013-01-13 12:17:03 -05:00
Paul Smith
5c69b3fe53 Change configure.in to configure.ac, and other Git fixes. 2013-01-12 22:38:17 -05:00
Paul Smith
1d298acf9d Ensure parallel test works properly. 2013-01-12 21:54:41 -05:00
Paul Smith
5a5a1aff6a Fix clean rules. 2013-01-12 21:53:15 -05:00
Paul Smith
002702c89c Modify instructions, etc. for Git support. 2013-01-12 19:31:13 -05:00
Paul Smith
a3bd466e25 Modify .gitignore for proper formatting. 2013-01-12 17:56:25 -05:00
Paul Smith
97fe6e7dd1 Rename CVS ignore files to .gitignore 2013-01-12 17:48:58 -05:00
Paul Smith
85f9f6985d Add missing load.c file to POTFILES.in 2013-01-06 15:37:07 +00:00
Eli Zaretskii
0d12b1a207 job.c (create_batch_file): Fix last change: always increment the
counter of batch files before trying to use it.
2012-12-08 10:26:36 +00:00
Eli Zaretskii
299f5faf93 job.c (construct_command_argv_internal): Remove " from
sh_chars_dos[].  Ignore an escaped backslash inside a string
 quoted with "..".  This lifts the 4KB or 8KB command-line length
 limitation imposed by the Windows shell when a command uses quoted
 strings, because we now don't call the shell in that case.
2012-12-07 14:23:39 +00:00
Eli Zaretskii
0d5d963bcf job.c (reap_children): Add debug message for when removal of a temporary
batch file fails.
2012-12-07 14:13:16 +00:00
Eli Zaretskii
715927552f Avoid leaving temporary batch files in the temporary directory.
job.c (create_batch_file): Declare the counter of batch files
 static, to avoid having 2 jobs using the same file name and
 stepping on each other's toes.  When all 64K names are used up,
 make one more loop looking for slots that became vacant.  This
 avoids leaving behind temporary batch files in the temporary
 directory, which happens frequently on a fast machine when using
 parallel builds.
2012-12-07 14:11:15 +00:00
Paul Smith
7670c84f77 Implement new "load" directive.
Provides support for dynamically loadable objects in GNU make, as a
"technology preview".
2012-10-29 07:05:21 +00:00
Paul Smith
2efd6b47bf Rearrange elements to reduce struct size on 64bit architectures. 2012-10-28 14:57:49 +00:00
Paul Smith
ca8885d5be Remove extraneous close(). 2012-10-28 14:56:28 +00:00
Paul Smith
3a285e342e Update the required version of gettext to get new bugfix macros. 2012-09-30 03:20:50 +00:00
Paul Smith
f263ff4ce9 Define _GNU_SOURCE before testing for bsd_signal.
Fixes Savannah bug #32247
2012-09-10 03:05:49 +00:00
Paul Smith
fbe5b2c9cd Force intermediate targets to be considered if their non-intermediate
parent needs to be remade.  Fixes Savannah bug #30653.
2012-09-10 02:36:05 +00:00
Paul Smith
a94b0b0ea5 Keep the command line on the heap to avoid stack overflow.
Fixes Savannah bug #36451.
2012-09-09 23:25:07 +00:00
Paul Smith
b9c4a38022 On BSD, realpath(3) doesn't fail if the target doesn't exist, so test
explicitly with stat(2).  Fixes Savannah bug #35919.
2012-09-09 23:14:55 +00:00
Paul Smith
90ee335724 Get error messages in the C locale for comparision with make output.
Fixes Savannah bug #35764.
2012-09-09 22:52:50 +00:00
Paul Smith
7d3743dfdc Verify that backslashes before non-special characters are preserved. 2012-09-09 22:37:13 +00:00
Paul Smith
a839588fc9 Save the variable buffer content, not a potentially old pointer to it.
Fixes Savannah bug #36925.
2012-09-09 21:56:55 +00:00
Paul Smith
8a0d46468a Fix stupid wrong-pointer error handling target vars containing semicolons.
Fixes Savannah bug #36106.
2012-09-09 21:31:20 +00:00
Paul Smith
bc578b6c8e Ignore UTF-8 BOMs. See Savannah bug #36529. 2012-09-09 21:11:00 +00:00
Eli Zaretskii
1820908804 read.c (unescape_char): Fix a thinko in the last change. 2012-09-09 20:33:58 +00:00
Paul Smith
145661a541 Savannah bug #37179: Use alternate shared library syntax for MacOS. 2012-09-09 20:14:09 +00:00
Paul Smith
a95dc485fa Break out of an infinite loop if we're not making progress. 2012-09-09 20:06:03 +00:00
Paul Smith
30b2e4207d When .POSIX: is specified use POSIX-standard macro values by default. 2012-09-09 19:19:15 +00:00
Eli Zaretskii
7f5309ebb4 Update README.W32.template for Guile and job-server support. 2012-09-01 07:58:14 +00:00
Eli Zaretskii
6cb5be7813 Fix unescape_char when not unescaping.
read.c (unescape_char): Advance 'p' after copying the unescaped
 characters.  Otherwise the backslashes are incorrectly erased from
 the original string.
2012-09-01 07:52:54 +00: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
cf1c79c9a3 Improve handling for escaped colons in prerequisite lists.
Fixes Savannah bug #12126 and bug #16545
2012-03-04 16:53:50 +00:00
Paul Smith
76827d7c10 Create a new CSTRLEN (constant string length) macro, and use it. 2012-03-04 08:58:44 +00:00
Paul Smith
eb632d7676 Ensure appending private variables in pattern-specific target variables.
Fixes Savannah bug #35468.
2012-03-04 08:09:09 +00:00
Paul Smith
fdb5fcc28d Support nanosecond timestamps in stat() for AIX 5.2+.
Fixes Savannah bug #32485
2012-03-04 00:35:28 +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
405c89ba1e Ensure that .ONESHELL works with .SHELLFLAGS options containing whitespace.
See Savannah bug #35397.
2012-03-03 22:56:20 +00:00
Paul Smith
a77c5c0910 Fix Savannah bug #35410: handle escape chars in filter/filter-out
Also add a valgrind suppression file for Guile-enabled make.
2012-03-03 22:12:46 +00:00
Paul Smith
88f1bc8b55 Modify backslash/newline handling for POSIX.
We fixed Savannah 16670 but that broke previously-working makefiles
that relied on the GNU make behavior.  The POSIX behavior doesn't
seem to me to be better, and can be obtained using GNU make as well,
so put it back as the default behavior and require .POSIX to
get the POSIX behavior.
Add a new section to the manual discussing backslash/newline handling.
Update the test suite.
2012-03-03 18:45:08 +00:00
Paul Smith
6405534814 Check for possible buffer overflow on very long filenames.
Fixes Savannah bug #35525
2012-02-26 21:34:51 +00:00
Eli Zaretskii
c0751bd3fc Ifdef away unused w32 functions.
w32/subproc/sub_proc.c (proc_stdin_thread, proc_stdout_thread)
 (proc_stderr_thread, process_pipe_io): Ifdef away unused
 functions.
2012-02-03 12:16:57 +00:00
Eli Zaretskii
1befa76448 Fix Savannah bug #34832 with unused TLS attributes.
w32/subproc/w32err.c (map_windows32_error_to_string) [_MSC_VER]:
 Don't use TLS storage for szMessageBuffer.  Ifdef away special
 code for handling Winsock error codes.  Make the function return a
 `const char *'.  Suggested by Ozkan Sezer.  Fixes Savannah bug #34832.
2012-02-03 12:15:56 +00:00
Paul Smith
e3b394f3f0 Map Guile variable objects to the empty string.
In Guile 2.0, (define ...) results in a variable object.  Ensure make
converts that to an empty string to avoid spurious errors.
2012-01-30 01:40:56 +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
fca11f6039 Create a new function $(file ...) 2012-01-29 18:12:22 +00:00
Paul Smith
d6e1c6e6c5 Guile portability
Don't support Guile 1.6 and use a portable test for printable strings.
2012-01-29 16:30:12 +00:00
Eli Zaretskii
aa07c06387 config.h.W32.template: Update from config.h.in. 2012-01-28 21:59:26 +00:00
Eli Zaretskii
dc25e84754 Support a Windows build with Guile.
README.W32.template: Update with instructions for building with Guile.
 build_w32.bat: Support building with Guile.
 make.h [HAVE_STDINT_H]: Include stdint.h.
2012-01-28 20:28:31 +00:00
Eli Zaretskii
666ad44568 Actually commit main.c with changes announced in last commit. 2012-01-28 20:19:55 +00:00
Eli Zaretskii
dddd1be5ec main.c (main, clean_jobserver): Move declarations of variables
not used in the WINDOWS32 build to the #else branch, to avoid
 compiler warnings.
2012-01-28 16:54:00 +00:00
Eli Zaretskii
eb4f966971 Fix failures on MS-Windows when Make's standard handles are invalid.
This can happen when Make is invoked from a GUI application.

  * w32/subproc/sub_proc.c (process_init_fd): Don't dereference
  pproc if it is a NULL pointer.
  (process_begin, process_cleanup): Don't try to close pipe handles
  whose value is INVALID_HANDLE_VALUE.
  (process_easy): Initialize hIn, hOut, and hErr to
  INVALID_HANDLE_VALUE.  If DuplicateHandle fails with
  ERROR_INVALID_HANDLE, duplicate a handle for the null device
  instead of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE or
  STD_ERROR_HANDLE.  Don't try to close pipe handles whose value is
  INVALID_HANDLE_VALUE.

  * function.c (windows32_openpipe): Initialize hIn and hErr to
  INVALID_HANDLE_VALUE.  If DuplicateHandle fails with
  ERROR_INVALID_HANDLE, duplicate a handle for the null device
  instead of STD_INPUT_HANDLE or STD_ERROR_HANDLE.  Fix indentation.
  Don't try to close handles whose value is INVALID_HANDLE_VALUE.
2012-01-28 16:50:21 +00:00
Eli Zaretskii
715a11735f function.c (define_new_function): Fix format strings in calls to `fatal'. 2012-01-25 18:16:14 +00:00
Paul Smith
89f7058b99 Handle NULL returns from Guile. 2012-01-18 13:31:11 +00:00
Paul Smith
9fb4cdeedb Fix an issue with PATH_SEPARATOR_CHAR when cross-compiling for Windows.
Fixes Savannah bug #34818.
2012-01-16 21:29:44 +00:00
Paul Smith
0bdc191501 Fix autoconf macros for detecting DOS-style pathnames.
Fixes Savannah bug #35256.
2012-01-16 03:53:34 +00:00
Paul Smith
49cc211819 Create a new internal interface for defining new make functions.
This allows us to create new functions without changing function.c.
You still have to modify the GNU make code (for now) though: this is
simply a preliminary step to possibly allowing make to load modules.

Modify the Guile integration to use this method rather than ifdefs
in function.c.
2012-01-16 03:32:49 +00:00
Paul Smith
4e2e5eb199 Disallow whitespace in variable names. 2012-01-16 02:44:04 +00:00
Paul Smith
3f6bb04e75 Update copyright notices. 2012-01-16 02:29:20 +00:00
Paul Smith
c992c4d80f Add GNU Guile as an optional embedded scripting language for make.
On configure-enabled systems, configure will detect Guile installed
(using pkg-config, which is how GNU Guile is distributed) and enable
it if so.

On all non-configure-enabled systems, currently, the default is for
Guile support to be disabled.
2012-01-15 22:41:53 +00:00
Paul Smith
3057357c0a Add prerequisites to ensure ordering of results. 2011-12-10 17:13:14 +00:00
Paul Smith
cb0bedc3d0 Allow os2 and mingw to disable jobserver with a configure option. 2011-11-15 22:56:26 +00:00
Paul Smith
dc2a6ceb81 Enable jobserver on W32 when using configure.
Some W32 cleanups: see Savannah bug #34830
Forgot to modify the config.h.W32.template file for jobserver support.
2011-11-15 21:12:53 +00:00
Paul Smith
4f47fbf953 Be sure to start parsing prereqs in the right place even if there are
escape characters (backslashes) in the target name.
See Savannah bug #33399
2011-11-14 07:31:06 +00:00
Paul Smith
9fcd90e36c Changes to resolve warnings.
Fixes Savannah bug #34608.
2011-11-14 02:26:00 +00:00
Paul Smith
83ce81fcaa Don't use Hungarian notation: remove _p/_ptr from var names.
Fixes Savannah bug #32567.
2011-11-14 00:58:49 +00:00
Paul Smith
63888b91f6 Support jobserver capability on Windows systems.
Implementation contributed by Troy Runkel <Troy.Runkel@mathworks.com>
2011-11-14 00:42:49 +00:00
Paul Smith
934f51d166 In very obscure situations we may write the free token back to the pipe.
Don't do that.  I couldn't come up with a repro case for this!
2011-11-14 00:18:38 +00:00
Paul Smith
bfc3e1ca7c Enable high-resolution timestamps for Darwin (Mac OSX)
Patch provided by Troy Runkel <Troy.Runkel@mathworks.com>
2011-11-13 23:39:54 +00:00
Paul Smith
c7d07fd0b5 Add translation for Czech (cs). 2011-09-26 19:18:30 +00:00
Paul Smith
d472624f33 When we re-exec the master makefile in a jobserver environment, ensure
that MAKEFLAGS is set properly so the re-exec'd make runs in parallel.
See Savannah bug #33873.
2011-09-18 23:39:26 +00:00
Paul Smith
0369a93825 We compute various values for vpath lookup the first time through
and store them in static variables; however one value (std_dirs)
was not being stored statically so the second time through it was
not set.
Fixes Savannah bug #32511
2011-09-18 20:52:13 +00:00
Paul Smith
ef2b0425e7 Avoid certificate checks when getting PO files from translationproject.org 2011-09-17 01:45:09 +00:00
Paul Smith
a5c774a51b Ensure variables defined in $(call ...) have global scope
Add a note about using #!/usr/bin/make -f to the manual.
Clean up the w32 subdirectory in the dist tarball.
2011-09-12 05:29:58 +00:00
Paul Smith
9a9f83e8b5 Ensure that -n takes precedence over -t.
Patch from Michael Witten <mfwitten@gmail.com>
2011-09-02 05:37:54 +00:00
Paul Smith
e4d5d43424 Save strings we're expanding in case an embedded eval causes them
to be freed (if they're the value of a variable that's reset for example).
See Savannah patch #7534
2011-08-29 16:20:19 +00:00
Paul Smith
b06b8c64a2 Fix another error related to whitespace handling in archives.
Newer version of VMS support strncasecmp() so update the config.h.
2011-06-12 16:22:04 +00:00
Paul Smith
f15efca811 Ensure private variables are not used when appending target-specific
variables.  Fixes Savannah bug #32872.
2011-05-07 20:03:49 +00:00
Paul Smith
b664d3a91d Inverted the boolean test from what I wanted it to be. Added a
regression test to make sure this continues to work.
2011-05-07 14:36:11 +00:00
Eli Zaretskii
b5c065418f job.c (construct_command_argv_internal): Don't assume shellflags
is always non-NULL.  Escape-protect characters special to the
 shell when copying the value of SHELL into new_line.  Fixes
 Savannah bug #23922.
2011-05-07 08:29:13 +00:00
Paul Smith
bd6f63e563 Updated documentation to fix Savannah bugs #32058 and #31582 2011-05-02 15:11:23 +00:00
Paul Smith
6979e7e43b Use the same algorithm for counting the number of words to sort as we
use to break up the list of words, so we're sure to get the same number.
Fixes Savannah bug #33125
2011-05-02 12:35:01 +00:00
Paul Smith
dc90160079 Extern the global declaration of stack_limit. Fixes Savannah bug #32753 2011-05-02 12:29:09 +00:00
Paul Smith
a81ee5209b Avoid invoking glob() unless the filename has potential globbing
characters in it, for performance improvements.
2011-05-02 00:18:06 +00:00
Boris Kolpackov
15a79d723d Delay caching of the file name in eval_makefile() until after all the
expansions and searches are complete. This fixes an assertion in a
situation where the MAKEFILES variable contains a file path that
contains tilde.
2011-04-29 15:27:39 +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
1454a04f81 * Fixups to the make man page
* Minor syntax cleanups in the manual
* In non-maintainer mode set NDEBUG to disable assert()
* Performance improvements in strcache:
    Build Info			1000	2000	4000
    3.82 -g			2.61s	8.85s	33.52s
    3.82 -O2			1.90s	7.62s	27.82s
    New -g (with asserts)	1.03s	2.31s	5.79s
    New -O2 (no asserts)	0.65s	1.50s	3.52s
2011-02-21 07:30:11 +00:00
Paul Smith
ae2ab76fac Check if the target-specific variable is the same as the global
variable, and if so don't try to update it.  Savannah bug #31743.
2010-11-30 14:48:52 +00:00
Paul Smith
391456aad7 Improve backslash/newline handling to adhere to POSIX requirements. 2010-11-06 21:56:23 +00:00
Paul Smith
a86d1693ba Bump the version to 3.82.90.
Fix some doc bugs.
Implement the --trace flag.
Show filename/linenumber on error.
2010-08-29 23:05:26 +00:00
Paul Smith
3b1432d86a Set shellflags to a reasonable default if it's not set already. 2010-08-29 04:50:26 +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
5acda13ace - Fix the NEWS file to be accurate
- Add oneshell to $(.FEATURES) (forgot that!)
- Fix Savannah bug #30612: handling of archive references with >1 object
2010-08-14 02:50:14 +00:00
Paul Smith
036760a9fd Fix Savannah bug #30723: expand MAKEFLAGS before we re-exec after
rebuilding makefiles.
2010-08-10 07:35:34 +00:00
Eli Zaretskii
91be515567 w32/subproc/build.bat: Make all 3 cl.exe compile command lines
use the same /I switches.  Fixes Savannah bug #30662.
2010-08-07 08:55:17 +00:00
Eli Zaretskii
b6b6875986 function.c (func_shell) [WINDOWS32]: Reset just_print_flag
around the call to construct_command_argv, so that a temporary
 batch file _is_ created when needed for $(shell).  Fixes Savannah
 bug #16362.
2010-08-07 08:46:06 +00:00
Eli Zaretskii
8f029808af Fix the DJGPP build.
configh.dos.template (HAVE_STRNCASECMP): Define.
2010-08-07 08:15:45 +00:00
Paul Smith
95f1a32d27 Release GNU make 3.82
- Update tests for Solaris bizarre-ness
- Update files for release
2010-07-28 05:39:50 +00:00
Eli Zaretskii
59691939f9 job.c 2010-07-24 08:27:50 +00:00
Eli Zaretskii
e954532d48 job.c (pid2str) [WINDOWS32]: Fix CPP conditionals for using %Id format. 2010-07-24 08:27:26 +00:00
Paul Smith
f5d7411c49 Fix up incorrect prototype. 2010-07-20 13:12:06 +00:00
Paul Smith
fba20a776d - Many fixup patches from Savannah.
- Fix the test suite on Solaris (from Boris)
- Update the manual for .ONESHELL
2010-07-19 07:10:53 +00:00
Boris Kolpackov
df2fa7c5a5 Fix buffer overrun in concat(). 2010-07-16 13:01:15 +00:00
Paul Smith
9903cda2a7 Update copyrights for 2010. 2010-07-13 01:20:10 +00:00
Paul Smith
ded9121846 Fixes to build_w32.bat for building with MSVC 64bit. 2010-07-12 20:32:59 +00:00
Eli Zaretskii
02ff72c970 Add missing one_shell declaration. 2010-07-12 17:18:31 +00:00
Eli Zaretskii
90b30b6e0e *** empty log message *** 2010-07-12 17:17:45 +00:00
Eli Zaretskii
96c0761689 make.h (alloca) [!__GNUC__]: Don't define prototype.
(int w32_kill): Use pid_t for process ID argument.
 Savannah bug #27809.
2010-07-12 17:16:54 +00:00
Paul Smith
bbe7b86718 Forgot to add the ONESHELL regression tests. 2010-07-12 05:29:25 +00:00
Paul Smith
7ba7dbca47 Add the beginning of the .ONESHELL special feature.
Original patch by David Boyce.  Modified by Paul Smith.
2010-07-12 05:23:19 +00:00
Eli Zaretskii
b85b7e0a55 w32/subproc/sub_proc.c: Include stdint.h.
(sub_process_t): Use intptr_t for file handles and pid_t for
 process ID.
 (process_pipes, process_init_fd, process_begin): Use intptr_t for
 file handles and pid_t for process ID.
 Savannah bug #27809.  Patch by Ozkan Sezer <sezeroz@gmail.com>
2010-07-09 12:05:10 +00:00
Eli Zaretskii
587588c1fa Fix Savannah bug #30312.
function.c (abspath): Support absolute file names in UNC format.
2010-07-09 11:40:19 +00:00
Eli Zaretskii
94bda718c4 config.h.W32.template (pid_t): Add a definition for 64-bit Windows builds that don't use GCC. 2010-07-09 11:38:01 +00:00
Eli Zaretskii
4e4d8f246f job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
(exec_command) [WINDOWS32]: Use pid2str instead of non-portable
 %Id.

 main.c (handle_runtime_exceptions): Use %p to print addresses,
 to DTRT on both 32-bit and 64-bit hosts.  Savannah bug #27809.

 job.c (w32_kill, start_job_command, create_batch_file): Use
 pid_t for process IDs and intptr_t for the 1st arg of
 _open_osfhandle.
 function.c (windows32_openpipe): Use pid_t for process IDs and
 intptr_t for the 1st arg of _open_osfhandle.
 (func_shell): Use pid_t for process IDs.
 main.c (main) [WINDOWS32]: Pacify the compiler.
 config.h.W32.template (pid_t): Add a definition for 64-bit
 Windows builds that don't use GCC.
 Savannah bug #27809.  Patch by Ozkan Sezer <sezeroz@gmail.com>
2010-07-09 11:10:04 +00:00
Paul Smith
8a0f9d7b42 Fix FTP upload rules. 2010-07-07 02:06:48 +00:00
Paul Smith
c7b469f0f3 - Enhance .POSIX to set -e when invoking shells, as demanded by a
backward-incompatible change in the 2008 POSIX specification.
- Add the .SHELLFLAGS variable so people can choose their own shell flags.
- Add tests for this.
- Add documentation for this.
2010-07-06 06:37:42 +00:00
Paul Smith
c78b7265bd Fixups for warnings on Windows (esp 64bit). 2010-07-05 18:32:03 +00:00
Paul Smith
fc644b4c45 Do not consider filenames that contain parens but don't END in a paren,
to be an archive group.  Fixes Savannah bug #28525.
2010-07-03 16:45:45 +00:00
Paul Smith
97f106fa10 - Add whitespace to command line invocation in features/recursion
- Set up .FEATURES with separate calls for optional features, as some
  compilers don't like conditionals inside macro invocations.
2010-07-01 07:16:00 +00:00
Paul Smith
7746a1f74f - Rename strieq() to patheq() for clarity.
- Convert xmalloc/memset pairs to xcalloc.
2010-07-01 05:59:08 +00:00
Eli Zaretskii
c0239cdbfa *** empty log message *** 2009-12-11 15:55:16 +00:00
Eli Zaretskii
866aa6267a (construct_command_argv_internal) <sh_cmds_dos> [WINDOWS32]: Add "echo." and
a few more commands that are built into cmd.exe.  Fixes Savannah bug #28126.
2009-12-11 15:54:19 +00:00
Eli Zaretskii
b4cec7790f *** empty log message *** 2009-12-11 12:03:05 +00:00
Eli Zaretskii
deace771d6 (lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do with '/'. 2009-12-11 12:02:45 +00:00
Eli Zaretskii
f4d9937274 (construct_vpath_list): Correct the argument names in the commentary. 2009-12-11 09:47:41 +00:00
Paul Smith
b6f45ddc53 Add VMS enhancements from Hartmut Becker. 2009-11-16 02:31:23 +00:00
Boris Kolpackov
fe43fa9de3 Implement linker-compatible library search. 2009-11-12 16:42:36 +00:00
Paul Smith
5f188b39a4 Update copyright years. 2009-10-25 18:56:44 +00:00
Paul Smith
76d2d2ca41 Fix fat-finger bug that left implicit rules with identical stem lengths
being sorted indeterminately.
2009-10-25 18:34:43 +00:00
Paul Smith
4e51b6d9a4 New command line option: --eval=STRING will cause STRING to be
evaluated as a makefile statement before the first makefile is
read.
2009-10-25 00:46:52 +00:00
Paul Smith
606cf9b169 Various simple code cleanups. 2009-10-25 00:26:34 +00:00
Boris Kolpackov
131f115730 Get the old behavior for a situation when no makefile is found in a directory. 2009-10-22 14:29:22 +00:00
Paul Smith
b1d34394a8 Massage the NEWS file 2009-10-12 22:24:54 +00:00
Boris Kolpackov
baee33eb0f Minor fix and code rework. 2009-10-07 09:34:42 +00:00
Boris Kolpackov
bd2d124f27 Fix savannah bug 25780. Optimize things a bit. 2009-10-06 12:36:29 +00:00
Boris Kolpackov
4254e88cfa Implement the new undefine directive. 2009-10-06 06:56:57 +00:00
Boris Kolpackov
174e910a1d Performance improvements 2009-10-05 14:40:18 +00:00
Paul Smith
acbdc33e1c Add a test for another (still open) bug. 2009-10-04 19:18:16 +00:00
Paul Smith
f87715a62c - Include <alloca.h> even on non-__GNUC__ systems.
- Add some tests for unresolved bugs.
2009-10-03 20:08:20 +00:00
Boris Kolpackov
56653d8524 Fix Savannah bugs #15110, #25493, #12686, and #17740. 2009-09-30 09:54:26 +00:00
Paul Smith
f907a4d90c - Update manual description for pattern rule search algorithm
- Add new "-all" flag to the test suite to run tests that don't pass yet
- Add some non-passing tests
- Fix from Andreas Buening for OS/2.
2009-09-28 23:08:49 +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
Eli Zaretskii
f9c15cac35 * glob.c (my_realloc) [__DJGPP__]: Don't define, and don't
redefine realloc to call it, since the DJGPP's realloc handles
	NULL pointers correctly.
2009-09-28 06:46:03 +00:00
Eli Zaretskii
bf1794767e Fix typo. 2009-09-27 17:56:24 +00:00
Eli Zaretskii
5d19c91605 * configh.dos.template: Remove unconditional definition of
SYS_SIGLIST_DECLARED.
	Include <sys/version.h> because ports of GCC 4.3.0 and later no
	longer include it, so macros like __DJGPP_MINOR__ are no longer
	defined automatically.

	* Makefile.DOS.template (INCLUDES): Use $(prefix) and the
	corresponding variables to define LIBDIR, INCLUDEDIR and LOCALEDIR
	instead of using the hardcoded ones.
	(SUBDIRS): doc subdir added.
	(INFO_DEPS, DVIS): Values changed to 'make.info' and 'make.dvi'.
	(TEXI2HTML, TEXI2HTML_FLAGS): Removed.  Use makeinfo --html to
	create html formated docs.  texi2html may not be ported to DOS.
	(make.info, make.dvi, make.ps, make.html): Make targets depend on
	'make.texi'.
	(.texi.info, .texi, .texi.dvi): Now recursively invocate.  Change
	-I switch to look in ./ instead of ./doc.
	(html): Target depend on html-recursive instead of make_1.html.
	(make_1.html): Removed.
	(mostlyclean-aminfo): Use $(srcdir)/doc instead of ./ as prefix.
	(all-recursive): Allow for more than one subdir in the build
	process.
	(mostlyclean-recursive, clean-recursive, distclean-recursive)
	(maintainer-clean-recursive, check-recursive): Enter in doc/ too.
	(tags-recursive): Allow for more than one subdir in the build
	process.
	(info-recursive, dvi-recursive, ps-recursive, html-recursive): New
	targets.  Enter into doc/ to produce the targets.
	(all-am): $(INFO_DEPS) replaced by info.
2009-09-27 16:22:50 +00:00
Paul Smith
8688ef20cf - Add static pattern targets to the string cache.
- Use specific free_*() calls where appropriate.
2009-09-27 02:15:36 +00:00
Paul Smith
44ac2cdb4d Fix some memory leaks, found with valgrind. 2009-09-26 23:01:55 +00:00
Boris Kolpackov
48045f99e5 Performance improvement. 2009-09-25 15:51:11 +00:00
Boris Kolpackov
5973926ce6 Merge three parallel arrays into one. Make sure sufficient space is allocated. 2009-09-25 15:44:27 +00:00
Paul Smith
d65b267e4a - Fix broken handling of order-only prereqs in secondary expansion
of implicit rules.
- Fix leaked memory when dealing with implicit rule chains that
  have file variables or pattern variables.
2009-09-24 20:59:22 +00:00
Paul Smith
0afbbf8595 - Rework secondary expansion so we only defer it if there's a possibility
it might be needed: for most situations we parse prereqs immediately as
  we used to.  Reduces memory usage.
- Fixes Savannah bug #18622.
2009-09-24 02:41:44 +00:00
Paul Smith
3cc351decd Added Italian (it) language support. 2009-09-16 17:42:09 +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
Eli Zaretskii
5abe477620 *** empty log message *** 2009-09-14 18:20:02 +00:00
Eli Zaretskii
295a05fbd6 * w32/subproc/sub_proc.c (process_begin): Check *ep non-NULL
inside the loop that looks up environment for PATH.
2009-09-14 18:18:37 +00:00
Paul Smith
958ea92eb8 - Fix Savannah bug #21824: don't loop through NULL cmds pointer
- Fix Savannah bugs #24509, 18963: doc enhancements
2009-09-12 21:28:33 +00:00
Eli Zaretskii
70c726c875 * function.c (windows32_openpipe): Update envp after calling
sync_Path_environment.
2009-08-31 17:54:11 +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
e2f16fdf45 Changes from Ralf Wildenhues. 2009-08-01 22:09:40 +00:00
Eli Zaretskii
139c28ae69 function.c (func_realpath) [!HAVE_REALPATH]: Require the file to
exist, as realpath(3) does where it's supported.
2009-07-04 11:34:32 +00:00
Eli Zaretskii
e8fd23cc83 (func_realpath) [!HAVE_REALPATH]: Require the file to exist, as
realpath(3) does where it's supported.
2009-07-04 11:33:33 +00:00
Eli Zaretskii
1471af2de2 * function.c (IS_ABSOLUTE, ROOT_LEN): New macros.
(abspath): Support systems that define HAVE_DOS_PATHS (have
	drive letters in their file names).  Use IS_PATHSEP instead of a
	literal '/' comparison.
2009-07-04 11:15:14 +00:00
Paul Smith
56f70324e8 - Forgot changelog for fix 13529 2009-06-14 06:08:54 +00:00
Paul Smith
be6b22a283 - Fix Savannah bug #13529 2009-06-14 06:08:11 +00:00
Paul Smith
dceb954f9c - Fix Savannah bug #13401 2009-06-13 23:10:52 +00:00
Paul Smith
38b23bc3f0 - Fixes Savannah bug #18435 2009-06-13 22:47:40 +00:00
Paul Smith
bf9822658f - Fix Savannah bug 17825
- Fix Savannah bug 21231
2009-06-13 21:21:48 +00:00
Paul Smith
c8840352ac - Fix Savannah bug #19108
- Fix Savannah bug #17752
- Test suite:
  * When tests fail keep a "run" file containing the command invoked.
  * Support for the Valgrind "memcheck" and "massif" tools.
2009-06-10 02:21:09 +00:00
Paul Smith
d4ee001292 - Fix Savannah bug #18124
- Fix Savannah bug #17521
- Fix Savannah bug #16401
- Fix Savannah bug #16469
- Fix Savannah bug #16473
2009-06-09 15:35:38 +00:00
Paul Smith
a72bff7cb3 - Fix Savannah bug #24622 2009-06-07 18:16:15 +00:00
Paul Smith
0b30c8d9ce - Add a new test suite for LIBPATTERNS
- Fix Savannah bug #21198
- Fix Savannah bug #21823
- Fix Savannah bug #22010
2009-06-07 17:40:06 +00:00
Paul Smith
668af46980 Add attribution. 2009-06-06 23:23:36 +00:00
Paul Smith
b9f831b858 - Work around a bug in glibc glob(3), by avoiding GLOB_NOCHECK.
- Fix issue in very parallel builds found building glibc.
2009-06-06 23:16:46 +00:00
Paul Smith
71385e1225 - Add forgotten variable/define test suite
- Skip initial whitespace including formfeeds, vertical tab, etc.
- Add tests for that
- Fix the variable/SHELL test; it was wrong!
2009-06-05 01:17:29 +00:00
Paul Smith
81f3e4babd - Modify access of config and gnulib Savannah modules to use GIT
- Fix Savannah bug #24655.
- Fix Savannah bug #24588.
- Fix Savannah bug #24277.
- Fix Savannah bug #25697.
- Fix Savannah bug #25694.
- Fix Savannah bug #25460.
- Fix Savannah bug #26207.
- Fix Savannah bug #25712.
- Fix Savannah bug #26593.
- Fix various doc issues.
2009-06-04 06:30:27 +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
7b16a8e3ca We had the incorrect ISBN in the manual; not sure what happened here
but the FSF confirmed that we had the wrong one.
2009-05-24 19:06:04 +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
3fd62c76c2 (convert_Path_to_windows32): Fix last change. Fixes Savannah bug #25412. 2009-03-14 16:31:57 +00:00
Eli Zaretskii
27ef86f6b1 <top level>: Update Copyright years. Add prototype for xmalloc.
(find_file): Accept 3 arguments PATH_VAR, FULL_FNAME, and FULL_LEN
instead of an LPOFSTRUCT pointer.  Use xmalloc instead of malloc.
Loop over an array of extensions, instead of duplicating the same
code inline.  Use SearchPath followed by CreateFile, instead of
the obsolete OpenFile.  Fixes Savannah bug #17277.
(process_begin): Find $(PATH) in `envp', and pass a pointer to it
to `find_file'.  Fixes Savannah bug #25662.
2009-03-14 14:42:06 +00:00
Eli Zaretskii
656b15a404 * function.c (func_shell): Don't close pipedes[1] if it is -1.
Fixes Savannah bug #20495.
2009-03-07 17:30:30 +00:00
Eli Zaretskii
f8f3b9005b * build_w32.bat (GCCBuild): Use "-gdwarf-2 -g3" instead of
"-gstabs+ -ggdb3".

	* w32/subproc/build.bat (GCCBuild): Likewise.
2008-09-30 11:26:16 +00:00
Eli Zaretskii
4c995f262a * job.c (construct_command_argv_internal): Avoid extra backslash
in batch-mode Unixy shells.  Under DB_JOBS, display the contents
	of the batch file.
2008-09-30 11:19:58 +00:00
Eli Zaretskii
c7f2c384ee *** empty log message *** 2008-05-31 08:06:44 +00:00
Eli Zaretskii
ed4a06e6de Remove obsolete text about non-support for -jN without Unixy shell.
Remove obsolete text about not supplying Visual Studio project files
(we do supply them).
Modify text to prefer GCC builds to MSC builds.
2008-05-31 08:06:05 +00:00
Paul Smith
b50116c4ae Manual typo.
New translation.
2008-05-18 15:11:39 +00:00
Paul Smith
b23b0c3552 Update the translation project location for PO files (again)
Apply fix for Savannah bug #22379.
2008-03-28 03:46:39 +00:00
Eli Zaretskii
bb7cb05da5 *** empty log message *** 2008-01-26 13:51:55 +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
2750526aa5 Makefile.DOS.template (info_TEXINFOS): Remove unused variable.
(TEXINFOS): Value changed to `doc/make.texi'.
(.SUFFIXES): Use .texi instead of .texinfo.
(make.info, make.dvi): Depend on doc/make.texi.
(.texi.info): New target, instead of ".texinfo.info".  Change -I switch
to $(MAKEINFO) to look in doc/.  Use --no-split.
(.texi): New target, instead of ".texinfo".  Change -I switch to $(MAKEINFO)
to look in doc/.  Use --no-split.
(.texi.dvi): New target, instead of ".texinfo.dvi".  Change -I switch
to $(MAKEINFO) to look in doc/.
(install-info-am, uninstall-info): Don't look for "*.i[0-9]" and
"*.i[0-9][0-9]" (due to --no-split above).
(noinst_TEXINFOS, TEXI2HTML, TEXI2HTML_FLAGS): New variables.
(html, make_1.html): New targets.
(.PHONY): Add "html".
(.SUFFIXES): Add .html.
2007-12-22 12:07:36 +00:00
Eli Zaretskii
84e9bcd65e glob/glob.c [__GNU_LIBRARY__ && __DJGPP__]: Add a realloc declaration
that matches the one in the DJGPP libc.
2007-12-22 11:28:49 +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
Eli Zaretskii
be883de241 config.h.W32: Include sys/types.h.
[!_PID_T_] (pid_t): Define only if not already defined.
2007-12-22 11:00:29 +00:00
Eli Zaretskii
c233a70323 vpath.c (construct_vpath_list) [HAVE_DOS_PATHS]: Support VPATH values that
use `:' in drive letters, when PATH_SEPARATOR_CHAR is also `:'.
2007-12-22 10:55:30 +00:00
Paul Smith
8025f93312 For mod times farther in the future, print the value in fixed-point rather
than exponential notation (patch from Bruno Haible).
2007-11-05 14:15:19 +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
Eli Zaretskii
c1f71b0336 Convert to Unix line-endings. 2007-10-24 20:06:32 +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
2a23064da5 Fixes from Eli Zaretskii:
Fix to allow quoted directories in PATH.
Fix for Savannah bug #20549.
2007-10-10 13:22:21 +00:00
Paul Smith
e54dfb4284 Some Windows fixes to allow builds to succeed. 2007-10-10 04:32:15 +00:00
Paul Smith
19b6504f8a Incorporate Icarus Sparry's fix for 3330 and 15919, and test cases.
One of our translations disappeared from the translations site so remove it.

The fdl.texi file was changed to not contain any @node entries, so add some
around it in make.texi.
2007-08-15 13:53:53 +00:00
Paul Smith
bb4d040fad Fix Savannah bug #20452.
Add a new feature to the test suite suggested by Icarus Sparry:
set a timer before invoking a test, so that if it loops infinitely we
will wake up and have a chance to kill the process and continue.
2007-07-14 02:57:46 +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
a940199072 Fix a core dump when reading_file is 0 (20033).
Fix some manual typos (20018).
2007-06-19 04:47:58 +00:00
Paul Smith
eda0e24ccd Fix some documentation gitches.
Fix an uninitialized variable.
Add builtin rules for Objective C.
Add a new debug line that shows where the commands that are about to be run
were defined.
2007-05-11 20:57:21 +00:00
Paul Smith
52ebc531ce Fix Savannah bug #19656: rationalize our use of case-insensitive string
comparison functions to always use POSIX strcasecmp().  For non-POSIX
systems that use other functions (strcmpi or stricmp) use a macro to alias
strcasecmp to those.  If we can't find any of them (VMS, plus whatever
UNIX doesn't have them) then define our own version in misc.c.
2007-05-09 02:01:53 +00:00
Paul Smith
891409f212 Fix Savannah bug #19348: if the user specified
--disable-case-insensitive-file-system, don't turn it on.
2007-03-21 13:49:34 +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
f222b19158 Code cleanup: Remove all references to PARAMS() & ansi2knr. 2006-04-07 01:43:44 +00:00
Paul Smith
776d8b7bc2 Minor command correction. 2006-04-01 06:37:45 +00:00
Paul Smith
a8f101d0bc Release GNU make 3.81.
Update NEWS docs.
Enhance the manual to use automake version.texi, and use the canonical
FSF copyright features and statement.
Some $(realpath ...) tests won't work on Windows; leave them out
The jobserver filedescriptor test might fail if some FDs are reserved,
so for now comment out that check.
2006-04-01 06:36:40 +00:00
Boris Kolpackov
367a49591e Fixed Savannah bug #16140. 2006-03-22 13:16:03 +00:00
Paul Smith
94aead216e Minor fixes before the rc2 release. 2006-03-20 03:03:04 +00:00
Paul Smith
24aac7f8f6 Add some alloca(0) calls for systems without "normal" alloca support.
Fix a file descriptor leak with make re-exec while using the jobserver.
Update some release information.
2006-03-20 02:36:36 +00:00
Paul Smith
29e539bad0 Minor tweaks for 3.81rc2. 2006-03-17 18:55:26 +00:00
Boris Kolpackov
22886f8a74 Fixed Savannah bug #16053. 2006-03-17 14:24:20 +00:00
Paul Smith
50eb3cf5e5 Fix Savannah bug #15913. 2006-03-15 03:31:30 +00:00
Paul Smith
6d8d9b74d9 Numerous updates to tests for issues found on Cygwin and Windows.
Revert a fix for $? including non-existent files as it shows a bug
in the Linux kernel build.  Give them a release to fix this.
Add some changes from Eli Z. for Windows changes.
2006-03-10 02:20:45 +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
08bfd86103 Move the copyright info to the end of the NEWS file, otherwise automake's
GNITS check doesn't think we have updated it (only scans the first 15 lines).
2006-02-20 03:34:02 +00:00
Paul Smith
6e0527913c - Memory cleanups, found with valgrind.
- Fix handling of special targets like .SUFFIX for VMS insensitive targets.
- Don't make temporary batch files for -n.  Make sure batch files are created
  in text mode.
2006-02-20 02:14:00 +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
0806a403d6 Fix Savannah bug #106: keep separate track of which variable we are
expanding, and use that info when generating error messages instead of
the file info, where appropriate.
2006-02-15 23:54:42 +00:00
Paul Smith
86af3872a9 Some memory leak cleanups (found with valgrind). 2006-02-14 15:42:17 +00:00
Paul Smith
df267b31c5 Fix bug #11183. 2006-02-13 23:38:36 +00:00
Paul Smith
a6bdc58385 Last of the copyright updates. 2006-02-11 22:16:04 +00:00
Paul Smith
24338ec929 More copyright/license updates. 2006-02-11 20:00:39 +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
5a7a42cfce - New code capability: a read-only string cache. Start of solution for
Savannah bug #15182, but not much uses it yet.  Coming shortly.
- Added short-circuiting $(and ..) and $(or ...) functions.
2006-02-10 05:29:00 +00:00
Boris Kolpackov
d0c4e92f11 Fixed Savannah bug #15641. 2006-02-08 17:29:07 +00:00
Paul Smith
ce9c63b32b Updates to Windows stuff from Markus Mauhart. 2006-02-06 16:41:49 +00:00
Paul Smith
a4e3523fe4 Fix Savannah bugs # 15341, 15534, and 15533.
Rewrite large chunks of the "Commands" section of the manual to better
describe then backslash-newline handling, the SHELL variable, etc.
2006-02-06 16:21:59 +00:00
Paul Smith
7a8549f5dd Fix a bug where a variable could be used without being initialized in W32. 2006-02-01 13:31:25 +00:00
Paul Smith
4cd3539024 Various updates, mainly to the Windows port, from Eli Zaretskii and
Markus Maurhart.
2006-02-01 07:54:22 +00:00
Paul Smith
64e16d6c00 Various changes getting ready for the release of 3.81.
- Updates to make.texi and make.1 and other documentation
- Some VMS patches
- Fix minor bugs reported on the mailing list and from Debian.
2006-01-04 14:45:16 +00:00
Boris Kolpackov
3d0d9e5d75 Fixed record_target_var to initialize variable's export field with v_default
instead of leaving it "initialized" by whatever garbage happened to be on
the heap.
2005-12-14 13:11:18 +00:00
Paul Smith
4bd6db9df1 Update the make.1 man page.
Use rm -f instead of rm in the test scripts.  Fixes bug #15085.
2005-12-13 14:44:17 +00:00
Paul Smith
3bcb608bda Extend .SECONDEXPANSION to implicit rules. Final fix for bug #13781. 2005-12-11 15:41:17 +00:00
Boris Kolpackov
0e6c4f5b0e Fixed bug #13022 by setting is_target flag on files that this implicit
pattern rule also makes.
2005-12-09 16:46:19 +00:00
Boris Kolpackov
a34b85490d Fixed bug #14334 by propagate the change of modification time to all the
double-colon entries only if it is the last one to be updated.
2005-12-07 11:33:38 +00:00
Boris Kolpackov
1fd3f9d79c Implemented the flavor function which returns the flavor of
a variable ('simple', 'recursive', or 'undefined').
2005-11-17 07:27:28 +00:00
Boris Kolpackov
3dd1faa5c8 Implemented the .INCLUDE_DIRS special variable. It expands to a list
of directories that make searches for included makefiles.
2005-11-14 15:31:13 +00:00
Paul Smith
82103b1a49 Fix a crash I introduced last-minute.
Try to avoid extraneous rebuilds of template files.
2005-10-26 16:06:30 +00:00
Paul Smith
11095a90f1 Make second expansion optional (partial implementation).
I decided this feature was too impacting to make the permanent default
behavior.  This set of changes makes the default behavior of make the
old behavior (no second expansion).  If you want second expansion, you
must define the .SECONDEXPANSION: special target before the first target
that needs it.

This set of changes ONLY fixes explicit and static pattern rules to work
like this.  Implicit rules still have second expansion enabled all the
time: I'll work on that next.

Note that there is still a backward-incompatibility: now to get the old
SysV behavior using $$@ etc. in the prerequisites list you need to set
.SECONDEXPANSION: as well.
2005-10-24 13:01:39 +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
5ee856d96d Try using POSIX::getcwd to find the working directory wherever it exists.
This should help the tests run more accurately on Windows (hopefully...)
2005-08-31 13:38:17 +00:00
Paul Smith
0ffd22cb44 Preserve the backslash that's printed by echo. 2005-08-29 18:45:31 +00:00
Paul Smith
f7598efb67 Fix make.h preprocessor directive to work better with Windows compilers.
Fix some regression tests to (hopefully) work better on Windows.
2005-08-29 14:11:00 +00:00
Paul Smith
6636dc1d5c If we're on a DOS/W32/OS2 system and we're not using a unixy shell, don't
follow POSIX backslash/newline conventions.

Use a different method for testing the SHELL variable, which hopefully
will work better on non-UNIX systems.
2005-08-25 04:40:10 +00:00
Boris Kolpackov
bf58e35105 Wrapped calls to $(wildcard ) with $(sort) so that the resulting order
is no longer filesystem-dependant.
2005-08-13 19:24:49 +00:00
Boris Kolpackov
e437226241 Fixed Savannah bug #13881. 2005-08-10 10:21:13 +00:00
Paul Smith
b237dff775 - Fixed a bug reported by Michael Matz regarding handling of parallel
jobs after a failed job.
- Enhancements to WINDOWS32 code from Eli Zaretskii.
- Add Microsoft Project files from J. Grant.
2005-08-08 05:08:00 +00:00
Paul Smith
a53903e4c3 Add Indonesian translation. 2005-07-15 05:05:32 +00:00
Paul Smith
1e9dc3ce45 Various minor updates and code cleanups. 2005-07-12 04:35:13 +00:00
Paul Smith
0e30f46a62 Various fixes and updates from testers of the beta3 release (mostly Windows
and OS/2 changes).
2005-07-04 03:50:59 +00:00
Paul Smith
7dfa2461c3 Cleaned up some problems found with the tests running on a powerful
Solaris system with an EMC NFS storage solution.  Still get some odd
errors here unfortunately related to sub-second timestamps that I just
can't figure out.  It all works if we run the tests in /tmp instead
though :-/.
2005-06-27 22:18:47 +00:00
Paul Smith
261d7b44fa Make sure timestamp problems don't cause the -W test to fail. 2005-06-27 18:53:46 +00:00
Paul Smith
b581e1350f Fixes for some Windows/MSC compile issues.
wget command line option seems to have changed?
2005-06-27 15:40:56 +00:00
Paul Smith
a36cfed31a Date update. 2005-06-27 01:01:54 +00:00
Paul Smith
da1b137e38 Fix strerror() handling for systems which set ANSI_STRING.
Don't print errors if "include" is specified with no arguments.
New test suite for the $(shell ...) function.
2005-06-27 01:01:07 +00:00
Paul Smith
d6a7894d3a Fix Savannah bug # 1332: handle backslash-newline pairs in command scripts
according to POSIX rules.
2005-06-26 03:31:29 +00:00
Paul Smith
f388233b03 Fix Savannah bug # 13478. If -L is given, take the latest mtime for a
symlink even if it is "dangling" (it doesn't resolve to a real file).
2005-06-25 23:00:17 +00:00
Paul Smith
6cdaff0948 Fix Savannah bug #1454: skip over semicolons (and comments) inside variable
references in target definition lines.
2005-06-25 21:30:13 +00:00
Paul Smith
1dd9ed1c05 Fix -W foo yielding infinite recursion in some cases of re-exec.
Added a -W test suite.
2005-06-25 20:00:24 +00:00
Paul Smith
978819e1d6 Add a new variable: MAKE_RESTARTS, to count how many times make has re-exec'd.
When rebuilding makefiles, unset -B if MAKE_RESTARTS is >0.
2005-06-25 18:57:28 +00:00
Paul Smith
467115baae Fix Savannah bug # 1328: if stdout is redirected to a full filesystem, we
check for this and exit with an error.
The closeout.c version from gnulib pulls in too much other stuff, and
gnulib requires an ANSI C 89 compliant compiler, while GNU make (so far)
still wants to work on K&R.
2005-06-12 22:22:07 +00:00
Paul Smith
974d14ac4f Fixes for VMS from Hartmut Becker. 2005-06-10 20:16:28 +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
Boris Kolpackov
af88a3550a Fixed Savannah bugs #13216 and #13218. 2005-05-31 20:54:30 +00:00
Paul Smith
e50e0fdf88 Implement new "if... else if... endif" semantics. 2005-05-13 12:45:30 +00:00
Paul Smith
26d8d00cb7 Fixes to allow "make dist" etc. to work again. 2005-05-10 01:38:18 +00:00
Paul Smith
e4c14a675c Document the secondary expansion method. Also, some other documentation
cleanups.

If we find a make error (invalid makefile syntax or something like that)
write back any tokens we have before we exit.

If we have waiting jobs (using -j + -l) set an alarm before we sleep on
the read() system call, so we can wake up to check the load and start
waiting jobs, if there are long-running jobs we would otherwise be
waiting for.  Suggested by Grant Taylor.
2005-05-08 16:50:58 +00:00
Paul Smith
9d5b5bd2f5 Fix problems with losing tokens in the jobserver, reported by Grant
Taylor.  There are two forms of this: first, it was possible to lose
tokens when using -j and -l at the same time, because waiting jobs were
not checked when determining whether any jobs were outstanding.  Second,
if you had an exported recursive variable that contained a $(shell ...)
function there is a possibility to lose tokens, since a token was taken
but the child list was not updated until after the shell function was
complete.

To resolve this I introduced a new variable that counted the number of
tokens we have obtained, rather than checking whether there were any
children on the list.  I also added some sanity checks to make sure we
weren't writing back too many or not enough tokens.  And, the master
make will drain the token pipe before exiting and compare the count of
tokens at the end to what was written there at the beginning.

Also:
  * Ensure a bug in the environment (missing "=") doesn't cause make to core.
  * Rename the .DEFAULT_TARGET variable to .DEFAULT_GOAL, to match the
    terminology in the documentation and other variables like MAKECMDGOALS.
  * Add documentation of the .DEFAULT_GOAL special variable.

Still need to document the secondary expansion stuff...
2005-05-03 13:57:20 +00:00
Paul Smith
49ee105c68 Fix performance degradation introduced by the second expansion feature.
I did this by adding intelligence into the algorithm such that the
second expansion was only actually performed when the prerequisite list
contained at least one "$", so we knew it is actually needed.

Without this we were using up a LOT more memory, since every single
target (even ones never used by make) had their file variables
initialized.  This also used a lot more CPU, since we needed to create
and populate a new variable hash table for every target.

There is one issue remaining with this feature: it leaks memory.  In
pattern_search() we now initialize the file variables for every pattern
target, which allocates a hash table, etc.  However, sometimes we
recursively invoke pattern_search() (for intermediate files) with an
automatic variable (alloca() I believe) as the file.  When that function
returns, obviously, the file variable hash memory is lost.
2005-04-13 03:16:33 +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
Boris Kolpackov
4923580e3a Fixed Savannah bug #12320. 2005-03-15 15:31:47 +00:00
Boris Kolpackov
d584d0c1c6 Fixed Savannah bug #12267. 2005-03-10 09:14:09 +00:00
Boris Kolpackov
18251c4633 Fixed Savannah bug #12266. 2005-03-09 19:21:34 +00:00
Boris Kolpackov
2860d3b247 Fixed Savannah bug #12202. 2005-03-04 14:31:09 +00:00
Paul Smith
28078b517a - Missing docs for $|
- Update NEWS and AUTHORS files.
- Fix support request #103195.
- Apply patch #3679
- Fix handling of sys_siglist in autoconf/etc.
2005-03-04 12:52:32 +00:00
Boris Kolpackov
cb2f200269 Fixed stem termination and stem triple-expansion bugs. 2005-03-03 17:39:48 +00:00
Boris Kolpackov
0759af440a Fixed Savannah bug #12180. 2005-03-01 08:01:05 +00:00
Paul Smith
a2232470c2 - Fix bug #7144 (infinite loop sometimes with -q and double-colon rules)
- Resolve support request #103195 (rationalize wordlist fn arguments)
2005-02-28 09:41:25 +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
Boris Kolpackov
93bd1bd93c Implementation of the .DEFAULT_TARGET special variable. 2005-02-27 22:24:30 +00:00
Boris Kolpackov
659fc6b55e Implementation of the second expansion in explicit
rules, static pattern rules and implicit rules.
2005-02-27 21:40:23 +00:00
Paul Smith
9d153cc1b1 Add configure operations to support MINGW on Windows. 2005-02-26 01:41:48 +00:00
Paul Smith
6d995b036e Update NEWS file. 2005-02-16 05:38:10 +00:00
Paul Smith
e8ca9b8eb1 Add a patch from Paul Eggert that's been lying around in my directory for
a long time, disabling stack size limits where possible.

Update version to beta2.
2005-02-16 05:03:42 +00:00
Paul Smith
c90f47e832 Flush stdout after printing directory info.
Fix references to MINGW #define constants.
Remove WINDOWS32 ifdef from sub_proc.h.
Only add variables to the command line for recursion once.
New features in run_make_test: #PWD# and #MAKEPATH# replacements.
Test the multi-variable fix in the recursion regression test.
2005-02-10 00:10:57 +00:00
Paul Smith
939167cfc1 Add a new Irish (ga) translation.
Fixed the CVS download URL to be simplified.
Fixed the .texi doc download: the ftp site was decommed so use CVS.
2005-02-09 21:28:00 +00:00
Paul Smith
1ce563a181 Add a Finnish translation.
Update the URL for the GNU translation site in maintMakefile; the old one
stopped working.
2005-02-01 23:02:17 +00:00
Paul Smith
dff0be9e68 Handle build.sh in a better way (recommendation from the automake mailing
list).
2004-12-06 15:03:45 +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
Paul Smith
6c9e53d648 Fix problems with README and build.sh
Apply an old patch from Paul Eggert.
2004-11-30 20:58:52 +00:00
Boris Kolpackov
49ca261bd5 Implemented realpath' and abspath' built-in functions. 2004-11-30 19:51:24 +00:00
Paul Smith
be6a8bc869 Fix bug #10252: Remove any trailing slashes from -C arguments (WINDOWS32).
Add a regression test for "@" before a define/enddef vs. one inside.
2004-11-29 01:35:13 +00:00
Paul Smith
539f513773 Fix for bug #1276: Handle SHELL according to POSIX requirements.
POSIX requires that the value of SHELL in the makefile NOT be exported
to sub-commands.  Instead, the value in the environment when make was
invoked should be passed to the environment of sub-commands.  Note that
make still uses SHELL to _run_ sub-commands; it just doesn't change the
value of the SHELL variable in the environment of sub-commands.

As an extension to POSIX, if the makefile explicitly exports SHELL then
GNU make _will_ use it in the environment of sub-commands.
2004-11-28 23:11:23 +00:00
Paul Smith
d27cac1598 Fix WINDOWS32 bug #11155 with patch from Alessandro Vesely. 2004-11-28 16:58:51 +00:00
Paul Smith
e8e4c19873 Patch for command line parsing for VMS from Hartmut Becker. 2004-11-12 21:30:20 +00:00
Boris Kolpackov
547abfa13e New $(lastword ) built-in function: implementation, documentation and tests. 2004-10-21 17:42:24 +00:00
Paul Smith
71fd6bfa1c Apply patch from Alessandro Vesely for WINDOWS32-specific bug # 9748. 2004-10-06 13:09:22 +00:00
Boris Kolpackov
b0d67e0e15 Moved expansion of simple pattern-specific variables from the rebuild stage
to the read stage.
2004-10-05 16:56:14 +00:00
Boris Kolpackov
fb6410f435 Implemented dontcare flag inheritance when rebuilding makefiles. 2004-09-28 18:13:55 +00:00
Boris Kolpackov
341312cc57 bugfix for exported pattern-specific variables 2004-09-27 18:09:52 +00:00
Paul Smith
29d78ddb28 Update the test template. A few fixes in run_make_test().
Rename implicit_prereq_eval to patternrules, to be the start of a suite
of tests of pattern rules.
2004-09-22 04:36:17 +00:00
Boris Kolpackov
73e7767ffc Fixed bug in implicit rule prerequisite evaluation code. Added test. 2004-09-21 20:23:12 +00:00
Paul Smith
6e51d9c90a Some code cleanups and efficiency enhancements. As far as I can tell
none of these have impacts that are visible to the user (although in
some cases that appears to be nothing more than dumb luck :-/).
2004-09-21 13:51:58 +00:00
Paul Smith
704c60cec0 Remove sindex() and replace with strstr().
Windows: allow users to set SHELL to cmd.exe and have it behave as if no
UNIX shell were found.
2004-09-21 12:07:12 +00:00
Paul Smith
9714e501fb Add some more unit tests for variable flavors.
Allow run_make_tests() to be invoked with an undef makefile string, in
which case it re-uses the previous string.
2004-09-21 05:39:04 +00:00
Paul Smith
0799ce730d Fix some bugs in variable pattern substitution (e.g. $(VAR:A=B)),
reported by Markus Mauhart <qwe123@chello.at>.  One was a simple typo; to
fix the other we call patsubst_expand() for all instances of variable
substitution, even when there is no '%'.  We used to call subst_expand()
with a special flag set in the latter case, but it didn't work properly
in all situations.  Easier to just use patsubst_expand() since that's
what it is.
2004-09-21 04:00:31 +00:00
Paul Smith
08c8105c54 Various enhancements
- OS/2 Patches
  - OpenVMS updates
  - Sanitize the handling of -include/sinclude with and without -k
  - Fix the setting of $< for order-only rules.
2004-05-16 19:16:52 +00:00
Paul Smith
e334942e57 Numerous updates and bug fixes.
A number of W32 cleanups from J.Grant.
A number of OS/2 cleanups from Andreas Buening.
Various random bug fixes.
2004-03-22 15:11:48 +00:00
Paul Smith
f305a52c02 Don't use __STDC__; some compilers don't set it properly.
Use autoconf's test to set HAVE_ANSI_COMPILER and check that instead.
2004-03-06 08:05:17 +00:00
Paul Smith
213ccc2234 More maintainer rules. 2004-03-06 08:00:17 +00:00
Paul Smith
e3e3f15ebc Updates to automate generation of GNU upload artifacts.
Fix a problem compiling on old, pre-ANSI systems.  getloadavg test is still
broken, but make builds.
Document a breakage on SunOS 4.x systems.
2004-03-04 13:42:51 +00:00
Paul Smith
59306b0223 Fix the origin regression test.
Remove sample code from make.h I accidentally left behind.
2004-02-25 19:30:27 +00:00
Paul Smith
be5b33e876 Add in HAVE_STDARG_H to the various port config files. 2004-02-25 01:23:13 +00:00
Paul Smith
f29b86c314 Many compiler warning cleanups.
Small fixes for W32 (from Jonathan Grant  <jg-make@jguk.org>)
Maintainer enhancements to clean up the tree.
2004-02-24 13:50:19 +00:00
Paul Smith
be8c3dbc97 Numerous fixes: patches for OS/2; core for -f ''; makefile updates. 2004-02-23 06:25:54 +00:00
Paul Smith
fafeb87027 VMS fix. 2004-02-21 17:10:41 +00:00
Paul Smith
1f16ee5c2d Many bug fixes etc.
- Apply a fix for the "thundering herd" problem when using "-j -l".
  This also fixes bug #4693.
- Fix bug #7257: allow functions as ifdef arguments
- Fix bug #4518: make sure we print all double-colon rules with -p.
- Upgrade to autconf 2.58/automake 1.8/gettext 0.13.1
- Various doc cleanups, etc.
2004-01-21 06:32:59 +00:00
Paul Smith
2b3ee46f4e Enhancements to the documentation (fixes bugs #1772 and 4898).
Add "!" to the list of shell escape characters: POSIX sh allows it to be
used to negate the return value of the command.
2004-01-08 03:17:08 +00:00
Paul Smith
a35db90275 Fix order-only prerequisites for pattern rules. (Savannah patch #2349).
Add a regression test for this.

Older libraries don't allow *alloc(0), so make sure we don't ever do that.
2004-01-07 19:36:39 +00:00
Paul Smith
ee3d37a591 Fix bugs 5798 and 6195. 2003-11-04 07:40:29 +00:00
Paul Smith
76f034acaa Added MINGW32 changes.
This commits a number of changes from Earnie Boyd that allows GNU make
to build for MINGW32 systems.  Only missing from this commit are the
changes to configure.in etc.; I'm waiting for Earnie to sign papers for
those new files.

Also not here is any README.mingw32 etc. which would explain how to use
this port.
2003-11-03 22:04:09 +00:00
Paul Smith
74216b00a4 Build fixes due to changes in the FSF web site.
Add new language support.
Minor configure, etc. cleanups.
2003-10-22 04:35:27 +00:00
Paul Smith
db401d8e0a Updated for autoconf 2.57, automake 1.7.6, and gettext 0.12.1.
Fixed problems with the dist target (adding missing files).
Workaround for a bug in gettext 0.12.1 po/Makefile.in.in where distclean
wasn't cleaning everything, which caused distcheck to fail.
2003-07-31 13:04:32 +00:00
Paul Smith
e3986eea43 Minor updates for Windows and OS/2. 2003-07-19 02:46:25 +00:00
Paul Smith
1a5beef51f - Fix bug #1405: allow multiple pattern-specific variables to match a target.
- Fix some uncleanliness about the implementation of patterns-specific vars.
- Some enhancements to the OS/2 port.
2003-05-02 01:44:59 +00:00
Paul Smith
652234e967 Fix bug #2515: the .SECONDARY target with no prerequisites wasn't
behaving properly (if you listed prerequisites it worked properly).
2003-03-28 06:31:44 +00:00
Paul Smith
acb2e64966 Fix bug #2892.
More OS/2 updates from Andreas Buening.
Upgrade build system to autoconf 2.57 and automake 1.7.3.
2003-03-25 03:21:42 +00:00
Paul Smith
276d0c7c64 Fix bug #2846. 2003-03-25 02:46:42 +00:00
Paul Smith
955899ef77 Commit fix for bug #1418.
Upgrade to require autoconf 2.56.
Fix a pathological performance hit substituting in large values with
lots of words.
2003-03-25 00:15:25 +00:00
Paul Smith
4068c5e4a3 Add support for OS/2, contributed by Andreas Buening <andreas.buening@nexgo.de>
Also a small patch from Hartmut Becker <Hartmut.Becker@compaq.com> for VMS.
2003-03-24 23:14:15 +00:00
Paul Smith
1fa3db1468 Fix bug #2238: the read.c:eval() function was not entirely reentrant.
Apply patch #1022: fix a memory corruption on very long target-specific
variable definition lines.
2003-01-30 07:49:17 +00:00
Paul Smith
b7c728046e Enhancement (bug #2407) Make error messages more clear. 2003-01-30 06:21:36 +00:00
Paul Smith
d33ff30145 Portability fix for glob.h building in FreeBSD ports system.
Implement a fix for bug # 2169: too many OSs, even major OSs like Solaris,
don't properly implement SA_RESTART: important system calls like stat() can
still fail when SA_RESTART is set.  So, forget the BROKEN_RESTART config
check and get rid of atomic_stat() and atomic_readdir(), and implement
permanent wrappers for EINTR checking on various system calls (stat(),
fstat(), opendir(), and readdir() so far).
2003-01-30 05:22:52 +00:00
Paul Smith
d15a484098 Fix bug #1744: mask extra arguments to recursive invocations of $(call ...) 2003-01-22 13:45:44 +00:00
Paul Smith
dd70c67ea4 Added Ukrainian translation. 2002-12-19 14:31:45 +00:00
Paul Smith
b04a205f3e Add hash.c etc. to various non-UNIX makefiles. 2002-11-19 04:39:15 +00:00
Paul Smith
d696707cb5 Fix eval bugs 1516 and 1517. 2002-10-25 22:01:47 +00:00
Paul Smith
bd108cf45c A few minor fixes to the manual and automake files. 2002-10-25 18:42:52 +00:00
Paul Smith
6374309c6d Convert the source code to use ANSI C style function definitions and
enable the automake ansi2knr capability.

Right now this doesn't quite build using a K&R compiler because of a
problem with the loadavg test program, but the rest of the code works.  I'm
asking the automake list about this problem.
2002-10-14 21:54:04 +00:00
Paul Smith
8bbdbb02b3 Fix bug#1379: don't use alloca() where it could overrun the stack size.
Implemented enhancement #1391: allow "export" in target-specific
variable definitions.

Change the Info name of the "Automatic" node to "Automatic Variables".
Add text clarifying the scope of automatic variables to that section.
2002-10-13 18:50:10 +00:00
Paul Smith
47cd8d4624 Fix core dump on malformed variable line (Debian bug #81656)
Allow SysV-style variable references to use {} in addition to ().
Add variable.h to the POTFILES.in since it has a translatable string.
2002-10-05 13:45:47 +00:00
Paul Smith
d1d9c0274b Update version info. 2002-10-04 03:17:56 +00:00
Paul Smith
ee9584dc8d Don't put .cvsignore files in the distributed tar file. 2002-10-04 02:28:59 +00:00
Paul Smith
9dc79463a9 Fix K&R-isms found on SunOS 4.1.4 builds. 2002-10-04 02:12:52 +00:00
Paul Smith
1d3dfeb74b Some updates for automake 1.7 and prep for releasing 3.80. 2002-10-03 05:46:12 +00:00
Paul Smith
2de1b62112 Add VMS updates from Martin Zinser. 2002-10-01 15:32:14 +00:00
Paul Smith
ae003efd61 Fix a bug handling target/prerequisite names containing comment
characters.
2002-09-23 22:16:40 +00:00
Paul Smith
ebd05dbeb3 Fix a bug exporting/unexporting multiple variables in one command.
Update the text about reporting bugs.
2002-09-18 20:51:58 +00:00
Paul Smith
76652d5d02 Add some indexing to the manual.
Fix a few simple casting warnings, etc.
2002-09-18 04:35:52 +00:00
Paul Smith
dac7b49de4 Fix bug #940 (from the Savannah bug tracker): make sure that target-
specific variables work correctly in conjunction with double-colon
targets.
2002-09-17 21:52:45 +00:00
Paul Smith
d7ebcadadb Fixups for the release. One bug fix, some automake complaint fixes,
and a function return type fix for older systems.
2002-09-12 22:15:58 +00:00
Paul Smith
4a11acf047 Fix HAVE_BROKEN_RESTART logic.
Fix hash.h typos (only noticed when using Windows).
Update .cvsignore files.
2002-09-11 16:55:44 +00:00
Paul Smith
5df75e7265 Fix regex matching for modification time warnings.
The ones we had were weird, and failed for multiple warnings in a
single file.
2002-09-10 22:39:18 +00:00
Paul Smith
bc91c0b23f A few test bug fixes:
* Never use "touch" in make rules; it breaks on most sub-second
    supporting systems.  Use echo "" > $@ instead.
  * Forgot to close test makefiles before using them!

All the above worked fine on Linux but failed miserably on Solaris.
2002-09-10 22:23:20 +00:00
Paul Smith
5297a83b27 Have the test driver check for the new format of the time skew error
messages.
2002-09-10 20:59:03 +00:00
Paul Smith
7ea029a07c Add support for broken SA_RESTART on PTX.
Fix bug #103: allow ifdef, export, and unexport to expand their arguments.
2002-09-10 07:27:28 +00:00
Paul Smith
9b41488ad1 Whoops; configure wasn't looking for memmove. 2002-09-09 21:20:41 +00:00
Paul Smith
988deb489b Fix for complex situations where directories are declared as prerequisites.
Info on this fix from barkalow@reputation.com: thanks!

Some updates/cleanups of some of the tests; added a forgotten -t test, etc.
2002-09-04 07:26:19 +00:00
Paul Smith
d2429d7508 Update some NEWS and README nits, and add new gettext macros to config's
Makefile.am.
2002-09-03 21:43:04 +00:00
Paul Smith
299c72e6ed Update to a new version of automake and gettext.
Invent a new macro HAVE_DOS_PATHS and change various instances of:
  #if defined(WINDOWS) || defined(__MSDOS__)
to use the new macro instead.  This should help make the OS/2 port
cleaner, as well.
Invent a cvs-clean maintainer target that tries to get the workspace
back to the state it was in after a CVS checkout.
New language.
2002-08-10 01:27:16 +00:00
Paul Smith
ee3a4f9dd6 Change the version.
Update to require new gettext.
Change hash.c to by K&R.
Redo some strings to make i18n simpler.
2002-08-08 05:39:17 +00:00
Paul Smith
f2ceb0d68a Incorporate some VMS fixes.
Add -B option docs.
Add .VARIABLES variable.
Add a few new tests.
Add a new translation: Swedish
2002-08-08 00:11:19 +00:00
Paul Smith
bccb277dda New variables, .VARIABLES and .TARGETS. 2002-08-01 13:16:57 +00:00
Paul Smith
a56563badd Make sure templates are built. 2002-07-14 02:57:04 +00:00
Paul Smith
21cf8c6444 Install Greg McGary's patches to port the id-utils hashing functions to
GNU make.  Also he provides some other performance fixups after doing
some profiling of make on large makefiles.

Modify the test suite to allow the use of Valgrind to find memory problems.
2002-07-11 06:38:57 +00:00
Paul Smith
4d72c4c11e Implement SysV-style $$@ support. I looked at E.Parmelan's patch but
decided to implement this a different way, and didn't use it.
2002-07-10 12:59:07 +00:00
Paul Smith
6c9a393f95 Documentation and tests for order-only prerequisites.
Add a new test suite for automatic variables.
2002-07-09 06:35:56 +00:00
Paul Smith
724925be2b Various cleanups reported by people using the alpha release.
Incorporate "order-only" prerequisites patch.  Wrote a test for it.
The test shows what might be a bug in the code; I need to look at it
more closely (anyway it doesn't behave as I expected).  Also I haven't
done the docs yet.
2002-07-08 13:05:02 +00:00
Paul Smith
2f20fc1cc7 Remove .po files; we'll retrieve them directly from the translation site. 2002-07-08 03:25:34 +00:00
Paul Smith
8572d6adf0 Major updates in preparation for 3.80.
New version of the manual, put into the doc subdir.
Enhancements: $(eval ...) and $(value ...) functions, various bug
fixes, etc.  See the ChangeLog.
More to come.
2002-07-08 02:26:47 +00:00
Paul Smith
4a07398023 Update the README template. 2002-05-29 22:24:09 +00:00
Paul Smith
99e01f61fd Install newest German translation. 2002-05-13 14:40:16 +00:00
Paul Smith
9052b52dfc Fix Debian bug #144306: pass target-specific variables into the environment
properly.

Fix configure: allow cross-compilation; fix getloadavg (still needs _lots_
of work!)

Let $(call ...) functions to be self-referencing.  Lets us do transitive
closures, for example.
2002-05-10 03:15:07 +00:00
Paul Smith
5dedf7be63 Remove our local copy so we can use the standard version. 2002-04-24 21:52:21 +00:00
Paul Smith
2276c37ae7 Add back initial "\" which was accidentally removed a year ago! :-/. 2002-04-24 21:36:38 +00:00
Paul Smith
306462f0bd Updates for new tools. Everything works now building on Linux,
including creating make packages.  I'll try some other systems tomorrow.
Also added a new translation: Croatian.  Thanks!
2002-04-22 04:35:19 +00:00
Paul Smith
3a8a7a5d00 Updates and fixes for CVS builds.
Created a README.cvs describing the procedure.
2002-04-22 02:11:31 +00:00
Paul Smith
7ed1a08985 Update GNU make to use Autoconf 2.53, Automake 1.6.1, Gettext 0.11.1.
We're using Gettext's "external" feature to avoid including the intl
code in the GNU make distribution.
2002-04-21 23:57:24 +00:00
Paul Smith
cae1db6ecd Installed a new translation for Hebrew. 2002-04-20 19:35:15 +00:00
Paul Smith
dad29566b3 Updates to translaations.
Fix an assert() in an obscure use of -q
Handling of double-colon timestamp updates was broken in a bizarre way.
Store arguments to $(call ...) functions in simple variables, not recursive
variables.
2002-04-20 19:25:54 +00:00
Paul Smith
d242ee9053 Install updated translations. 2002-03-12 01:36:17 +00:00
Paul Smith
1d9d40a209 Install a new Japanese translation. 2001-12-04 18:47:02 +00:00
Paul Smith
c0312423d9 Update copyright info. 2001-11-18 18:38:02 +00:00
Paul Smith
9302338304 Installed the da.po (Danish) translation file.
Fixed some translation string issues.
2001-08-19 04:55:51 +00:00
Paul Smith
74f08c639d Installed a new French translation (resolves Debian Bug #106720) 2001-08-03 19:02:51 +00:00
Paul Smith
635a784ebf New/updated translations; minor update to the index of the manual. 2001-07-05 00:35:03 +00:00
Paul Smith
4c28600a50 New translation. 2001-06-01 03:57:19 +00:00
Paul Smith
ce2c6eadf1 Fix for EINTR problems when using jobserver.
New translation files.
Fix for @+ inside define macros being applied too widely.
Various other bug fixes.
2001-06-01 03:56:50 +00:00
Paul Smith
5d582d4ba0 Some VMS fixes sent by John Fowler.
Fix: make flags on some lines of define/endef don't affect other lines
2001-05-21 06:16:00 +00:00
Paul Smith
8f2b1e2c7c Some bug fixes and document updates. 2001-01-21 06:49:11 +00:00
Paul Smith
e5324a8c6a * Fix FAT handling on Windows to match the DJGPP port's FAT handling.
* Fix a potential hole in readline if lines end in ^M (CRLF).
2000-11-17 06:59:08 +00:00
Paul Smith
d5a04ee984 * Various bug fixes.
* New Galician translation.
2000-10-05 16:27:06 +00:00
Paul Smith
50ba270762 * Rework phrasing to allow for better translations.
# New Japanese translation file.
2000-09-21 04:14:38 +00:00
Paul Smith
8ddf04c627 Fix PR/1831. See the ChangeLog. 2000-08-21 06:18:35 +00:00
Paul Smith
1a82956eae * Various fixes; see the ChangeLog. 2000-07-30 18:26:42 +00:00
Paul Smith
3c132f10f3 * Minor code cleanups
* Fix for PR/1811, from Paul Eggert.
2000-07-07 17:34:56 +00:00
Paul Smith
88187d9f4b * Fix PR/1791. 2000-06-23 19:43:11 +00:00
Paul Smith
775b644765 * Released 3.79.1 2000-06-23 18:55:43 +00:00
Paul Smith
fcbfe98cbe * Fix -q so it works more correctly.
* Don't print "nothing to do" messages for ":" commands
* Update the version to 3.79.1
2000-06-23 15:55:46 +00:00
Paul Smith
cbe92a2241 * Fix PR/1709. 2000-06-22 00:45:34 +00:00
Paul Smith
d5f7eb2897 * A couple of nits. 2000-06-20 21:32:40 +00:00
Paul Smith
3e6f48b444 * More updates and fixes. 2000-06-20 05:48:40 +00:00
Paul Smith
0d70d05458 * Various fixes for problems in the 3.79.0.1 pretest. 2000-06-19 21:22:44 +00:00
Paul Smith
f04e78f11b * Typo. 2000-06-14 22:29:48 +00:00
Paul Smith
c392c19335 * More fixes for configuring gettext correctly. 2000-06-14 22:29:30 +00:00
Paul Smith
4972b017b6 * Some timestamp fixes from Paul Eggert.
* Fix compilation on Linux; use libintl.h and not gettext.h when using
  the system gettext.
2000-06-13 05:22:52 +00:00
Paul Smith
4a5550c822 * Lots of bug fixes and cleanup; new i18n files, etc. 2000-06-07 05:43:37 +00:00
Paul Smith
e5c40f6e5a New translation files. 2000-06-01 14:37:58 +00:00
Paul Smith
5ed9fb46b2 * Various bug fixes. 2000-04-22 02:11:17 +00:00
Paul Smith
f9c91ec34d * Some final cleanups, and release 3.79. 2000-04-05 16:02:55 +00:00
Paul Smith
f3a974bf32 * Fix bug handling archive members: convert timestamp to nsec properly
on those systems that support it.
2000-04-03 05:58:41 +00:00
Paul Smith
c67266ceac * New config.sub and config.guess
* Update version number for release
* Fixes to the build.sh to handle i18n/gettext
* Make dash-n more robust.
2000-03-29 03:23:18 +00:00
Paul Smith
4145bcbcda * Handle case of empty static pattern rule prerequisites.
* Fix linenumbers in error messages for rule definitions.
2000-03-27 20:53:50 +00:00
Paul Smith
c637af71d9 * A large number of fixes/enhancements. See the ChangeLog.
* Added a new version of the German translation file.
2000-03-27 06:54:37 +00:00
Paul Smith
a81013175c * Ignore attempt to change a file into itself.
* Define COFLAGS to avoid unknown variable warning.
* Fix some usec problems on UnixWare.
* Don't remove .INTERMEDIATE targets specified on the command line.
2000-03-26 06:56:54 +00:00
Paul Smith
75f879f37f * Fix backslash-escape in targets.
* Release 3.78.91.
2000-02-09 19:57:15 +00:00
Paul Smith
e68a27ec7b * Fix some warnings in gettext.c and function.c
* Don't try to execute tests which are actually directories.
2000-02-09 07:02:18 +00:00
Paul Smith
17f2dda0ac * Fix for dir.c from Andreas Schwab.
* Fix += target-specific variables: if your direct parent doesn't have a
  setting for the variable but his parent does, you'll get recursive
  expansion errors.
2000-02-07 19:54:04 +00:00
Paul Smith
90f23f1ea6 * Updates for VMS, Windows, and DOS ports.
* Clean up some warnings.
2000-02-05 07:50:47 +00:00
Paul Smith
9b0a3d91ea * Fix PR/1407.
* Keep filename/lineno information for variables, for debugging.
2000-02-05 07:37:40 +00:00
Paul Smith
95a09e94f7 * Some pre-pretest release cleanup. 2000-01-27 00:00:27 +00:00
Paul Smith
de2a8fc730 * Updated gettext to use more advanced libit 0.7 version.
* Various cleanups.
2000-01-25 07:42:51 +00:00
Paul Smith
447c76f601 * A few fixes. 2000-01-23 07:05:16 +00:00
Paul Smith
24aec1878b * Mention it in NEWS. 2000-01-22 08:59:09 +00:00
Paul Smith
2fd5b943d1 * Implement GNU gettext internationalization support in GNU make. 2000-01-22 08:57:17 +00:00
Paul Smith
74fca88bf3 * More fixes to VMS by Hartmut Becker. 2000-01-22 05:59:28 +00:00
Paul Smith
5577cdc261 * Merge VMS patches by Hartmut Becker. 2000-01-22 05:43:03 +00:00
Paul Smith
b7b83d6398 * Change $(call...) to not expand arguments by default.
* Unify the way arguments are passed to builtin functions in function.c.
2000-01-11 07:31:42 +00:00
Paul Smith
af44f16799 * Fix problems with double-colon rules.
* Fix problems with INTERMEDIATE rules.
1999-12-18 17:43:47 +00:00
Paul Smith
1a35bfb45b * Various changes and fixes. See ChangeLog. 1999-12-08 20:13:50 +00:00
Paul Smith
4d5c556f00 * Update debugging to use string flags instead of integers. 1999-11-27 08:09:42 +00:00
Paul Smith
ce3413f883 * Add new debug header file. 1999-11-22 06:16:48 +00:00
Paul Smith
217ca5d910 * Add new debugging output level selection feature. 1999-11-22 06:15:35 +00:00
Paul Smith
ebb733c0f9 * Many cleanups and bugfixes.
* New handling of += in target-specific variables.
1999-11-17 07:33:47 +00:00
Paul Smith
3e26bde6db * Fix PR/1394.
* Apply changes from Paul Eggert.
* Many other cleanups (index/rindex --> strchr/strrchr, etc.)
1999-10-15 07:00:58 +00:00
Paul Smith
c71200d022 * Ensure -Iglob comes before any user-specified CPPFLAGS. 1999-10-14 23:20:12 +00:00
Paul Smith
281951154b * Fix PR/1379: -n/-q behaves correctly when all commands are recursive. 1999-10-13 07:00:23 +00:00
Paul Smith
829f4fd04b * Fix test suite on DOS (PR/1344)
* Fix target-specific vars bug (PR/1378)
1999-10-08 06:32:24 +00:00
Paul Smith
f26e413b12 * Fix for DOS short filenames. 1999-09-29 06:29:38 +00:00
Paul Smith
dbb8f3e30b * Ouch: found a bug where re-exec from changed makefiles turned off
jobserver :(.
1999-09-23 18:23:33 +00:00
Paul Smith
c828aeaa98 * Oops. Fix a problem running submakes like $(MAKE) $(MFLAGS). 1999-09-22 05:57:52 +00:00
Paul Smith
3c83c469e4 * Fix escaping from perl to the shell. 1999-09-17 04:20:45 +00:00
Paul Smith
a63f51340b * A few script fixes and updates for 3.78. 1999-09-17 03:15:37 +00:00
Paul Smith
45e04a5860 * Some minor pre-release updates. 1999-09-16 05:58:44 +00:00
Paul Smith
6ec7d1881c * Fix some tests. 1999-09-16 03:43:10 +00:00
Paul Smith
c800367385 * Cleanup the test suite. 1999-09-15 22:23:35 +00:00
Paul Smith
0d366b6682 * Added the test suite to the main distribution. 1999-09-14 02:03:19 +00:00
Paul Smith
4121dea6a5 * Some configuration fixes. 1999-09-14 00:17:58 +00:00
Paul Smith
b88c1d3a3d * Various cleanups for release. 1999-09-11 05:44:53 +00:00
Paul Smith
373dbb43da * Various pre-release cleanups. 1999-09-11 05:10:27 +00:00
Paul Smith
5e9a3e34ac * Some doc and help changes. 1999-09-06 05:21:52 +00:00
Paul Smith
860a30ae1e * Fix for infinite recursion. 1999-09-04 22:05:18 +00:00
Paul Smith
e49b2f15c9 * Removed a memory stomp (reading freed memory).
* Fixed some infinite recursion on rebuilt makefiles bugs.
1999-09-03 22:46:28 +00:00
Paul Smith
10fee1c03c * A few W32 fixes for backslash support. 1999-09-02 00:31:21 +00:00
Paul Smith
82f0c5495a * A bugfix on MAKEFLAGS options creation that broke jobserver.
* Put the host info in the --version output.
* Don't croak if the user forces -jN on submakes.
1999-09-01 08:04:30 +00:00
Paul Smith
bf7cc546dd * Added config.guess/config.sub for new autoconf tests. 1999-09-01 03:58:04 +00:00
Paul Smith
27255c5b51 * Large file support for AIX, HP-UX, and IRIX.
* W32 support for Cygnus Cygwin shell (bash).
1999-08-31 17:02:31 +00:00
Paul Smith
b134da5505 * A few cleanups, and 3.77.94 release. 1999-08-25 21:39:28 +00:00
Paul Smith
d0b03e9355 * Terminology change in docs and code. 1999-08-24 04:49:39 +00:00
Paul Smith
5dc4b92b60 * Fix jobserver algorithm again.
* A couple of nits.
* Fix considered pruning for double-colon rules.
1999-08-23 22:15:17 +00:00
Paul Smith
b3fa4b3c7e * Start rewrite of jobserver to avoid unique tokens for debugging. 1999-08-23 05:35:14 +00:00
Paul Smith
6fa76a7d15 * Various changes. 1999-08-22 17:50:57 +00:00
Paul Smith
4ff6c62456 * Code cleanup. 1999-08-19 04:43:46 +00:00
Paul Smith
cbb9e38d10 * Rework jobserver yet one more time.
* Install the $(if ...) function and document it.  Still need some examples.
1999-08-13 07:36:26 +00:00
Paul Smith
9e79637ec3 * Some DOS fixes. 1999-08-12 23:16:42 +00:00
Paul Smith
e34540f79b * Release 3.77.92.
* Complete implementation of new jobserver algorithm.
* A few minor fixups.
1999-08-01 08:12:06 +00:00
Paul Smith
09f1e4cf83 * Applied some DOS updates.
* Started reworking the jobserver algorithm; not complete yet.
1999-08-01 06:05:17 +00:00
Paul Smith
28ef4c4dac * Add gettext macros to start i18n support. 1999-07-28 06:23:37 +00:00
Paul Smith
3a945a665e * Update the manual. 1999-07-26 05:06:58 +00:00
Paul Smith
6dbd348522 * Forgot ChangeLog. 1999-07-24 04:56:06 +00:00
Paul Smith
a9166bb7bc * Some configure fixes. 1999-07-24 04:55:08 +00:00
Paul Smith
4e7ee4fc01 * Bugfix for NT archive support.
* Rework how the jobserver stuff works.
1999-07-23 22:46:47 +00:00
Paul Smith
b05cb1d99e * Make some portability fixes. 1999-07-22 06:29:02 +00:00
Paul Smith
c8a60e7431 * Update the AUTHORS file. 1999-07-22 04:41:51 +00:00
Paul Smith
6d2984e0b2 * Fix backward incompatibility in new function implementation.
* Add support for ARFZMAG archive formats.
1999-07-22 04:31:11 +00:00
Paul Smith
ec50fe2a2b * Installed new versions of GLIBC glob library.
* Installed Tim Magill's "graph pruning" performance enhancement.
* Update version to 3.77.90 for the release.
* Require automake 1.4.
1999-07-22 04:20:14 +00:00
Paul Smith
c69d4c95bf * Installed VMS fixes. 1999-07-21 16:06:18 +00:00
Paul Smith
588da9812e * Add configure option to enable dmalloc library.
* Various code cleanups.
1999-07-21 05:53:23 +00:00
Paul Smith
73846549f6 * Fix memory leaks, fd leaks, and some long-standing bugs recognizing when
targets need to have their modtimes rechecked (-n, etc.)
1999-07-20 22:34:41 +00:00
Karl Berry
169e6b8c3d pdfimage takes braces 1999-07-18 18:19:53 +00:00
Paul Smith
826ab14b26 * Fix some memory and file descriptor leaks. 1999-07-16 22:28:46 +00:00
Paul Smith
a3cf773e29 * Various bug fixes. 1999-07-16 02:25:03 +00:00
Paul Smith
9d89ad56bf * Fix up and document $(apply ...) function. 1999-07-15 07:36:44 +00:00
Paul Eggert
adb1632033 Sync to ftp.gnu.org version of 1999-07-06. 1999-07-13 04:50:09 +00:00
Paul Smith
8df9d54020 * Fixed error rebuilding makefiles with -j>1
* Fixed problem with job pipe and -j>1 when waiting on -l loads.
1999-07-09 22:55:44 +00:00
Paul Smith
9035aa27b7 * Minor code cleanup. 1999-07-08 22:32:38 +00:00
Paul Smith
e1d72ad3f1 * Added -R / --no-builtin-variables flag. 1999-07-08 06:49:52 +00:00
Paul Smith
012254e81e * Various bugfixes/updates. See ChangeLog. 1999-07-06 21:09:32 +00:00
Paul Smith
2858f7a8f1 * Various bug fixes. 1999-06-14 06:50:28 +00:00
Paul Smith
187787286d * Various bug fixes. 1999-06-14 05:26:28 +00:00
Paul Smith
fc0fe4103a * Add new jobserver feature.
* Small updates to the manual
* E.Zaretskii fix for new DJGPP version.
1999-04-25 04:30:55 +00:00
Paul Smith
7f3ffd4019 Clean up some logic. 1999-04-13 02:28:27 +00:00
Paul Smith
a2ea1bd27f If a file declared .INTERMEDIATE already exists before make starts, we
won't delete it--this is how normal intermediate files behave, too.
1999-04-09 05:57:35 +00:00
Paul Smith
3d1cdf4106 * Fix possible memory stomp.
* A few admin file cleanups.
1999-04-02 06:19:33 +00:00
Paul Smith
7052a57152 * Ignore CR in CRLF line terminators for compatibility with DOSsy
makefiles.
1999-03-31 23:25:13 +00:00
Karl Berry
47922a5a65 * texinfo.tex (\defopheader): missing word space before `on'.
Report from: Chris Hanson <cph@martigny.ai.mit.edu>.
1999-03-31 18:30:14 +00:00
Paul Smith
e005a48b9f * More build fixes. I think a vanilla CVS checkout should build OK now. 1999-03-30 06:19:17 +00:00
Karl Berry
0798a61169 * texinfo.tex (\imagexxx): Equalize space above and below if in
vmode.  From rms.
.,
1999-03-27 10:32:23 +00:00
Paul Smith
ecb3bca9f5 * Manual updates: added xrefs, some typos sent by users.
* Change the build env. to not link libglob.a unless we need it.
1999-03-26 07:08:57 +00:00
Paul Smith
c4353af3f9 * Reworked function.c to use separate functions instead of a huge case stmt.
* Added new functions $(error ...) and $(warning ...) and documented same.
* In windows/dos shells, only treat \ as an escape for special chars.
1999-03-26 04:04:42 +00:00
Karl Berry
8363e0496d * texinfo.tex (&): be sure active & is defined for @deftypefn
operator&.
	Report from: Nathan Sidwell <nathan@acm.org>.
1999-03-24 16:04:27 +00:00
Karl Berry
4025030d96 * texinfo.tex: Changes from Andreas to use \sl\$ inside italics
and to avoid extra spaces around @anchor.
	* texinfo.tex (\image, \imagexx): move pdf test to imagexxx for
 		correct filename parsing.
1999-03-20 21:49:38 +00:00
Paul Smith
1e0513335f * Add strneq() (streq only n chars) macro
* fix return type of xstrdup.
1999-03-19 04:27:56 +00:00
Karl Berry
e3d0d562da * texinfo.tex (\imagexxx): reset catcode ^^M in case we're inside
in an example.  Report from kama.
1999-03-16 12:49:21 +00:00
Karl Berry
db865774df * texinfo.tex (\putwordin): new macro for word `in'.
(\xrefX): use it.
1999-03-15 22:34:20 +00:00
Paul Smith
a6a9ebb54f * Define and use xstrdup() instead of strdup(). 1999-03-05 07:13:12 +00:00
Paul Smith
9e6ba6a148 * Update FSF address info in copyright notices.
* Update maintainers build process; remove GNUmakefile.  Require builders to
  run automake && autoreconf by hand.
* Use AC_SUBST_FILE to get the maintMakefile included, rather than GNU
  make's include directive, which conflicts with automake 1.4's include
  directive.
1999-03-05 05:55:11 +00:00
Paul Smith
ede263043c Fix a bug where conditional variables weren't being expanded correctly. 1999-03-04 17:03:56 +00:00
Karl Berry
a8f7173799 * texinfo.tex: Expand tabs. 1999-02-22 12:59:43 +00:00
Paul Smith
a66668aabc * New feature: .LIBPATTERNS controls the way -lfoo dependencies are expanded.
* A few tweaks to the system glob test, after trying it on a system where
  it's true.
* Installed patches to archive handling for AIX 4.3 big archives.
* Fix a memory stomp in target-specific variables.
* Fix a memory leak in foreach functions.
1999-02-22 07:23:30 +00:00
Paul Smith
84f38c9c6f * Updates for automake 1.4 and autoconf 2.13
* Check for a libc version of GNU glob and, if found, don't use the local
  glob headers.
* Fix a bug in OpenVMS archive handling.
* Fix a bug in VMS siglist processing.
1999-02-19 18:07:49 +00:00
Karl Berry
5808507144 * texinfo.tex (\paragraphindent): implement.
Suggestion from: Paul DuBois <dubois@primate.wisc.edu>.
	* texinfo.tex (\alias): use def rather than \let.
	Change timestamp format to include hours.
1999-02-15 13:15:05 +00:00
Karl Berry
e3ef8e974c * texinfo.tex: New commands @alias and @definfoenclose.
From: "Eric S. Raymond" <esr@snark.thyrsus.com>.
1999-02-09 15:10:17 +00:00
Karl Berry
281cdd5d74 * texinfo.tex (\scanmacro): Use \endinput to avoid spurious space,
and various other space fixes.  From: Andreas Schwab
 		<schwab@ls5.informatik.uni-dortmund.de>.
1999-02-08 19:55:39 +00:00
Karl Berry
3634e15fe3 * texinfo.tex (\uref): implement optional third arg.
* texinfo.tex (\dosubind): Include index entry in third arg to
		\entry instead of writing as bogus fourth arg.
	Report from: kama@hippo.fido.de (Karl Heinz Marbaise).
	* texinfo.tex (\setemergencystretch): Increase somewhat.
	* texinfo.tex (\putwordof): rename from \putwordOf.
	* texinfo.tex (defivarhead, \defcvarheader): Use \putwordof.
1999-02-05 10:33:07 +00:00
Karl Berry
9c95acec4b * texinfo.tex (\documentlanguage, \documentencoding): new
commands.  \documentlanguage based on an implementation by kama.
1999-02-03 11:35:04 +00:00
Karl Berry
8b55cda094 * texinfo.tex: Fix @macro expansion inside @section. Patch from
Andreas:
	From: Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>
	The general idea is to construct a list a all defined macros in
 		the form \do\macro1\do\macro2..., then temporarily define
 		\do to something appropriate and execute the list to do
 		whatever is needed.  Here is a patch, and i have also
 		fixed a few other bugs that i found while browsing through
 		the @macro implementation.  Additionally i have added a
 		check to prevent the user from doing silly things like
 		@macro shipout.
1999-01-30 13:16:18 +00:00
Karl Berry
9d9111c450 * texinfo.tex (\obstexwarn): Don't use *** in message, it
interferes with make output parsing.
1999-01-24 16:04:24 +00:00
Karl Berry
0f686c1e6b * texinfo.tex: Internationalization improvements from kama. 1999-01-22 10:24:18 +00:00
Karl Berry
6eeae809a8 * texinfo.tex (\contents, \shortcontents): Run \contentspagealignmacro.
From: Trond Endrestol <trond@agamemnon.gtf.ol.no>
1999-01-21 10:37:08 +00:00
Karl Berry
5b16b3c015 * texinfo.tex (\begindoublecolumns): Ship out \partialpage
immediately if it is nonvoid, instead of saving it.  This avoids a
	bug where the index could end up printing one line per page (see
	the indexspread.tex test).
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>

	* texinfo.tex (\image): If running pdftex, do \pdfimage{imagefile.pdf}.
 	From: Samuel Tardieu <sam@inf.enst.fr>

 	Also, update copyright year.
1999-01-15 09:29:00 +00:00
Karl Berry
c0ec561e37 * texinfo.tex (\enddoublecolumns): Move \pagegoal reset to after
the \endgroup so we get the restored single-column \vsize
 		as intended.
1999-01-06 11:11:58 +00:00
Karl Berry
71aacd9fe0 * texinfo.tex (\indexdummies): Set \{ and \} to \mylbrace and
\mybrace to avoid braces in the index file, which
	texindex can't handle.
1998-12-21 15:36:12 +00:00
Karl Berry
dc7cf1c4b2 * texinfo.tex (\pickupwholefraction): Ignore whole-number part.
(\setuptable): Always pass whole-number part and decimal point.  This
	allows leading zeroes.
	Suggestion from: Ben Bullock <ben@hayamasa.demon.co.uk>.
	Date: Fri, 21 Aug 1998 14:06:50 +0100 (BST)
1998-12-20 12:55:40 +00:00
Karl Berry
7f83bfe911 * texinfo.tex (\indexdummies): set \{ and \} to \lbracecmd and
\rbracecmd to avoid lossage if @tex is active during \shipout.
	Report from: "Peter Kabal" <Kabal@ece.mcgill.ca>.
1998-12-15 21:48:39 +00:00
Karl Berry
45406fc744 doc fix 1998-12-12 20:44:40 +00:00
Karl Berry
76468fbaa1 update date 1998-11-13 23:00:02 +00:00
Karl Berry
2116c80dc7 1998-11-11 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* doc/texinfo.tex (\onepageout): Put the cropmarks in vboxes of
	zero height so that they don't contribute space themselves.
	Compensate for \topandbottommargin.
	(\internalpagesizes): Advance \outervsize by 2\topandbottommargin,
	not only 0.6in.
1998-11-13 22:49:41 +00:00
Karl Berry
28eecbb94f * texinfo.tex: Use standard time-stamp.el package instead of
update-date.el.
.,
1998-11-08 18:39:08 +00:00
Karl Berry
9ad3cb03b7 * texinfo.tex (\indexnofonts,\indexdummies): add \url and \uref to
list.
1998-11-01 12:43:32 +00:00
Karl Berry
0be25c6986 * texinfo.tex (@env, @command, @option): Must disable for index
and xref commands.  Also, \input plain if necessary before
 		using {} in the version number.
1998-10-27 16:59:40 +00:00
Richard M. Stallman
4dfe38353e Mention Automake.
Mention DESTDIR.
Comment on changing prefix or exec_prefix.
1998-10-15 15:29:00 +00:00
Paul Smith
3948640154 Ignore non-empty lines which become empty after variable expansion.
Don't choke on invalid pattern rules if we fail during makefile parsing.
Don't dump core if a non-empty command becomes empty after expansion.
1998-10-13 20:59:08 +00:00
Paul Smith
2c64fb221a Checkpoint changes. Bug fixes, mostly. 1998-10-03 05:39:55 +00:00
Paul Smith
e90887e68a Don't use a separate configure.in for the glob directory. It now uses
the configure script for make proper.
1998-10-03 05:23:25 +00:00
Karl Berry
321b447568 * texinfo.tex: Use date as version number instead of RCS, and
update-date to update it.
1998-09-30 15:43:32 +00:00
Richard M. Stallman
b5722838c2 Treat __GNU__ line NeXT: undefine BSD and FSCALE. 1998-09-27 07:29:59 +00:00
Karl Berry
7a43e6cd30 * texinfo.tex: Fix @macro expansion of @code with _ in the
argument.
 	From: Zack Weinberg <zack@rabi.columbia.edu>.
1998-09-17 17:25:42 +00:00
Karl Berry
84d159bb64 * texinfo.tex (\itemzzz): take \itemmargin into account when
unhboxing.  Reported by Bob.
1998-08-28 14:29:37 +00:00
Karl Berry
050f9d9f5d * texinfo.tex: Change @defun environments so that right margin is
not changed, and instead the defun type label is outdented
 		into the margin.
1998-08-14 20:54:46 +00:00
Karl Berry
50b5c15b54 * texinfo.tex (\smartslanted): define this separately from
\smartitalic.
	(\emph, \i): use \smartitalic for true italics.
1998-08-13 17:33:06 +00:00
Karl Berry
fc6cca1c7c * texinfo.tex (\value): handle active _ or - in argument (happens
if called from @code).
 	Report from: Dave Love <d.love@dl.ac.uk>.
1998-08-10 19:17:34 +00:00
Paul Smith
5d1d6aa6de Attempt to add back ^M's. 1998-07-31 05:18:21 +00:00
Paul Smith
e2403327e9 GNU make release 3.77. 1998-07-30 20:54:47 +00:00
Karl Berry
65a7296e2c * texinfo.tex (\dosubind): Don't do \vskip to preserve \lastskip
unless we are in vertical mode.  Otherwise we might end a
 		paragraph prematurely, and \folio won't get expanded by
 		\output.
 	Report from: "Richard E. Stone" <res@rstone.mn.org>
1998-07-19 14:20:42 +00:00
Karl Berry
99454e6a1e * texinfo.tex: Keep track of how negative the page numbers have
gotten:
	(\lastnegativepageno): New \count register.
	(\startcontents): Use it.
	(\contents, \summarycontents): set it.
1998-07-17 12:00:43 +00:00
Karl Berry
411a01acce * texinfo.tex (\imagexxx): Add some space around the image if it's
by itself.
1998-07-14 19:03:08 +00:00
Karl Berry
33654a7af4 1998-07-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* texinfo.tex (chapterzzz): Put a space before the chapter number
	in the message.
	(appendixzzz): Use \putwordAppendix in the message.

Thu Jul  9 08:39:53 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex (\macro): Globalize assignments since it's done
		inside a group.  From Zack.

Mon Jul  6 17:21:25 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex (\comment): Speed up.
	(\loggingall): Turn on eTeX's extended tracing.
	More macro fixes.
	Date: Sat, 04 Jul 1998 14:51:49 -0400
	From: Zack Weinberg <zack@rabi.phys.columbia.edu>
1998-07-12 17:28:02 +00:00
Karl Berry
fa1ec9e1f3 * texinfo.tex (\contents, \summarycontents, \startcontents): Use
roman numerals for toc, arabic outside, even when toc is
 		at the beginning.
1998-07-02 14:22:24 +00:00
Karl Berry
fefeb0f7bd * texinfo.tex (\anchor): New command @anchor.
(\xrefX): Avoid double space when xref to an @anchor or an @unnumbered.

	* texinfo.tex (\itemzzz): Use kerns and \unhbox when item text
		fits in the space, so footnotes can work.
1998-07-01 14:28:14 +00:00
Karl Berry
6cca2382f0 * texinfo.tex (\setref): Take additional argument for the -snt
xref.  Call \indexdummies.
	(\donoderef, \appendixnoderef, \unnumbnoderef): Change \setref calls.
1998-06-29 14:07:11 +00:00
Karl Berry
44309109fe * texinfo.tex (\contents, \summarycontents): Must not be \outer. 1998-06-27 23:30:48 +00:00
Karl Berry
d153373039 * texinfo.tex (\writetocentry): New macro.
(\chapternofonts): No longer needed.
	(\chapter, ..., \unnumberedsubsubsec): Change all the sectioning
		commands to call \writetocentry instead of doing it inline.
	Also, do not call \chapternofonts, we avoid expansion with
		\the\toks instead.
	(\opencontents): No longer needed, instead \writetocentry opens
		the file when necessary.
	(\setfilename): Don't call \opencontents.
	(\ifsetcontentsaftertitlepage, \ifsetshortcontentsaftertitlepage):
		New conditionals.
	(\Etitlepage): Call \contents and/or \shortcontents if
		conditionals are set.

	Global: use \nobreak instead of \penalty 10000 for epsilon efficiency.
1998-06-27 19:12:04 +00:00
Karl Berry
ccac245bf5 * texinfo.tex (\acronym): New Texinfo command. 1998-06-25 12:31:28 +00:00
Karl Berry
f106953139 * texinfo.tex (\dots, \enddots): Missing \leavevmode.
Report from: Thomas Esken <esken@nmlab.informatik.fh-dortmund.de>
	Date: Tue, 23 Jun 1998 14:22:27 +0200 (MET DST)
1998-06-24 11:45:50 +00:00
Karl Berry
54727192c0 * texinfo.tex: Rewrite of index stuff to do better column breaking
and balancing.
	The old code failed miserably when the index was just the wrong size,
	e.g., the Autoconf manual with @afourpaper.
	Bug report from: Wilhelm Mueller <muewi@hb.senbvs43.uni-bremen.de>
	Date: Fri, 12 Jun 1998 16:34:49 +0200 (MET DST)
	(\initial): Add more glue around the initial, and make it a
		multiple of \baselineskip.
	(\entry): Add glue before each entry so the columns can always be the
	 same height.
	(\doublecolumnout): Available space no longer needs to handle
	 \partialpage specially.
	(\pagesofar): Take \ht\partialpage into account with \vsize.
	(\enddoublecolumns): Reset \output to avoid calling
		\balancecolumns twice
	(\balancecolumns): Format for readability.
	(\initialskipamount): No longer needed, remove.

	(\hbadness): Increase a bit, boxes that are a little underfull look ok.
1998-06-23 14:28:30 +00:00
Karl Berry
20258f42d4 * texinfo.tex (\ninettsl): cmsltt10 is not standard, so use
cmsltt10 scaled 900.
 	Date: Mon, 15 Jun 1998 12:35:41 +0200 (MET DST)
 	From: Werner Struckmann <struck@ips.cs.tu-bs.de>.
1998-06-22 13:00:05 +00:00
Karl Berry
4f79de612b * texinfo.tex: @macro fixes from Zack Weinberg
<zack@rabi.phys.columbia.edu>.
 	- @ifblah did not work inside @macro
        - spaces in parameter lists in macro definitions caused errors
        - leading spaces in parameter lists in macro invocations were
	  preserved inappropriately.
1998-06-19 11:50:37 +00:00
Karl Berry
ea9504a609 * texinfo.tex (\smallformatx, \smalldisplayx): New macros.
(\smallbook): Arrange to use them.
	(\display, \flushleft, etc.): Rewrite to avoid duplication.
1998-06-12 19:10:27 +00:00
Karl Berry
511cb55530 * texinfo.tex (\pagesizes): Rename to \internalpagesizes.
(\custompaper): Rename to \pagesizes.
1998-06-08 21:37:20 +00:00
Karl Berry
65d7b12aeb * texinfo.tex: Rewrite paper size definitions, add @custompaper.
* texinfo.tex: Fix for macros in arguments to other commands.
  		From Zack.
1998-06-07 13:35:32 +00:00
Karl Berry
2968844002 * texinfo.tex: Better @macro implementation.
From: Zack Weinberg <zack@rabi.phys.columbia.edu>.
1998-06-05 20:10:04 +00:00
Karl Berry
a709205e81 * texinfo.tex (\imagexxx): Center image if it is not part of a
paragraph.
1998-05-27 21:04:33 +00:00
Karl Berry
9391fb8e4c Tue May 19 17:17:12 1998 Karl Berry <karl@cs.umb.edu>
* texinfo.tex: \linkstrue by default.
	Also, first implementation of @macro; can only handle some cases,
 		but that is better than nothing.
	From: Zack Weinberg <zack@rabi.phys.columbia.edu>

Thu May 14 17:32:47 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex: New command @novalidate along the lines of makeinfo
		--no-validate.
	Date: Sun, 26 Oct 1997 18:54:47 -0500
	From: Zack Weinberg <zack@rabi.phys.columbia.edu>
1998-05-19 21:26:03 +00:00
Ulrich Drepper
4950159344 automatically generated from GPLed version 1998-05-19 07:09:32 +00:00
Karl Berry
91da8b09df * texinfo.tex (\valuexxx): Split up into expandable and
non-expandable parts.
	(\expandablevalue): New macro.
	(\indexdummies): \let\value = \expandable value.

	* texinfo.tex: Doc fixes.

	* texinfo.tex (\doind): Just call \dosubind with empty third arg.
	(\dosubind): Replace with \doind definition and suitable code to handle
	possible third arg.  And propagate glue past the whatsit from the
 	\write so index entries don't cause extra space between
 	@defuns (for example).

Wed May  6 12:51:27 1998  Karl Berry  <karl@cs.umb.edu>

	* texinfo.tex (\deftypemethparsebody): Handle the extra arg in
 	@deftypemethodx, too.
	(\deftypefunx): Error definition was misspelled as \deftypeunx.
1998-05-13 12:44:07 +00:00
Karl Berry
e3e88767f1 (\putwordon, \putwordMethodon): New macros.
* texinfo/texinfo.tex (\putwordon, \putwordMethodon): New macros.
  	Use in \def... commands.
	(\indexdummies): make `\ ' be just ` ' for sorting.
	(\deftypemethparsebody): New macro.
	(\defmethod): Call it.
	Various doc fixes.
	Repored by: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise)
	Date: Wed, 07 Jan 1998 10:19:42 +0100
1998-05-02 14:14:31 +00:00
Ulrich Drepper
76ae1bc064 automatically generated from GPLed version 1998-04-27 23:45:12 +00:00
Ulrich Drepper
e24c9e161a automatically generated from GPLed version 1998-04-27 23:45:12 +00:00
Ulrich Drepper
f0a7421adc automatically generated from GPLed version 1998-04-13 23:54:17 +00:00
Ulrich Drepper
8204f56f2f automatically generated from GPLed version 1998-04-13 23:54:16 +00:00
Karl Berry
e97f8e6f57 @cartouche: Align right side correctly.
From: dale.smith@bellhow.com (Dale Smith)
Date: Fri, 06 Mar 1998 14:47:02 GMT
1998-04-10 20:54:46 +00:00
Karl Berry
20b68e968a (\dosetq): Use \normalturnoffactive instead of just \turnoffactive,
so \'s in node names are handled properly.
(\tie): Move definition to more rational position in the file.
(\@, \{, etc.): Use decimal numbers in all cases, to avoid use of '.
Paranoia only.
(\+): Turn off once and for all at the beginning, and define as
\tabalign in @tex.
1998-04-05 21:19:01 +00:00
Karl Berry
9d31f1e1f1 (\synindex, \syncodeindex): \closeout the redirected index.
From: Jakob Stoklund Olesen <stoklund@mi.aau.dk>
1998-04-01 00:36:53 +00:00
Karl Berry
2fcce1d3b0 (\doignore): Ignore everything after `c', so @end ifinfo and the like
can be commented out.
(\macrocsname): New macro.
Reported by: "James A. Lupo" <lupoja@feynman.ml.wpafb.af.mil>
1998-04-01 00:33:30 +00:00
Karl Berry
1290679bc3 (\doprintindex): Change catcode of @ before \read, in case of
\initial{@} being the line that is read.
Reported by: Drew Csillag <drew_csillag@geocities.com>
1998-02-25 22:54:34 +00:00
Karl Berry
dc70a3bc0b (\dotable): Don't inherit \rightskip from
surrounding environment.  Add \leftskip to \hsize in the first
column.  Set \item to \crcr to avoid empty first row.  Prepend
\parskip glue before table.  Set \everycr locally outside of
alignment, don't reset it explicitly in \Emultitable.
From Andreas Schwab.

Also, work on leading commentary in file a bit.
1998-02-25 20:48:50 +00:00
Karl Berry
aa9ec7c2c7 \!: Save and restore this for @tex.
From: Jean-Pierre Moreau <jpmoreau@ciframedical.com>
Date: Fri, 22 Aug 1997 16:47:36 -0400
1998-02-24 23:05:08 +00:00
Karl Berry
04c488df1c (\angleleft, \angleright): New macros.
(\refx, \email, \key): Use them.
From: Stephen Gildea <gildea@intouchsys.com>
Date: Fri, 26 Dec 1997 11:43:32 EST
1998-02-24 22:48:24 +00:00
Karl Berry
8de0e41662 1997-08-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* doc/texinfo.tex (xrdef): Read the second argument with \ as an
	escape character.
1998-02-23 22:34:20 +00:00
Karl Berry
e94d73997a (\tocentry): Don't \turnoffactive before
typesetting the arguments, it causes special characters to be
printed incorrectly.
1998-01-26 20:40:21 +00:00
Karl Berry
7585dedefc (\dots, \enddots): Use current font instead of always using math italic. 1997-12-24 18:59:06 +00:00
Karl Berry
57ba55d08c Spurious xepsf.tex should be epsf.tex. 1997-12-23 16:33:04 +00:00
Ulrich Drepper
886748c02d automatically generated from GPLed version 1997-12-04 01:16:52 +00:00
Ulrich Drepper
d378e4204d automatically generated from GPLed version 1997-11-06 00:43:09 +00:00
Karl Heuer
e7e9b799c4 Mention YFLAGS and LFLAGS along with CFLAGS. 1997-10-27 03:47:03 +00:00
Karl Berry
a3a7581c1a (\titlefont): Explicitly set \rm. 1997-10-13 19:49:25 +00:00
Paul Smith
3e12cad198 Quick changes for make 3.76.1. 1997-09-19 19:47:55 +00:00
Paul Smith
e2ffc653aa Minor tweaks for 3.76. 1997-09-16 18:08:59 +00:00
Paul Smith
4e58a6ca4c Changes for GNU make 3.76 1997-09-16 14:19:43 +00:00
Paul Smith
41dcca8426 Changes for GNU make 3.76 1997-09-16 14:17:23 +00:00
Paul Eggert
161a026602 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Ulrich Drepper
e244062995 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Paul Eggert
24fec5cb53 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Ulrich Drepper
b903988475 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Paul Smith
6ea87be73b Changes for GNU make 3.75.93. 1997-09-05 21:01:49 +00:00
Paul Smith
f6490d62cf GNU make 3.75.92 1997-08-27 21:14:44 +00:00
Paul Smith
480ad62713 New glob.h to understand __const 1997-08-27 20:43:43 +00:00
Paul Smith
acd666ce50 Updated for GNU make 3.75.92. 1997-08-27 20:36:31 +00:00
Paul Smith
be3fb0ae6d Updates for GNU make 3.75.92. 1997-08-27 20:30:54 +00:00
Paul Smith
dd0c939e78 Last minute 3.75.91 changes. 1997-08-18 20:14:30 +00:00
Paul Smith
fff468765c e the global copy of this lib. 1997-08-18 19:31:49 +00:00
Paul Smith
63dff1e0bc Bug fixes and automake changes. 1997-08-18 18:11:04 +00:00
Paul Smith
e746a9c951 Removed files that are no longer needed now that we use automake. 1997-08-18 16:48:45 +00:00
Paul Smith
74d4418f1c Removed files that are no longer needed now that we use automake. 1997-08-18 15:19:04 +00:00
Miles Bader
062e5f6aae automatically generated from GPLed version 1997-08-14 02:25:35 +00:00
Paul Eggert
c495345f7c automatically generated from GPLed version 1997-08-14 02:16:15 +00:00
Paul Smith
f0239bb0af Final update for 3.75.1. 1997-08-01 06:31:21 +00:00
Karl Berry
2d29a55137 (\email): Let to \uref instead of \code, as a second optional argument
makes sense for this, too.
1997-07-26 19:12:35 +00:00
Richard M. Stallman
806c7aa46c Test __unix' along with unix'. 1997-07-22 21:35:43 +00:00
Jim Meyering
47daa6787e Add comment describing HAVE_PSTAT_GETDYNAMIC. 1997-07-15 13:21:56 +00:00
Karl Berry
eb4d510a74 (\indexdummies): Add \value. 1997-07-14 17:43:41 +00:00
Karl Berry
c86587fb9b (\authorrm): Must use \def instead of \let, as \secrm is not yet
defined.
1997-07-10 17:34:25 +00:00
Richard M. Stallman
fd688f6e9c (\titlefont): Define again, using \titlefonts. 1997-07-10 01:23:38 +00:00
Karl Berry
f96ef9a409 (\startcontents): Leave ^ catcode as other. 1997-07-09 20:45:27 +00:00
Richard M. Stallman
09616e5837 Declare how to hyphenate "whitespace". 1997-07-09 19:40:16 +00:00
Richard M. Stallman
cf9aa5b70b [OSF_ALPHA]: Include sys/mbuf.h, sys/socket.h, net/route.h. 1997-07-06 23:43:39 +00:00
Karl Berry
9033f1a656 (\titlefonts): New macro to set title font styles, so italic etc. work
in @title.
(\titlefont): No longer needed.
(\titlepage): Call \titlefonts instead of \titlefont.
(\chapsf, \ssecsy, \ssecttsl): Correct magstep values.
From: Stephen Gildea <gildea@intouchsys.com>.
1997-07-05 21:51:30 +00:00
Karl Berry
ccfe89b829 (\onepageout): Back up to 2\baselineskip per Stephen.
(\kbdinputstyle): New command.
1997-07-05 21:16:39 +00:00
Richard M. Stallman
35f1bbbe23 [__GNU__]: Test for not NeXT. 1997-07-04 04:45:19 +00:00
gnu
9f88582943 fix TeX overfills -len 1997-07-04 04:42:36 +00:00
Richard M. Stallman
b38d9d2ae9 (\kbdfont, \kbdexamplefont): New macros, parms that
tell @kbd what to do.
(\setkbdinputdistinct, \setkbdinputexample): New commands set them.
(\kbd): Use those parms.
1997-07-04 00:07:28 +00:00
Karl Berry
132e0eda6c (\onepageout): Leave only one line space above the footline, to be more
like plain.  Suggested by Stephen Gildea.
(\evenfootline): Left one too many line spaces here, so reduce by two.

(\ifnottex): Another ignore command.
(\ifnothtml,\ifnotinfo): New commands.
(\doignore): Ignore brace characters, so mismatched braces in ignored
text do not cause complaints.
1997-07-03 20:52:37 +00:00
Karl Berry
c297b2fbd5 (\image): New definition for new @image command. 1997-06-27 19:09:14 +00:00
Richard M. Stallman
ec08feae97 Update FSF address in second place. 1997-06-26 20:56:18 +00:00
Ulrich Drepper
8c7887ac02 update from main archive 970623 1997-06-23 22:48:40 +00:00
Ulrich Drepper
08cf536bfb automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Paul Eggert
b48b02c7f4 automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Ulrich Drepper
e7a0e14a43 automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Paul Eggert
6413a1d08e automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Miles Bader
8f34c48e3f automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Paul Eggert
818bb8940c automatically generated from GPLed version 1997-06-21 03:24:49 +00:00
Karl Berry
cc4d91d751 (\oddfootingxxx),
(\onepageout): Leave space for the footline if present.
(\everyfootingxxx, \everyheadingxxx): Call \oddfootingxxx and
\evenfootingxxx instead of repeating their code.
From: Stephen Gildea <gildea@intouchsys.com>.

(\setfilename): Read texinfo.cnf if present.

(\indexdummies, \indexnofonts): No-op additional commands @result @equiv
@expansion @print @error @point.
From: Dave Bodenstab <imdave@ais.net> (for texi2www doc).
1997-06-18 19:58:18 +00:00
Ulrich Drepper
36d804bd51 Undo last change. 1997-06-13 23:19:09 +00:00
Ulrich Drepper
f95d071efc update from main archive 970612 1997-06-12 23:56:51 +00:00
Karl Berry
c0deecf9ee (\setmultitablespacing): Restore bad typing mistake from yesterday. 1997-06-06 14:31:32 +00:00
Karl Berry
dd63648825 (\uref): Write real definition, taking one mandatory argument and one
optional one.
1997-06-05 22:04:25 +00:00
Karl Berry
229ba33d0e * texinfo.tex (\mainmagstep): Define this as a \count variable
instead of with \let, to make changing to \magstep1 more transparent.
 	From: HERBERT@boevm4.vnet.ibm.com.
	(\uref): New command a la \url.
1997-06-04 21:47:40 +00:00
Paul Eggert
ccbe33db90 automatically generated from GPLed version 1997-05-27 03:15:15 +00:00
Paul Eggert
32efbf8dc3 automatically generated from GPLed version 1997-05-27 03:15:15 +00:00
Paul Eggert
6e3b0629f1 automatically generated from GPLed version 1997-05-27 03:15:15 +00:00
Karl Berry
51659ed000 (\deftypemethod, \deftypemethodheader): New macros to implement
new commands @deftypemethod and @deftypemethodx.
Suggestion from: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise).
1997-05-24 22:06:39 +00:00
Karl Berry
7827f1bde8 (\opnr, \clnr): Increment/decrement \parencount, for
* texinfo.tex (\opnr, \clnr): Increment/decrement \parencount, for
   	  @defun lines with nested parens.  From Bill Schelter
 	  <wfs@fireant.ma.utexas.edu>.
	(\itemizeitem): Correct \errmessage.
1997-05-23 17:02:00 +00:00
Karl Berry
922730c406 (\codeunder): Use \_ and \ifusingtt to avoid dotaccent from _ in roman
fonts, e.g., @deftypefn.
(\tex): Remove spurious spaces at the end of subdefinitions.
From: "John W. Eaton" <jwe@bevo.che.wisc.edu>.
(\url, \email): \let to \code; no quotes or angle brackets.
1997-05-19 21:34:38 +00:00
Richard M. Stallman
5e91041347 Explain which commands should use CFLAGS. 1997-05-17 19:07:42 +00:00
Karl Berry
9f7ba4a505 (\onepageout): \ifcropmarks, center the page body.
Lost this when merged \croppageout with \onepageout.
Found by Arnold.

(\doprintindex): Do not bother to go into double column mode unless
there actually is a non-empty index.

(\begindoublecolumns): Include any existing \partialpage in the new one,
lest we lose a whole page of output.
Found by M J Morley <mjm@scs.leeds.ac.uk>.

(\chapternofonts): Remove spurious spaces, both in the definitions that
get output to the aux file(s) and in this macro.

Fix comments and rationalize whitespace in various other places.
1997-05-05 21:06:33 +00:00
Karl Berry
2745ed943b Avoid expansion in node titles.
Merge cropmarks code into main output routine.
1997-04-27 19:40:44 +00:00
Paul Eggert
0cb72b4a51 automatically generated from GPLed version 1997-04-18 00:47:55 +00:00
Paul Smith
73fcfdbe24 Last-minute changed for 3.75.1 1997-04-07 18:02:17 +00:00
Paul Smith
0ada207e2d Changes for make 3.75.1 1997-04-07 07:21:16 +00:00
Paul Smith
7bb7ba7849 New file for DJGPP port. 1997-04-07 06:54:40 +00:00
Paul Smith
2a294c52d1 Renamed to config.h.W32 at RMS' request. 1997-04-02 06:03:37 +00:00
Paul Smith
71515366cd Renamed to README.W32 at RMS' request. 1997-04-02 05:59:56 +00:00
Roland McGrath
d78f2db327 Mon Mar 10 23:47:02 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* job.c (construct_command_argv_internal): Don't discard an
	explicit empty argument at the end of the command line.  In the
	slow case return immediately if the command line was empty.
1997-03-12 21:17:08 +00:00
Miles Bader
30c9fcfec3 [__GNU__] (NeXT, host_self):
New macros, to make hurd systems use the NeXT code for getting load averages.
1997-02-23 03:38:49 +00:00
Paul Eggert
e2b79aacf7 automatically generated from GPLed version 1997-01-23 04:23:12 +00:00
Paul Eggert
e981c049f4 automatically generated from GPLed version 1997-01-22 05:25:31 +00:00
Jim Meyering
9012013552 [hpux && HAVE_PSTAT_GETDYNAMIC]: Use HPUX's pstat_getdynamic so
we don't need any special privileges to determine load averages.
Patch from Kaveh Ghazi, based on a sample implementation from
Richard J. Rauenzahn.
Indent cpp-directives to reflect nesting.
1997-01-16 03:33:02 +00:00
Karl Berry
cda4f25fd4 Oops, did inadvertent branch. 1997-01-04 19:24:13 +00:00
Ulrich Drepper
b32b9197ab update from main archive 961217 1996-12-18 03:22:53 +00:00
Paul Eggert
b66145d8bc Spelling fix. 1996-12-17 06:25:17 +00:00
David J. MacKenzie
d2fe84cab3 fix a couple of bugs 1996-12-11 00:49:47 +00:00
Karl Berry
c2ea8e2486 (\deftypevarheader, \deftypevrheader): Remove
* texinfo.tex (\deftypevarheader, \deftypevrheader): Remove
        anything after the first space in the name to be indexed, for the
	sake of tzname[2].
	(\dovarind): New macro.
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
1996-11-19 21:11:43 +00:00
Karl Berry
db2384b9ab \indexbreaks, \realunder, \multitable, \footnotezzz. 1996-11-17 00:12:46 +00:00
Karl Berry
9b0b3a6e70 (\value): Don't call \parsearg, @value takes a simple arg. 1996-11-16 00:20:09 +00:00
Karl Berry
a71d56b4cc (\parsetpheaderline): Don't go through \tptemp when
removing braces from #2, use the macro call directly.
	(\removeemptybraces): Expand to #1 instead of defining \tptemp.
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
	This makes @deftp {Data type} {struct termios} work again.
1996-11-16 00:19:07 +00:00
Karl Berry
10011ce289 (\set, \value): Allow - and _ in @set variable names. 1996-11-09 23:37:11 +00:00
David J. MacKenzie
84a9fd68b7 many bug fixes and a few additions, mostly derived from bug-gnu-utils 1996-11-09 22:19:34 +00:00
Karl Berry
262ca66cb7 (\readauxfile): Leave \catcode`\^ as other;
* texinfo.tex (\readauxfile): Leave \catcode`\^ as other;
 	otherwise, node names containing ^, such as in info/info.texi,
 	cause an error when run through TeX.
	(\setq): Do not call \auxhat.
	(\auxhat): Definition no longer needed.
	Reported by Howard Gayle <howard@hal.com>.
1996-11-09 18:44:09 +00:00
Richard M. Stallman
a1eb3e67cd Talk about which dir Info files, Bison output, etc. should go in.
Add some more utilities that can be used in make commands.
1996-11-07 22:30:30 +00:00
Karl Berry
78a4848b83 (see ChangeLog for Oct 29.) 1996-11-05 19:52:23 +00:00
Karl Berry
b16829dc46 Call \normalturnoffactive for the sake of \write's that include a \. 1996-11-05 19:51:16 +00:00
Jim Meyering
c71e4ac269 [__hpux]: Define hpux. From Eric Backus.
[__sun]: Define sun.  Reported by Kaveh Ghazi.
1996-10-10 03:29:50 +00:00
Karl Berry
82e6316607 Untabify. 1996-09-30 17:47:57 +00:00
Karl Berry
a8de4b93e3 Changes for Texinfo 3.8 release; see ChangeLog. 1996-09-30 17:39:54 +00:00
Karl Berry
6e7fa14c65 (\inforef): Move to more appropriate place.
* texinfo.tex (\inforef): Move to more appropriate place.
	(\pounds): Remove spurious extra $.
	(\email): Typeset argument in angle brackets.
	(\macro): Use \doignore for robustness, instead of just letting TeX
	parse the argument.
	(\unmacro): Define.
1996-09-18 12:15:20 +00:00
Richard M. Stallman
5206d3f2bc (getloadavg): Add new code for SUNOS_5 to use -lkstat. 1996-09-10 19:50:17 +00:00
Richard M. Stallman
e2da48ca55 Describe preinstall and postinstall commands. 1996-09-09 18:06:22 +00:00
Karl Berry
bc26243d90 Formatting change, define @pounds, etc. 1996-09-06 19:24:48 +00:00
Karl Berry
b4db97478e (\centerchfplain): Rewrite to use \chfplain, and to
actually center.
	(\unnchfplain): Just call \chfplain.
	(\chfplain): Rewrite to be generally callable.
	(\centerparametersmaybe): Hook, a no-op except with @centerchap.
1996-09-02 15:14:43 +00:00
Karl Berry
4e361d0f01 (\key): Do not uppercase the argument; key names
can be mixed case, e.g., `Control'.
1996-08-31 19:08:16 +00:00
Roland McGrath
d5d49d2e5a Regenerated for 3.75 1996-08-28 21:13:05 +00:00
Roland McGrath
191dc2b434 . 1996-08-28 18:15:23 +00:00
Roland McGrath
6fa74367b7 Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
* main.c (print_version): Print out bug-reporting address.
Mon Aug 26 19:55:47 1996  Roland McGrath  <roland@baalperazim.frob.com>

	* main.c (print_data_base): Don't declare ctime; headers do it for us
 	already.
1996-08-27 11:29:03 +00:00
Roland McGrath
4cee1500a4 Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
* version.c: Version 3.75 released.
1996-08-27 10:16:17 +00:00
Karl Berry
2602fb8e71 (\key): Typeset a lozenge around the argument (from
gildea@intouchsys.com).
1996-08-20 18:37:11 +00:00
Karl Berry
bfce132399 (\heading, \subheading, \subsubheading): Can no
* texinfo.tex (\heading, \subheading, \subsubheading): Can no
 	longer call the nonexistent \*secheadingi series. Instead, call
 	\plain*secheading.
	(\plainsubsecheading, \plainsubsubsecheading): New macros, by analogy
	with \plainsecheading.
	(\unnumberedsubseczzz, \unnumberedsubsubseczzz): Call them.
1996-08-05 18:01:12 +00:00
Karl Berry
30cf28ef63 (\HEADINGSdouble, \HEADINGSsingle,
HEADINGSdoubleafter, \HEADINGSsingleafter, \CHAPPAGoff,
\CHAPPAGon, \CHAPPAGodd): Set \contentsalignmacro, analogous to
\pagealignmacro.
(\startcontents): Call \contentsalignmacro instead of \pagealignmacro.
1996-08-03 18:59:17 +00:00
Karl Berry
a7f3831457 Restoring good RCS id. 1996-08-02 15:12:28 +00:00
Karl Berry
bcd11d854b (\indexfonts): Make leading be 12pt. Otherwise, it's too crammed.
(\smalllispx): Remove \setleading{10pt}. That was too small.
(\doprintindex): Do not call \tex ... \Etex.  Index files are Texinfo
source, not TeX source, except for using \ instead of @ as the
escape character (for now).
1996-07-29 19:08:10 +00:00
Roland McGrath
bb01a1a810 . 1996-07-29 05:46:07 +00:00
Roland McGrath
c622dd9bdf Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com)
* w32/include/pathstuff.h: Added prototype for the new
	function convert_vpath_to_win32. Deleted macro for same.
1996-07-29 05:44:09 +00:00
Roland McGrath
7092951361 Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com)
* w32/pathstuff.c: Turned convert_vpath_to_win32() into a
	real function. This was done so that VPATH could contain
	white space separated pathnames. Please note that directory
	paths (in VPATH/vpath context) containing white space are not
	supported (just as they are not under Unix). See README.WIN32
	for suggestions.
1996-07-29 05:44:06 +00:00
Roland McGrath
88d39b2a22 Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com)
* w32/pathstuff.c: Turned convert_vpath_to_win32() into a
	real function. This was done so that VPATH could contain
	white space separated pathnames. Please note that directory
	paths (in VPATH/vpath context) containing white space are not
	supported (just as they are not under Unix). See README.WIN32
	for suggestions.
	* README.WIN32: Added some notes about why I chose not to try
	and support pathnames which contain white space and some
	workaround suggestions.
1996-07-29 05:44:03 +00:00
Karl Berry
3863dbeb03 (paragraphindent): Move to more reasonable place in the source file.
(chapfonts, secfonts, subsecfonts, indexfonts): Call \setleading.
(\chfplain, \secheading, \plainsecheading, \subsecheading,
 \subsubheading): Rewrite to properly \hangindent the title.
(\sectionheading): New generic macro to print section titles.
1996-07-28 20:57:40 +00:00
Karl Berry
cca242e6e3 Initial revision 1996-07-28 20:55:30 +00:00
Roland McGrath
7082394702 . 1996-07-26 02:33:47 +00:00
Roland McGrath
1f0bf7b4db Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (mkdep-nolib): Use -MM option unconditionally.
1996-07-26 02:33:35 +00:00
Roland McGrath
b18ce15130 Regenerated 1996-07-26 02:29:30 +00:00
Roland McGrath
c41efad63b Regenerated 1996-07-26 00:35:16 +00:00
Roland McGrath
683c716de3 autoconf 1996-07-26 00:35:09 +00:00
Roland McGrath
29253a9683 Regenerated for 3.74.7 1996-07-26 00:34:58 +00:00
Roland McGrath
9cc98648fd Updated from libc 1996-07-26 00:34:37 +00:00
Roland McGrath
d3c192e4a6 . 1996-07-26 00:33:49 +00:00
Roland McGrath
08905cdcbc Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* main.c (define_makeflags): Back up P to point at null terminator
	when killing final space and dash before setting MFLAGS.
1996-07-26 00:33:25 +00:00
Roland McGrath
4b72e38789 . 1996-07-26 00:06:10 +00:00
Roland McGrath
ce17fda12f Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (win32files): Add NMakefile.
1996-07-26 00:05:44 +00:00
Roland McGrath
2df6034eb6 Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
From Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>:
	* dir.c [__MSDOS__] [DJGPP > 1]: Include <libc/dosio.h> and defin
	`__opendir_flags' initialized to 0.
	[__MSDOS__] (dosify) [DJGPP > 1]: Return name unchanged if _USE_LFN.
	(find_directory) [__MSDOS__ && DJGPP > 1]: If _USE_LGN, set
	__opendir_flags to __OPENDIR_PRESERVE_CASE.
1996-07-26 00:05:41 +00:00
Roland McGrath
dd0fe8f1ee Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (win32files): Add NMakefile.
	* NMakefile (LDFLAGS_debug): Value fixed by tulloh.
1996-07-26 00:05:37 +00:00
Roland McGrath
37fbc32ba4 Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* vmsfunctions.c (vms_stat): `sys$dassgn (DevChan);' added by kkaempf.
1996-07-26 00:05:34 +00:00
Roland McGrath
64bdaa521f . 1996-07-20 11:13:47 +00:00
Roland McGrath
37ce7efdca Sat Jul 20 12:32:10 1996 Klaus Kmpf (kkaempf@progis.de)
* remake.c (f_mtime) [VMS]: Add missing `if' conditional for future
	modtime check.
	* config.h-vms, makefile.vms, readme.vms, vmsify.c: Update address.
1996-07-20 11:13:04 +00:00
Roland McGrath
4b92c539d4 Sat Jul 20 05:29:43 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* configure.in: Require autoconf 2.10 or later.
1996-07-20 09:30:04 +00:00
Roland McGrath
a22f67aaf7 Regenerated for 3.74.6 1996-07-19 22:18:36 +00:00
Roland McGrath
9fc574683d Updated from libc 1996-07-19 22:18:33 +00:00
Roland McGrath
c8e016d07a 3.74.6 1996-07-19 21:43:36 +00:00
Roland McGrath
c396f06a21 . 1996-07-19 21:42:21 +00:00
Roland McGrath
fc47a2c83c updated w32 code by tulloh 1996-07-19 21:41:07 +00:00
Roland McGrath
561b384313 Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (win32files): New variable.
	(distfiles): Add it.
	* w32: Updated by Rob Tulloh.
1996-07-19 21:40:29 +00:00
Roland McGrath
88942403a6 Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* makefile.vms (LOADLIBES): Fix typo.
1996-07-19 21:40:25 +00:00
Roland McGrath
8733fbd646 . 1996-07-14 19:59:40 +00:00
Roland McGrath
cf2db2cf3c Sun Jul 14 12:59:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* job.c (construct_command_argv_internal): Fix up #else, #endifs.
1996-07-14 19:59:13 +00:00
Roland McGrath
f0cea20864 Sun Jul 14 12:59:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* remake.c (f_mtime): Don't compare MTIME to NOW if MTIME == -1.
1996-07-14 19:59:04 +00:00
Roland McGrath
fcb18b988b Sun Jul 14 12:59:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* configh.dos: Define HAVE_DIRENT_H instead of DIRENT.
1996-07-14 19:58:54 +00:00
Roland McGrath
8b24ec18b0 xref nonunix ports 1996-07-14 19:54:36 +00:00
Roland McGrath
df5ba0ef96 Regenerated for 3.74.5 1996-07-14 17:10:20 +00:00
Roland McGrath
74475bb939 Updated from libc 1996-07-14 17:09:51 +00:00
Roland McGrath
22ffba3660 . 1996-07-14 17:07:54 +00:00
Roland McGrath
9603eb13a0 . 1996-07-14 17:07:27 +00:00
Roland McGrath
fde68d03f3 Sun Jul 14 12:59:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* main.c (main): Exit with status 2 when update_goal_chain returns 2.
1996-07-14 17:07:13 +00:00
Mark Seaborn
56162c4968 formatting tweaks 1996-07-03 23:05:19 +00:00
Roland McGrath
f78bcc2e72 . 1996-06-22 22:00:43 +00:00
Roland McGrath
0c23819036 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* configure.in: Don't check for _sys_siglist.
	* make.h [HAVE__SYS_SIGLIST]: Don't test this; just punt if there is
	no strsignal or sys_siglist.
1996-06-22 22:00:31 +00:00
Roland McGrath
91a7257252 . 1996-06-22 21:42:29 +00:00
Roland McGrath
d5f0b88095 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* job.c (start_job_command): Call block_sigs.
	(block_sigs): New function, broken out of start_job_command.
	(reap_children): Block fatal signals around removing dead child from
	chain and adjusting job_slots_used.
	* job.h: Declare block_sigs.
1996-06-22 21:42:15 +00:00
Roland McGrath
3024918fcd Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* file.c (file_hash_enter): Allow renaming :: to : when latter is
	non-target, or : to :: when former is non-target.
1996-06-22 21:42:13 +00:00
Roland McGrath
bdc49369eb Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* job.c (reap_children): Don't call die if handling_fatal_signal.
	* job.c (start_job_command): Call block_sigs.
	(block_sigs): New function, broken out of start_job_command.
	(reap_children): Block fatal signals around removing dead child from
	chain and adjusting job_slots_used.
	* job.h: Declare block_sigs.
	* job.c (reap_children): Quiescent value of shell_function_pid is
	zero, not -1.
1996-06-22 21:42:10 +00:00
Roland McGrath
610526fee7 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* remote-stub.c (remote_setup, remote_cleanup): New (empty) functions.
	* main.c (main): Call remote_setup.
	(die): Call remote_cleanup.
	* main.c (print_version): Add 96 to copyright years.
1996-06-22 21:42:06 +00:00
Roland McGrath
3f60c36245 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* read.c (conditional_line): Strip ws in `ifeq (a , b)' so it is the
	same as `ifeq (a, b)'.
1996-06-22 21:42:02 +00:00
Roland McGrath
bd88059c38 (Wildcard Function): fix typo 1996-06-22 21:21:30 +00:00
Roland McGrath
63f3cf925b Updated from libc 1996-06-22 21:14:22 +00:00
Roland McGrath
8541e3345d . 1996-06-22 19:31:26 +00:00
Roland McGrath
d86e4a26c8 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* remote-stub.c (remote_setup, remote_cleanup): New (empty) functions.
	* main.c (main): Call remote_setup.
	(die): Call remote_cleanup.
	* main.c (print_version): Add 96 to copyright years.
1996-06-22 19:31:12 +00:00
Roland McGrath
2c973c0b46 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* remote-stub.c (remote_setup, remote_cleanup): New (empty) functions.
	* main.c (main): Call remote_setup.
	(die): Call remote_cleanup.
1996-06-22 19:31:06 +00:00
Roland McGrath
e0620ee179 Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* job.c (start_job_command): Call block_sigs.
	(block_sigs): New function, broken out of start_job_command.
	(reap_children): Block fatal signals around removing dead child from
	chain and adjusting job_slots_used.
	* job.c (reap_children): Quiescent value of shell_function_pid is
	zero, not -1.
1996-06-22 19:30:59 +00:00
Roland McGrath
dac23b2d0b Wed May 15 17:37:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* dir.c (print_dir_data_base): Use %ld dev and ino and cast them to
	long.
1996-06-22 19:30:04 +00:00
Roland McGrath
783e6680b2 Sat Jun 15 20:30:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* read.c (find_char_unquote): Avoid calling strlen on every call
	just to throw away the value most of the time.
1996-06-22 19:26:13 +00:00
Richard M. Stallman
2529deb2bf Describe lispdir variable. 1996-06-12 21:50:54 +00:00
Karl Heuer
3d3252b8de [SOLARIS2]: Define SUNOS_5. 1996-05-28 00:17:16 +00:00
Roland McGrath
b14b16769c Note win32 port 1996-05-27 00:58:20 +00:00
Roland McGrath
e7a525c5d5 Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
* dir.c: WIN32 does not support inode. For now, fully qualified
	pathname along with st_mtime will be keys for files.
	Fixed problem where vpath can be confused when files
	are added to a directory after the directory has already been
	read in. The code now attempts to reread the directory if it
	discovers that the datestamp on the directory has changed since
	it was cached by make. This problem only seems to occur on WIN32
	right now so it is lumped under port #ifdef WIN32.

	* function.c: WIN32: call subproc library (CreateProcess()) instead of
	fork/exec.

	* job.c: WIN32: Added the code to do fork/exec/waitpid style processing
	on WIN32 systems via calls to subproc library.

	* main.c: WIN32: Several things added here. First, there is code
	for dealing with PATH and SHELL defaults. Make tries to figure
	out if the user has %PATH% set in the environment and sets it to
	%Path% if it is not set already. Make also looks to see if sh.exe
	is anywhere to be found. Code path through job.c will change
	based on existence of a working Bourne shell. The checking for
	default shell is done twice: once before makefiles are read in
	and again after. Fall back to MSDOS style execution mode if no sh.exe
	is found. Also added some debug support that allows user to pause make
	with -D switch and attach a debugger. This is especially useful for
	debugging recursive calls to make where problems appear only in the
	sub-make.

	* make.h: WIN32: A few macros and header files for WIN32 support.

	* misc.c: WIN32: Added a function end_of_token_w32() to assist
	in parsing code in read.c.

	* read.c: WIN32: Fixes similar to MSDOS which allow colon to
	appear in filenames. Use of colon in filenames would otherwise
	confuse make.

	* remake.c: WIN32: Added include of io.h to eliminate compiler
	warnings. Added some code to default LIBDIR if it is not set
	on WIN32.

	* variable.c: WIN32: Added support for detecting Path/PATH
	and converting them to semicolon separated lists for make's
	internal use. New function sync_Path_environment()
	which is called in job.c and function.c before creating a new
	process. Caller must set Path in environment since we don't
	have fork() to do this for us.

	* vpath.c: WIN32: Added detection for filenames containing
	forward or backward slashes.

	* NMakefile: WIN32: Visual C compatible makefile for use with nmake.
	Use this to build GNU make the first time on Windows NT or Windows 95.

	* README.WIN32: WIN32: Contains some helpful notes.

	* build_w32.bat: WIN32: If you don't like nmake, use this the first
	time you build GNU make on Windows NT or Windows 95.

	* config.h.WIN32: WIN32 version of config.h

	* subproc.bat: WIN32: A bat file used to build the
	subproc library from the top-level NMakefile. Needed because
	WIndows 95 (nmake) doesn't allow you to cd in a make rule.

	* w32/include/dirent.h
	* w32/compat/dirent.c: WIN32: opendir, readdir, closedir, etc.

	* w32/include/pathstuff.h: WIN32: used by files needed functions
	defined in pathstuff.c (prototypes).

	* w32/include/sub_proc.h: WIN32: prototypes for subproc.lib functions.

	* w32/include/w32err.h: WIN32: prototypes for w32err.c.

	* w32/pathstuff.c: WIN32: File and Path/Path conversion functions.

	* w32/subproc/build.bat: WIN32: build script for subproc library
	if you don't wish to use nmake.

	* w32/subproc/NMakefile: WIN32: Visual C compatible makefile for use
	with nmake. Used to build subproc library.

	* w32/subproc/misc.c: WIN32: subproc library support code
	* w32/subproc/proc.h: WIN32: subproc library support code
	* w32/subproc/sub_proc.c: WIN32: subproc library source code
	* w32/subproc/w32err.c: WIN32: subproc library support code
1996-05-22 21:51:45 +00:00
Roland McGrath
d369e0531a [WIN32]: No-op as for [MSDOS]. 1996-05-22 21:47:37 +00:00
Roland McGrath
6701f24bbb . 1996-05-22 21:25:55 +00:00
Roland McGrath
e76076e334 Wed May 22 17:24:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* makefile.vms: Set LOADLIBES.
	* makefile.com (link_using_library): Fix typo.
1996-05-22 21:25:45 +00:00
Roland McGrath
673e04af3a Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (vmsfiles): Fix typo.
1996-05-13 23:22:17 +00:00
Roland McGrath
bc8ac28654 . 1996-05-13 23:21:36 +00:00
Roland McGrath
95744a1491 Regenerated for 3.74.4 1996-05-13 23:16:46 +00:00
Roland McGrath
78f280d541 Updated from libc 1996-05-13 23:16:23 +00:00
Roland McGrath
44811ac351 . 1996-05-13 23:14:45 +00:00
Roland McGrath
6cf0e549f7 Updated from libc 1996-05-13 20:30:33 +00:00
Roland McGrath
25d9818333 . 1996-05-13 20:22:24 +00:00
Roland McGrath
2a905c5e5a Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* dir.c: New function: amigafy() to fold filenames
	Changes HASH() to HASHI() to fold filenames on Amiga.
	Stringcompares use strieq() instead of streq()
	The current directory on Amiga is "" instead of "."
	* file.c: Likewise.
1996-05-13 20:22:05 +00:00
Roland McGrath
0ddf0df13c Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* main.c: (main), variable.c Changed handling of ENV-vars. Make
	stores now the names of the variables only and reads their contents
	when they are accessed to reflect that these variables are really
	global (ie. they CAN change WHILE make runs !) This handling is
	made in lookup_variable()
	* variable.c: Handling of ENV variable happens inside lookup_variable()
1996-05-13 18:40:28 +00:00
Roland McGrath
b4dcc6f6bd Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* job.h: No envp on Amiga
1996-05-13 18:40:22 +00:00
Roland McGrath
c8484a6170 Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* main.c: (main), variable.c Changed handling of ENV-vars. Make
	stores now the names of the variables only and reads their contents
	when they are accessed to reflect that these variables are really
	global (ie. they CAN change WHILE make runs !) This handling is
	made in lookup_variable()
1996-05-13 18:40:11 +00:00
Roland McGrath
7431536bed Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (amigafiles): Add amiga.h.
Sun May 12 19:19:43 1996  Aaron Digulla   <digulla@fh-konstanz.de>

	* amiga.h: New file. Prototypes for amiga.c
1996-05-13 18:39:59 +00:00
Roland McGrath
678b14fb7e Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* function.c: Use special function wildcard_expansion() for
	$(wildcard ) to allow Amiga wildcards
	The current directory on Amiga is "" instead of "."
1996-05-13 18:39:52 +00:00
Roland McGrath
efbe1b6411 Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* README.Amiga: updated feature list
1996-05-13 18:39:46 +00:00
Roland McGrath
5fb14db85f Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* Makefile.ami: renamed file.h to filedep.h
	Updated dependencies
1996-05-13 18:39:40 +00:00
Roland McGrath
df99d7af1f Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (amigafiles): Add amiga.h.
1996-05-13 18:39:33 +00:00
Roland McGrath
db561cfc3e Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* read.c: "find_semicolon" is declared as static but never defined.
	No difference between Makefile and makefile on Amiga; added
	SMakefile to *default_makefiles[].
	(read_makefile) SAS/C want's two_colon and pattern_percent be set
	before use.
	The current directory on Amiga is "" instead of "."
	Strange #endif moved.
1996-05-13 18:39:02 +00:00
Roland McGrath
0feb1dd25f Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* make.h: Added HASHI(). This is the same as HASH() but converts
	it's second parameter to lowercase on Amiga to fold filenames.
1996-05-13 18:38:38 +00:00
Roland McGrath
e2d8bf4aa4 Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* job.c: No Pipes on Amiga, too
	(load_too_high) Neither on Amiga
	ENV variable on Amiga are in a special directory and are not
	passed as third argument to main().
1996-05-13 18:38:29 +00:00
Roland McGrath
dc27ebc311 Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* dir.c: New function: amigafy() to fold filenames
	Changes HASH() to HASHI() to fold filenames on Amiga.
	Stringcompares use strieq() instead of streq()
	The current directory on Amiga is "" instead of "."
1996-05-13 18:38:20 +00:00
Roland McGrath
989d9ecaae Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* amiga.c: New function wildcard_expansion(). Allows to use
	Amiga wildcards with $(wildcard )
	* amiga.h: New file. Prototypes for amiga.c
1996-05-13 18:38:15 +00:00
Roland McGrath
b0098dfd6a Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* read.c: "find_semicolon" is declared as static but never defined.
	No difference between Makefile and makefile on Amiga; added
	SMakefile to *default_makefiles[].
	(read_makefile) SAS/C want's two_colon and pattern_percent be set
	before use.
	The current directory on Amiga is "" instead of "."
	Strange #endif moved.
	* SMakefile: Updated dependencies
1996-05-13 18:38:10 +00:00
Roland McGrath
40a08e8a62 . 1996-05-09 20:07:56 +00:00
Roland McGrath
5e728dfa57 Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* commands.c (fatal_error_signal) [SIGQUIT]: Make SIGQUIT check
	conditional.
1996-05-09 20:07:14 +00:00
Roland McGrath
085eac4c74 Mention amiga port 1996-05-09 18:40:55 +00:00
Roland McGrath
085caaa900 Updated from libc 1996-05-09 18:29:30 +00:00
Roland McGrath
cc28a52f40 . 1996-05-09 18:28:25 +00:00
Roland McGrath
1e38c11f3c Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* function.c (expand_function) [_AMIGA]: Fix some typos.
	(patsubst_expand): Make len vars unsigned.
1996-05-09 18:28:15 +00:00
Roland McGrath
58af8d9dd1 Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* read.c (parse_file_seq): Use `int' for char arg to avoid widening
	conflict issues.
	* dep.h: Fix prototype.
1996-05-09 18:28:09 +00:00
Roland McGrath
abe5f64440 Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* main.c (main): Use unsigned for fread return.
1996-05-09 18:28:03 +00:00
Roland McGrath
68b9650616 Updated from libc 1996-05-09 18:16:24 +00:00
Roland McGrath
5dfa403ec8 (libc-srcdir): Use ../libc. 1996-05-09 18:10:49 +00:00
Roland McGrath
f7ecda9a35 Updated from libc 1996-05-09 18:06:45 +00:00
Roland McGrath
e99a3aca7e Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* GNUmakefile (globfiles): Add AmigaDOS support files.
	(distfiles): Add $(amigafiles).
	(amigafiles): New variable.

Thu Nov  7 10:18:16 1995  Aaron Digulla   <digulla@fh-konstanz.de>

	* Added Amiga support in commands.c, dir.c, function.c,
	job.c, main.c, make.h, read.c, remake.c
	* commands.c: Amiga has neither SIGHUP nor SIGQUIT
	* dir.c: Amiga has filenames with Upper- and Lowercase,
	but "FileName" is the same as "filename". Added strieq()
	which is use to compare filenames. This is like streq()
	on all other systems. Also there is no such thing as
	"." under AmigaDOS.
	* function.c: On Amiga, the environment is not passed as envp,
	there are no pipes and Amiga can't fork. Use my own function
	to create a new child.
	* job.c: default_shell is "" (The system automatically chooses
	a shell for me). Have to use the same workaround as MSDOS for
	running batch commands. Added HAVE_SYS_PARAM_H. NOFILE isn't
	known on Amiga. Cloned code to run children from MSDOS. Own
	version of sh_chars[] and sh_cmds[]. No dup2() or dup() on Amiga.
	* main.c: Force stack to 20000 bytes. Read environment from ENV:
	device. On Amiga, exec_command() does return, so I exit()
	afterwards.
	* make.h: Added strieq() to compare filenames.
	* read.c: Amiga needs special extension to have passwd. Only
	one include-dir. "Makefile" and "makefile" are the same.
	Added "SMakefile".  Added special code to handle device names (xxx:)
	and "./" in rules.
	* remake.c: Only one lib-dir. Amiga link-libs are named "%s.lib"
	instead of "lib%s.a".
	* main.c, rule.c, variable.c: Avoid floats at all costs.
	* vpath.c: Get rid of as many alloca()s as possible.
1996-05-09 18:02:06 +00:00
Roland McGrath
73c52a3b12 Thu May 9 13:20:43 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* read.c (read_makefile): Grok `sinclude' as alias for `-include'.
1996-05-09 17:28:47 +00:00
Roland McGrath
4679c702de Document "sinclude". 1996-05-09 17:25:54 +00:00
Roland McGrath
59cb26b58b Note "sinclude". 1996-05-09 17:24:04 +00:00
Roland McGrath
386e27b622 Update date to 20 March 96 1996-05-09 17:07:56 +00:00
Richard M. Stallman
68db062e1e Avoid symlinks if possible. 1996-05-06 03:45:23 +00:00
Roland McGrath
a67e842fb1 . 1996-03-20 15:01:50 +00:00
Roland McGrath
712c43dde1 [HAVE_STRING_H]: Include string.h. 1996-03-20 14:59:27 +00:00
Roland McGrath
c0e8c1012d moved to filedef.h 1996-03-20 14:58:34 +00:00
Roland McGrath
c97502625c Wed Mar 20 09:52:27 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* GNUmakefile (vmsfiles): New variable.
	(distfiles): Include $(vmsfiles).
1996-03-20 14:58:18 +00:00
Roland McGrath
9e443adaf6 Tue Mar 19 20:21:34 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
Merged VMS port from Klaus Kaempf <kkaempf@didymus.rmi.de>.
	* make.h (PARAMS): New macro.
	* config.h-vms: New file.
	* makefile.com: New file.
	* makefile.vms: New file.
	* readme.vms: New file.
	* vmsdir.h: New file.
	* vmsfunctions.c: New file.
	* vmsify.c: New file.
	* file.h: Renamed to filedef.h to avoid conflict with VMS system hdr.
	* ar.c: Added prototypes and changes for VMS.
	* commands.c: Likewise.
	* commands.h: Likewise.
	* default.c: Likewise.
	* dep.h: Likewise.
	* dir.c: Likewise.
	* expand.c: Likewise.
	* file.c: Likewise.
	* function.c: Likewise.
	* implicit.c: Likewise.
	* job.c: Likewise.
	* job.h: Likewise.
	* main.c: Likewise.
	* make.h: Likewise.
	* misc.c: Likewise.
	* read.c: Likewise.
	* remake.c: Likewise.
	* remote-stub.c: Likewise.
	* rule.c: Likewise.
	* rule.h: Likewise.
	* variable.c: Likewise.
	* variable.h: Likewise.
	* vpath.c: Likewise.
	* compatMakefile (srcs): Rename file.h to filedef.h.
1996-03-20 14:57:41 +00:00
Roland McGrath
dfefc77263 Regenerated 1996-03-20 14:55:13 +00:00
Roland McGrath
ee7af57e3c Updated from libc 1996-03-20 03:12:54 +00:00
Roland McGrath
46a1497b8e (NULL): Define only if not already defined. 1996-03-20 01:08:11 +00:00
Roland McGrath
4603f9f8c6 [HAVE_STRING_H]: Include string.h.
[HAVE_STDLIB_H]: Include stdlib.h.
1996-03-20 01:07:36 +00:00
Roland McGrath
b2a22df721 RMS documented his .SECONDARY feature. 1996-03-20 00:58:43 +00:00
Roland McGrath
89785948f6 . 1996-03-20 00:57:43 +00:00
Roland McGrath
8b2aca5930 Sun Jul 30 00:49:53 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
* file.h (struct file): New field `secondary'.
	* file.c (snap_deps): Check for .INTERMEDIATE and .SECONDARY.
	(remove_intermediates): Don't delete .SECONDARY files.
1996-03-20 00:56:52 +00:00
Roland McGrath
b8ea37e31c Sat Aug 19 23:11:00 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
* remake.c (check_dep): For a secondary file, try implicit and
	default rules if appropriate.
Wed Aug  2 04:29:42 1995  Richard Stallman  <rms@mole.gnu.ai.mit.edu>

	* remake.c (check_dep): If an intermediate file exists,
	do consider its actual date.
1996-03-20 00:56:45 +00:00
Roland McGrath
e044fe76f6 Add '96 to copyright years. 1996-03-04 17:59:44 +00:00
Roland McGrath
557392f016 Minor tweaks to fix overfull & underfull hboxes in fmting make man. 1996-03-04 17:57:41 +00:00
Roland McGrath
eaecc11501 . 1996-03-02 21:27:49 +00:00
Roland McGrath
b25f811f51 Sat Mar 2 16:26:52 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* compatMakefile (srcs): Add getopt.h; prepend $(srcdir)/ to getopt*.
1996-03-02 21:27:40 +00:00
Roland McGrath
34b0c6b3b4 (Standard Targets): Use @smallexample. 1996-03-01 21:47:33 +00:00
Roland McGrath
2de9513b20 . 1996-03-01 19:19:37 +00:00
Roland McGrath
8eb20e9d92 Fri Mar 1 12:04:47 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* remake.c (f_mtime): Move future modtime check before FILE is
	clobbered by :: loop.
1996-03-01 19:14:35 +00:00
Roland McGrath
32979e8122 . 1996-03-01 17:45:50 +00:00
Roland McGrath
490f35dda4 Fri Mar 1 12:04:47 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* dir.c: Use canonical code from autoconf manual for dirent include.
	[_D_NAMLEN]: Redefine NAMLEN using this.
	(dir_contents_file_exists_p): Use NAMLEN macro.
	(read_dirstream) [_DIRENT_HAVE_D_NAMLEN]: Only set d_namlen #if this.
1996-03-01 17:45:37 +00:00
Roland McGrath
a579af186b Fri Mar 1 12:04:47 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* compatMakefile (objs): Add missing backslash.
1996-03-01 17:45:34 +00:00
Roland McGrath
01d08292bc Updated from libc 1996-03-01 17:43:47 +00:00
Roland McGrath
f9c4aae3bf (libc-srcdir) New var.
(stamp-glob): Use $(libc-srcdir).
1996-03-01 17:19:01 +00:00
Roland McGrath
74e456e107 autoheader 1996-03-01 17:07:48 +00:00
Roland McGrath
f8b096b9fd Regenerated 1996-03-01 17:07:36 +00:00
Roland McGrath
527201342c Regenerated for 3.74.3 1996-03-01 17:07:14 +00:00
Roland McGrath
5f1e98e59b Updated from libc 1996-03-01 17:07:10 +00:00
Roland McGrath
f4020bfba8 . 1996-03-01 17:05:11 +00:00
Roland McGrath
4792e6f5c0 Fixed sed cmd in auto dep section.
Fixed bogus MAKEFLAGS override example.
1996-03-01 17:02:26 +00:00
Roland McGrath
514eda2bda Mention future modtime detection. 1996-03-01 17:00:57 +00:00
Richard M. Stallman
310f677b84 Say it is ok to use true and false.
Make recommendations about install-info accurate.
1996-02-29 04:22:34 +00:00
Roland McGrath
f323abd6b3 . 1996-02-29 00:27:34 +00:00
Roland McGrath
b07e961db1 Wed Feb 28 03:56:20 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* remake.c (f_mtime): Check for future timestamps; give error and mark
	file as "failed to update".
1996-02-29 00:27:25 +00:00
Roland McGrath
5958f28900 Wed Feb 28 03:56:20 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* default.c (default_terminal_rules): Remove + prefix from RCS cmds.
	(default_variables): Put + prefix in $(CHECKOUT,v) value instead.
1996-02-29 00:27:22 +00:00
Roland McGrath
fd504b4d84 . 1996-02-28 07:40:34 +00:00
Richard M. Stallman
1bb24cbbbb Replace strip' target with install-strip'. 1996-02-27 07:36:22 +00:00
Richard M. Stallman
b255a75bab Describe `strip' target. 1996-02-10 06:28:45 +00:00
Karl Heuer
0569ceb303 Update FSF address in comment. 1996-02-01 18:44:05 +00:00
arnold
8021c41954 Reordering of sections for better reading linearly and to go with
reorg'ed standards.texi. use Makefile with a capital 'M' everywhere.
Add description of Autoconf versions of standard directories.
1996-01-19 00:18:58 +00:00
Richard M. Stallman
edd7981e49 Minor change about parallel make. 1996-01-17 22:29:34 +00:00
Roland McGrath
715363eb49 Don't declare unblock_sigs; job.h already does. 1996-01-12 23:09:23 +00:00
Karl Heuer
c36430699e (alloca): If malloc fails, just abort. 1996-01-07 07:00:56 +00:00
Roland McGrath
5f99dee5b5 . 1996-01-06 21:26:02 +00:00
Roland McGrath
9521ecc573 (HAVE_SYSCONF_OPEN_MAX): #undef removed. 1996-01-06 21:25:28 +00:00
Roland McGrath
cb69b06199 (NGROUPS_MAX): Don't try to define this macro. 1996-01-06 21:24:34 +00:00
Richard M. Stallman
21fed1fbcc (getloadavg) [MSDOS]: Return 0 load instead of failing the call. 1995-12-28 23:28:35 +00:00
Roland McGrath
17aef36902 . 1995-12-22 23:45:03 +00:00
Roland McGrath
98f8d6286e (GETOPT, GETOPT_SRC, GLOB): Variables removed.
(objs, srcs): Include their values here instead of references.
1995-12-22 23:44:31 +00:00
Roland McGrath
d96d52d27d autoconf 1995-12-14 11:25:51 +00:00
Roland McGrath
625b9f6ba2 . 1995-12-14 11:25:36 +00:00
Roland McGrath
8756e81616 Regenerated for 3.74.2 1995-12-14 11:25:13 +00:00
Roland McGrath
3e141c8277 . 1995-12-14 11:23:23 +00:00
Roland McGrath
aaed50ac3f (reap_children): Call unblock_sigs after start_job_command. 1995-12-14 11:21:20 +00:00
Roland McGrath
a89eb21084 Updated from libc 1995-12-14 11:14:36 +00:00
Roland McGrath
4356ddddbc . 1995-12-14 11:00:34 +00:00
Roland McGrath
b8db661c24 (dir_setup_glob): Don't use lstat; glob never calls it anyway.
Avoid & before function names to silence bogus sunos4 compiler.
1995-12-14 07:22:03 +00:00
Roland McGrath
a54c552d39 Remove check for `sysconf (_SC_OPEN_MAX)'. 1995-12-14 07:18:09 +00:00
Roland McGrath
25d48503eb . 1995-12-12 05:49:35 +00:00
Roland McGrath
5df0d41985 (read_dirstream): Fix braino: fill in the buffer when not reallocating it! 1995-12-12 05:48:31 +00:00
Roland McGrath
737e056a89 (CPPFLAGS): Add -Iglob. 1995-12-12 05:47:27 +00:00
Roland McGrath
8c13a20895 Fix typo. 1995-12-12 04:55:06 +00:00
Roland McGrath
2a0707e1b8 Mention delayed -w msgs. 1995-12-12 04:54:41 +00:00
Roland McGrath
d116acac75 autoheader 1995-12-12 04:36:32 +00:00
Roland McGrath
6ab25d18b2 Regenerated 1995-12-12 04:35:35 +00:00
Roland McGrath
4061695ef6 autoconf 1995-12-12 04:34:14 +00:00
Roland McGrath
e3200b9303 Regenerated for 3.74.1 1995-12-12 04:33:36 +00:00
Roland McGrath
18a7013e55 Updated from libc 1995-12-12 04:33:02 +00:00
Roland McGrath
624552badd . 1995-12-12 04:32:10 +00:00
Roland McGrath
76d037cb95 (collapse_continuations): Fix skipping of trailing \s so it can never
dereference before the beginning of the array.
1995-12-12 04:24:17 +00:00
Roland McGrath
dfdf1bec21 . 1995-12-12 03:48:29 +00:00
Roland McGrath
caa2fe5d39 [HAVE_D_NAMLEN]: Define this for __GNU_LIBRARY__ > 1.
(D_NAMLEN): Macro removed.
(FAKE_DIR_ENTRY): New macro.
(dir_contents_file_exists_p): Test HAVE_D_NAMLEN instead of using D_NAMLEN.
(read_dirstream): Return a struct dirent * for new glob interface.
(init_dir): Function removed.
(dir_setup_glob): New function.
1995-12-12 03:37:15 +00:00
Roland McGrath
2f506a6d52 Remove all [M_XENIX] code. 1995-12-12 03:33:25 +00:00
Roland McGrath
856d83462f (main): Don't call init_dir. 1995-12-12 03:32:46 +00:00
Roland McGrath
e9fcf7ea88 Use plain stat instead of safe_stat.
(find_semicolon): Function removed.
(read_makefile): Don't use find_semicolon or remove_comments for rule lines.
Use find_char_unquote directly and handle quoted comments properly.
(multi_glob): Call dir_setup_glob on our glob_t and use GLOB_ALTDIRFUNC flag.
1995-12-12 03:31:40 +00:00
Roland McGrath
bfa6ab6a0c (safe_stat): Function removed. 1995-12-12 03:27:28 +00:00
Roland McGrath
4e6de57b8f Use plain stat instead of safe_stat. 1995-12-12 03:26:08 +00:00
Roland McGrath
41e6704efd Updated from libc 1995-12-12 02:50:12 +00:00
Roland McGrath
ffea662953 Updated from libc 1995-12-12 02:42:43 +00:00
Roland McGrath
db5cc03f75 Updated from libc 1995-12-07 21:05:46 +00:00
Roland McGrath
cd851988e7 Updated from libc 1995-12-07 20:32:37 +00:00
Roland McGrath
fb39f49937 . 1995-11-26 01:43:28 +00:00
Roland McGrath
dccc12dbee [HAVE_UNION_WAIT]: Include sys/wait.h.
(start_job_command): Pass new arg to `message'; fix inverted test in that
call.
1995-11-26 01:42:27 +00:00
Roland McGrath
1305447ace . 1995-11-26 01:40:35 +00:00
Roland McGrath
5ed1a6399a (log_working_directory): Declare it. 1995-11-26 01:39:38 +00:00
Roland McGrath
3f614c58ed Pass new arg in `message' calls. 1995-11-26 01:38:10 +00:00
Roland McGrath
37cf6fdc18 (log_working_directory): Made global.
Print entering msg only once.
1995-11-26 01:37:07 +00:00
Roland McGrath
808f1c1cd2 (message): Take new arg PREFIX. Print "make: " only if nonzero. 1995-11-26 01:35:05 +00:00
Roland McGrath
06021f945f (touch_file): Removing newline from message string. 1995-11-22 00:16:14 +00:00
Roland McGrath
ad61285598 (start_job_command): Pass null instead of "" to message; don't add newline. 1995-11-22 00:14:59 +00:00
Roland McGrath
10d6808977 (start_job_command): Use `message' to print the command, and call it with
an empty string if the command is silent.
1995-11-22 00:06:28 +00:00
Roland McGrath
21fbad8602 (touch_file): Use message instead of printf. 1995-11-21 23:58:54 +00:00
Roland McGrath
fa6d6f9150 . 1995-11-17 20:03:48 +00:00
Roland McGrath
ed02723506 . 1995-10-10 20:22:47 +00:00
Roland McGrath
692858922f (How Make Works): Clearify that default goal is only first target. 1995-10-10 20:18:24 +00:00
Roland McGrath
9da3bccd89 . 1995-10-10 20:12:44 +00:00
Roland McGrath
16a5d4cf48 . 1995-10-10 20:07:10 +00:00
Roland McGrath
b1e6353edd (enter_command_line_file): Barf if NAME is "". 1995-10-10 18:59:08 +00:00
Roland McGrath
e1c593016b Add note wrt broken system makes--use build.sh. 1995-10-04 18:15:35 +00:00
Roland McGrath
10124ce95b . 1995-09-11 18:14:14 +00:00
Roland McGrath
6e19c6febb Updated from libc 1995-09-11 18:04:00 +00:00
Roland McGrath
4314e2f987 . 1995-09-09 10:45:06 +00:00
Roland McGrath
0eab889a28 (delete_target): Ignore unlink failure if it is ENOENT. 1995-09-09 10:32:56 +00:00
hag
c51dd24814 Updated ISBN and foundation address 1995-08-22 18:45:01 +00:00
hag
41ea0f1556 Updated address of foundation 1995-08-22 18:43:05 +00:00
Roland McGrath
ee6b27b728 Don't check for getdtablesize. 1995-08-17 19:09:57 +00:00
Roland McGrath
af72fc38fe (getdtablesize): Remove decls and macros. 1995-08-17 19:08:36 +00:00
Roland McGrath
294c429f93 (Standard Targets): rewrote some paragraphs to avoid overfull hboxes. 1995-08-15 00:12:12 +00:00
Roland McGrath
9409f5c54a Don't suggest sending questions to bug-gnu-utils.
Use @smallexample instead of @example to avoid overfull hbox.
1995-08-15 00:03:06 +00:00
Roland McGrath
78ac5bd9c7 (define_makeflags): Omit command line variable definitions from MFLAGS
value.
1995-08-10 23:58:12 +00:00
Roland McGrath
030d31ba93 Updated from libc 1995-08-10 23:29:54 +00:00
Roland McGrath
70465ffcfb (ar_scan) [AIAMAG]: Check for zero MEMBER_OFFSET, indicating a valid, but
empty, archive.
1995-08-10 23:09:46 +00:00
Roland McGrath
ee2b67af6d [ps2]: Use nlist instead of knlist #ifdef _AIX. 1995-08-07 20:48:08 +00:00
Roland McGrath
0afe62e255 (file_impossible_p): Correctly reset FILENAME to name within directory
before hash search.
1995-08-07 20:42:51 +00:00
Roland McGrath
ee14af651f (child_error): Do nothing if IGNORED under -s. 1995-08-07 20:37:15 +00:00
Roland McGrath
9fd3c2453b (exec_command): Correctly use ARGV[0] for script name when running shell
directly.
1995-08-07 19:39:37 +00:00
Roland McGrath
a4e66c61c0 (CFLAGS): Add some warnings. 1995-08-01 18:48:58 +00:00
Roland McGrath
8cfdca3e72 . 1995-08-01 18:48:11 +00:00
Roland McGrath
2c27d8dbdc (child_execute_job): Close STDIN_FD and STDOUT_FD after dup'ing from them.
Don't try to close all excess descriptors; getdtablesize might return
a huge value.  Any open descriptors in the parent should have FD_CLOEXEC
set.
1995-08-01 18:46:37 +00:00
Roland McGrath
d02b26a4b8 (start_job_command): Set FD_CLOEXEC flag on BAD_STDIN descriptor. 1995-08-01 18:38:49 +00:00
Roland McGrath
8b3f13f6ec (getloadavg): Set FD_CLOEXEC flag on /dev/kmem file descriptor. 1995-08-01 18:29:36 +00:00
David J. MacKenzie
e74b6ae5c2 Define mandir the way everyone actually uses it. 1995-06-27 18:28:56 +00:00
David J. MacKenzie
f21ec15ffa . 1995-06-23 02:57:42 +00:00
Roland McGrath
3f49392b9c [convex] (LOAD_AVE_TYPE, LDAV_CVT): Define to double, no conversion. 1995-06-20 07:50:41 +00:00
Roland McGrath
f9a914c035 (read_all_makefiles): Properly append default makefiles to the end of the
`read_makefiles' chain.
1995-06-20 07:47:01 +00:00
Roland McGrath
b2fc502c55 Regenerated for 3.74 1995-05-19 20:40:12 +00:00
Roland McGrath
d091a08961 . 1995-05-19 20:37:02 +00:00
Roland McGrath
eb3b7904f0 Regenerated 1995-05-10 21:59:24 +00:00
Roland McGrath
bbfb270092 Regenerated for 3.73.3 1995-05-10 21:58:53 +00:00
Roland McGrath
c18253b59b Updated from libc 1995-05-10 21:57:56 +00:00
Roland McGrath
41177916df . 1995-05-10 21:46:30 +00:00
Roland McGrath
7acd99c5e6 AIX support from Tim Bell <tbel@afsmail.cern.ch>:
[_AIX] (LOAD_AVE_TYPE, FSCALE, NLIST_STRUCT): Define these for AIX.
(getloadavg) [_AIX]: Use `knlist' instead of `nlist'.
1995-05-10 15:03:48 +00:00
Roland McGrath
d6c62b351f . 1995-05-09 22:51:11 +00:00
Roland McGrath
c9c43b0871 ($(infodir)/make.info): Make sure $$dir is set in install-info cmd. 1995-05-09 21:14:48 +00:00
Roland McGrath
13e8568f03 (print_file): Grok update_status of 1 for -q. 1995-05-03 19:53:19 +00:00
Roland McGrath
cebdba9dfa Move include of config.h before all others. 1995-04-29 19:47:58 +00:00
Roland McGrath
4ea152e71b Regenerated 1995-04-27 16:57:09 +00:00
Roland McGrath
443f39f4f7 Regenerated for 3.73.2 1995-04-27 16:56:40 +00:00
Roland McGrath
675981bc4f Updated from libc 1995-04-27 16:43:27 +00:00
Roland McGrath
11af972f87 . 1995-04-27 16:41:39 +00:00
Roland McGrath
d9c126da40 . 1995-04-27 16:41:12 +00:00
Roland McGrath
7170467928 . 1995-04-27 16:37:56 +00:00
Roland McGrath
81699266d3 (remove_intermediates): Fix inverted test to bail under -n for signal case.
Bail under -q or -t.
Skip files with update_status==-1.
1995-04-26 21:27:19 +00:00
Roland McGrath
cbdb3653da [HAVE_UNISTD_H]: Include unistd.h so it can declare sys_siglist. 1995-04-26 21:19:26 +00:00
Roland McGrath
5d82479d89 (job_next_command): Skip empty lines.
(new_job): Don't test the return of job_next_command.
Just let start_waiting_job handle the case of empty commands.
1995-04-26 21:15:25 +00:00
Roland McGrath
ed0d607279 . 1995-04-19 22:20:52 +00:00
Roland McGrath
855bd6896d [__MSDOS__]: Include <fcntl.h>. From DJ Delorie. 1995-04-19 18:09:30 +00:00
Roland McGrath
179ef370e8 Regenerated for 3.73.1 1995-04-19 07:29:56 +00:00
Roland McGrath
01dc9a22f9 Updated from libc 1995-04-19 07:28:27 +00:00
Roland McGrath
bc15ada5ed . 1995-04-19 07:26:32 +00:00
Roland McGrath
fce5e4a9b9 . 1995-04-08 18:54:00 +00:00
Roland McGrath
07a45cd0af (notice_finished_file): Set FILE->update_status to zero if it's -1. 1995-04-08 18:52:42 +00:00
Roland McGrath
226a132e31 (CPPFLAGS): Use $(defines) too. 1995-04-05 04:53:56 +00:00
Roland McGrath
b59f5f30b9 Regenerated for 3.73 1995-04-05 04:41:14 +00:00
Roland McGrath
acdd73ea34 . 1995-04-05 04:21:27 +00:00
Roland McGrath
38b5b27eb5 Add '95 to copyright years. 1995-04-05 03:32:21 +00:00
Roland McGrath
e8325b9be2 (Options/Recursion): Correction: -I is indeed passed in MAKEFLAGS. 1995-04-05 03:29:01 +00:00
Roland McGrath
f8eb0fc41b . 1995-03-30 10:02:35 +00:00
Roland McGrath
ea38e1fe78 (main): Fixed braino in assert. 1995-03-28 18:59:57 +00:00
Roland McGrath
ed276c008d Regenerated for 3.72.13 1995-03-28 18:28:18 +00:00
Roland McGrath
910d25619e (CPPFLAGS): Use $(CPPFLAGS) instead of $(defines). 1995-03-28 18:24:20 +00:00
Roland McGrath
2ae5430550 Remade with Autoconf 2.3 1995-03-28 18:04:30 +00:00
Roland McGrath
e53ac8a6fc . 1995-03-27 10:55:57 +00:00
Roland McGrath
cb51d55ab2 Avoid string in assert expression. Some systems are broken. 1995-03-27 10:28:35 +00:00
Roland McGrath
0b4723a689 . 1995-03-27 10:02:36 +00:00
Roland McGrath
3f9ce84b4a Include <assert.h>. 1995-03-24 23:39:24 +00:00
Roland McGrath
bdbe8501c6 (main): Handle 1 and 2 returns from update_goal_chain makefile run
properly.
1995-03-24 23:27:05 +00:00
Roland McGrath
3a12be3a73 autoheader 1995-03-24 07:30:46 +00:00
Roland McGrath
2346f99368 Regenerated for 3.72.12 1995-03-24 07:28:53 +00:00
Roland McGrath
d855846472 . 1995-03-24 07:27:44 +00:00
Roland McGrath
b9f7d21e42 Regenerated 1995-03-24 06:37:24 +00:00
Roland McGrath
db089ad3e3 . 1995-03-24 05:58:13 +00:00
Roland McGrath
1331cca1fa (handle_non_switch_argument): New function, broken out of decode_switches.
(decode_switches): Set optind to 0 to reinitialize getopt, not to 1.  When
getopt_long returns EOF, break the loop and handle remaining args with a
simple second loop.
1995-03-24 05:56:41 +00:00
Roland McGrath
fe05aaf7f2 (update_file_1): Handle FILE->update_status == 2 in -d printout. 1995-03-24 05:40:22 +00:00
Roland McGrath
cc35ff7381 (remake_file): Set update_status to 2 instead of 1 for no rule to make.
Mention parent (dependent) in error message.
1995-03-24 05:33:31 +00:00
Roland McGrath
a146085382 (start_job_command, reap_children): Set update_status to 2 instead of 1
for failed commands.
1995-03-24 05:32:12 +00:00
Roland McGrath
79fcb77ad1 (signame_init): Define SIGINFO. 1995-03-21 21:44:32 +00:00
Roland McGrath
3608635ec6 (search_path): Function removed (was already #if 0'd out). 1995-03-21 21:24:36 +00:00
Roland McGrath
ca53696814 Remove AC_TYPE_GETGROUPS; nothing needs it any more. 1995-03-21 21:23:26 +00:00
Roland McGrath
61dac07200 Updated from libc 1995-03-17 21:17:43 +00:00
Roland McGrath
9e42026e08 . 1995-03-17 21:16:34 +00:00
Roland McGrath
b52ea79ee6 Write @CPPFLAGS@ translation. 1995-03-17 20:57:17 +00:00
Roland McGrath
e483431569 . 1995-03-13 05:51:54 +00:00
Roland McGrath
28b622b8a1 (stamp-glob): Remove $(globfiles), not the whole glob directory. 1995-03-13 05:51:44 +00:00
Roland McGrath
cbfc50cb51 (parse_file_seq): Rearranged l(a b)' -> l(a) l(b)' loop to not
skip the elt immediately preceding `l(...'.
1995-03-13 05:45:44 +00:00
Roland McGrath
deb7cced6e Regenerated for 3.72.11 1995-03-10 20:36:06 +00:00
Roland McGrath
f9af56ac67 . 1995-03-10 20:36:06 +00:00
Roland McGrath
3ba2e947ac Changed find_char_unquote callers here too. 1995-03-10 20:34:41 +00:00
Roland McGrath
13d0eeb8e5 (find_char_unquote): Make second arg a string of stop chars instead of a
single stop char.  Stop when any char in the string is hit.
All callers changed.
(find_semicolon): Pass stop chars "#;" to one find_char_unquote call,
instead of using two calls.  If the match is not a ; but a #, return zero.
1995-03-10 20:33:40 +00:00
Roland McGrath
d9f063656b . 1995-03-10 19:08:28 +00:00
Roland McGrath
aceefb74da (read_makefile, parse_file_seq): Fix typo __MS_DOS__ -> __MSDOS__. 1995-03-10 19:07:26 +00:00
Roland McGrath
f38d98e988 Regenerated for 3.72.10 1995-03-10 19:00:29 +00:00
Roland McGrath
ff8ff73e65 . 1995-03-10 18:58:47 +00:00
Roland McGrath
8478b0c10a (globfiles): Add glob/configure.bat.
(distfiles): Add configh.dos, configure.bat.
1995-03-10 18:56:38 +00:00
Roland McGrath
1adf3a07dc (read_makefile, parse_file_seq) [__MS_DOS__]: Don't see : as separator in
"C:\...".
1995-03-09 01:42:12 +00:00
Roland McGrath
a5a27a893d (STDC_HEADERS): Define only if undefined.
(HAVE_SYS_PARAM_H): Don't define this.
(HAVE_STRERROR): Define this.
1995-03-09 01:13:02 +00:00
Roland McGrath
595f7598ae (construct_command_argv_internal) [__MSDOS__]: Fix typos. 1995-03-09 01:08:14 +00:00
Roland McGrath
8bc1a424e2 . 1995-03-08 18:21:45 +00:00
Roland McGrath
5e69859273 Regenerated 1995-03-08 18:18:03 +00:00
Roland McGrath
3a0f9ce0cb (decode_switches): Reset optind to 1 instead of 0. 1995-03-08 18:10:43 +00:00
Roland McGrath
3aabdf96a1 . 1995-03-08 18:09:30 +00:00
Roland McGrath
55b99d4151 Undo last change. Bad juju. 1995-03-08 18:08:00 +00:00
Roland McGrath
f3699ad75f (configure, config.h.in): Depend on aclocal.m4. Commit files to CVS. 1995-03-08 18:06:59 +00:00
Roland McGrath
0af0c8dba0 . 1995-03-08 00:13:28 +00:00
Roland McGrath
1280ee49bb (configure, config.h.in): Uncomment these rules.
Commit the files to CVS if there is a CVS directory.
1995-03-08 00:11:27 +00:00
Roland McGrath
8fc1187283 Do CVS magic, not RCS magic. 1995-03-08 00:10:10 +00:00
Roland McGrath
e8dcf11ae0 . 1995-03-07 23:49:08 +00:00
Roland McGrath
ce40d6af9f . 1995-03-07 23:44:43 +00:00
Roland McGrath
636435e5c2 (decode_switches): If non-option arg is "-", ignore it. 1995-03-07 22:31:01 +00:00
Roland McGrath
0733d6947d (strsignal): Cast sys_siglist elt to char *. 1995-03-07 06:41:05 +00:00
Roland McGrath
b91d62feb3 [! __STDC__]: Don't use prototype for strsignal decl. 1995-02-23 23:42:12 +00:00
Roland McGrath
f6d5cdba19 (main): Pass missing arg to tmpnam. 1995-02-22 03:19:53 +00:00
Roland McGrath
fcb29e5e96 Check for strsignal. 1995-02-22 03:18:18 +00:00
Roland McGrath
d7a043b46c (child_error): Use strsignal. 1995-02-22 03:17:54 +00:00
Roland McGrath
d85ab5953a (main): Don't call signame_init #ifdef HAVE_STRSIGNAL. 1995-02-22 03:17:22 +00:00
Roland McGrath
93dd485ab6 (strsignal): Declare it. 1995-02-22 03:15:51 +00:00
Roland McGrath
5c350f4fd5 [! HAVE_STRSIGNAL] (strsignal): New function. 1995-02-22 03:13:12 +00:00
Roland McGrath
514c4bac33 (strerror): Fix swapped args in sprintf. 1995-02-22 03:10:16 +00:00
Roland McGrath
8f24715a10 (CFLAGS, LDFLAGS): Don't set these variables. 1995-02-13 16:50:03 +00:00
Roland McGrath
4c7f18cd09 (print_version): Add 95 to copyright years. 1995-02-11 01:39:58 +00:00
Roland McGrath
c5af4810ff (start_job_command): Remember to call notice_finsihed_file under -n when
not recursing.  To do this, consolidate that code under the empty command
case and goto there for the -n case.
1995-02-10 23:44:03 +00:00
Richard M. Stallman
551c4322cb real-clean renamed to maintainer-clean.
Description changed too.
1995-02-07 23:45:48 +00:00
Roland McGrath
e33c50b1e2 [! STDC_HEADERS]: Don't declare qsort. Sun headers declare it int. 1995-02-07 18:36:00 +00:00
Roland McGrath
bc1e6b66f1 (read_makefile): For bogus line starting with tab, ignore it if blank after
removing comments.
1995-02-06 22:58:07 +00:00
Roland McGrath
bbd5e695f5 Cast results of alloca' to char *'. 1995-02-06 22:37:36 +00:00
Roland McGrath
f3cfccf0b8 Cast results of alloca' to char *' in two places. 1995-02-06 22:36:43 +00:00
Roland McGrath
016e1beef5 Check for mktemp. 1995-02-05 23:50:12 +00:00
Roland McGrath
21a8ec0d72 (main) [! HAVE_MKTEMP]: Use tmpnam instead of mktemp. 1995-02-05 23:49:40 +00:00
Roland McGrath
fecd9e661a (make_cv_sysconf_open_max): New check for `sysconf (_SC_OPEN_MAX)'. 1995-02-05 23:45:49 +00:00
Roland McGrath
2914c705e5 Added #undef HAVE_SYSCONF_OPEN_MAX. 1995-02-05 23:36:04 +00:00
Roland McGrath
3f506aaf90 [HAVE_SYSCONF_OPEN_MAX] (getdtablesize): Define as macro using sysconf. 1995-02-05 23:35:39 +00:00
Roland McGrath
75ea6c3ce2 (update_file_1): When !MUST_MAKE, don't set FILE->update_status to zero
before calling notice_finished_file.
(notice_finished_file): Touch only when FILE->update_status is zero.
(remake_file): Set FILE->update_status to zero after not calling
execute_file_command and deciding to touch instead.
1995-01-27 09:42:00 +00:00
Roland McGrath
3fb9ebf83f (debug_signal_handler): New function; toggles debug_flag.
(main): Handle SIGUSR1 with that.
1995-01-26 06:29:18 +00:00
Roland McGrath
b4890bdb1c (realclean): Remove Info files. 1995-01-16 20:46:50 +00:00
Roland McGrath
2cbfa1024a (variable_expand): Fix braino in last change. 1995-01-15 16:33:35 +00:00
Roland McGrath
258dad0f9a Fix nits in last change. 1995-01-15 16:32:10 +00:00
Roland McGrath
37358a9a82 (start_job_command): Save and restore environ around vfork call.
(search_path): Function #if 0'd out.
(exec_command): Use execvp instead of search_path.
1995-01-15 15:57:48 +00:00
Roland McGrath
e167e0a3c2 (variable_expand): Rewrote computed variable name and substitution
reference handling to be simpler.  First expand the entire text between the
parens if it contains any $s, then examine the result of that for
subtitution references and do no further expansion while parsing them.
1995-01-15 15:32:37 +00:00
Roland McGrath
7879457545 (construct_command_argv_internal): Handle " quoting too, when no
backslash, $ or ` characters appear inside the quotes.
1995-01-15 13:43:48 +00:00
Roland McGrath
d525f4dd72 (union wait check): If WEXITSTATUS and WTERMSIG are defined, just use int. 1995-01-15 13:23:03 +00:00
Roland McGrath
bd19554ea7 (Foreach Function): Correccion de gramatica espanola. 1995-01-13 06:30:39 +00:00
Roland McGrath
fffc384bfc (default_variables) [__hpux]: Remove special definition of ARFLAGS.
Existence of the `f' flag is not consistent across HPUX versions;
and one might be using GNU ar anyway.
1995-01-11 00:14:53 +00:00
Roland McGrath
afd1d69e7d (clean): Don't remove Info files. 1995-01-10 11:30:56 +00:00
Roland McGrath
c1305a1a18 ($(bindir)/make): Fix typo in echo. 1995-01-10 11:29:08 +00:00
Roland McGrath
43d5fbfc88 Fix typo in comment. 1995-01-10 11:28:12 +00:00
Roland McGrath
a4642a6a57 (check): Remove gratuitous target declaration. 1995-01-10 11:27:24 +00:00
Roland McGrath
11ca7f1ead (ETAGS, CTAGS): Don't use -t. 1995-01-07 16:59:15 +00:00
Roland McGrath
4aa992616f Include config.h first. 1995-01-07 16:57:36 +00:00
Roland McGrath
ab0fb2fa6f (ar_name_equal) [cray]: Subtract 1 like [__hpux]. 1995-01-07 16:55:30 +00:00
Roland McGrath
e1dd3bfa4a (decode_switches): For --help, print usage to stdout. 1995-01-07 16:38:08 +00:00
Richard M. Stallman
86238ec9d3 install, uninstall, installdirs should not alter the build dir. 1995-01-04 19:37:36 +00:00
Roland McGrath
2e9779fdb4 (update_file_1): Do set_command_state (FILE, cs_not_started) only if old
state was deps_running.
1994-12-05 17:42:13 +00:00
Roland McGrath
b61a13463d (start_waiting_job): Use set_command_state. 1994-11-29 01:10:47 +00:00
Roland McGrath
d3b9c35c8f (CPPFLAGS): New variable.
(prefix, exec_prefix): Set from @...@.
(compilation loop): Pass $CPPFLAGS to compiler.
1994-11-28 23:06:28 +00:00
Roland McGrath
c50b75b439 (build.sh.in): Make it executable. 1994-11-28 23:02:42 +00:00
Roland McGrath
7376280c33 (globfiles): Add configure.in, configure. 1994-11-28 22:02:23 +00:00
Roland McGrath
3c767901f6 (make-$(version).tar): Rename install.sh to install-sh. 1994-11-28 20:54:38 +00:00
Roland McGrath
c6dfff5f1b (prefix, exec_prefix): Set.
(CPPFLAGS): Filter out @...@.
($(ARCH)/glob/libglob.a): Don't pass down variables.
1994-11-28 20:51:40 +00:00
Roland McGrath
74540a1e91 Abbreviate copyright years. 1994-11-28 20:50:45 +00:00
Roland McGrath
5159db0aa4 (AC_OUTPUT): Don't write glob/Makefile. 1994-11-28 20:48:43 +00:00
Roland McGrath
e495d2380d (AC_CHECK_SYMBOL): Use AC_DEFINE_UNQUOTED. 1994-11-28 20:28:26 +00:00
Roland McGrath
1ed34a0118 Don't check for ranlib. 1994-11-28 20:20:43 +00:00
Roland McGrath
e8f64b2c88 (notice_finished_file): Only mark also_make's as updated if really ran
cmds.
1994-11-23 03:42:34 +00:00
Roland McGrath
4867409da2 Put dnls before random whitespace. 1994-11-15 11:32:39 +00:00
Roland McGrath
f801fc3521 (CPPFLAGS): New variable, set from @CPPFLAGS@.
(RANLIB): Variable removed.
(prefix, exec_prefix): Set these from @...@.
(.c.o): Use $(CPPFLAGS).
(glob/libglob.a): Don't pass down variables to sub-make.
glob/Makefile should be configured properly by configure.
(distclean): Remove config.log and config.cache (autoconf stuff).
1994-11-13 10:02:19 +00:00
David J. MacKenzie
b2c0446e71 Explain reason for new filesystem layout. 1994-11-11 04:33:24 +00:00
Roland McGrath
8f98ceb724 Add #undef HAVE_UNION_WAIT. 1994-11-08 02:09:49 +00:00
Roland McGrath
dea9990bc8 Converted to Autoconf v2. 1994-11-08 02:08:24 +00:00
Roland McGrath
e4c43aab3e Test HAVE_DIRENT_H, HAVE_SYS_DIR_H, HAVE_NDIR_H instead of DIRENT, SYSDIR,
NDIR.
1994-11-08 00:14:50 +00:00
Roland McGrath
e55ed78080 (prefix, exec_prefix): Set these from @...@.
(CPPFLAGS): New variable, set from @CPPFLAGS@.
(compiling loop): Pass $CPPFLAGS before $CFLAGS.
1994-11-07 23:42:58 +00:00
Roland McGrath
ca54a0b991 Initial revision 1994-11-07 23:40:44 +00:00
Roland McGrath
e25e2fb7f5 (define_makeflags): When no flags, set WORDS to zero. 1994-11-07 18:57:56 +00:00
Roland McGrath
1a886b6359 (define_makeflags): Terminate properly when FLAGSTRING is empty. 1994-11-06 23:33:55 +00:00
Roland McGrath
b511712f25 (rcs-mark-{alpha,beta}): Let make do the globbing instead of sh. 1994-11-04 21:08:52 +00:00
Roland McGrath
30fcca501f Remove `DRAFT' from edition. 1994-11-04 20:23:23 +00:00
Roland McGrath
806dc4f7c4 (Variables/Recursion): Fix typo. 1994-11-01 08:40:19 +00:00
Roland McGrath
c0163410d2 (start_job_command): When ARGV is nil, only set update_state and call
notice_finished_file if job_next_command returns zero.
1994-11-01 08:34:10 +00:00
Roland McGrath
eac1e9ee66 Doc .DELETE_ON_ERROR.
Doc new MAKEFLAGS/MAKEOVERRIDES.
Doc .IGNORE/.SILENT with deps.
1994-11-01 08:29:31 +00:00
Roland McGrath
8ad5af7c28 (start_job_command): Call notice_finished_file for empty command line. 1994-11-01 06:18:07 +00:00
Roland McGrath
857d7ad256 (snap_deps): Set COMMANDS_SILENT for .SILENT, not COMMANDS_NOERROR. 1994-10-27 06:02:43 +00:00
Roland McGrath
612a29e0dd [alliant && i860] (FSCALE): Move defn before #ifndef FSCALE. 1994-10-27 00:34:56 +00:00
Roland McGrath
462304918c (snap_deps): Set command_flags bits in all :: entries. 1994-10-26 02:49:21 +00:00
Roland McGrath
9d36c92adb (snap_deps): Fix last change. 1994-10-24 23:44:16 +00:00
Roland McGrath
640c4ecd99 (posix_pedantic): Declare it. 1994-10-24 23:11:57 +00:00
Roland McGrath
07f09cfd88 (main): Move checks .IGNORE, .SILENT, .POSIX to snap_deps. 1994-10-24 22:57:07 +00:00
Roland McGrath
d37c9ba18a (snap_deps): Check .IGNORE, .SILENT, .POSIX here instead of in main.
If .IGNORE has deps, OR COMMANDS_NOERROR into their command_flags and
don't set -i.  Likewise .SILENT.
1994-10-24 22:56:27 +00:00
Roland McGrath
cc8d6cf343 (start_job_command): In FLAGS initialization, OR in
CHILD->file->command_flags.
1994-10-24 22:50:01 +00:00
Roland McGrath
4b17f0982b (struct file): New member `command_flags'. 1994-10-24 22:47:43 +00:00
Roland McGrath
dc576b2051 (Automatic Dependencies): Improve recommended sed command.
Mention -MM flag to gcc.
1994-10-24 05:05:43 +00:00
Roland McGrath
a543a2ae9f (Commands): Add warning about "blank" line starting with a tab. 1994-10-17 00:02:27 +00:00
Roland McGrath
0e352e4bf7 (switches): Bump flag values for --no-print-directory and
--warn-undefined-variables, so neither is 1 (which indicates a nonoption
argument).
1994-10-16 05:01:46 +00:00
Roland McGrath
3f8bde0f25 (main): Add missing code in .IGNORE test. 1994-10-16 03:39:35 +00:00
Roland McGrath
4308542cb1 Document $+ and $(+D), $(+F). 1994-10-10 08:10:13 +00:00
Roland McGrath
e622fcf22e (define_automatic_variables): Define +D and +F. 1994-10-10 08:08:58 +00:00
Roland McGrath
1766b7fa59 (main): Define hidden automatic variable with command vars, and
MAKEOVERRIDES to a reference to that.
(define_makeflags): If posix_pedantic, write a reference to that instead.
1994-10-01 08:07:35 +00:00
Roland McGrath
fa999783d7 (posix_pedantic): New variable.
(main): Set posix_pedantic if .POSIX is a target.
Fix .IGNORE and .SILENT hecks to require is_target.
1994-09-30 01:04:54 +00:00
Roland McGrath
e97d6632b5 Comment fix. 1994-09-29 19:52:49 +00:00
Roland McGrath
e3d013a79a (set_file_variables): Define new automatic variable $+, like $^ but before
calling uniquize_deps.
1994-09-29 08:23:25 +00:00
Roland McGrath
9807a2869f (reap_children): Call delete_child_targets for non-signal error if
.DELETE_ON_ERROR is a target.
1994-09-29 04:14:20 +00:00
Roland McGrath
e9521d3447 [alliant && i860] (LOAD_AVE_TYPE, FSCALE, NLIST_STRUCT): Define. 1994-09-28 21:00:06 +00:00
Roland McGrath
c62ca42327 (reap_children): Don't change C->file->command_state when dying.
Test it only after calling start_job_command for a new command line.
When no more cmds, just set C->file->update_status.
(start_job_command): When the last line is empty or under -n, set
C->file->update_status.
(start_waiting_job): Grok cs_not_started after start_job_command as success.
(new_job): Set C->file->update_status when there are no cmds.
(job_next_command): When out of lines, don't set CHILD->file->update_status or
CHILD->file->command_state.
1994-09-26 23:02:40 +00:00
Roland McGrath
2feb36f620 (quote_as_word): Actually test DOUBLE_DOLLARS, instead of always doubling. 1994-09-26 22:45:08 +00:00
Roland McGrath
f40918e005 (quote_as_word): Renamed from shell_quote.
Take new arg; if nonzero, also double $s.
(main): Define MAKEOVERRIDES from command_variables here.
(define_makeflags): Don't use command_variables here; instead write a
reference $(MAKEOVERRIDES) in MAKEFLAGS.  Make vars recursive.
1994-09-26 22:37:10 +00:00
Roland McGrath
b13a443fa7 [__MSDOS__]: Fixed typo. 1994-09-26 22:20:56 +00:00
Roland McGrath
e938a511be (selective_vpath_search): Reset EXISTS when stat fails. 1994-09-26 22:16:51 +00:00
David J. MacKenzie
a96d572aa6 remove CONFIG_BROKETS 1994-09-26 21:57:54 +00:00
David J. MacKenzie
990c39d973 REMOVE CONFIG_BROKETS 1994-09-26 21:56:21 +00:00
David J. MacKenzie
24d37fb493 remove CONFIG_BROKETS 1994-09-26 21:52:40 +00:00
Richard M. Stallman
c1e20276cb (getloadavg): Add OSF_ALPHA support. 1994-09-17 00:16:57 +00:00
Roland McGrath
9f71eaf6b5 Include <assert.h> and use assert instead of printfs and abort. 1994-09-10 15:04:57 +00:00
Roland McGrath
03cd08cca2 (decode_switches): Loop until optind hits ARGC, not just until getopt_long
returns EOF.  Initialize C to zero before loop; in loop if C is EOF, set
optarg from ARGV[optind++], else call getopt_long.
(decode_env_switches): Use variable_expand instead of
allocated_variable_expand.  Allocate a fresh buffer to copy split words
into; scan characters by hand to break words and debackslashify.
(shell_quote): New function.
(define_makeflags): Allocate doubled space for switch args, and command
variable names and values; use shell_quote to quote those things.
1994-09-10 07:01:10 +00:00
Roland McGrath
dc44a79020 Add HAVE_SYS_SIGLIST and HAVE__SYS_SIGLIST. 1994-09-09 07:16:54 +00:00
Roland McGrath
8ed6e13cfe (Archive Suffix Rules): Remove Next pointer. 1994-09-09 06:59:08 +00:00
Roland McGrath
b321e0f535 (decode_switches): The non-option return from getopt is 1, not 0.
(command_variables): New type and variable.
(decode_switches, decode_env_switches): After making a variable definition,
record the struct variable pointer in the command_variables chain.
(define_makeflags): If ALL, write variable definitions for
command_variables.
1994-09-09 06:45:51 +00:00
Roland McGrath
c1433e9495 (other_args): Variable removed.
(goals, lastgoal): New static variables (moved from auto in main).
(main): Don't process OTHER_ARGS at all.
Don't set variable MAKEOVERRIDES at all; define MAKE to just $(MAKE_COMMAND).
(init_switches): Prepend a - (return in order) instead of a + (require order).
(decode_switches): Don't set OTHER_ARGS at all.
Grok '\0' return from getopt_long as non-option argument; try variable
definition and (if !ENV) enter goal targets here.
(decode_env_switches): Use allocated_variable_expand to store value.
Use find_next_token to simplify word-splitting loop.
Don't prepend a dash to uninterpreted value.
Instead, if split into only one word, try variable definition and failing
that prepend a dash to the word and pass it to decode_switches as a single arg.
1994-09-09 05:37:40 +00:00
Roland McGrath
e4a94e0210 (notice_finished_file): Only recheck modtimes if FILE->command_state was
cs_running on entry (meaning the commands actually just ran).
(update_file_1): Whenever we set FILE->update_status, call
notice_finished_file instead of just set_command_state.
1994-09-07 07:06:46 +00:00
Roland McGrath
9e97330bcb (start_job_command): Whenever we set CHILD->file->update_status, call
notice_finished_file instead of just set_command_state.
1994-09-07 07:02:23 +00:00
Roland McGrath
4969b416b8 (set_command_state): Actually set FILE->command_state. 1994-09-07 00:31:13 +00:00
Roland McGrath
0bd0301ae3 (set_command_state): Fix typo. 1994-09-07 00:24:10 +00:00
Roland McGrath
ff6efbadf5 (set_command_state): Declare D. 1994-09-07 00:17:57 +00:00
Roland McGrath
0b3317d2e1 Add missing ". 1994-09-07 00:15:23 +00:00
Roland McGrath
ca5a872280 Changed all assignments of command_state members to calls to
set_command_state.
1994-09-07 00:04:49 +00:00
Roland McGrath
4244f182f2 (set_command_state): New function. 1994-09-07 00:02:25 +00:00
Roland McGrath
be6e6d74bb Declare set_command_state. 1994-09-06 23:48:36 +00:00
Roland McGrath
4c0fef3dd7 (init_switches): Put a + first in options. 1994-09-06 23:13:43 +00:00
Richard M. Stallman
d3b65c3cb7 entered into RCS 1994-08-21 17:29:57 +00:00
gnu
bc48185f8e Formerly make-stds.texi.~29~ 1994-08-10 05:41:00 +00:00
Roland McGrath
6fcf219fa7 Initial revision 1994-07-25 23:47:05 +00:00
Roland McGrath
d2e23eefd2 Added trailing CRs. 1994-07-25 23:46:16 +00:00
Roland McGrath
55162a6730 Changed all uses of ':' to PATH_SEPARATOR_CHAR. 1994-07-25 23:34:32 +00:00
Roland McGrath
021ea7e61c (directory_before_chdir): New variable, moved out of main (was local).
(main) [__MSDOS__]: Look for \ or : to delimit last component of PROGRAM.
Don't frob ARGV[0] before setting MAKE_COMMAND variable.
(die): Change back to `directory_before_chdir' before dying.

Part of MSDOS/GO32 port from DJ Delorie <dj@ctron.com>.
1994-07-25 23:33:26 +00:00
Roland McGrath
f663464925 (PATH_SEPARATOR_CHAR): Macro removed (now in make.h). 1994-07-25 23:28:08 +00:00
Roland McGrath
5d435e0859 (PATH_SEPARATOR_CHAR): New macro; differing defns for [__MSDOS__] and not. 1994-07-25 23:27:48 +00:00
Roland McGrath
a2ab31ba62 [__MSDOS__]: Include <process.h>.
(PATH_SEPARATOR_CHAR): New macro; differing defns for [__MSDOS__] and not.
[__MSDOS__] (dos_pid, dos_status, dos_bname, dos_bename, dos_batch_file):
New variables.
(reap_children) [__MSDOS__]: Don't call wait; just examine those vars.
(unblock_sigs) [__MSDOS__]: Do nothing.
(start_job_command) [__MSDOS__]: Use spawnvpe instead of vfork and exec.
(load_too_high) [__MSDOS__]: Always return true.
(search_path) [__MSDOS__]: Check for : or / in FILE to punt.
Use PATH_SEPARATOR_CHAR instead of ':'.
(construct_command_argv_internal) [__MSDOS__]: Wholly different values for
sh_chars and sh_cmds.  Wholly new code to handle shell scripts.

Part of MSDOS/GO32 port from DJ Delorie <dj@ctron.com>.
1994-07-25 23:23:03 +00:00
Roland McGrath
da2ea1ea7f (expand_function: `shell') [__MSDOS__]: Wholly new implementation. 1994-07-25 23:06:00 +00:00
Roland McGrath
21a1b3b255 [__MSDOS__] (dosify): New function.
(dir_contents_file_exists_p) [__MSDOS__]: Call it on FILENAME and process
the result instead of FILENAME itself.
(file_impossible_p) [__MSDOS__]: Likewise.
Part of MSDOS/GO32 port from DJ Delorie <dj@ctron.com>.
1994-07-25 23:01:19 +00:00
Roland McGrath
c8e76a708e [__MSDOS__]: Define GCC_IS_NATIVE.
(default_suffix_rules) [__MSDOS__]: Use `y_tab.c' instead of `y.tab.c'.
(default_variables) [GCC_IS_NATIVE]: Set CC and CXX to `gcc', YACC to
`bison -y', and LEX to `flex'.
Part of MSDOS/GO32 port from DJ Delorie <dj@ctron.com>.
1994-07-25 22:54:09 +00:00
Roland McGrath
461cffc4e9 Initial revision 1994-07-25 22:48:06 +00:00
Roland McGrath
cdd25d1fb3 (fatal_error_signal) [__MSDOS__]: Just remove intermediates and exit.
Part of MSDOS/GO32 port from DJ Delorie <dj@ctron.com>.
1994-07-25 22:47:14 +00:00
Roland McGrath
9a3666d550 (set_file_variables): Add parens in length computation in .SUFFIXES dep
loop to quiet compiler warning.  From Jim Meyering.
1994-07-25 22:09:25 +00:00
Roland McGrath
90dffad2cc (read_makefile): Free FILENAME if we allocated it. From Jim Meyering. 1994-07-25 22:07:41 +00:00
Roland McGrath
c1f2ef6d09 Update ISBN number to 1-882114-50-7 for edition 0.46.
Use new macro ISBN set at top of file.
1994-07-20 12:30:52 +00:00
Roland McGrath
51250a676d Split a shell command line in @example to avoid overfull hbox. 1994-07-08 18:33:15 +00:00
Roland McGrath
d2461a2409 (Goals): Say that only first target in first rule is default goal.
(Archive Pitfalls): New node.
1994-07-05 21:27:09 +00:00
Roland McGrath
fdea69c5fa (selective_vpath_search): Use safe_stat in place of stat. 1994-07-04 21:56:24 +00:00
Roland McGrath
7c7552336d (construct_include_path): Use safe_stat in place of stat. 1994-07-04 21:55:13 +00:00
Roland McGrath
535dcf6a22 (search_path): Use safe_stat in place of stat. 1994-07-04 21:54:18 +00:00
Roland McGrath
84091971f9 (find_directory): Use safe_stat in place of stat. 1994-07-04 21:53:25 +00:00
Roland McGrath
61da194af9 (delete_target): Use safe_stat in place of stat. 1994-07-04 21:52:28 +00:00
Roland McGrath
30c1465265 (ar_member_touch) [EINTR]: Do EINTR looping around fstat. 1994-07-04 21:51:49 +00:00
Roland McGrath
b574b8ea5a (name_mtime): Use safe_stat in place of stat.
(touch_file) [EINTR]: Do EINTR looping around fstat.
1994-07-04 21:50:03 +00:00
Roland McGrath
710e8e6f6f (safe_stat): New function, EINTR-safe wrapper around stat. 1994-07-04 21:46:58 +00:00
Roland McGrath
4a8a7637f3 (read_makefile): Check for a shell command first, and then strip leading
tabs before further checking if it's not a shell command line.
1994-06-24 10:34:03 +00:00
Roland McGrath
6348923799 Fix typo in last change. 1994-06-24 10:22:37 +00:00
Roland McGrath
660a23d649 [__arm]: Undefine POSIX.
[!__GNU_LIBRARY__ && !POSIX && !_POSIX_VERSION]: Don't declare system
functions that return int.
1994-06-24 09:45:35 +00:00
Roland McGrath
5bd9836fba (construct_command_argv_internal): After swallowing a backslash-newline
combination, if INSTRING is set goto string_char (new label) for normal
INSTRING handling code.
1994-06-24 09:40:13 +00:00
Roland McGrath
0cb47363e1 Put #include of errno.h and decl of errno before #ifndef HAVE_GETLOADAVG. 1994-06-04 05:24:48 +00:00
Roland McGrath
fff5a9ece0 Don't check for sys_siglist and _sys_siglist with AC_HAVE_FUNCS.
Instead use two AC_COMPILE_CHECKs.
1994-06-04 05:11:12 +00:00
Richard M. Stallman
e3a24fc596 [emacs]: Block input around the garbage reclamation.
Include blockinput.h.
1994-06-02 17:45:40 +00:00
Roland McGrath
bb38b0c253 [!__GNU_LIBRARY__ && !POSIX]: Also test #ifndef _POSIX_VERSION for these
declarations.
1994-05-23 22:25:30 +00:00
Roland McGrath
d2ed03e72a [GETLOADAVG_PRIVILEGED] [POSIX]: Remove bogus #ifndefs around #undefs of
HAVE_SETREUID and HAVE_SETREGID.
1994-05-23 22:20:30 +00:00
Roland McGrath
e72213687f [GETLOADAVG_PRIVILEGED] [POSIX]: Don't test [HAVE_SETUID] and [HAVE_SETGID].
Every system has those, and configure doesn't check for them.
1994-05-21 20:28:10 +00:00
Roland McGrath
491d66a916 [_POSIX_VERSION]: Don't #define POSIX #ifdef ultrix. 1994-05-21 20:27:18 +00:00
Roland McGrath
f4fb1be3d8 (loadavg): Depend on and use loadavg.c instead of getloadavg.c.
(loadavg.c): Link or copy it from getloadavg.c.
(distclean): Remove loadavg.c.
1994-05-21 20:26:33 +00:00
Roland McGrath
10abeb4a08 (AC_MACRODIR): Don't define it.
[AC_MACRODIR]: Protect deps using it with ifdef.
1994-05-19 00:35:53 +00:00
Roland McGrath
a369402d11 Correct update date updated in last change. 1994-05-17 03:50:09 +00:00
Roland McGrath
fe3962cf54 Update update date for last change. 1994-05-17 03:46:27 +00:00
Roland McGrath
cf76b42f2b [GETLOADAVG_PRIVILEGED] [! POSIX]: Undefine HAVE_SETEUID and HAVE_SETEGID. 1994-05-17 03:09:02 +00:00
Roland McGrath
fb088e4526 (SCCS_GET_MINUS_G check): Put -G flag before file name. 1994-05-17 02:59:57 +00:00
Roland McGrath
f2804372bd (default_terminal_rules): In SCCS rules, put $(SCCS_OUTPUT_OPTION) before
$<.  On some systems -G is grokked only before the file name.
1994-05-17 02:58:49 +00:00
Roland McGrath
c25db14264 (Overriding Makefiles): Don't suggest using .DEFAULT; that loses if the
target file exists.  Instead recommend the combination of a match-anything
rule and a force target.
1994-05-11 01:42:43 +00:00
Roland McGrath
e83c7d40cd (construct_command_argv_internal): Swallow backslash-newline combinations
inside '' strings too.
1994-05-10 20:27:17 +00:00
Roland McGrath
65d0cd98a9 (do_define): Call collapse_continuations on each line before all else. 1994-05-05 08:15:00 +00:00
Roland McGrath
ec505152e0 (AC_MACRODIR): Change default back. 1994-05-02 23:45:18 +00:00
Roland McGrath
0d2488a804 Note that dirs in VPATH, vpath can be separated by blanks as well as
colons.
1994-05-02 23:00:39 +00:00
Roland McGrath
bc5f054132 (config.h.in): Use $(AC_MACRODIR) in dep. 1994-05-02 22:32:54 +00:00
Roland McGrath
e812d40f9f (AC_MACRODIR): Define if undefined.
(ACFLAGS, configure, config.h.in): Use that value.
1994-05-02 22:29:56 +00:00
Roland McGrath
b12c639bb2 (ARCH==hp300): Disabled customs. 1994-04-25 23:37:12 +00:00
Roland McGrath
dd841ded6f (construct_command_argv_internal): Notice newline inside '' string when
RESTP is non-null.
1994-04-25 23:31:55 +00:00
Roland McGrath
3c9e8b266a (update_goal_chain): Reset FILE to G->file after the double-colon loop so
it is never null for following code.
1994-04-22 21:58:26 +00:00
Roland McGrath
e6bce5ef88 (read_makefile): Fix `override define' parsing to skip whitespace after
`define' properly.
1994-04-22 21:57:47 +00:00
Roland McGrath
bdff21b09a (srcdir): Define as @srcdir@; don't reference $(VPATH).
(glob/Makefile): New target.
1994-04-22 21:33:25 +00:00
Roland McGrath
408e868fd2 (Using Variables): Fixed @xref node to `Automatic'. 1994-04-21 22:39:51 +00:00
Roland McGrath
cf63c0c966 (dist): Depend on rcs-mark first.
(rcs-mark): New target.
(rcs-mark-alpha, rcs-mark-beta): Use $(version-); append : to name for -N.
(version-): New variable, removes dots (RCS doesn't like) from $(version).
1994-04-21 22:35:15 +00:00
Roland McGrath
d2e496cc01 (Using Variables): Fix menu item to `Automatic'. 1994-04-21 22:23:37 +00:00
Roland McGrath
ac336f7a9c Undo last change; reverted to revision 1.22. 1994-04-21 22:14:01 +00:00
Roland McGrath
8f581d3bc0 (parse_file_seq): Fix typo in last change. Remove unused variable. 1994-04-21 21:28:59 +00:00
Roland McGrath
b2522ec319 (chop_commands): Fix braino in last change (failed to initialize IDX for
loop).
1994-04-21 21:28:02 +00:00
Roland McGrath
117d4e0f36 (remove_comments): Use find_char_unquote. 1994-04-21 21:18:04 +00:00
Roland McGrath
9b0a99a051 (find_char_unquote): Declare it. 1994-04-21 20:37:39 +00:00
Roland McGrath
5c807f5457 (find_char_unquote): New function, generalized from find_percent.
(find_percent, find_semicolon, parse_file_seq): Use that.
1994-04-21 20:36:47 +00:00
Roland McGrath
7eeab2fbe1 (chop_commands): Use find_char_unquote to find newlines. 1994-04-21 20:16:42 +00:00
Roland McGrath
f6716d5e74 (pattern_search): Always allocate new storage for FILE->stem.
It is not safe to store STEM's address because it might be auto storage.
1994-04-21 03:48:00 +00:00
Roland McGrath
be451f6d29 Check for seteuid and setegid. 1994-04-21 02:41:56 +00:00
Roland McGrath
eb0dbf1993 [HAVE_SETEUID]: Declare seteuid.
[HAVE_SETEGID]: Declare setegid.
(make_access, user_access) [HAVE_SETEUID]: Use seteuid.
[HAVE_SETEGID]: Use setegid.
1994-04-21 02:41:36 +00:00
Roland McGrath
5ebd380d7a Clarify -q exit status.
(Running): Enumerate possible exit status values (0, 1, 2).
1994-04-21 02:33:10 +00:00
Roland McGrath
cbfe6d75f6 (update_goal_chain): Set STATUS to FILE->update_status, to preserve whether
it's 2 for error or 1 for -q trigger.  When STATUS gets nonzero and -q is
set, always stop immediately.
1994-04-21 02:15:37 +00:00
Roland McGrath
716e804b5b (main, decode_switches): Die with 2 for errors.
(main): Accept 2 return from update_goal_chain and die with that.
1994-04-21 02:08:28 +00:00
Roland McGrath
4848c19870 (fatal, makefile_fatal): Die with 2; 1 is reserved for -q answer. 1994-04-21 02:01:24 +00:00
Roland McGrath
bca4e882ba (reap_children): Die with 2 for error.
(start_job_command): Set update_status to 2 for error.  Set it to 1 when we
would run a command and question_flag is set.
1994-04-21 02:00:20 +00:00
Roland McGrath
eb08818828 (read_makefile): Don't mark makefiles as precious. Just like other
targets, they can be left inconsistent and in need of remaking by aborted
commands.
1994-04-21 01:39:36 +00:00
Roland McGrath
b86e35d2a6 (Automatic Dependencies): Mention here that deps preclude intermediate files. 1994-04-21 01:35:11 +00:00
Roland McGrath
f5b14eee67 (Wildcard Pitfall): Fixed typo. 1994-04-21 01:21:39 +00:00
Roland McGrath
118439508b (Bugs): Take my bloody e-mail address out of the manual and tell them to
send misc. questions to the bug address.
1994-04-21 00:59:00 +00:00
Roland McGrath
f875c95115 (Archive Members): Don't say archive file must exist. Instead, in ar cmds
example, use `c' flag and mention it is needed if archive doesn't exist.
(Archive Update): Fix typo: foo.o -> file.o.
1994-04-21 00:55:18 +00:00
Roland McGrath
f2c10dedf0 (read_makefile): Write no error msg for -include file. 1994-04-20 22:42:32 +00:00
Roland McGrath
37c95f6d39 (dist-flavor): New variable, default to alpha.
(dist): Depend on rcs-mark-$(dist-flavor).
(rcs-mark-beta): New target.
1994-04-20 22:25:09 +00:00
Roland McGrath
22846c7022 (Using Variables): Add paragraph that xrefs to Automatic Variables.
Add Automatic Variables item to the menu.
1994-04-20 22:21:51 +00:00
Roland McGrath
fd025b9089 (fatal_error_signal): Don't unblock signals. 1994-04-06 01:17:43 +00:00
Roland McGrath
6dc8e442f2 (update_goal_chain): Do inner loop on double-colon entries.
(update_file): Use FILE->double_colon pointer to find all entries.
(f_mtime): Likewise.
(notice_finished_file): Propagate mtime change to all entries.
1994-04-05 10:37:12 +00:00
Roland McGrath
4e4b1ed670 (main): When disqualifying makefiles for updating, use double_colon pointer
to find all entries for a file.
1994-04-05 10:20:03 +00:00
Roland McGrath
3580cdedd8 (enter_file): If there is already a double-colon entry for the file, set
NEW->double_colon to that pointer.
(file_hash_enter): Use FILE->double_colon to find all entries to set name.
1994-04-05 10:17:01 +00:00
Roland McGrath
108cca9aa5 (record_files): Set double_colon pointer instead of flag. 1994-04-05 10:14:49 +00:00
Roland McGrath
98104e4d2e (try_variable_definition): Return after abort. 1994-04-05 10:09:28 +00:00
Roland McGrath
dc8983dc8b (struct file): Change member double_colon' from flag to struct file *'. 1994-04-05 09:22:13 +00:00
Roland McGrath
0513e29593 (read_makefile): Remove unused variable.
(parse_file_seq): When removing an elt that is just `)', properly fix up
the previous elt's next pointer.
1994-04-01 23:44:10 +00:00
Roland McGrath
087ef58502 Put $Id$ inside [] in AC_REVISION, since expansion contains a comma. 1994-03-29 00:23:41 +00:00
Roland McGrath
298a8363ff (rcs-mark-alpha): New target.
(dist): Depend on that.
1994-03-29 00:18:03 +00:00
Roland McGrath
ebe1ed2e49 (Makefile.in): Edit MAKE assignment into @SET_MAKE@. 1994-03-29 00:13:58 +00:00
Roland McGrath
6a7b0d623b Do AC_SET_MAKE. 1994-03-28 23:31:37 +00:00
Roland McGrath
f0c1a986db Added rcsid. 1994-03-28 22:58:08 +00:00
Roland McGrath
e7defc873b entered into RCS 1994-03-23 14:53:21 +00:00
Roland McGrath
4b4d5bcd0a Added rcs id. 1994-03-23 14:43:56 +00:00
Roland McGrath
d3fbc4f345 entered into RCS 1994-03-23 14:12:55 +00:00
Roland McGrath
227cffec2b entered into RCS 1994-03-04 05:36:26 +00:00
Roland McGrath
5d3189c952 Formerly read.c.~75~ 1994-03-04 05:10:22 +00:00
Roland McGrath
c71c43c0b5 Formerly misc.c.~31~ 1994-03-04 05:10:20 +00:00
Roland McGrath
1944def8db entered into RCS 1994-02-16 23:58:49 +00:00
Roland McGrath
4b7d940657 Formerly read.c.~74~ 1994-02-16 22:55:31 +00:00
Roland McGrath
d68bb0895b entered into RCS 1994-02-16 21:32:01 +00:00
Roland McGrath
29b051dc0c Formerly misc.c.~30~ 1994-02-16 21:25:32 +00:00
Roland McGrath
8e1432e250 Formerly main.c.~105~ 1994-02-16 21:13:16 +00:00
Roland McGrath
015d472119 entered into RCS 1994-02-16 21:09:47 +00:00
Roland McGrath
7aca4a343d entered into RCS 1994-02-12 00:16:20 +00:00
Roland McGrath
92c245ab98 entered into RCS 1994-02-11 02:45:27 +00:00
Roland McGrath
3bb79f5823 Formerly make.h.~82~ 1994-02-04 21:28:53 +00:00
Roland McGrath
554f67bc64 Formerly misc.c.~29~ 1994-02-03 07:21:18 +00:00
Roland McGrath
5ee9dc7472 Formerly variable.c.~27~ 1994-02-01 00:11:47 +00:00
Roland McGrath
bb55335906 Formerly read.c.~73~ 1994-02-01 00:07:17 +00:00
Roland McGrath
b5665419ba Formerly variable.c.~26~ 1994-01-26 00:48:30 +00:00
Roland McGrath
7f534ea595 Formerly make.texinfo.~127~ 1994-01-26 00:47:07 +00:00
Roland McGrath
23e64a0b13 Formerly commands.c.~20~ 1994-01-25 21:51:25 +00:00
Roland McGrath
1c0df127f8 Formerly make.texinfo.~126~ 1994-01-19 23:04:36 +00:00
Roland McGrath
68a5f2a17a Formerly make.texinfo.~125~ 1994-01-17 22:06:11 +00:00
Roland McGrath
50bb35c3e3 Formerly default.c.~32~ 1994-01-17 22:05:22 +00:00
Roland McGrath
fc99c2260b Formerly GNUmakefile.~116~ 1994-01-12 00:30:18 +00:00
Roland McGrath
f178779347 Formerly GNUmakefile.~115~ 1994-01-07 21:28:25 +00:00
Roland McGrath
90829c3577 entered into RCS 1994-01-07 21:27:29 +00:00
Roland McGrath
7c1f91ced2 Formerly main.c.~104~ 1994-01-06 23:12:09 +00:00
Roland McGrath
b4ccaac8da Formerly compatMakefile.~87~ 1994-01-06 23:11:22 +00:00
Roland McGrath
2932fb1bca Formerly read.c.~72~ 1993-12-23 22:56:05 +00:00
Roland McGrath
db98fe95a4 Formerly GNUmakefile.~113~ 1993-12-23 20:41:21 +00:00
Roland McGrath
66784463c0 Formerly configure.in.~32~ 1993-12-23 19:46:50 +00:00
Roland McGrath
fe450df425 Formerly vpath.c.~15~ 1993-12-23 04:42:29 +00:00
Roland McGrath
c9f149173f Formerly GNUmakefile.~112~ 1993-12-22 22:18:14 +00:00
Roland McGrath
9ee5e4d17d Formerly configure.in.~31~ 1993-12-22 22:00:41 +00:00
Roland McGrath
96d67bce90 Formerly configure.in.~30~ 1993-12-17 20:31:32 +00:00
Roland McGrath
a0ab37fcd6 Formerly arscan.c.~32~ 1993-12-16 23:24:39 +00:00
Roland McGrath
65b8056203 Formerly main.c.~103~ 1993-12-16 20:10:36 +00:00
Roland McGrath
4f752036ac Formerly main.c.~102~ 1993-12-15 22:49:45 +00:00
Roland McGrath
b8c55666a7 Formerly make.texinfo.~124~ 1993-12-15 00:33:30 +00:00
Roland McGrath
08e7a4fcdd Formerly configure.in.~29~ 1993-12-14 23:06:56 +00:00
Roland McGrath
386d0a7ffc Formerly make.texinfo.~123~ 1993-12-14 22:16:38 +00:00
Roland McGrath
c33908dea5 Formerly default.c.~31~ 1993-12-14 21:59:57 +00:00
Roland McGrath
1bc63e8cc7 Formerly configure.in.~28~ 1993-12-14 21:56:50 +00:00
Roland McGrath
ad87633b72 entered into RCS 1993-12-14 21:50:51 +00:00
Roland McGrath
21eecea26d Formerly ar.c.~6~ 1993-12-14 21:06:33 +00:00
Roland McGrath
d519e2c19b Formerly read.c.~71~ 1993-12-14 20:09:51 +00:00
Roland McGrath
cf9bc4ae2f Formerly file.c.~27~ 1993-12-14 19:36:43 +00:00
Roland McGrath
2a19159394 Formerly vpath.c.~14~ 1993-12-14 19:28:59 +00:00
Roland McGrath
8e73c0981b Formerly configure.in.~27~ 1993-12-03 21:40:28 +00:00
Roland McGrath
f935610ca9 Formerly read.c.~70~ 1993-12-02 20:44:03 +00:00
Roland McGrath
12113c5925 Formerly misc.c.~28~ 1993-12-02 20:37:46 +00:00
Roland McGrath
63160928cd Formerly GNUmakefile.~111~ 1993-11-11 16:51:19 +00:00
Roland McGrath
48fe766053 Formerly default.c.~30~ 1993-11-11 16:47:27 +00:00
Roland McGrath
acd7330a5f Formerly read.c.~69~ 1993-11-10 11:06:04 +00:00
Roland McGrath
78454538f9 entered into RCS 1993-11-03 13:06:04 +00:00
Roland McGrath
a7bafcee76 Formerly make.texinfo.~122~ 1993-11-03 12:21:47 +00:00
Roland McGrath
4394c7a32d entered into RCS 1993-11-03 11:56:26 +00:00
Roland McGrath
38abf5e6c4 Formerly function.c.~31~ 1993-10-29 21:50:48 +00:00
Roland McGrath
58c146fa50 Formerly compatMakefile.~86~ 1993-10-29 20:47:10 +00:00
Roland McGrath
e612cccef3 Formerly make.h.~81~ 1993-10-28 00:09:14 +00:00
Roland McGrath
960650331a Formerly file.h.~6~ 1993-10-27 22:23:18 +00:00
Roland McGrath
462e175970 Formerly main.c.~101~ 1993-10-27 22:14:41 +00:00
Roland McGrath
a1749c85c8 Formerly remake.c.~52~ 1993-10-27 22:14:26 +00:00
Roland McGrath
c727af1bcc Formerly main.c.~100~ 1993-10-26 23:55:04 +00:00
Roland McGrath
8cb881fa9e Formerly remake.c.~51~ 1993-10-26 23:45:32 +00:00
Roland McGrath
3aeb946943 Formerly read.c.~68~ 1993-10-25 19:25:17 +00:00
Roland McGrath
9012e6a254 Formerly GNUmakefile.~110~ 1993-10-25 19:11:46 +00:00
Roland McGrath
251b0fc75f Formerly main.c.~99~ 1993-10-25 18:52:25 +00:00
Roland McGrath
f7a6c58f5b Formerly configure.in.~26~ 1993-10-22 06:56:46 +00:00
Roland McGrath
0ddf761563 entered into RCS 1993-10-21 20:48:08 +00:00
Roland McGrath
58d81fe699 Formerly make.texinfo.~121~ 1993-10-21 20:02:11 +00:00
Roland McGrath
4daf275edd Formerly make.texinfo.~120~ 1993-10-20 05:46:21 +00:00
Roland McGrath
d27b2c3de5 Formerly configure.in.~25~ 1993-10-18 11:15:08 +00:00
Roland McGrath
7c456a7368 Formerly rule.c.~16~ 1993-10-18 11:04:04 +00:00
Roland McGrath
a8c24526e3 Formerly file.c.~26~ 1993-10-18 11:01:37 +00:00
Roland McGrath
9e7e303ac8 Formerly make.h.~80~ 1993-10-14 22:29:26 +00:00
Roland McGrath
a3d7dfa85c Formerly default.c.~29~ 1993-10-14 22:25:17 +00:00
Roland McGrath
88054f8ad3 Formerly main.c.~98~ 1993-10-14 22:23:39 +00:00
Roland McGrath
f5e7fb8ea0 Formerly job.h.~6~ 1993-10-14 21:27:29 +00:00
Roland McGrath
7cb595fc60 Formerly compatMakefile.~85~ 1993-10-14 21:04:51 +00:00
Roland McGrath
4cbe738cfb Formerly make.h.~79~ 1993-10-14 19:08:38 +00:00
Roland McGrath
0f83ab90e3 entered into RCS 1993-10-14 19:08:36 +00:00
Roland McGrath
0e15559bbf Formerly GNUmakefile.~109~ 1993-10-11 23:47:29 +00:00
Jim Meyering
eaba9405d7 entered into RCS 1993-10-08 00:11:55 +00:00
Roland McGrath
492f92b9ec *** empty log message *** 1993-10-03 19:33:04 +00:00
Roland McGrath
cc5be7c0cd Formerly default.c.~28~ 1993-10-03 19:15:29 +00:00
Roland McGrath
f8300f1e1c Formerly main.c.~97~ 1993-09-28 18:20:17 +00:00
Roland McGrath
7f71af7974 Formerly job.c.~110~ 1993-09-28 18:18:15 +00:00
Roland McGrath
065ac461c5 Formerly job.c.~109~ 1993-09-20 22:33:18 +00:00
Roland McGrath
f8c3e52b0f Formerly main.c.~96~ 1993-09-20 22:05:19 +00:00
Richard M. Stallman
1775c102ad entered into RCS 1993-09-20 20:03:30 +00:00
Roland McGrath
2a53aecb26 entered into RCS 1993-09-20 20:03:20 +00:00
Roland McGrath
3087dcdb2e *** empty log message *** 1993-09-20 20:02:01 +00:00
Roland McGrath
5174a5e5a1 Formerly make.texinfo.~119~ 1993-09-17 07:33:03 +00:00
Roland McGrath
b018db955c Formerly remake.c.~50~ 1993-09-17 04:51:21 +00:00
Roland McGrath
0da218acc1 Formerly make.h.~78~ 1993-09-17 04:49:17 +00:00
Roland McGrath
9fc36f7358 Formerly commands.c.~19~ 1993-09-17 04:46:36 +00:00
Roland McGrath
ec2751c045 Formerly job.c.~108~ 1993-09-17 04:37:54 +00:00
Roland McGrath
7b91e889b6 *** empty log message *** 1993-09-10 04:22:01 +00:00
Roland McGrath
16667d15e0 Formerly main.c.~95~ 1993-09-09 00:14:18 +00:00
Roland McGrath
b9337d3143 Formerly make.texinfo.~118~ 1993-09-06 23:34:51 +00:00
Roland McGrath
2bf7e9bcda Formerly make.texinfo.~117~ 1993-08-30 16:36:35 +00:00
Roland McGrath
b24a026b02 entered into RCS 1993-08-30 16:31:47 +00:00
Roland McGrath
0ef3708713 *** empty log message *** 1993-08-25 21:46:19 +00:00
Roland McGrath
2012e2877c Formerly make.texinfo.~116~ 1993-08-19 21:03:38 +00:00
Roland McGrath
ba45b6e5fa Formerly make.h.~77~ 1993-08-19 20:36:09 +00:00
Roland McGrath
308e6149e6 Formerly main.c.~94~ 1993-08-19 20:36:08 +00:00
Roland McGrath
cbbf3ee5ef Formerly variable.c.~25~ 1993-08-19 20:36:05 +00:00
Roland McGrath
8171a9ba6e Formerly read.c.~67~ 1993-08-18 19:01:46 +00:00
Roland McGrath
8788690192 Formerly GNUmakefile.~108~ 1993-08-16 21:40:16 +00:00
Roland McGrath
769061023a Formerly compatMakefile.~84~ 1993-08-16 21:39:37 +00:00
Roland McGrath
ba2c317cb7 Formerly configure.in.~24~ 1993-08-16 21:34:26 +00:00
Roland McGrath
aea1502a78 *** empty log message *** 1993-08-16 19:10:25 +00:00
Roland McGrath
9dcfb711c1 *** empty log message *** 1993-08-12 22:17:13 +00:00
Roland McGrath
4d8fff0ec0 Formerly make.h.~76~ 1993-08-12 21:19:12 +00:00
Roland McGrath
3c954a048b Formerly job.c.~107~ 1993-08-11 20:16:45 +00:00
Roland McGrath
2f8d1abe7c Formerly main.c.~93~ 1993-08-11 20:04:39 +00:00
Roland McGrath
d2654362c5 Formerly variable.c.~24~ 1993-08-11 20:04:34 +00:00
Roland McGrath
1bafe5ed81 Formerly job.c.~106~ 1993-08-11 19:32:02 +00:00
Roland McGrath
869ec1b877 *** empty log message *** 1993-08-11 07:27:10 +00:00
Roland McGrath
3cc0c7306a Formerly main.c.~92~ 1993-08-11 06:59:04 +00:00
Roland McGrath
c52575a837 Formerly main.c.~91~ 1993-08-11 06:54:23 +00:00
Roland McGrath
6d00f337e5 Formerly function.c.~30~ 1993-08-11 06:35:19 +00:00
Richard M. Stallman
b6e638af6d *** empty log message *** 1993-08-10 21:27:23 +00:00
Roland McGrath
5fc2539281 Formerly job.c.~105~ 1993-08-09 22:25:00 +00:00
Roland McGrath
0bab40c121 Formerly remote-stub.c.~3~ 1993-08-09 22:21:56 +00:00
Roland McGrath
8980e49036 Formerly function.c.~29~ 1993-08-09 22:11:17 +00:00
Roland McGrath
84b4d9cce4 Formerly compatMakefile.~83~ 1993-08-03 23:18:21 +00:00
Roland McGrath
92a67d1895 Formerly dep.h.~6~ 1993-08-03 04:18:56 +00:00
Roland McGrath
22cd0cd4e3 Formerly compatMakefile.~82~ 1993-08-02 20:49:11 +00:00
Roland McGrath
e75d998e50 *** empty log message *** 1993-08-02 20:48:12 +00:00
Roland McGrath
ae087fbb2f *** empty log message *** 1993-08-01 23:03:26 +00:00
Roland McGrath
714aeaf857 Formerly make.texinfo.~115~ 1993-08-01 22:32:20 +00:00
Roland McGrath
cbeeeafde9 *** empty log message *** 1993-08-01 20:39:38 +00:00
Roland McGrath
572856fa8f entered into RCS 1993-08-01 20:28:14 +00:00
Roland McGrath
1d9b68aef5 Formerly compatMakefile.~81~ 1993-08-01 20:17:31 +00:00
Roland McGrath
e813da324d Formerly misc.c.~27~ 1993-08-01 20:03:45 +00:00
Roland McGrath
b018243a45 Formerly compatMakefile.~80~ 1993-07-30 20:55:50 +00:00
Roland McGrath
9326e8fec5 Formerly compatMakefile.~79~ 1993-07-30 05:29:32 +00:00
Roland McGrath
5cf5f261d9 Formerly configure.in.~23~ 1993-07-30 03:37:40 +00:00
Roland McGrath
e22a936ca5 *** empty log message *** 1993-07-30 03:20:49 +00:00
Roland McGrath
9f33e6cdcb *** empty log message *** 1993-07-27 00:37:13 +00:00
Roland McGrath
16777bbe0f entered into RCS 1993-07-26 20:20:46 +00:00
Roland McGrath
e851ef2303 Initial revision 1993-07-26 20:20:42 +00:00
Roland McGrath
1681a1f29a Formerly make.texinfo.~114~ 1993-07-26 19:10:51 +00:00
melissa
acb8140655 Formerly make.texinfo.~113~ 1993-07-26 18:27:27 +00:00
Roland McGrath
245d0b3772 *** empty log message *** 1993-07-26 17:37:11 +00:00
Roland McGrath
96fb58e401 Formerly compatMakefile.~78~ 1993-07-26 02:23:47 +00:00
Roland McGrath
02d19fe9c1 Formerly GNUmakefile.~107~ 1993-07-26 02:12:47 +00:00
Roland McGrath
32b80e7367 Formerly make.texinfo.~112~ 1993-07-25 21:08:39 +00:00
Roland McGrath
7c30adcd57 Formerly make.texinfo.~111~ 1993-07-23 22:07:42 +00:00
Roland McGrath
8153755c17 Formerly make.h.~75~ 1993-07-23 20:04:37 +00:00
Roland McGrath
2a983b8ead Formerly configure.in.~22~ 1993-07-23 20:04:35 +00:00
Roland McGrath
bd395b5c02 Formerly make.texinfo.~110~ 1993-07-22 21:35:45 +00:00
Roland McGrath
d24f1f2330 Formerly make.texinfo.~109~ 1993-07-16 22:14:09 +00:00
Roland McGrath
cace096aba Formerly make.texinfo.~108~ 1993-07-15 02:31:03 +00:00
Roland McGrath
f0929a13c3 Formerly read.c.~66~ 1993-07-15 02:25:00 +00:00
Roland McGrath
7a031cd4b2 Formerly variable.c.~23~ 1993-07-15 01:59:03 +00:00
Roland McGrath
fc8fa16253 Formerly variable.c.~22~ 1993-07-15 00:22:56 +00:00
Roland McGrath
ca3b88c66a Formerly function.c.~28~ 1993-07-15 00:22:55 +00:00
Roland McGrath
f7f63b75b5 Formerly make.texinfo.~107~ 1993-07-14 23:54:44 +00:00
Roland McGrath
250e638f44 Formerly read.c.~65~ 1993-07-14 23:04:39 +00:00
Roland McGrath
0a0130dcf2 Formerly dep.h.~5~ 1993-07-14 22:56:42 +00:00
Roland McGrath
aef2a1ccd0 Formerly main.c.~90~ 1993-07-14 22:56:38 +00:00
Jim Meyering
2ef2fbe7a4 *** empty log message *** 1993-07-13 16:37:01 +00:00
Roland McGrath
c3b30f576d Formerly make.h.~74~ 1993-07-13 02:42:59 +00:00
David J. MacKenzie
c2cc8e33fb *** empty log message *** 1993-07-12 22:13:12 +00:00
Roland McGrath
af7ef68647 Formerly make.texinfo.~106~ 1993-07-09 18:02:38 +00:00
Roland McGrath
9a6b8d1015 Formerly vpath.c.~13~ 1993-07-09 01:30:13 +00:00
Roland McGrath
3296fa1dff Formerly rule.c.~15~ 1993-07-09 01:22:33 +00:00
Roland McGrath
5a4a5d3160 Formerly make.h.~73~ 1993-07-08 23:51:22 +00:00
David J. MacKenzie
3a511f5874 *** empty log message *** 1993-07-06 23:07:30 +00:00
Roland McGrath
2b8f817cfb Formerly GNUmakefile.~106~ 1993-07-01 03:36:40 +00:00
Roland McGrath
7789ea8a3c Formerly implicit.c.~14~ 1993-06-30 23:04:21 +00:00
Roland McGrath
5003c9b26b Formerly rule.h.~5~ 1993-06-30 22:42:37 +00:00
Roland McGrath
d92b741fce Formerly rule.c.~14~ 1993-06-30 22:40:50 +00:00
Roland McGrath
aa68ee5ce2 Formerly file.c.~25~ 1993-06-30 22:11:36 +00:00
Roland McGrath
26c6ec1893 Formerly make.texinfo.~103~ 1993-06-30 20:07:02 +00:00
Roland McGrath
86d4d7425b Formerly job.c.~104~ 1993-06-25 20:03:56 +00:00
Roland McGrath
f84518396b Formerly read.c.~64~ 1993-06-25 20:03:54 +00:00
Roland McGrath
2e0e3d22ec Formerly vpath.c.~12~ 1993-06-25 20:03:51 +00:00
Roland McGrath
d3fc910b29 Formerly make.texinfo.~102~ 1993-06-25 19:47:50 +00:00
Roland McGrath
9c32a4c3cd Formerly main.c.~89~ 1993-06-25 19:47:20 +00:00
Roland McGrath
54462c9590 Formerly make.h.~72~ 1993-06-25 19:20:49 +00:00
Roland McGrath
ae112a5cb5 Formerly expand.c.~9~ 1993-06-25 19:20:36 +00:00
Roland McGrath
4ac6d66244 Formerly default.c.~27~ 1993-06-25 18:59:05 +00:00
melissa
08c71a7dbf Formerly make.texinfo.~101~ 1993-06-24 21:21:03 +00:00
Roland McGrath
5b5415bf87 Formerly make.texinfo.~100~ 1993-06-22 06:02:26 +00:00
Roland McGrath
f64cd37b29 Formerly default.c.~26~ 1993-06-21 21:56:36 +00:00
Roland McGrath
8bd226777e Formerly compatMakefile.~77~ 1993-06-11 18:42:04 +00:00
Roland McGrath
e176cf73a5 Formerly read.c.~63~ 1993-06-10 22:20:53 +00:00
Roland McGrath
d66f4e3407 Formerly ar.c.~5~ 1993-06-10 22:13:54 +00:00
Roland McGrath
4abb5e433f Formerly make.texinfo.~99~ 1993-06-10 21:56:37 +00:00
Roland McGrath
46a5b5adcc Formerly make.texinfo.~98~ 1993-06-10 01:52:27 +00:00
Roland McGrath
4694e31659 Formerly ar.c.~4~ 1993-06-10 01:43:06 +00:00
Roland McGrath
3d6b586776 Formerly read.c.~62~ 1993-06-10 01:31:02 +00:00
Roland McGrath
c4cc2ec376 Formerly dep.h.~4~ 1993-06-10 00:18:21 +00:00
Roland McGrath
4a94240844 Formerly rule.c.~13~ 1993-06-09 23:16:30 +00:00
Roland McGrath
6fc0ab541e Formerly default.c.~25~ 1993-06-09 23:16:28 +00:00
Roland McGrath
5b4a918d26 Formerly function.c.~27~ 1993-06-09 23:16:25 +00:00
Roland McGrath
bd3309f09b Formerly GNUmakefile.~105~ 1993-06-09 22:06:20 +00:00
Roland McGrath
122c9699fa *** empty log message *** 1993-06-09 20:28:35 +00:00
Roland McGrath
e2f08f5dbf Formerly make.texinfo.~97~ 1993-06-09 17:45:57 +00:00
Jim Blandy
7089c07d4e *** empty log message *** 1993-06-09 09:23:12 +00:00
Roland McGrath
f363e41c27 Formerly read.c.~61~ 1993-06-08 00:36:13 +00:00
Roland McGrath
24cd5ede9e Formerly compatMakefile.~76~ 1993-06-08 00:24:19 +00:00
Roland McGrath
f4fac65746 Formerly main.c.~88~ 1993-06-08 00:08:45 +00:00
Roland McGrath
f6b549870a Formerly dep.h.~3~ 1993-06-07 23:28:51 +00:00
Roland McGrath
074d147ef7 Formerly main.c.~87~ 1993-06-04 19:53:32 +00:00
Roland McGrath
55f5d979ae Formerly main.c.~86~ 1993-06-04 00:27:28 +00:00
Roland McGrath
00dc97cb8a Formerly implicit.c.~13~ 1993-06-04 00:15:12 +00:00
Roland McGrath
9766fe1775 Formerly main.c.~85~ 1993-06-03 20:56:33 +00:00
Roland McGrath
b5fb6b260e Formerly GNUmakefile.~104~ 1993-06-03 20:47:55 +00:00
Roland McGrath
6382676838 Formerly read.c.~60~ 1993-06-02 21:42:39 +00:00
Roland McGrath
14f2b39dff Formerly GNUmakefile.~103~ 1993-06-02 21:09:00 +00:00
Roland McGrath
9697738544 entered into RCS 1993-06-02 20:56:37 +00:00
Roland McGrath
4a9fdcd65f Formerly file.c.~24~ 1993-06-02 20:51:35 +00:00
Roland McGrath
80091295df Formerly main.c.~84~ 1993-06-02 20:51:28 +00:00
Roland McGrath
3c11aba3cd Formerly compatMakefile.~75~ 1993-05-31 22:48:16 +00:00
Roland McGrath
54fb272967 Formerly implicit.c.~12~ 1993-05-27 21:34:50 +00:00
Roland McGrath
e12d722d99 Formerly make.texinfo.~96~ 1993-05-26 21:21:42 +00:00
Roland McGrath
8a5a2b9b8d Formerly make.texinfo.~95~ 1993-05-26 18:41:58 +00:00
Roland McGrath
0246a6dc63 Formerly main.c.~83~ 1993-05-26 18:33:12 +00:00
Richard M. Stallman
60c868c193 *** empty log message *** 1993-05-25 00:43:37 +00:00
Roland McGrath
1e71bdd085 Formerly make.texinfo.~94~ 1993-05-25 00:00:35 +00:00
Roland McGrath
b0a9db44b6 Formerly rule.c.~12~ 1993-05-24 23:02:13 +00:00
Roland McGrath
f846c07d43 *** empty log message *** 1993-05-24 21:41:18 +00:00
Roland McGrath
dfc8da6e0e Formerly compatMakefile.~74~ 1993-05-24 20:17:29 +00:00
Jim Blandy
8960f971ca *** empty log message *** 1993-05-24 15:57:15 +00:00
Roland McGrath
ff71fe9277 Formerly file.c.~23~ 1993-05-22 20:24:37 +00:00
Roland McGrath
fe92d8e656 Formerly main.c.~82~ 1993-05-22 20:20:16 +00:00
Jim Blandy
f0080188b7 *** empty log message *** 1993-05-21 23:39:17 +00:00
Roland McGrath
5a55f43ddc Formerly compatMakefile.~73~ 1993-05-21 22:15:48 +00:00
Roland McGrath
63b6de85b5 Formerly GNUmakefile.~102~ 1993-05-21 17:36:32 +00:00
Roland McGrath
29acbbea8d Initial revision 1993-05-20 20:22:34 +00:00
Roland McGrath
e66d29867e Formerly compatMakefile.~72~ 1993-05-20 01:30:41 +00:00
Roland McGrath
0bcabeb134 Formerly read.c.~59~ 1993-05-19 21:15:51 +00:00
Roland McGrath
e90a315ebe entered into RCS 1993-05-19 17:56:38 +00:00
Roland McGrath
b06b92566c Formerly make.texinfo.~93~ 1993-05-17 00:24:00 +00:00
Roland McGrath
8aa529e55e Formerly vpath.c.~11~ 1993-05-14 23:09:34 +00:00
Roland McGrath
03acd42408 Formerly dir.c.~12~ 1993-05-14 22:41:07 +00:00
Roland McGrath
bc0276c3cb Formerly read.c.~58~ 1993-05-14 22:25:11 +00:00
Roland McGrath
3d952e5879 Formerly main.c.~81~ 1993-05-14 21:50:11 +00:00
Roland McGrath
3f15ef960a Formerly make.texinfo.~92~ 1993-05-14 21:50:07 +00:00
Roland McGrath
fa67064dc6 Formerly make.h.~71~ 1993-05-14 20:40:38 +00:00
Roland McGrath
5340230f6b Formerly README.template.~5~ 1993-05-12 21:22:14 +00:00
Roland McGrath
7162378126 Formerly arscan.c.~31~ 1993-05-12 21:05:03 +00:00
Roland McGrath
534926ac7a Formerly function.c.~26~ 1993-05-12 19:44:41 +00:00
Roland McGrath
5580266222 Formerly configure.in.~21~ 1993-05-12 19:24:14 +00:00
Roland McGrath
6c6f210456 Formerly job.c.~103~ 1993-05-12 19:20:45 +00:00
Jim Meyering
c5c92b71ce Initial revision 1993-05-11 23:23:34 +00:00
Roland McGrath
369bb2a609 Formerly function.c.~25~ 1993-05-07 22:34:49 +00:00
Roland McGrath
5c82e72caa Formerly commands.c.~18~ 1993-05-06 21:30:42 +00:00
Roland McGrath
ca5b7c487d Formerly make.h.~70~ 1993-05-06 21:30:40 +00:00
Roland McGrath
9596950898 Formerly job.c.~102~ 1993-05-06 21:30:10 +00:00
Roland McGrath
29de1a7e5a Formerly expand.c.~8~ 1993-05-06 21:14:33 +00:00
Roland McGrath
f1daf67200 Formerly read.c.~57~ 1993-05-03 21:14:22 +00:00
Roland McGrath
e8c11d4e32 Formerly arscan.c.~30~ 1993-05-03 21:03:37 +00:00
Roland McGrath
481e0e7d22 Formerly arscan.c.~29~ 1993-04-30 01:08:30 +00:00
Roland McGrath
2b81718876 Formerly ar.c.~3~ 1993-04-29 23:57:58 +00:00
Roland McGrath
6ee7823efe Formerly job.c.~101~ 1993-04-29 01:20:37 +00:00
Roland McGrath
683e4a5de9 Formerly arscan.c.~28~ 1993-04-26 20:43:32 +00:00
Roland McGrath
548b4c9bf1 Formerly make.h.~69~ 1993-04-26 20:07:49 +00:00
Roland McGrath
fba3960a6a Formerly main.c.~80~ 1993-04-26 20:05:02 +00:00
Roland McGrath
0986bb2c43 Formerly GNUmakefile.~100~ 1993-04-22 22:42:00 +00:00
Roland McGrath
5532d1d11d Formerly make.texinfo.~91~ 1993-04-19 19:42:09 +00:00
Roland McGrath
dab0d4214e Formerly compatMakefile.~71~ 1993-04-16 20:11:42 +00:00
Roland McGrath
088a491f10 Formerly GNUmakefile.~99~ 1993-04-16 18:41:16 +00:00
Roland McGrath
681f7a3067 Formerly make.texinfo.~90~ 1993-04-16 18:26:18 +00:00
Roland McGrath
ada4528484 Formerly configure.in.~20~ 1993-04-16 00:54:50 +00:00
Roland McGrath
1386d961a9 Formerly default.c.~24~ 1993-04-16 00:54:40 +00:00
Roland McGrath
828b45420a Initial revision 1993-04-16 00:51:27 +00:00
Roland McGrath
e9f008dc04 Formerly misc.c.~26~ 1993-04-15 22:42:20 +00:00
Roland McGrath
44ecfc2f36 Formerly read.c.~56~ 1993-04-15 22:30:01 +00:00
Roland McGrath
e28495225d Formerly rule.c.~11~ 1993-04-15 22:29:57 +00:00
Roland McGrath
c190a98796 Formerly function.c.~24~ 1993-04-15 22:29:47 +00:00
Roland McGrath
a03f503fb7 Formerly misc.c.~25~ 1993-04-14 20:43:53 +00:00
Roland McGrath
04789f11cd Formerly make.texinfo.~89~ 1993-04-14 19:44:21 +00:00
Roland McGrath
f02ced5786 Formerly main.c.~79~ 1993-04-14 18:20:33 +00:00
Roland McGrath
2fae4442e2 Formerly make.h.~68~ 1993-04-14 17:34:15 +00:00
Roland McGrath
f138f0eeff Formerly job.c.~100~ 1993-04-14 17:22:35 +00:00
Roland McGrath
ea1e49e5a8 Formerly default.c.~23~ 1993-04-14 15:32:26 +00:00
Roland McGrath
9bd8004ded Formerly make.texinfo.~88~ 1993-04-12 21:11:48 +00:00
Roland McGrath
596d50cb1c Formerly arscan.c.~27~ 1993-04-12 20:52:46 +00:00
Roland McGrath
48f4ce2825 Formerly remake.c.~49~ 1993-04-12 20:52:45 +00:00
Roland McGrath
d8b7640a81 Formerly dir.c.~11~ 1993-04-12 20:51:44 +00:00
Roland McGrath
8c01d0459a Formerly main.c.~78~ 1993-04-12 20:51:42 +00:00
Roland McGrath
e4dce6fa11 Formerly configure.in.~19~ 1993-04-12 20:51:39 +00:00
Roland McGrath
7831181410 Formerly make.h.~67~ 1993-04-12 20:51:32 +00:00
Roland McGrath
2cc84f7c97 Formerly variable.c.~21~ 1993-04-12 20:02:24 +00:00
Roland McGrath
5136f317d2 Formerly default.c.~22~ 1993-04-12 19:58:26 +00:00
Roland McGrath
ae7b53245a Formerly make.texinfo.~87~ 1993-04-11 22:26:07 +00:00
Roland McGrath
542a0f8112 Formerly main.c.~77~ 1993-04-08 22:14:23 +00:00
Roland McGrath
2ed0333f3c Formerly job.c.~99~ 1993-04-08 22:08:11 +00:00
Roland McGrath
791928d60b Formerly job.c.~98~ 1993-04-07 21:10:12 +00:00
Roland McGrath
de21395cad Formerly make.texinfo.~86~ 1993-04-07 20:44:43 +00:00
Roland McGrath
5973c4e97a Formerly main.c.~76~ 1993-04-07 20:40:35 +00:00
Roland McGrath
6dbdf2caa8 Formerly compatMakefile.~70~ 1993-04-07 19:31:50 +00:00
Roland McGrath
6ed99f4d40 Formerly configure.in.~18~ 1993-04-06 00:58:10 +00:00
Roland McGrath
3f0a207eaf Formerly job.c.~97~ 1993-04-06 00:21:23 +00:00
Roland McGrath
07c6b685b7 Formerly main.c.~75~ 1993-04-02 22:16:47 +00:00
Roland McGrath
0c1c2ff3d0 Formerly GNUmakefile.~98~ 1993-03-29 19:30:33 +00:00
Roland McGrath
d1a988ce9f Formerly GNUmakefile.~97~ 1993-03-28 22:36:05 +00:00
Roland McGrath
ae1278315f Formerly compatMakefile.~69~ 1993-03-28 22:06:13 +00:00
Roland McGrath
164dcdad22 Formerly vpath.c.~10~ 1993-03-24 20:13:56 +00:00
Roland McGrath
f3bd744187 Formerly make.texinfo.~85~ 1993-03-24 19:29:31 +00:00
Roland McGrath
722018bdbe Formerly variable.c.~20~ 1993-03-24 19:27:11 +00:00
Roland McGrath
bfe005e8a0 Formerly GNUmakefile.~96~ 1993-03-18 01:34:17 +00:00
Roland McGrath
f9b50f6436 Formerly main.c.~74~ 1993-03-18 01:02:20 +00:00
Roland McGrath
28c125b725 Formerly compatMakefile.~68~ 1993-03-12 20:54:25 +00:00
Roland McGrath
ab9034ef4e Formerly compatMakefile.~67~ 1993-03-11 19:25:31 +00:00
Roland McGrath
19c3ead040 Formerly configure.in.~17~ 1993-03-11 19:25:28 +00:00
Roland McGrath
63b17f1d63 Formerly GNUmakefile.~95~ 1993-03-11 19:25:25 +00:00
Roland McGrath
3e9cf581d1 entered into RCS 1993-03-11 19:25:21 +00:00
Roland McGrath
e7b737dc5e Formerly GNUmakefile.~94~ 1993-03-10 22:56:43 +00:00
Roland McGrath
1a56335cbf Formerly implicit.c.~11~ 1993-03-10 20:41:03 +00:00
Roland McGrath
4b30933904 Formerly file.c.~22~ 1993-03-10 20:24:57 +00:00
Roland McGrath
094f89cee5 Formerly make.texinfo.~84~ 1993-03-08 21:54:29 +00:00
Roland McGrath
36a66b6bec Formerly remake.c.~48~ 1993-03-08 20:04:20 +00:00
Roland McGrath
69105addb4 Formerly compatMakefile.~66~ 1993-03-08 19:50:11 +00:00
Roland McGrath
e4c66e2f88 Formerly read.c.~55~ 1993-03-08 18:50:09 +00:00
Roland McGrath
d5ef06dee5 Formerly main.c.~73~ 1993-03-08 18:49:51 +00:00
Roland McGrath
7c675f86e6 Formerly make.man.~4~ 1993-03-08 18:38:35 +00:00
Roland McGrath
60a76e0d39 Formerly compatMakefile.~65~ 1993-02-22 19:19:33 +00:00
Roland McGrath
c88072ca74 Formerly implicit.c.~10~ 1993-02-21 22:03:38 +00:00
Roland McGrath
a609f1f9c2 Formerly rule.c.~10~ 1993-02-21 21:58:43 +00:00
Roland McGrath
2413679845 Formerly rule.h.~4~ 1993-02-21 21:56:09 +00:00
Roland McGrath
b50f2fc0a6 Formerly commands.c.~17~ 1993-02-21 20:05:54 +00:00
Roland McGrath
4034f2bdfb Formerly compatMakefile.~64~ 1993-02-21 19:49:42 +00:00
Roland McGrath
b2361b3591 Formerly misc.c.~24~ 1993-02-21 19:48:46 +00:00
Roland McGrath
ed70d6422c Formerly main.c.~72~ 1993-02-21 19:28:33 +00:00
Roland McGrath
17bc902648 Formerly variable.c.~19~ 1993-02-21 19:28:30 +00:00
Roland McGrath
db6a102206 Formerly read.c.~54~ 1993-02-21 19:28:27 +00:00
Roland McGrath
ded09420ad Formerly remake.c.~47~ 1993-02-08 22:56:09 +00:00
Roland McGrath
078cc29e60 Formerly implicit.c.~9~ 1993-02-08 22:50:02 +00:00
Roland McGrath
bede66b709 Formerly vpath.c.~9~ 1993-02-08 22:50:00 +00:00
Roland McGrath
cc1433e808 Formerly compatMakefile.~63~ 1993-02-08 22:12:47 +00:00
Roland McGrath
4f1320fba2 Formerly compatMakefile.~62~ 1993-02-05 22:48:57 +00:00
Roland McGrath
b8a4e2bb0e Formerly commands.c.~16~ 1993-02-05 22:34:51 +00:00
Roland McGrath
720b21097c Formerly commands.h.~2~ 1993-02-05 22:31:57 +00:00
Roland McGrath
162269418e Formerly remake.c.~46~ 1993-02-05 22:31:31 +00:00
Roland McGrath
580e2a7391 Formerly job.c.~96~ 1993-02-05 22:31:29 +00:00
Roland McGrath
d870f4df8c Formerly configure.in.~16~ 1993-02-05 20:24:00 +00:00
Roland McGrath
309a65a790 Formerly remote-cstms.c.~8~ 1993-02-04 18:31:53 +00:00
Roland McGrath
963f33c909 Formerly make.h.~66~ 1993-02-04 18:23:27 +00:00
Roland McGrath
af73694245 Formerly main.c.~71~ 1993-02-04 18:23:19 +00:00
Roland McGrath
a4f557cb63 Formerly make.texinfo.~83~ 1993-02-04 18:06:47 +00:00
Roland McGrath
d47d6051a3 Formerly compatMakefile.~61~ 1993-02-04 18:01:50 +00:00
Roland McGrath
87bb5a6259 Formerly make.texinfo.~82~ 1993-02-04 01:45:16 +00:00
Roland McGrath
708c7c90a3 Formerly compatMakefile.~60~ 1993-02-04 01:16:36 +00:00
Roland McGrath
573ddaf6da Formerly job.c.~95~ 1993-02-04 00:58:10 +00:00
Roland McGrath
db545dffcc Formerly read.c.~53~ 1993-02-04 00:01:08 +00:00
Roland McGrath
f7ee7d26a5 Formerly GNUmakefile.~93~ 1993-02-03 23:12:43 +00:00
Roland McGrath
15d4ec2322 Formerly expand.c.~7~ 1993-02-03 20:59:22 +00:00
Roland McGrath
88ae51cb2e Formerly compatMakefile.~59~ 1993-02-02 01:49:11 +00:00
Roland McGrath
657338f0c9 Formerly remote-cstms.c.~7~ 1993-02-01 23:58:39 +00:00
Roland McGrath
fe356384aa Formerly GNUmakefile.~92~ 1993-02-01 23:22:42 +00:00
Roland McGrath
69e442ec90 Formerly job.h.~5~ 1993-02-01 21:03:32 +00:00
Roland McGrath
8b738924b0 Formerly job.c.~94~ 1993-02-01 21:02:40 +00:00
Roland McGrath
afa97833cc Formerly read.c.~52~ 1993-02-01 00:24:58 +00:00
Roland McGrath
3c516ccd35 Formerly compatMakefile.~58~ 1993-02-01 00:11:27 +00:00
Roland McGrath
dfaa02a8d5 Formerly job.c.~93~ 1993-01-31 22:54:06 +00:00
mycroft
50d1798203 Formerly make.texinfo.~81~ 1993-01-29 02:57:54 +00:00
Roland McGrath
85da8b0b54 Formerly commands.c.~15~ 1993-01-28 23:01:09 +00:00
Roland McGrath
ddd3143498 Formerly variable.c.~18~ 1993-01-28 23:01:01 +00:00
Roland McGrath
cd493b3d8f Formerly configure.in.~15~ 1993-01-28 21:41:44 +00:00
Roland McGrath
6a44c4b672 Formerly make.texinfo.~78~ 1993-01-28 19:47:54 +00:00
Roland McGrath
2603a60526 Formerly configure.in.~14~ 1993-01-26 02:24:51 +00:00
Roland McGrath
9a1a8d0dc6 Formerly vpath.c.~8~ 1993-01-26 01:51:23 +00:00
Roland McGrath
7444af63fc Formerly compatMakefile.~57~ 1993-01-26 01:16:01 +00:00
Roland McGrath
ae0045f50e Formerly remake.c.~45~ 1993-01-26 00:41:38 +00:00
Roland McGrath
2c132055ef Formerly remake.c.~44~ 1993-01-25 23:30:19 +00:00
Roland McGrath
09e4a320e6 Formerly make.h.~65~ 1993-01-25 23:30:16 +00:00
Roland McGrath
c1e3141433 Formerly file.h.~5~ 1993-01-25 22:45:49 +00:00
Roland McGrath
c316ab7609 Formerly main.c.~70~ 1993-01-25 22:16:33 +00:00
Roland McGrath
cf197b7550 Formerly variable.c.~17~ 1993-01-25 21:42:31 +00:00
Roland McGrath
c653200459 Formerly variable.c.~16~ 1993-01-23 01:54:04 +00:00
Roland McGrath
0b396e2587 Formerly GNUmakefile.~91~ 1993-01-23 00:35:32 +00:00
Roland McGrath
6090eb3125 Formerly job.c.~92~ 1993-01-22 22:31:27 +00:00
Roland McGrath
21c1a55665 Formerly configure.in.~13~ 1993-01-22 22:16:40 +00:00
Roland McGrath
c50958dd46 Formerly remake.c.~43~ 1993-01-22 22:02:48 +00:00
Roland McGrath
d56535498b Formerly misc.c.~23~ 1993-01-22 21:32:00 +00:00
Roland McGrath
81e8efbcdf Formerly dir.c.~10~ 1993-01-22 19:46:10 +00:00
Roland McGrath
c308b3a5f3 Formerly configure.in.~12~ 1993-01-21 23:50:44 +00:00
Roland McGrath
f48fcf5f45 Formerly compatMakefile.~56~ 1993-01-21 23:50:44 +00:00
Roland McGrath
4d36cfe6a3 Formerly build.template.~4~ 1993-01-21 23:50:43 +00:00
Roland McGrath
2370f79846 Formerly job.c.~91~ 1993-01-21 23:27:00 +00:00
Roland McGrath
b758dc3f8b Formerly GNUmakefile.~90~ 1993-01-21 23:24:19 +00:00
Roland McGrath
e8a9cedc6a Formerly remake.c.~42~ 1993-01-21 22:24:55 +00:00
Roland McGrath
44078a3441 Formerly job.c.~90~ 1993-01-19 00:32:39 +00:00
Roland McGrath
ce25808caa Formerly configure.in.~11~ 1993-01-19 00:19:54 +00:00
Roland McGrath
c2b69b5d9d Formerly read.c.~51~ 1993-01-19 00:14:29 +00:00
Roland McGrath
6925f7153a Formerly compatMakefile.~55~ 1993-01-18 19:54:17 +00:00
Roland McGrath
5460cd5a00 Formerly make.texinfo.~77~ 1993-01-15 19:56:31 +00:00
Roland McGrath
2861ad6208 Formerly main.c.~69~ 1993-01-15 18:18:29 +00:00
Roland McGrath
37d9554e31 Formerly remake.c.~41~ 1993-01-15 18:06:22 +00:00
Roland McGrath
633efa004c Formerly make.h.~64~ 1993-01-15 18:05:49 +00:00
melissa
800a9e957d Formerly make.texinfo.~76~ 1993-01-15 02:46:25 +00:00
Robert J. Chassell
8ea8c0372a Formerly make.texinfo.~75~ 1993-01-14 22:55:03 +00:00
Roland McGrath
4dd2ed0ad1 entered into RCS 1993-01-14 22:25:02 +00:00
Roland McGrath
bbf2720b4d Formerly make.texinfo.~74~ 1993-01-14 20:23:10 +00:00
Roland McGrath
5893545370 Formerly read.c.~50~ 1993-01-14 19:26:47 +00:00
Roland McGrath
6ef5854e47 Formerly compatMakefile.~54~ 1993-01-14 18:53:17 +00:00
Roland McGrath
5c44db1b5f Formerly misc.c.~22~ 1993-01-13 21:23:01 +00:00
Roland McGrath
f0c68224d6 Formerly arscan.c.~26~ 1993-01-13 21:18:56 +00:00
Roland McGrath
bb90ac7aef Formerly variable.c.~15~ 1993-01-13 21:09:20 +00:00
Roland McGrath
4694e3fe2e Formerly GNUmakefile.~89~ 1993-01-13 21:05:06 +00:00
Roland McGrath
fae8065d7f Formerly build.template.~3~ 1993-01-13 21:05:03 +00:00
Roland McGrath
099b4d5643 Formerly build.template.~2~ 1993-01-12 23:00:41 +00:00
Roland McGrath
5e83d8b10a Formerly GNUmakefile.~88~ 1993-01-12 22:51:00 +00:00
Roland McGrath
4c84e13064 Formerly configure.in.~10~ 1993-01-12 21:11:23 +00:00
Roland McGrath
ef028aa4c6 Formerly README.template.~4~ 1993-01-12 21:02:13 +00:00
Roland McGrath
2bff7aa420 Formerly main.c.~68~ 1993-01-12 19:42:13 +00:00
Roland McGrath
e07db8077c Formerly make.h.~63~ 1993-01-12 19:36:16 +00:00
Roland McGrath
35ffa6973a Initial revision 1993-01-12 19:30:31 +00:00
Roland McGrath
402b400e52 Formerly compatMakefile.~53~ 1993-01-12 17:31:40 +00:00
Roland McGrath
6b6a4f1de2 Formerly GNUmakefile.~87~ 1993-01-11 23:02:32 +00:00
Roland McGrath
ab6a618dac Formerly make.texinfo.~73~ 1993-01-11 22:51:16 +00:00
Roland McGrath
45572fa600 Formerly vpath.c.~7~ 1993-01-11 22:46:31 +00:00
Richard M. Stallman
36a6a9eb7d Formerly make-stds.texi.~2~ 1993-01-11 22:29:30 +00:00
Roland McGrath
7c91702697 Formerly misc.c.~21~ 1993-01-11 19:45:54 +00:00
Roland McGrath
71fceb51e3 Formerly compatMakefile.~52~ 1993-01-11 19:45:52 +00:00
Richard M. Stallman
9705781777 Initial revision 1993-01-11 17:41:09 +00:00
Roland McGrath
76ae16dee3 Formerly job.c.~89~ 1993-01-08 22:40:24 +00:00
Roland McGrath
035157a2fd Formerly vpath.c.~6~ 1993-01-08 22:07:33 +00:00
Roland McGrath
50a643208f Formerly GNUmakefile.~86~ 1993-01-08 21:49:21 +00:00
Roland McGrath
92cd154b95 Formerly main.c.~67~ 1993-01-08 21:48:11 +00:00
Roland McGrath
d07b95da6f Formerly misc.c.~20~ 1993-01-08 20:32:36 +00:00
Roland McGrath
2f22bfeaaa Formerly make.texinfo.~72~ 1993-01-08 20:01:42 +00:00
Roland McGrath
fcedb448bb Formerly make.texinfo.~71~ 1993-01-07 22:47:51 +00:00
Roland McGrath
5a4ab813f0 Formerly job.c.~88~ 1993-01-07 01:46:47 +00:00
Robert J. Chassell
99369403b7 Formerly make.texinfo.~70~ 1993-01-07 01:40:19 +00:00
Roland McGrath
adde98d27b Formerly main.c.~66~ 1993-01-07 00:34:28 +00:00
Roland McGrath
e2622b0fea Formerly make.h.~62~ 1993-01-06 23:28:54 +00:00
Roland McGrath
99afb91aca Formerly function.c.~23~ 1993-01-06 22:57:35 +00:00
Roland McGrath
1632e7feb3 Formerly implicit.c.~8~ 1993-01-06 22:57:30 +00:00
Roland McGrath
9403ef9942 Formerly commands.c.~14~ 1993-01-06 22:57:24 +00:00
Roland McGrath
c8d4d2305d Formerly read.c.~49~ 1993-01-06 22:57:21 +00:00
Roland McGrath
f341a61976 Formerly job.h.~4~ 1993-01-06 22:57:14 +00:00
Roland McGrath
5778d6cdb9 Formerly compatMakefile.~51~ 1993-01-06 22:39:31 +00:00
Roland McGrath
f2bc0a0c93 Formerly dir.c.~9~ 1993-01-06 20:07:35 +00:00
Roland McGrath
d8817e2c39 Formerly GNUmakefile.~85~ 1993-01-06 00:30:46 +00:00
Roland McGrath
5b45a568c0 Formerly job.c.~87~ 1993-01-05 23:41:29 +00:00
Roland McGrath
d19c2ef049 Formerly misc.c.~19~ 1993-01-05 23:02:42 +00:00
Roland McGrath
c0c67164d5 Formerly configure.in.~9~ 1993-01-05 22:40:32 +00:00
Roland McGrath
93385de9ff Formerly compatMakefile.~50~ 1993-01-05 19:54:03 +00:00
Roland McGrath
9edb745a71 Formerly GNUmakefile.~84~ 1993-01-05 19:53:58 +00:00
Roland McGrath
d315acf15e Formerly main.c.~65~ 1993-01-04 21:59:56 +00:00
Roland McGrath
aa8a3b306d Formerly make.texinfo.~69~ 1993-01-04 20:42:16 +00:00
melissa
89b66be8b3 Formerly make.texinfo.~68~ 1992-12-31 20:56:47 +00:00
Roland McGrath
b313929074 Formerly make.h.~61~ 1992-12-31 17:26:10 +00:00
Robert J. Chassell
8c6ef34e56 Formerly make.texinfo.~67~ 1992-12-30 23:57:35 +00:00
Roland McGrath
f4f6b2b97e Formerly compatMakefile.~49~ 1992-12-29 18:59:17 +00:00
Roland McGrath
c2dbc39224 Formerly GNUmakefile.~83~ 1992-12-29 02:36:27 +00:00
Roland McGrath
2d89aa53df Formerly read.c.~48~ 1992-12-29 00:20:25 +00:00
Roland McGrath
52930ae3a9 Formerly compatMakefile.~48~ 1992-12-28 23:25:58 +00:00
Roland McGrath
ede645439a Formerly read.c.~47~ 1992-12-23 21:14:20 +00:00
Roland McGrath
95614c2e7c Formerly compatMakefile.~47~ 1992-12-23 18:18:27 +00:00
Roland McGrath
37fb62e217 Formerly variable.h.~9~ 1992-12-22 23:44:09 +00:00
Roland McGrath
555a705aaa Formerly expand.c.~6~ 1992-12-22 23:44:03 +00:00
Roland McGrath
123f70c521 Formerly compatMakefile.~46~ 1992-12-22 23:31:46 +00:00
Roland McGrath
02caa22338 Formerly default.c.~21~ 1992-12-22 22:31:16 +00:00
Roland McGrath
38f78c7be1 Formerly file.c.~21~ 1992-12-22 22:31:13 +00:00
Roland McGrath
fd5c585cab Formerly implicit.c.~7~ 1992-12-22 22:31:10 +00:00
Roland McGrath
0aa6e8609e Formerly read.c.~46~ 1992-12-22 22:31:08 +00:00
Roland McGrath
40463f4410 Formerly commands.c.~13~ 1992-12-22 22:31:07 +00:00
Roland McGrath
01e07f8ae2 Formerly variable.c.~14~ 1992-12-22 22:16:14 +00:00
Robert J. Chassell
f75288402e Formerly make.texinfo.~66~ 1992-12-22 21:42:45 +00:00
Roland McGrath
63fec5f467 Formerly remake.c.~40~ 1992-12-22 21:22:05 +00:00
Roland McGrath
b0a8c63bf2 Formerly make.texinfo.~65~ 1992-12-22 20:14:36 +00:00
Roland McGrath
2d038ae579 Formerly GNUmakefile.~82~ 1992-12-21 21:53:24 +00:00
Roland McGrath
50f2c1fbd9 Formerly configure.in.~7~ 1992-12-20 23:08:11 +00:00
Roland McGrath
40507f313a Formerly GNUmakefile.~81~ 1992-12-20 22:59:52 +00:00
Roland McGrath
11404035d1 Formerly compatMakefile.~45~ 1992-12-20 22:58:53 +00:00
Roland McGrath
3cc78a1a0f Formerly make.h.~60~ 1992-12-20 22:57:06 +00:00
Roland McGrath
501241725a Formerly compatMakefile.~44~ 1992-12-17 21:16:40 +00:00
Roland McGrath
501732ca84 Formerly configure.in.~6~ 1992-12-16 21:25:21 +00:00
Roland McGrath
17d92fd05b Formerly make.texinfo.~64~ 1992-12-16 00:08:34 +00:00
Roland McGrath
d0d141ea5b Formerly make.texinfo.~63~ 1992-12-15 19:35:51 +00:00
Roland McGrath
97f458f27e Formerly make.texinfo.~62~ 1992-12-11 01:10:17 +00:00
Roland McGrath
da96d5b5bb Formerly make.texinfo.~61~ 1992-12-10 20:04:37 +00:00
Roland McGrath
68aec7ab65 Formerly make.texinfo.~60~ 1992-12-10 18:48:19 +00:00
Noah Friedman
c1d26a2bde Formerly make.texinfo.~59~ 1992-12-09 23:32:39 +00:00
Roland McGrath
dfdedfe97a Formerly make.texinfo.~58~ 1992-12-09 23:28:14 +00:00
Roland McGrath
8c4eb82fb8 Formerly main.c.~64~ 1992-12-09 22:10:14 +00:00
Roland McGrath
2b42e280e8 Formerly default.c.~20~ 1992-12-09 22:09:42 +00:00
Roland McGrath
289417e089 Formerly read.c.~45~ 1992-12-09 21:02:53 +00:00
Roland McGrath
1faf31158c Formerly remake.c.~39~ 1992-12-09 20:34:36 +00:00
Roland McGrath
0a7da8a929 Formerly make.texinfo.~57~ 1992-12-09 19:35:34 +00:00
Roland McGrath
a3254ad7b3 Formerly variable.c.~13~ 1992-11-23 20:53:24 +00:00
Roland McGrath
b8b8ba69d4 Formerly default.c.~19~ 1992-11-23 20:48:49 +00:00
Roland McGrath
081275c58e Formerly make.h.~59~ 1992-11-23 20:41:02 +00:00
Roland McGrath
968e9fce6c Formerly job.c.~86~ 1992-11-23 20:04:25 +00:00
Roland McGrath
b81f248c35 Formerly main.c.~63~ 1992-11-23 20:04:19 +00:00
Roland McGrath
fa0cf27f72 Formerly read.c.~44~ 1992-11-18 19:54:01 +00:00
Roland McGrath
4cbb8e0d70 Formerly make.texinfo.~56~ 1992-11-17 23:43:09 +00:00
Roland McGrath
4a970dc04e Formerly make.texinfo.~55~ 1992-11-17 01:08:21 +00:00
Roland McGrath
4125f8f08e Formerly main.c.~62~ 1992-11-16 23:59:17 +00:00
Roland McGrath
45649948db Formerly vpath.c.~5~ 1992-11-16 22:49:14 +00:00
Roland McGrath
7d8fafa4b7 Formerly make.texinfo.~54~ 1992-11-13 23:19:57 +00:00
Roland McGrath
9e258d2369 Formerly rule.c.~9~ 1992-11-13 23:14:36 +00:00
Roland McGrath
1ab478ef48 Formerly make.texinfo.~53~ 1992-11-13 22:19:43 +00:00
Roland McGrath
ecc3b33299 Formerly job.c.~85~ 1992-11-12 20:45:29 +00:00
Roland McGrath
424bcccf98 Formerly read.c.~43~ 1992-11-10 21:41:55 +00:00
Roland McGrath
d13ecbbb67 Formerly dir.c.~8~ 1992-11-10 20:43:35 +00:00
Roland McGrath
09fe55be99 Formerly rule.c.~8~ 1992-11-10 20:36:44 +00:00
Roland McGrath
1efb91cda6 Formerly default.c.~18~ 1992-11-10 20:36:42 +00:00
Roland McGrath
3d72bcb583 Formerly function.c.~22~ 1992-11-10 20:36:39 +00:00
Roland McGrath
2fbb3407dd Formerly vpath.c.~4~ 1992-11-10 20:29:48 +00:00
Roland McGrath
9d58debbcc Formerly remake.c.~38~ 1992-11-09 22:52:52 +00:00
Roland McGrath
07a309961b Formerly make.h.~58~ 1992-11-09 22:52:50 +00:00
Roland McGrath
eae9bb14a2 Formerly job.c.~84~ 1992-11-09 22:52:13 +00:00
Roland McGrath
a401a5e46a Formerly read.c.~42~ 1992-11-05 23:33:11 +00:00
Roland McGrath
019a25fa84 Formerly vpath.c.~3~ 1992-11-05 23:33:08 +00:00
Roland McGrath
a8993377f7 Formerly compatMakefile.~43~ 1992-11-04 02:00:19 +00:00
Roland McGrath
8c9b95d07e Formerly file.c.~20~ 1992-11-04 01:44:30 +00:00
Roland McGrath
db8c8b2ad8 Formerly read.c.~41~ 1992-10-29 21:49:15 +00:00
Roland McGrath
55b9f37c35 Formerly make.texinfo.~52~ 1992-10-29 20:32:03 +00:00
Roland McGrath
815ee70d7d Formerly remake.c.~37~ 1992-10-25 06:16:09 +00:00
Roland McGrath
04b7426dfa Formerly commands.c.~12~ 1992-10-25 06:13:10 +00:00
Roland McGrath
0e4062c177 Formerly remake.c.~36~ 1992-10-25 05:49:07 +00:00
Roland McGrath
cff0af8d6d Formerly read.c.~40~ 1992-10-25 03:24:24 +00:00
Roland McGrath
8b591a8b90 Formerly expand.c.~5~ 1992-10-25 03:01:07 +00:00
Roland McGrath
deefc22d2f Formerly GNUmakefile.~80~ 1992-10-25 02:43:22 +00:00
Roland McGrath
a485ade084 Formerly variable.c.~12~ 1992-10-23 19:57:55 +00:00
Roland McGrath
b45d1ae3c2 Formerly default.c.~17~ 1992-10-15 23:11:06 +00:00
Roland McGrath
7db4dd0dbd Formerly dir.c.~7~ 1992-10-15 23:11:04 +00:00
Roland McGrath
348caf1627 Formerly compatMakefile.~42~ 1992-10-15 23:11:02 +00:00
Roland McGrath
6683a1c8db Formerly make.h.~57~ 1992-10-15 23:01:36 +00:00
Roland McGrath
d3543bc097 Formerly misc.c.~18~ 1992-10-15 23:01:34 +00:00
Roland McGrath
6247727678 Formerly job.c.~83~ 1992-10-12 21:58:54 +00:00
Roland McGrath
67516d5331 Formerly make.h.~56~ 1992-10-12 21:58:52 +00:00
Roland McGrath
e7f3e4a031 Formerly compatMakefile.~41~ 1992-10-12 20:32:29 +00:00
Roland McGrath
b0a49baf2f Formerly GNUmakefile.~79~ 1992-10-12 18:16:07 +00:00
Roland McGrath
d9ffca6d79 Formerly dir.c.~6~ 1992-10-12 18:05:41 +00:00
Roland McGrath
dba6ec5d0c Formerly file.c.~19~ 1992-10-12 18:04:07 +00:00
Roland McGrath
953f1c7df0 Formerly compatMakefile.~40~ 1992-10-12 17:46:23 +00:00
Roland McGrath
81acf8675a Formerly read.c.~39~ 1992-10-12 17:35:43 +00:00
Roland McGrath
f31ff1c1c4 Formerly main.c.~61~ 1992-10-11 21:26:57 +00:00
Roland McGrath
8140043344 Formerly dir.c.~5~ 1992-10-11 21:25:04 +00:00
Roland McGrath
29002aca14 Formerly compatMakefile.~39~ 1992-10-11 21:01:06 +00:00
Roland McGrath
a39f01fb1d Formerly configure.in.~4~ 1992-10-11 21:01:04 +00:00
Roland McGrath
b13de88757 Formerly read.c.~38~ 1992-10-09 18:00:37 +00:00
Roland McGrath
b3747a6bdb Formerly commands.c.~11~ 1992-10-09 17:50:59 +00:00
Roland McGrath
112dd3508d Formerly variable.c.~11~ 1992-10-09 17:50:55 +00:00
Roland McGrath
46ccc784fe Formerly dir.c.~4~ 1992-10-09 17:35:07 +00:00
Roland McGrath
9603279fb8 Formerly vpath.c.~2~ 1992-10-09 17:35:03 +00:00
Roland McGrath
e567c8d914 Formerly configure.in.~3~ 1992-10-09 16:12:29 +00:00
Roland McGrath
21d566bf51 Formerly make.h.~55~ 1992-10-02 23:42:13 +00:00
Roland McGrath
313e5ec45d Formerly main.c.~60~ 1992-09-30 23:21:22 +00:00
Roland McGrath
b0cafff1bf Formerly main.c.~59~ 1992-09-30 01:26:59 +00:00
Roland McGrath
f683e78f53 Formerly make.texinfo.~51~ 1992-09-30 00:47:33 +00:00
Roland McGrath
be0d85ba3e Formerly make.texinfo.~50~ 1992-09-25 19:37:40 +00:00
Robert J. Chassell
6a0cfeb0f2 Formerly make.texinfo.~49~ 1992-09-25 18:05:31 +00:00
Roland McGrath
1f534482de Formerly read.c.~37~ 1992-09-16 20:15:19 +00:00
Roland McGrath
144b6ecba5 Formerly main.c.~58~ 1992-09-15 20:10:46 +00:00
Roland McGrath
53f7c27956 Formerly read.c.~36~ 1992-09-15 19:14:03 +00:00
Roland McGrath
44251cbc0c Formerly remake.c.~35~ 1992-09-09 20:46:57 +00:00
Roland McGrath
a1849dfc5f Formerly job.c.~82~ 1992-09-09 20:32:56 +00:00
Roland McGrath
e7930bea3a Formerly commands.c.~10~ 1992-09-09 20:20:37 +00:00
Roland McGrath
d8f06cf21f Formerly default.c.~16~ 1992-09-09 19:50:38 +00:00
Roland McGrath
44653ac71b Formerly compatMakefile.~38~ 1992-09-02 22:03:40 +00:00
Roland McGrath
7f0fe7f44d Formerly make.h.~54~ 1992-09-02 21:53:59 +00:00
Roland McGrath
47839c882d Formerly make.texinfo.~48~ 1992-08-29 00:51:40 +00:00
Robert J. Chassell
e547c81b9a Formerly make.texinfo.~47~ 1992-08-28 18:27:35 +00:00
Roland McGrath
b52b376cf1 Formerly read.c.~35~ 1992-08-28 00:14:48 +00:00
Roland McGrath
e80a2e9424 Formerly compatMakefile.~37~ 1992-08-28 00:14:44 +00:00
Roland McGrath
e30c4023e1 Formerly read.c.~34~ 1992-08-27 23:53:17 +00:00
Roland McGrath
5aa595c99b Formerly remake.c.~34~ 1992-08-27 23:29:25 +00:00
Roland McGrath
a301f9327a Formerly GNUmakefile.~78~ 1992-08-27 23:25:59 +00:00
Roland McGrath
602d1e18af Formerly file.c.~18~ 1992-08-27 22:06:44 +00:00
Roland McGrath
178a758738 Formerly compatMakefile.~36~ 1992-08-27 21:51:23 +00:00
Roland McGrath
381a6bbfb4 Formerly configure.in.~2~ 1992-08-27 19:30:57 +00:00
Roland McGrath
f4a089447d Formerly make.texinfo.~46~ 1992-08-26 22:33:53 +00:00
Roland McGrath
d080dd0182 Formerly main.c.~57~ 1992-08-26 21:47:38 +00:00
Roland McGrath
37bfd879df Formerly remake.c.~33~ 1992-08-26 21:18:03 +00:00
Roland McGrath
4d345bdee3 Formerly GNUmakefile.~77~ 1992-08-26 21:00:12 +00:00
Roland McGrath
e222f10616 Formerly make.texinfo.~45~ 1992-08-20 23:27:46 +00:00
Robert J. Chassell
9869db36e9 Formerly make.texinfo.~44~ 1992-08-20 21:29:58 +00:00
Roland McGrath
2ebdf6de85 Formerly job.c.~81~ 1992-08-20 18:20:20 +00:00
Roland McGrath
db7633eac4 Formerly remake.c.~32~ 1992-08-20 18:10:20 +00:00
Roland McGrath
8fbb772041 Formerly make.texinfo.~43~ 1992-08-19 22:16:47 +00:00
Roland McGrath
3c660b4d55 Formerly function.c.~21~ 1992-08-19 22:16:15 +00:00
Roland McGrath
0fad0bd5c5 Formerly compatMakefile.~35~ 1992-08-19 20:24:03 +00:00
Roland McGrath
1fa7491d02 Initial revision 1992-08-18 21:25:14 +00:00
Roland McGrath
1292aa1e4b Formerly make.texinfo.~42~ 1992-08-18 18:59:26 +00:00
Roland McGrath
0c61dffcb5 Formerly make.texinfo.~41~ 1992-08-14 18:47:05 +00:00
Robert J. Chassell
30016eef42 Formerly make.texinfo.~40~ 1992-08-14 18:39:14 +00:00
Roland McGrath
781ce7f4a8 Formerly arscan.c.~25~ 1992-08-14 16:37:50 +00:00
Roland McGrath
c76d6785de Formerly GNUmakefile.~76~ 1992-08-13 22:09:36 +00:00
Roland McGrath
81731a29d1 Formerly main.c.~56~ 1992-08-13 21:50:48 +00:00
Roland McGrath
ad93a01fa6 Formerly make.texinfo.~39~ 1992-08-11 21:03:44 +00:00
Roland McGrath
423783c913 Formerly implicit.c.~6~ 1992-08-10 22:08:41 +00:00
Roland McGrath
ccff1cc0d2 Formerly function.c.~20~ 1992-08-10 22:03:03 +00:00
Roland McGrath
47707f76cb Formerly compatMakefile.~34~ 1992-08-10 21:05:08 +00:00
Roland McGrath
3241a91312 Formerly file.c.~17~ 1992-08-02 11:28:04 +00:00
Roland McGrath
b732b99c0b Formerly variable.c.~10~ 1992-08-02 11:28:03 +00:00
Roland McGrath
b001b6a55a Formerly file.h.~4~ 1992-08-02 11:28:01 +00:00
Roland McGrath
24c9aabe16 Formerly make.h.~53~ 1992-08-02 11:28:00 +00:00
Roland McGrath
92df7dd504 Formerly variable.h.~8~ 1992-08-02 11:27:59 +00:00
Roland McGrath
fba924717c Formerly GNUmakefile.~75~ 1992-08-02 10:36:52 +00:00
Roland McGrath
e07d203a2f Formerly file.c.~16~ 1992-08-02 10:16:54 +00:00
Roland McGrath
92546f9ff9 Formerly rule.h.~3~ 1992-08-02 10:11:29 +00:00
Roland McGrath
849b2101e6 Formerly rule.c.~7~ 1992-08-02 10:11:25 +00:00
Roland McGrath
09a534168f Formerly file.h.~3~ 1992-08-02 09:51:40 +00:00
Roland McGrath
a98a648754 Formerly make.h.~52~ 1992-08-02 09:10:08 +00:00
Roland McGrath
f4c3f77b96 Formerly variable.h.~7~ 1992-08-02 09:10:05 +00:00
Roland McGrath
b95e47d401 Formerly variable.c.~9~ 1992-08-02 09:10:03 +00:00
Roland McGrath
8aff0091fc Formerly dep.h.~2~ 1992-08-02 05:42:58 +00:00
Roland McGrath
bc8c4949b7 Formerly GNUmakefile.~74~ 1992-07-30 20:32:16 +00:00
Roland McGrath
f44c1d9366 Formerly main.c.~55~ 1992-07-30 20:31:50 +00:00
Roland McGrath
5329b592b7 Formerly default.c.~15~ 1992-07-30 19:53:39 +00:00
Roland McGrath
39e2dbb7b3 Formerly make.h.~51~ 1992-07-30 19:41:18 +00:00
Roland McGrath
47db5afe4f Formerly make.h.~50~ 1992-07-26 22:30:45 +00:00
Roland McGrath
19142fcfd4 Formerly job.c.~80~ 1992-07-26 20:57:13 +00:00
Roland McGrath
2283b32986 Formerly variable.c.~8~ 1992-07-24 06:16:47 +00:00
Roland McGrath
2e5f56539d Formerly main.c.~54~ 1992-07-24 06:02:26 +00:00
Roland McGrath
a63f4e1f9c Formerly make.texinfo.~38~ 1992-07-24 02:23:53 +00:00
Roland McGrath
1d2e7e6142 Formerly make.texinfo.~37~ 1992-07-24 02:03:20 +00:00
Robert J. Chassell
099b302768 Formerly make.texinfo.~36~ 1992-07-24 00:25:51 +00:00
Robert J. Chassell
c29174d96b Formerly make.texinfo.~35~ 1992-07-17 17:05:55 +00:00
Robert J. Chassell
cda455684c Formerly make.texinfo.~34~ 1992-07-16 22:42:17 +00:00
Roland McGrath
0858bbcfb5 Formerly GNUmakefile.~73~ 1992-07-16 19:17:12 +00:00
Roland McGrath
f23e838c15 Formerly README.template.~3~ 1992-07-16 18:35:19 +00:00
Roland McGrath
5814d65428 Formerly GNUmakefile.~72~ 1992-07-16 18:34:43 +00:00
Roland McGrath
f8197823a4 Formerly main.c.~53~ 1992-07-16 18:31:50 +00:00
Roland McGrath
b408ee65f6 Formerly remake.c.~31~ 1992-07-15 02:15:54 +00:00
Roland McGrath
0f045633a7 Formerly main.c.~52~ 1992-07-15 02:15:53 +00:00
Roland McGrath
62e8630bdc Formerly rule.c.~6~ 1992-07-14 23:08:36 +00:00
Roland McGrath
eb7484abc4 Formerly GNUmakefile.~71~ 1992-07-13 22:17:50 +00:00
Roland McGrath
8ef3af8bed Formerly commands.c.~9~ 1992-07-13 21:51:47 +00:00
Roland McGrath
4eb52d9a45 Formerly make.texinfo.~33~ 1992-07-10 05:18:22 +00:00
Roland McGrath
7817332cc1 Formerly variable.h.~6~ 1992-07-10 04:06:24 +00:00
Roland McGrath
e3fbb5828f Formerly variable.c.~7~ 1992-07-10 04:06:22 +00:00
Roland McGrath
45cf6ce658 Formerly compatMakefile.~33~ 1992-07-10 01:40:44 +00:00
Roland McGrath
69222204e6 Formerly compatMakefile.~32~ 1992-07-07 23:55:43 +00:00
Roland McGrath
dc2a270b71 Formerly job.c.~79~ 1992-07-07 23:12:46 +00:00
Roland McGrath
9c7598db10 Formerly make.texinfo.~32~ 1992-07-07 01:04:06 +00:00
Roland McGrath
00fb56c2b9 Formerly GNUmakefile.~70~ 1992-07-05 01:55:13 +00:00
Roland McGrath
e37b0392be Formerly commands.c.~8~ 1992-07-05 00:52:52 +00:00
Roland McGrath
7dba11957a Formerly job.c.~78~ 1992-07-05 00:52:50 +00:00
Roland McGrath
517a17b6d9 Formerly main.c.~51~ 1992-07-05 00:52:48 +00:00
Roland McGrath
9d3d0c6b79 Formerly make.h.~49~ 1992-07-05 00:52:46 +00:00
Roland McGrath
bc1770c035 Formerly remote-cstms.c.~6~ 1992-07-05 00:52:45 +00:00
Roland McGrath
50cd0d5a12 Formerly main.c.~50~ 1992-07-02 22:48:17 +00:00
Roland McGrath
8d6f98b83d Formerly GNUmakefile.~69~ 1992-07-01 22:37:12 +00:00
Roland McGrath
8809c8ec38 Formerly job.c.~77~ 1992-07-01 00:52:45 +00:00
Roland McGrath
6feabe12a7 Formerly file.c.~15~ 1992-07-01 00:52:43 +00:00
Roland McGrath
41d94fb0e3 Formerly function.c.~19~ 1992-07-01 00:52:41 +00:00
Roland McGrath
d425bd20a2 Formerly make.h.~48~ 1992-07-01 00:52:39 +00:00
Roland McGrath
e7e9d84a54 Formerly arscan.c.~24~ 1992-07-01 00:52:37 +00:00
Roland McGrath
c84a275871 Formerly make.texinfo.~31~ 1992-06-26 00:58:23 +00:00
Roland McGrath
8d1f6733a9 Formerly GNUmakefile.~68~ 1992-06-26 00:54:04 +00:00
Roland McGrath
c355295fe0 Formerly README.template.~2~ 1992-06-26 00:52:43 +00:00
Roland McGrath
9ef264a343 Formerly remake.c.~30~ 1992-06-26 00:46:53 +00:00
Roland McGrath
fec3694512 Formerly job.c.~76~ 1992-06-26 00:33:00 +00:00
Roland McGrath
eaa2a12a44 Formerly main.c.~49~ 1992-06-25 21:45:52 +00:00
Roland McGrath
1b3fc99e0f Formerly compatMakefile.~31~ 1992-06-25 21:10:49 +00:00
Roland McGrath
e293b96610 Formerly dir.c.~3~ 1992-06-25 01:05:20 +00:00
Roland McGrath
f2c51355ed Formerly make.h.~47~ 1992-06-25 00:28:36 +00:00
Roland McGrath
7ab1580762 Formerly job.c.~75~ 1992-06-25 00:13:20 +00:00
Roland McGrath
a819615113 Formerly make.texinfo.~30~ 1992-06-24 23:40:28 +00:00
Roland McGrath
f519275024 Formerly file.c.~14~ 1992-06-23 22:42:43 +00:00
Roland McGrath
7a9130401f Formerly compatMakefile.~30~ 1992-06-22 20:34:09 +00:00
Roland McGrath
bfb4dddc2e Formerly GNUmakefile.~67~ 1992-06-22 20:34:05 +00:00
Roland McGrath
6f322b59da Formerly arscan.c.~23~ 1992-06-19 20:21:54 +00:00
Roland McGrath
320a119913 Formerly make.texinfo.~29~ 1992-06-18 23:25:43 +00:00
Robert J. Chassell
fcd3964082 Formerly make.texinfo.~28~ 1992-06-18 23:17:48 +00:00
Roland McGrath
eeb9b7065d Formerly default.c.~14~ 1992-06-17 21:59:54 +00:00
Roland McGrath
2aed822bd7 Formerly compatMakefile.~29~ 1992-06-17 02:07:35 +00:00
Roland McGrath
add4780bf7 Formerly commands.c.~7~ 1992-06-16 23:43:37 +00:00
Roland McGrath
df884f9d9a Formerly file.c.~13~ 1992-06-16 23:43:35 +00:00
Roland McGrath
498f1b50f7 Formerly make.h.~46~ 1992-06-16 23:43:31 +00:00
Roland McGrath
29380252a8 Formerly expand.c.~4~ 1992-06-16 23:43:29 +00:00
Roland McGrath
ade465512f Formerly arscan.c.~22~ 1992-06-16 23:43:25 +00:00
Roland McGrath
37fbe2a271 Formerly compatMakefile.~28~ 1992-06-16 01:30:57 +00:00
Roland McGrath
15614defd8 Formerly GNUmakefile.~66~ 1992-06-16 01:25:32 +00:00
Roland McGrath
b5ee5f8539 Formerly variable.c.~6~ 1992-06-15 22:41:38 +00:00
Roland McGrath
febf5d0944 Formerly make.h.~45~ 1992-06-15 22:41:21 +00:00
Roland McGrath
9e37e514d2 Formerly arscan.c.~21~ 1992-06-15 22:38:32 +00:00
Roland McGrath
5c2f4a7d88 Formerly job.c.~74~ 1992-06-15 22:10:36 +00:00
Roland McGrath
db8eb71a9c Formerly compatMakefile.~27~ 1992-06-15 21:53:41 +00:00
Roland McGrath
5780852aee Formerly job.c.~73~ 1992-06-15 21:47:25 +00:00
Roland McGrath
6619d7d8ac Formerly remake.c.~29~ 1992-06-15 21:47:19 +00:00
Roland McGrath
82f7d51bde Formerly file.c.~12~ 1992-06-15 16:39:11 +00:00
Roland McGrath
8407664cf6 Formerly job.c.~72~ 1992-06-12 23:41:40 +00:00
Roland McGrath
b5b32c8f9a Formerly file.h.~2~ 1992-06-12 23:17:24 +00:00
Roland McGrath
3dbe309fce Formerly make.texinfo.~27~ 1992-06-12 23:12:20 +00:00
Robert J. Chassell
87c5a97b91 Formerly make.texinfo.~26~ 1992-06-12 22:52:31 +00:00
Robert J. Chassell
83bb8c72a7 Formerly make.texinfo.~25~ 1992-06-12 20:59:52 +00:00
Robert J. Chassell
2172dfa41f Formerly make.texinfo.~24~ 1992-06-12 03:51:46 +00:00
Roland McGrath
ef46822708 Formerly variable.h.~5~ 1992-06-12 00:29:24 +00:00
Roland McGrath
78e7551083 Formerly expand.c.~3~ 1992-06-12 00:29:21 +00:00
Roland McGrath
d298fecfda Formerly GNUmakefile.~65~ 1992-06-12 00:29:17 +00:00
Roland McGrath
d3ea420650 Formerly job.c.~71~ 1992-06-12 00:21:48 +00:00
Roland McGrath
067777e77d Formerly arscan.c.~20~ 1992-06-11 22:30:17 +00:00
Roland McGrath
5ccd482b90 Formerly compatMakefile.~26~ 1992-06-11 20:08:55 +00:00
Roland McGrath
3893d9217c Formerly main.c.~48~ 1992-06-11 20:05:40 +00:00
Roland McGrath
efc335d4a1 Formerly GNUmakefile.~64~ 1992-06-11 05:33:52 +00:00
Roland McGrath
b9f64130af Formerly make.h.~44~ 1992-06-11 05:30:34 +00:00
Roland McGrath
0a4502e116 Formerly compatMakefile.~25~ 1992-06-11 05:30:32 +00:00
Roland McGrath
b6364d9ae4 Formerly job.c.~70~ 1992-06-11 05:25:28 +00:00
Roland McGrath
59caea5674 Formerly read.c.~33~ 1992-06-11 05:16:34 +00:00
Roland McGrath
2f5b18ba2f Formerly commands.c.~6~ 1992-06-11 05:12:44 +00:00
Roland McGrath
5631243fdd Formerly remake.c.~28~ 1992-06-11 05:05:49 +00:00
Roland McGrath
a61fc8acd1 Formerly dir.c.~2~ 1992-06-11 04:58:32 +00:00
Roland McGrath
b87ff76b7e Formerly remote-cstms.c.~5~ 1992-06-11 04:58:23 +00:00
Roland McGrath
1c9e851fe0 Formerly main.c.~47~ 1992-06-11 04:58:20 +00:00
Roland McGrath
5382f6d197 Formerly misc.c.~17~ 1992-06-11 04:58:15 +00:00
Roland McGrath
8ca2f785e2 Formerly arscan.c.~19~ 1992-06-11 04:58:10 +00:00
Roland McGrath
459c8137c0 Formerly ar.c.~2~ 1992-06-11 04:58:08 +00:00
Roland McGrath
9165d8e5d1 Formerly variable.h.~4~ 1992-06-11 02:28:31 +00:00
Roland McGrath
fcc5c80298 Formerly variable.c.~5~ 1992-06-11 02:27:16 +00:00
Roland McGrath
e309bb2f76 Formerly expand.c.~2~ 1992-06-11 02:27:09 +00:00
Roland McGrath
92dc493189 Formerly read.c.~32~ 1992-06-11 02:07:33 +00:00
Roland McGrath
39f1bf9ce8 Formerly job.c.~69~ 1992-06-05 01:04:26 +00:00
Roland McGrath
fe8bcf44ef Formerly main.c.~46~ 1992-06-05 01:04:07 +00:00
Roland McGrath
56ccbcff9a Formerly file.c.~11~ 1992-06-04 03:52:53 +00:00
Roland McGrath
72b7cf376b Formerly GNUmakefile.~63~ 1992-06-03 03:24:11 +00:00
Roland McGrath
374e8d510a Formerly commands.c.~5~ 1992-06-03 01:45:11 +00:00
Roland McGrath
343ac48a2d Formerly commands.c.~4~ 1992-06-03 01:17:16 +00:00
Roland McGrath
85bab9477b Formerly default.c.~13~ 1992-06-03 01:13:51 +00:00
Roland McGrath
835c266436 Formerly make.h.~43~ 1992-06-03 01:13:30 +00:00
Roland McGrath
6b0a5fd941 Formerly arscan.c.~18~ 1992-06-03 01:07:39 +00:00
Roland McGrath
1e9a5d4b8e Formerly GNUmakefile.~62~ 1992-05-28 05:03:09 +00:00
Roland McGrath
b238874895 Formerly GNUmakefile.~61~ 1992-05-26 10:26:59 +00:00
Roland McGrath
fc1ec6ab56 Formerly rule.c.~5~ 1992-05-26 05:26:26 +00:00
Roland McGrath
b4f6efcf69 Formerly main.c.~45~ 1992-05-25 23:02:13 +00:00
Roland McGrath
b3cc9ddd66 Formerly make.texinfo.~23~ 1992-05-21 20:34:22 +00:00
Roland McGrath
3a34103bb6 Formerly compatMakefile.~24~ 1992-05-20 00:51:39 +00:00
Roland McGrath
6268af4ceb Formerly main.c.~44~ 1992-05-20 00:49:58 +00:00
Roland McGrath
ecfe56b932 Formerly job.c.~68~ 1992-05-14 20:42:25 +00:00
Roland McGrath
16d81de018 Formerly GNUmakefile.~60~ 1992-05-14 20:05:17 +00:00
Roland McGrath
a5a036c101 Formerly job.c.~67~ 1992-05-13 22:28:01 +00:00
Roland McGrath
792819609a Formerly job.c.~66~ 1992-05-12 21:32:24 +00:00
Roland McGrath
3b69c7a484 Formerly main.c.~43~ 1992-05-12 17:29:57 +00:00
Roland McGrath
8ed1c7446e Formerly make.texinfo.~22~ 1992-05-12 04:43:56 +00:00
Roland McGrath
8486a30c74 Formerly variable.c.~4~ 1992-05-12 04:42:11 +00:00
Roland McGrath
8696be1950 Formerly GNUmakefile.~59~ 1992-05-11 19:21:28 +00:00
Roland McGrath
b43df925f8 Formerly compatMakefile.~23~ 1992-05-11 19:20:28 +00:00
Roland McGrath
cfe0c54e8c Formerly main.c.~42~ 1992-05-11 18:11:40 +00:00
Roland McGrath
81db471695 Formerly make.texinfo.~21~ 1992-05-11 05:31:18 +00:00
Roland McGrath
eb5d80d39a Formerly main.c.~41~ 1992-05-11 05:28:52 +00:00
Roland McGrath
ea3d4b3712 Formerly main.c.~40~ 1992-05-09 04:28:28 +00:00
Roland McGrath
cf561391a1 Formerly GNUmakefile.~58~ 1992-05-09 04:06:58 +00:00
Roland McGrath
276016fba7 Formerly compatMakefile.~22~ 1992-05-09 04:02:30 +00:00
Roland McGrath
d9dedc8f27 Formerly job.c.~65~ 1992-05-09 02:26:35 +00:00
Roland McGrath
569cdeac4e Formerly read.c.~31~ 1992-05-07 02:02:33 +00:00
Roland McGrath
48cabc8f9f Formerly job.c.~64~ 1992-05-05 22:04:08 +00:00
Roland McGrath
69e9db54be Formerly GNUmakefile.~57~ 1992-05-04 22:54:21 +00:00
Roland McGrath
1be71be2a2 Formerly make.texinfo.~20~ 1992-05-04 22:47:45 +00:00
Roland McGrath
2ebaa9f881 Formerly variable.c.~3~ 1992-05-04 22:37:22 +00:00
Roland McGrath
207db3747f Formerly read.c.~30~ 1992-05-04 22:37:19 +00:00
Roland McGrath
a3bd6fa73f Formerly variable.h.~3~ 1992-05-04 22:33:57 +00:00
Roland McGrath
883239f29a Formerly GNUmakefile.~56~ 1992-05-03 22:24:16 +00:00
Roland McGrath
e74b5d4fbf Formerly make.texinfo.~19~ 1992-05-03 22:21:18 +00:00
Roland McGrath
7a7b9644aa Formerly variable.h.~2~ 1992-05-03 22:09:16 +00:00
Roland McGrath
a2032ba51f Formerly read.c.~29~ 1992-05-03 22:03:26 +00:00
Roland McGrath
b8d48ad379 Formerly variable.c.~2~ 1992-05-03 22:02:26 +00:00
Roland McGrath
fec655d5e9 Formerly main.c.~39~ 1992-05-01 15:39:36 +00:00
Roland McGrath
9edeb3ad8e Formerly main.c.~38~ 1992-04-30 22:17:12 +00:00
Roland McGrath
56f17eb659 Formerly job.c.~63~ 1992-04-30 21:50:23 +00:00
Roland McGrath
d052fb99ee Formerly misc.c.~16~ 1992-04-29 21:23:10 +00:00
Roland McGrath
be3ab15f71 Formerly remake.c.~27~ 1992-04-29 21:22:58 +00:00
Roland McGrath
6a325039e2 Formerly main.c.~37~ 1992-04-29 21:15:52 +00:00
Roland McGrath
08ab2b7f94 Formerly job.c.~62~ 1992-04-29 21:11:44 +00:00
Roland McGrath
d724ba1739 Formerly job.c.~61~ 1992-04-29 01:10:14 +00:00
Roland McGrath
687844b2fe Formerly rule.c.~4~ 1992-04-29 00:44:29 +00:00
Roland McGrath
8b8764b427 Formerly rule.c.~3~ 1992-04-26 19:19:06 +00:00
Roland McGrath
f959c6b5b5 Formerly job.c.~60~ 1992-04-22 01:52:14 +00:00
Roland McGrath
7d375209b9 Formerly GNUmakefile.~55~ 1992-04-21 08:01:27 +00:00
Roland McGrath
75448c19f4 Formerly job.c.~59~ 1992-04-21 07:59:32 +00:00
Roland McGrath
a80e32c0fe Formerly main.c.~36~ 1992-04-21 07:56:07 +00:00
Roland McGrath
02b78d7ed0 Formerly commands.c.~3~ 1992-04-21 07:50:13 +00:00
Roland McGrath
3fcefefce5 Formerly function.c.~17~ 1992-04-21 07:50:09 +00:00
Roland McGrath
00da07ebd1 Formerly job.h.~3~ 1992-04-21 07:50:08 +00:00
Roland McGrath
79a2237ed2 Formerly remake.c.~26~ 1992-04-21 07:44:18 +00:00
Roland McGrath
fb37865802 Formerly job.h.~2~ 1992-04-21 07:16:26 +00:00
Roland McGrath
4ee750d034 Formerly job.c.~58~ 1992-04-15 06:02:36 +00:00
Roland McGrath
a31b168049 Formerly GNUmakefile.~54~ 1992-04-14 23:35:25 +00:00
Roland McGrath
22fda945cc Formerly implicit.c.~5~ 1992-04-14 22:39:01 +00:00
Roland McGrath
c5f7787f37 Formerly make.h.~42~ 1992-04-14 22:37:04 +00:00
Roland McGrath
7c92d87313 Formerly read.c.~28~ 1992-04-14 22:31:19 +00:00
Roland McGrath
491a9d9cb4 Formerly GNUmakefile.~53~ 1992-04-14 02:30:18 +00:00
Roland McGrath
71956239ac Formerly remake.c.~25~ 1992-04-14 02:12:51 +00:00
Roland McGrath
123c2494c3 Formerly remake.c.~24~ 1992-04-01 10:06:27 +00:00
Roland McGrath
d8742e9b3e Formerly file.c.~10~ 1992-04-01 09:58:26 +00:00
Roland McGrath
a7ec3f0576 Formerly read.c.~27~ 1992-04-01 09:42:11 +00:00
Roland McGrath
008dab1b25 Formerly commands.c.~2~ 1992-03-31 00:24:58 +00:00
Roland McGrath
d922934cf8 Formerly rule.c.~2~ 1992-03-24 09:50:46 +00:00
Roland McGrath
39d4bb0c7a Formerly remake.c.~23~ 1992-03-11 19:59:26 +00:00
Roland McGrath
feb8a001e1 Formerly make.texinfo.~18~ 1992-03-11 19:56:18 +00:00
melissa
9573cef0a8 Formerly make.texinfo.~17~ 1992-03-11 03:20:05 +00:00
melissa
bc8dd5d3f0 Formerly make.texinfo.~15~ 1992-03-10 23:51:10 +00:00
Roland McGrath
a4bfdb8264 Formerly remote-stub.c.~2~ 1992-03-10 22:15:46 +00:00
Roland McGrath
ee200385e4 Formerly remote-cstms.c.~4~ 1992-03-10 22:15:39 +00:00
Roland McGrath
c7ba588030 Formerly compatMakefile.~21~ 1992-03-10 22:15:32 +00:00
Roland McGrath
8da2a78834 Formerly job.c.~57~ 1992-03-10 22:15:30 +00:00
Roland McGrath
1fc97863a0 Formerly file.c.~9~ 1992-03-09 23:17:21 +00:00
Roland McGrath
46677a6769 Initial revision 1992-03-09 23:06:05 +00:00
Roland McGrath
4f811a3de9 Formerly compatMakefile.~20~ 1992-03-09 23:00:07 +00:00
Roland McGrath
13f4412f2c Formerly function.c.~16~ 1992-03-01 20:48:57 +00:00
Roland McGrath
edbca2344d Formerly make.texinfo.~14~ 1992-02-26 04:34:35 +00:00
Roland McGrath
794fb5ac89 Formerly GNUmakefile.~52~ 1992-02-16 07:20:51 +00:00
Roland McGrath
f5c49a3f5c Initial revision 1992-02-15 22:12:14 +00:00
Roland McGrath
5adf3025db Formerly read.c.~26~ 1992-02-14 11:30:14 +00:00
Roland McGrath
24e5b78f36 Initial revision 1992-02-14 10:52:22 +00:00
Roland McGrath
ba251262db Formerly main.c.~35~ 1992-02-14 05:15:30 +00:00
Roland McGrath
0642eea2ab Formerly make.texinfo.~13~ 1992-02-12 17:07:34 +00:00
Roland McGrath
6858598bee Formerly GNUmakefile.~51~ 1992-02-06 22:12:06 +00:00
Roland McGrath
87178cb5a4 Formerly job.c.~56~ 1992-02-05 01:04:23 +00:00
Roland McGrath
3e08b8c56a Formerly make.h.~41~ 1992-01-29 23:54:37 +00:00
Roland McGrath
ba26d609a1 Initial revision 1992-01-29 23:54:36 +00:00
Robert J. Chassell
7eda2f8293 Formerly make.texinfo.~12~ 1992-01-23 22:25:20 +00:00
Roland McGrath
cb14b4eb1e Initial revision 1992-01-20 19:14:46 +00:00
Roland McGrath
d2e5ab8c57 Initial revision 1992-01-20 18:49:36 +00:00
Roland McGrath
3798621e0b Initial revision 1992-01-18 02:09:28 +00:00
Roland McGrath
94527665c2 Initial revision 1992-01-17 08:30:31 +00:00
Roland McGrath
77497793e0 Formerly misc.c.~15~ 1992-01-17 08:30:27 +00:00
Roland McGrath
6a2935d67b Formerly default.c.~12~ 1992-01-14 02:12:09 +00:00
Roland McGrath
ee02d42916 Formerly make.texinfo.~11~ 1992-01-14 00:15:26 +00:00
Roland McGrath
b859320606 Initial revision 1992-01-11 11:37:36 +00:00
Roland McGrath
1eadb68598 Initial revision 1992-01-11 11:09:59 +00:00
Roland McGrath
8ac061de69 Formerly make.texinfo.~10~ 1992-01-11 07:20:24 +00:00
Roland McGrath
45fa41ff5c Formerly make.texinfo.~9~ 1991-12-30 18:11:55 +00:00
Roland McGrath
bdb62b6fe9 Formerly make.texinfo.~8~ 1991-11-15 02:22:08 +00:00
Roland McGrath
12220aa8fd Formerly arscan.c.~17~ 1991-10-23 01:30:25 +00:00
Roland McGrath
da136cba6f Initial revision 1991-10-18 19:26:24 +00:00
Roland McGrath
a4a1d4a78d Initial revision 1991-10-08 20:20:29 +00:00
Roland McGrath
6af05c6197 Initial revision 1991-10-08 20:04:17 +00:00
Roland McGrath
42289c5f18 Formerly implicit.c.~4~ 1991-10-08 20:04:11 +00:00
Roland McGrath
fb0ffcddc8 Formerly arscan.c.~16~ 1991-10-07 22:05:49 +00:00
Roland McGrath
97d38d0817 Initial revision 1991-10-07 22:04:20 +00:00
Roland McGrath
bd3a693fd4 Initial revision 1991-09-24 04:03:40 +00:00
Roland McGrath
4575aeb1e7 Formerly make.man.~3~ 1991-09-24 03:33:24 +00:00
Roland McGrath
c6fec241bc Formerly make.texinfo.~7~ 1991-09-18 19:07:51 +00:00
Roland McGrath
b9c983dee3 Initial revision 1991-09-15 21:20:45 +00:00
Roland McGrath
1a51e308e5 Initial revision 1991-09-13 23:39:37 +00:00
Roland McGrath
462a5eabb4 Formerly rule.h.~2~ 1991-06-03 20:37:28 +00:00
Roland McGrath
59fdb0d242 Initial revision 1991-06-03 20:37:27 +00:00
Roland McGrath
19ca125ae7 Initial revision 1991-03-23 14:10:48 +00:00
Roland McGrath
47a8cea564 Formerly make.man.~2~ 1990-09-17 20:01:40 +00:00
Roland McGrath
a7e692dc7a Initial revision 1990-01-25 05:31:33 +00:00
Roland McGrath
cd20a6a67f Initial revision 1989-08-13 07:28:15 +00:00
Roland McGrath
38892f2959 Initial revision 1989-06-11 21:44:40 +00:00
Roland McGrath
83fcf12d25 Initial revision 1989-05-10 22:57:31 +00:00
Roland McGrath
db3c60d235 Minor editorial changes. 1988-07-10 17:52:55 +00:00
Roland McGrath
2153102725 Changed `Features' chapter, giving credit to some
people who may have invented some things.
1988-07-10 00:51:51 +00:00
Roland McGrath
bf81164407 Gave credit for VPATH to System V (where it was invented, but
is undocumented) as well as 4.3 BSD (where it was taken from
System V and documented).
Added the replacement of filenames found via VPATH search inside
commands to `Missing' list.  Maybe implement this soon?
1988-07-04 13:41:43 +00:00
Roland McGrath
3206072ac3 * Misc cleanup from RMS.
* Documented `word' and `words' functions.
* Bumped revision number to match make.c
1988-07-03 20:59:14 +00:00
Roland McGrath
c9be6b239c Added some more stuff about recursive references. 1988-07-03 13:07:42 +00:00
Roland McGrath
78079dd062 Misc cleanup. Fixed `Features' list slightly. 1988-07-02 17:49:14 +00:00
Roland McGrath
da1fb0f2e9 Added copying conditions. 1988-07-02 12:14:48 +00:00
Roland McGrath
b85736329a * Fixed a minor grammaticaly error.
* Second release.
1988-06-28 21:58:42 +00:00
Roland McGrath
b8342bbfa8 Added recursive variable references. 1988-06-19 16:15:50 +00:00
Roland McGrath
0bc8f78d4b Fixed yet another Texinfo error. (Sigh) 1988-06-18 01:16:59 +00:00
Roland McGrath
03e57530fa Fixed some more Texinfo errors. 1988-06-18 00:26:10 +00:00
Roland McGrath
6e427e1209 * Documented that -k will continue if it doesn't know how to make a file.
* Fixed a Texinfo error.
* Bumped revision number to match the source.
1988-06-18 00:19:49 +00:00
Roland McGrath
0bc6cc3735 * Removed Bourne shell $(a-b), etc. variable references.
* Fixed foreach documentation slightly.
* Added chapter listing features tersely.
1988-06-18 00:13:50 +00:00
Roland McGrath
6b7b5698e9 Misc cleanup by RMS.
Removed RCS log.
1988-06-14 21:38:42 +00:00
Roland McGrath
edacffc68d Added more stuff about `foreach'. 1988-06-10 11:43:00 +00:00
Roland McGrath
8d8b42b086 * Fixed a typo in the `Missing' section.
* Added an example of how to replace the System V $$@ feature
  using static pattern rules.
1988-06-03 00:07:30 +00:00
Roland McGrath
4f7ffc8c0f Added foreach' and sort' functions. 1988-05-30 21:39:16 +00:00
Roland McGrath
15c5b63713 * Removed built-in .? -> .s suffix rules.
* Misc cleanup, etc.
1988-05-26 17:55:55 +00:00
Roland McGrath
af31731365 Major Beta release before release 2.0. 1988-05-22 14:49:44 +00:00
Roland McGrath
e693e99067 Misc cleanup 1988-05-22 13:39:08 +00:00
Roland McGrath
a20cb3e189 Static pattern rules section rewritten by RMS. 1988-05-22 12:29:23 +00:00
Roland McGrath
b718e918d1 Documented extended static rules. 1988-05-20 17:00:49 +00:00
Roland McGrath
7962f88558 Fixed a couple Texinfo bugs. 1988-05-18 16:26:55 +00:00
Roland McGrath
4fdc206106 Miscellaneous changes by Richard Stallman, added `$$@' to the
list of unsupported features.
1988-05-15 18:58:00 +00:00
Roland McGrath
79e979db5b * Made `$<' automatic variable be the first dependency of any rule.
* Bumped revision number to correspond to `make.c'.
1988-05-11 21:30:52 +00:00
Roland McGrath
ed80ce66fc * Miscellaneous changes suggested by RMS.
* The `define' directive makes recursive variables.
* Removed the `expand' function.
1988-05-04 17:56:07 +00:00
Roland McGrath
9cbc66ea7e Added Bugs section, replacing the paragraph in
the Overview chapter (Top node).
1988-05-01 14:49:57 +00:00
Roland McGrath
b3bc7bdca8 * Removed `roland@rtsg.lbl.gov' address.
* Doubled up @'s in addresses to fix Makeinfo errors.
1988-04-30 15:24:24 +00:00
Roland McGrath
5457895aa6 Removed $($@) automatic macro. 1988-04-24 00:57:23 +00:00
Roland McGrath
a2c4f1410a * Added paragraph about reporting bugs.
* Documented -v (print version info) flag.
* Corrected a couple typos (probably made a couple more :-).
* Given to RMS for beta-testing.
1988-04-23 22:01:48 +00:00
Roland McGrath
73604ef05c * Changed RCS stuff slightly (added a keyword).
* Changed date from February to April, 1988.
* Given to RMS for beta-testing.
1988-04-23 18:28:02 +00:00
Roland McGrath
3b22f37119 * Bumped revision number to be the same as the source.
* Note that the `patsubst' expansion function and expansions
  of the form `$(a:-b)', etc. (from Sun sh) were in revision
  1.2 but were accidently omitted from the log entry.
1988-04-23 17:40:09 +00:00
Roland McGrath
9f8301ae1a * Added RCS log.
* Changed the copyrights from Richard Stallman to Free Software Foundation.
* Added Roland McGrath to the authors on the title page.
* Missing `include'd makefiles are warnings, not fatal errors.
* Clarified that conditionals determine what is `seen' in the makefile,
  so they can't be used to determine commands based on macros that are
  defined when the commands are executed (such as `$@').
* Added `-w' switch to log directories to stdout.
* Added selective VPATH lists and the `vpath' directive.
* Added the previously undocumented `-lLIB' dependent syntax.
* Added the `filter', `filter-out', `strip' and `join' expansion functions.
* Added simply expanded vs. recursively expanded variables, `:=' variable
  assignments and changed most examples to use `:=' rather than `='.
* Corrected miscellaneous typos, grammatical errors, etc.

This version of the documentation is accurate for revision 1.2 of the source.
1988-04-23 16:16:04 +00:00
298 changed files with 112228 additions and 3705 deletions

28
.ccls Normal file
View File

@ -0,0 +1,28 @@
clang
%h --include=makeint.h
-DHAVE_CONFIG_H
-Isrc
-Ilib
-DLIBDIR="/usr/local/lib"
-DLOCALEDIR="/usr/local/share/locale"
-DMAKE_MAINTAINER_MODE
-pthread
-isystem
/usr/include/guile/2.0
-Wall
-Wextra
-Werror
-Wwrite-strings
-Wshadow
-Wdeclaration-after-statement
-Wbad-function-cast
-Wformat-security
-Wtype-limits
-Wunused-but-set-parameter
-Wlogical-op
-Wpointer-arith
-Wignored-qualifiers
-Wformat-signedness
-Wduplicated-cond
-Wno-address
-Wno-string-compare

14
.clangd Normal file
View File

@ -0,0 +1,14 @@
CompileFlags:
Add: [-xc, -DHAVE_CONFIG_H, -DMAKE_MAINTAINER_MODE, -DLIBDIR="/usr/local/lib", -DLOCALEDIR="/usr/local/share/locale", -I../src, -Isrc, -I../lib, -Ilib, -Wall, -Wextra, -Wwrite-strings, -Wshadow, -Wdeclaration-after-statement, -Wbad-function-cast, -Wformat-security, -Wtype-limits, -Wunused-but-set-parameter, -Wlogical-op, -Wpointer-arith, -Wignored-qualifiers, -Wformat-signedness, -Wduplicated-cond, -Wno-string-compare, -Wno-unused-includes]
---
If:
PathMatch: .*\.h
CompileFlags:
Add: [-xc-header, --include=makeint.h]
---
If:
PathMatch: .*/makeint\.h
Diagnostics:
UnusedIncludes: None

21
.dir-locals.el Normal file
View File

@ -0,0 +1,21 @@
(
(nil . ((bug-reference-bug-regexp . "\\(\\bSV[- ]\\([0-9]+\\)\\)")
(bug-reference-url-format . "https://savannah.gnu.org/bugs/?%s")
(ccls-initialization-options
. (:index (:threads 6
:initialBlacklist ["/make-[0-9]" "tests/work/" "/\\.deps"
"/\\..*cache" "/\\.git"])))
(lsp-file-watch-ignored-directories
. ("[/\\\\]\\.git$"
"[/\\\\]\\..*cache$"
;; autotools content
"[/\\\\]\\.deps$"
"[/\\\\]autom4te\\.cache$"
"[/\\\\]build-aux$"
;; make-specific content
"[/\\\\]doc[/\\\\]manual$"
"[/\\\\]tests[/\\\\]work$"
"[/\\\\]make-[0-9]"))
))
(c-mode . ((c-file-style . "gnu")))
)

78
.gitignore vendored Normal file
View File

@ -0,0 +1,78 @@
# Development artifacts
ID
TAGS
GPATH
GRTAGS
GTAGS
.*cache
.*gdbinit
.gdb_history
.vscode
*~
#*
.#*
*.diff
*.patch
*.orig
*.rej
# Configure artifacts
/lib/
/m4/
ABOUT-NLS
INSTALL
Makefile
Makefile.in
Basic.mk
aclocal.m4
autom4te.cache/
build-aux/
config.cache
config.h
config.h.in
config.log
config.status
configure
/mk/Posix.mk
stamp-*
.dirstamp
gnulib
*.sed
# Build artifacts
.deps/
gmk-default.h
loadavg
make
*.i
*.o
*.a
*.exe
*.dll.a
*.obj
*.lib
*.pdb
*.sbr
# Windows build artifacts
WinDebug/
WinRel/
GccDebug/
GccRel/
TccDebug/
TccRel/
# Test artifacts
makeerror-*
test-suite.log
# Distribution artifacts
.dep_segment
.check-git-HEAD
ChangeLog
README
build.cfg
mkconfig.h
make-[0-9]*/
make-[0-9]*.tar.*
checkcfg.*.log

128
AUTHORS Normal file
View File

@ -0,0 +1,128 @@
-----------------------------------
GNU Make development starting with GNU Make 3.76 by:
Paul D. Smith <psmith@gnu.org>
Additional development starting with GNU Make 4.3 by:
Dmitry Goncharov <dgoncharov@users.sf.net>
Additional development starting with GNU Make 3.81 by:
Boris Kolpackov <boris@kolpackov.net>
GNU Make development up to version 3.75 by:
Roland McGrath <roland@gnu.org>
GNU Make User's Manual
Written by:
Richard M. Stallman <rms@gnu.org>
Edited by:
Roland McGrath <roland@gnu.org>
Bob Chassell <bob@gnu.org>
Melissa Weisshaus <melissa@gnu.org>
Paul D. Smith <psmith@gnu.org>
-----------------------------------
GNU Make porting efforts:
Port to VMS by:
Klaus Kaempf <kkaempf@progis.de>
Hartmut Becker <Hartmut.Becker@hp.com>
Archive support/Bug fixes by:
John W. Eaton <jwe@bevo.che.wisc.edu>
Martin Zinser <zinser@decus.decus.de>
Port to MS-Windows (native/MinGW) maintained by:
Eli Zaretskii <eliz@gnu.org>
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
DJ Delorie <dj@delorie.com>
Rob Tulloh <rob_tulloh@tivoli.com>
Eli Zaretskii <eliz@gnu.org>
Jonathan Grant <jg@jguk.org>
Andreas Beuning <andreas.buening@nexgo.de>
Earnie Boyd <earnie@uses.sf.net>
Troy Runkel <Troy.Runkel@mathworks.com>
Juan M. Guerrero <juan.guerrero@gmx.de>
KO Myung-Hun <komh78@gmail.com>
Port to z/OS by:
Igor Todorovski <itodorov@ca.ibm.com>
-----------------------------------
Other contributors:
Luke Allardyce <lukeallardyce@gmail.com>
Costas Argyris <costas.argyris@gmail.com>
Aron Barath <baratharon@caesar.elte.hu>
David Boyce <dsb@boyski.com>
Kevin Buettner <kevinb@redhat.com>
Janet Carson <janet_carson@tivoli.com>
Howard Chu <hyc@highlandsun.com>
Ludovic Courtès <ludo@gnu.org>
Joe Crayne <oh.hello.joe@gmail.com>
Jeremy Devenport <jeremy.devenport@gmail.com>
Pete Dietl <petedietl@gmail.com>
Aaron Digulla <digulla@fh-konstanz.de>
Hannes Domani <ssbssa@yahoo.de>
Martin Dorey <martin.dorey@hds.com>
Christian Eggers <ceggers@arri.de>
Paul Eggert <eggert@twinsun.com>
Mike Frysinger <vapier@gentoo.org>
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
Noah Goldstein <goldstein.w.n@gmail.com>
Mike Haboustak <haboustak@gmail.com>
Frank Heckenbach <f.heckenbach@fh-soft.de>
Klaus Heinz <kamar@ease.rhein-main.de>
Ben Hutchings <ben@decadent.org.uk>
Cao jin <caoj.fnst@cn.fujitsu.com>
Michael Joosten
Christian Jullien <eligis@orange.fr>
Jim Kelton <jim_kelton@tivoli.com>
Kaz Kylheku <kaz@kylheku.com>
David Lubbren <uhay@rz.uni-karlsruhe.de>
Tim Magill <tim.magill@telops.gte.com>
Markus Mauhart <qwe123@chello.at>
Greg McGary <greg@mcgary.org>
Thien-Thi Nguyen <ttn@gnuvola.org>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
Enrique Olaizola <enrique_olaizola16@hotmail.com>
Ola Olsson <ola1olsson@gmail.com>
Jens Rehsack <sno@netbsd.org>
Thomas Riedl <thomas.riedl@siemens.com>
Jaak Ristioja <jaak@ristioja.ee>
Christoph Schulz <develop@kristov.de>
Andreas Schwab <schwab@suse.de>
spagoveanu <spagoveanu@gmail.com>
Carl Staelin (Princeton University)
Ian Stewartson (Data Logic Limited)
Tobias Stoeckmann <tobias@stoeckmann.org>
Torbjörn Svensson <torbjorn.svensson@foss.st.com>
Sergei Trofimovich <siarheit@google.com>
Justine Tunney <jtunney@gmail.com>
Marc Ullman <marc@mathworks.com>
Christof Warlich <cwarlich@gmx.de>
Florian Weimer <fweimer@redhat.com>
David A. Wheeler <dwheeler@dwheeler.com>
Bernhard M. Wiedemann <bwiedemann@suse.de>
Ben Wijen <ben@wijen.net>
Jouke Witteveen <j.witteveen@gmail.com>
With suggestions/comments/bug reports from a cast of ... well ...
hundreds, anyway :)
-------------------------------------------------------------------------------
Copyright (C) 1997-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

134
Basic.mk.template Normal file
View File

@ -0,0 +1,134 @@
# Basic GNU -*-Makefile-*- to build GNU Make
#
# NOTE:
# If you have no 'make' program at all to process this makefile:
# * On Windows, run ".\build_w32.bat" to bootstrap one.
# * On MS-DOS, run ".\builddos.bat" to bootstrap one.
#
# Once you have a GNU Make program created, you can use it with this makefile
# to keep it up to date if you make changes, as:
#
# make.exe -f Basic.mk
#
# Copyright (C) 2017-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
all:
src = src/
lib = lib/
make_SOURCES = %make_SOURCES%
glob_SOURCES = %glob_SOURCES%
loadavg_SOURCES = %loadavg_SOURCES%
alloca_SOURCES = %alloca_SOURCES%
w32_SOURCES = %w32_SOURCES%
vms_SOURCES = %vms_SOURCES%
remote_SOURCES = $(src)remote-stub.c
OUTDIR =
SRCDIR = .
OBJEXT = o
EXEEXT =
PREFIX = /usr/local
INCLUDEDIR = $(PREFIX)/include
LIBDIR = $(PREFIX)/lib
LOCALEDIR = $(PREFIX)/share
PROG = $(OUTDIR)make$(EXEEXT)
prog_SOURCES = $(make_SOURCES) $(remote_SOURCES)
BUILT_SOURCES =
OBJECTS = $(patsubst %.c,$(OUTDIR)%.$(OBJEXT),$(prog_SOURCES))
RESOURCE_OBJECTS =
OBJDIRS = $(addsuffix .,$(sort $(dir $(OBJECTS))))
# Use the default value of CC
LD = $(CC)
# Reserved for command-line override
CPPFLAGS =
CFLAGS = -g -O2
LDFLAGS =
extra_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR)src -I$(SRCDIR)/src -I$(OUTDIR)lib -I$(SRCDIR)/lib \
-DLIBDIR=\"$(LIBDIR)\" -DINCLUDEDIR=\"$(INCLUDEDIR)\" -DLOCALEDIR=\"$(LOCALDIR)\"
extra_CFLAGS =
extra_LDFLAGS = $(extra_CFLAGS) $(CFLAGS)
C_SOURCE = -c
OUTPUT_OPTION = -o $@
LINK_OUTPUT = -o $@
# Command lines
# $(call COMPILE.cmd,<src>,<tgt>)
COMPILE.cmd = $(CC) $(extra_CFLAGS) $(CFLAGS) $(extra_CPPFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(OUTPUT_OPTION) $(C_SOURCE) $1
# $(call LINK.cmd,<objectlist>)
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
# $(CHECK.cmd) $(CHECK.args)
CHECK.cmd = cd $(SRCDIR)/tests && ./run_make_tests -make $(shell cd $(<D) && pwd)/$(<F)
CHECK.args ?=
# $(call MKDIR.cmd,<dirlist>)
MKDIR.cmd = mkdir -p $1
# $(call RM.cmd,<filelist>)
RM.cmd = rm -f $1
# $(call CP.cmd,<from>,<to>)
CP.cmd = cp $1 $2
CLEANSPACE = $(call RM.cmd,$(OBJECTS) $(RESOURCE_OBJECTS) $(PROG) $(BUILT_SOURCES))
# Load overrides for the above variables.
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk)))
VPATH = $(SRCDIR)
all: $(PROG)
$(PROG): $(OBJECTS) $(RESOURCE_OBJECTS)
$(call LINK.cmd,$^)
$(OBJECTS): $(OUTDIR)%.$(OBJEXT): %.c
$(call COMPILE.cmd,$<)
$(OBJECTS): | $(OBJDIRS) $(BUILT_SOURCES)
$(OBJDIRS):
$(call MKDIR.cmd,$@)
check:
$(CHECK.cmd) $(CHECK.args)
clean:
$(CLEANSPACE)
$(filter %.h,$(BUILT_SOURCES)): %.h : %.in.h
$(call RM.cmd,$@)
$(call CP.cmd,$<,$@)
.PHONY: all check clean

674
COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/philosophy/why-not-lgpl.html>.

4997
ChangeLog.1 Normal file

File diff suppressed because it is too large Load Diff

6653
ChangeLog.2 Normal file

File diff suppressed because it is too large Load Diff

5633
ChangeLog.3 Normal file

File diff suppressed because it is too large Load Diff

221
Makefile.am Normal file
View File

@ -0,0 +1,221 @@
# This is a -*-Makefile-*-, or close enough
#
# Copyright (C) 1997-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
AUTOMAKE_OPTIONS = dist-lzip silent-rules std-options subdir-objects nostdinc
ACLOCAL_AMFLAGS = -I m4
MAKE_HOST = @MAKE_HOST@
SUBDIRS = lib po doc
bin_PROGRAMS = make
include_HEADERS = src/gnumake.h
man_MANS = doc/make.1
make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \
src/debug.h src/default.c src/dep.h src/dir.c src/expand.c \
src/file.c src/filedef.h src/function.c src/getopt.c \
src/getopt.h src/getopt1.c src/gettext.h src/guile.c \
src/hash.c src/hash.h src/implicit.c src/job.c src/job.h \
src/load.c src/loadapi.c src/main.c src/makeint.h src/misc.c \
src/mkcustom.h src/os.h src/output.c src/output.h src/read.c \
src/remake.c src/rule.c src/rule.h src/shuffle.h src/shuffle.c \
src/signame.c src/strcache.c src/variable.c src/variable.h \
src/version.c src/vpath.c src/warning.c src/warning.h
w32_SRCS = src/w32/pathstuff.c src/w32/w32os.c src/w32/compat/dirent.c \
src/w32/compat/posixfcn.c src/w32/include/dirent.h \
src/w32/include/dlfcn.h src/w32/include/pathstuff.h \
src/w32/include/sub_proc.h src/w32/include/w32err.h \
src/w32/subproc/misc.c src/w32/subproc/proc.h \
src/w32/subproc/sub_proc.c src/w32/subproc/w32err.c
w32_utf8_SRCS = src/w32/utf8.rc src/w32/utf8.manifest
vms_SRCS = src/vms_exit.c src/vms_export_symbol.c src/vms_progname.c \
src/vmsdir.h src/vmsfunctions.c src/vmsify.c
glob_SRCS = lib/fnmatch.c lib/fnmatch.h lib/glob.c lib/glob.h
alloca_SRCS = lib/alloca.c
loadavg_SRCS = lib/getloadavg.c
make_SOURCES = $(make_SRCS)
EXTRA_make_SOURCES = $(vms_SRCS)
if HAVE_GUILE
_GUILE_CFLAGS = $(GUILE_CFLAGS)
_GUILE_LIBS = $(GUILE_LIBS)
else
_GUILE_CFLAGS =
_GUILE_LIBS =
endif
make_LDADD = $(LIBOBJS) $(_GUILE_LIBS) lib/libgnu.a $(GETLOADAVG_LIBS) \
@LIBINTL@
localedir = $(datadir)/locale
AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
-DLIBDIR=\"$(libdir)\" -DLOCALEDIR=\"$(localedir)\"
# If prefix is not a standard location, look in prefix as well
if !KNOWN_PREFIX
AM_CPPFLAGS += -DINCLUDEDIR=\"$(includedir)\"
endif
AM_CFLAGS = $(_GUILE_CFLAGS)
if WINDOWSENV
make_SOURCES += $(w32_SRCS)
AM_CPPFLAGS += -I $(top_srcdir)/src/w32/include
else
make_SOURCES += src/posixos.c
endif
UTF8OBJ = src/w32/utf8.$(OBJEXT)
if HAVE_WINDRES
make_LDADD += $(UTF8OBJ)
endif
$(UTF8OBJ) : $(w32_utf8_SRCS)
$(WINDRES) -o $@ -i $<
if USE_CUSTOMS
make_SOURCES += src/remote-cstms.c
else
make_SOURCES += src/remote-stub.c
endif
# Extra stuff to include in the distribution.
mk_FILES = Basic.mk mk/msdosdjgpp.mk mk/VMS.mk mk/Windows32.mk
# We don't need this, since the standard automake output will do.
#mk/Posix.mk.in
m4_FILES = m4/gnulib-cache.m4
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
tests/run_make_tests.pl tests/test_driver.pl \
tests/config-flags.pm.in tests/config_flags_pm.com \
tests/config-flags.pm.W32 \
tests/mkshadow tests/thelp.pl tests/guile.supp tests/README
# test/scripts are added via dist-hook below.
EXTRA_DIST = ChangeLog INSTALL README build.sh build.cfg.in $(man_MANS) \
src/mkconfig.h README.customs README.OS2 README.zOS \
README.DOS builddos.bat src/configh.dos \
README.W32 build_w32.bat src/config.h.W32 \
README.VMS makefile.com src/config.h-vms src/vmsjobs.c \
vms_export_symbol_test.com \
src/gmk-default.scm src/gmk-default.h \
$(mk_FILES) $(m4_FILES) $(test_FILES) $(w32_utf8_SRCS)
# --------------- Generate the Guile default module content
src/guile.$(OBJEXT): src/gmk-default.h
src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
(echo 'static const char *const GUILE_module_defn = " '\\ \
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
$(top_srcdir)/src/gmk-default.scm \
&& echo '";') > src/gmk-default.h
# --------------- Local DIST Section
# Install the mk and tests subdirectories
#
dist-hook:
(cd $(top_srcdir); \
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
$(AMTAR) chf - $$sub) \
| (cd $(distdir); $(AMTAR) xfBp -)
# --------------- Local CHECK Section
check-local: check-regression
@banner=" Regression PASSED: $(PACKAGE_STRING) ($(MAKE_HOST)) built with $(CC) "; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"; \
echo
# > check-regression
#
# Look for the make test suite, and run it if found and we can find perl.
#
MAKETESTFLAGS =
.PHONY: check-regression
GMK_OUTDIR = ..
testlog = test-suite.log
testresult = tests/.test-result
errorpre = makeerror-$(PACKAGE_VERSION)-$(host_triplet)
testfiles = $(testlog) $(testresult) $(errorfile)
MOSTLYCLEANFILES = $(testfiles)
errordetails = config.status config.log src/config.h src/mkconfig.h \
$(testlog) tests/work
# Create a 4-letter random sequence
rand_value = c = "abcdefghijklmnopqrstuvwxyz0123456789"
rand_char = substr(c,int(rand()*36),1)
rand_string = $(AWK) 'BEGIN{srand(); $(rand_value); print $(rand_char) "" $(rand_char) "" $(rand_char) "" $(rand_char);}'
check-regression: tests/config-flags.pm
$(AM_V_at) rm -f $(testfiles)
$(AM_V_at) if test -f '$(top_srcdir)/tests/run_make_tests.pl'; then \
ulimit -n 128; \
if $(PERL) -v >/dev/null 2>&1; then \
echo "cd tests && $(PERL) $(PERLFLAGS) $(abs_top_srcdir)/tests/run_make_tests.pl -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
(cd tests && $(PERL) $(PERLFLAGS) '$(abs_top_srcdir)/tests/run_make_tests.pl' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); echo $$? >.test-result) 2>&1 | tee $(testlog); \
export TAR_OPTIONS='$(filter-out --sort%,$(TAR_OPTIONS))'; \
er=$$(cat $(testresult)); if test "$$er" -ne 0; then \
dirnm="$(errorpre)-$$($(rand_string))"; fnm="$$dirnm.tar.gz"; \
rm -rf "$$dirnm"; mkdir "$$dirnm"; \
$(AMTAR) chf - $(errordetails) | (cd "$$dirnm"; $(AMTAR) xf -); \
$(AMTAR) chf - "$$dirnm" | eval GZIP= gzip $(GZIP_ENV) -c >"$$fnm"; \
echo "*** Testing FAILED! Details: $$fnm"; \
echo '*** Please report to <$(PACKAGE_BUGREPORT)>'; echo; \
exit $$er; \
fi; \
else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \
else \
echo "Can't find the $(PACKAGE_NAME) test suite ($(top_srcdir)/tests)."; \
fi
# --------------- Maintainer's Section
# Tell automake that I haven't forgotten about this file and it will be
# created before we build a distribution (see maintMakefile in the Git
# distribution).
README:
@MAINT_MAKEFILE@

1964
NEWS Normal file

File diff suppressed because it is too large Load Diff

296
README.DOS Normal file
View File

@ -0,0 +1,296 @@
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
New (since 3.74) DOS-specific features:
1. Supports long filenames when run from DOS box on Windows 9x.
2. Supports both stock DOS COMMAND.COM and Unix-style shells
(details in 'Notes' below).
3. Supports DOS drive letters in dependencies and pattern rules.
4. Better support for DOS-style backslashes in pathnames (but see
'Notes' below).
5. The $(shell) built-in can run arbitrary complex commands,
including pipes and redirection, even when COMMAND.COM is your
shell.
6. Can be built without floating-point code (see below).
7. Supports signals in child programs and restores the original
directory if the child was interrupted.
8. Can be built without (a previous version of) Make.
9. The build process requires only standard tools. (Optional
targets like "check:" still need additional programs, though,
see below.)
10. Beginning with v3.78, the test suite works in the DJGPP
environment (requires Perl and auxiliary tools; see below).
To install a binary distribution:
Simply unzip the makNNNb.zip file (where NNN is the version number)
preserving the directory structure (-d switch if you use PKUNZIP).
If you are installing Make on Windows 9X or Windows 2000, use an
unzip program that supports long filenames in zip files. After
unzipping, make sure the directory with make.exe is on your PATH,
and that's all you need to use Make.
To build from sources:
1. Unzip the archive, preserving the directory structure (-d switch
if you use PKUNZIP). If you build Make on Windows 9X or Windows
2000, use an unzip program that supports long filenames in zip
files.
If you are unpacking an official GNU source distribution, use
either DJTAR (which is part of the DJGPP development
environment), or the DJGPP port of GNU Tar.
2. If you have a working Make already, you can run:
make -f Basic.mk
3. If you don't have a working Make already you can bootstrap one
by running:
.\builddos.bat
4. If you are building from outside of the source directory, you
need to tell Make where the sources are, like this:
make -f c:/djgpp/gnu/make/Basic.mk SRCDIR=c:/djgpp/gnu/make
or:
c:/djgpp/gnu/make/builddos.bat c:/djgpp/gnu/make
5. To run the test suite, type "make check". This requires a Unix
shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
and Sh-utils.
6. To install copy make.exe to the preferred location.
Since GNU Make 4.3, support for customized platform installations
has been removed. If you'd like to collaborate on reinstating
these capabilities, contact bug-make@gnu.org.
Notes:
-----
1. The shell issue.
This is probably the most significant improvement, first
introduced in the port of GNU Make 3.75.
The original behavior of GNU Make is to invoke commands
directly, as long as they don't include characters special to
the shell or internal shell commands, because that is faster.
When shell features like redirection or filename wildcards are
involved, Make calls the shell.
This port supports both DOS shells (the stock COMMAND.COM and its
4DOS/NDOS replacements), and Unix-style shells (tested with the
venerable Stewartson's 'ms_sh' 2.3 and the DJGPP port of 'bash' by
Daisuke Aoyama <jack@st.rim.or.jp>).
When the $SHELL variable points to a Unix-style shell, Make
works just like you'd expect on Unix, calling the shell for any
command that involves characters special to the shell or
internal shell commands. The only difference is that, since
there is no standard way to pass command lines longer than the
infamous DOS 126-character limit, this port of Make writes the
command line to a temporary disk file and then invokes the shell
on that file.
If $SHELL points to a DOS-style shell, however, Make will not
call it automatically, as it does with Unix shells. Stock
COMMAND.COM is too dumb and would unnecessarily limit the
functionality of Make. For example, you would not be able to
use long command lines in commands that use redirection or
pipes. Therefore, when presented with a DOS shell, this port of
Make will emulate most of the shell functionality, like
redirection and pipes, and shall only call the shell when a
batch file or a command internal to the shell is invoked. (Even
when a command is an internal shell command, Make will first
search the $PATH for it, so that if a Makefile calls 'mkdir',
you can install, say, a port of GNU 'mkdir' and have it called
in that case.)
The key to all this is the extended functionality of 'spawn' and
'system' functions from the DJGPP library; this port just calls
'system' where it would invoke the shell on Unix. The most
important aspect of these functions is that they use a special
mechanism to pass long (up to 16KB) command lines to DJGPP
programs. In addition, 'system' emulates some internal
commands, like 'cd' (so that you can now use forward slashes
with it, and can also change the drive if the directory is on
another drive). Another aspect worth mentioning is that you can
call Unix shell scripts directly, provided that the shell whose
name is mentioned on the first line of the script is installed
anywhere along the $PATH. It is impossible to tell here
everything about these functions; refer to the DJGPP library
reference for more details.
The $(shell) built-in is implemented in this port by calling
'popen'. Since 'popen' calls 'system', the above considerations
are valid for $(shell) as well. In particular, you can put
arbitrary complex commands, including pipes and redirection,
inside $(shell), which is in many cases a valid substitute for
the Unix-style command substitution (`command`) feature.
2. "SHELL=/bin/sh" -- or is it?
Many Unix Makefiles include a line which sets the SHELL, for
those versions of Make which don't have this as the default.
Since many DOS systems don't have 'sh' installed (in fact, most
of them don't even have a '/bin' directory), this port takes
such directives with a grain of salt. It will only honor such a
directive if the basename of the shell name (like 'sh' in the
above example) can indeed be found in the directory that is
mentioned in the SHELL= line ('/bin' in the above example), or
in the current working directory, or anywhere on the $PATH (in
that order). If the basename doesn't include a filename
extension, Make will look for any known extension that indicates
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
and .pl). If any such file is found, then $SHELL will be
defined to the exact pathname of that file, and that shell will
hence be used for the rest of processing. But if the named
shell is *not* found, the line which sets it will be effectively
ignored, leaving the value of $SHELL as it was before. Since a
lot of decisions that this port makes depend on the gender of
the shell, I feel it doesn't make any sense to tailor Make's
behavior to a shell which is nowhere to be found.
Note that the above special handling of "SHELL=" only happens
for Makefiles; if you set $SHELL in the environment or on the
Make command line, you are expected to give the complete
pathname of the shell, including the filename extension.
The default value of $SHELL is computed as on Unix (see the Make
manual for details), except that if $SHELL is not defined in the
environment, $COMSPEC is used. Also, if an environment variable
named $MAKESHELL is defined, it takes precedence over both
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
environment *is* used to set the shell (since on MSDOS, it's
unlikely that the interactive shell will not be suitable for
Makefile processing).
The bottom line is that you can now write Makefiles where some
of the targets require a real (i.e. Unix-like) shell, which will
nevertheless work when such shell is not available (provided, of
course, that the commands which should always work, don't
require such a shell). More important, you can convert Unix
Makefiles to MSDOS and leave the line which sets the shell
intact, so that people who do have Unixy shell could use it for
targets which aren't converted to DOS (like 'install' and
'uninstall', for example).
3. Default directories.
GNU Make knows about standard directories where it searches for
library and include files mentioned in the Makefile. Since
MSDOS machines don't have standard places for these, this port
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
$DJDIR is defined automatically by the DJGPP startup code as the
root of the DJGPP installation tree (unless you've tampered with
the DJGPP.ENV file). This should provide reasonable default
values, unless you moved parts of DJGPP to other directories.
4. Letter-case in filenames.
If you run Make on Windows 9x, you should be aware of the
letter-case issue. Make is internally case-sensitive, but all
file operations are case-insensitive on Windows 9x, so
e.g. files 'FAQ', 'faq' and 'Faq' all refer to the same file, as
far as Windows is concerned. The underlying DJGPP C library
functions honor the letter-case of the filenames they get from
the OS, except that by default, they down-case 8+3 DOS filenames
which are stored in upper case in the directory and would break
many Makefiles otherwise. (The details of which filenames are
converted to lower case are explained in the DJGPP libc docs,
under the '_preserve_fncase' and '_lfn_gen_short_fname'
functions, but as a thumb rule, any filename that is stored in
upper case in the directory, is a valid DOS 8+3 filename and
doesn't include characters invalid on MSDOS FAT filesystems,
will be automatically down-cased.) User reports that I have
indicate that this default behavior is generally what you'd
expect; however, your input is most welcome.
In any case, if you hit a situation where you must force Make to
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
environment or in the Makefile.
5. DOS-style pathnames.
There are a lot of places throughout the program sources which
make implicit assumptions about the pathname syntax. In
particular, the directories are assumed to be separated by '/',
and any pathname which doesn't begin with a '/' is assumed to be
relative to the current directory. This port attempts to
support DOS-style pathnames which might include the drive letter
and use backslashes instead of forward slashes. However, this
support is not complete; I feel that pursuing this support too
far might break some more important features, particularly if
you use a Unix-style shell (where a backslash is a quote
character). I only consider support of backslashes desirable
because some Makefiles invoke non-DJGPP programs which don't
understand forward slashes. A notable example of such programs
is the standard programs which come with MSDOS. Otherwise, you
are advised to stay away from backslashes whenever possible. In
particular, filename globbing won't work on pathnames with
backslashes, because the GNU 'glob' library doesn't support them
(backslash is special in filename wildcards, and I didn't want
to break that).
One feature which *does* work with backslashes is the filename-
related built-in functions such as $(dir), $(notdir), etc.
Drive letters in pathnames are also fully supported.
Bug reports:
-----------
Bugs that are clearly related to the MSDOS/DJGPP port should be
reported first on the comp.os.msdos.djgpp news group (if you cannot
post to Usenet groups, write to the DJGPP mailing list,
<djgpp@delorie.com>, which is an email gateway into the above news
group). For other bugs, please follow the procedure explained in
the "Bugs" chapter of the Info docs. If you don't have an Info
reader, look up that chapter in the 'make.i1' file with any text
browser/editor.
Enjoy,
Eli Zaretskii <eliz@is.elta.co.il>
-------------------------------------------------------------------------------
Copyright (C) 1996-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

179
README.OS2 Normal file
View File

@ -0,0 +1,179 @@
Port of GNU Make to OS/2.
Features of GNU Make that do not work under OS/2:
- remote job execution
- dynamic load balancing
Special features of the OS/2 version:
Due to the fact that some people might want to use sh syntax in
Makefiles while others might want to use OS/2's native shell cmd.exe,
GNU Make supports both shell types. The following list defines the order
that is used to determine the shell:
1. The shell specified by the environment variable MAKESHELL.
2. The shell specified by the SHELL variable within a Makefile. Like
Unix, SHELL is NOT taken from the environment.
3. The shell specified by the COMSPEC environment variable.
4. The shell specified by the OS2_SHELL environment variable.
5. If none of the above is defined /bin/sh is used as default. This
happens e.g. in the make testsuite.
Note: - Points 3 and 4 can be turned off at compile time by adding
-DNO_CMD_DEFAULT to the CPPFLAGS.
- DOS support is not tested for EMX and therefore might not work.
- The UNIXROOT environment variable is supported to find /bin/sh
if it is not on the current drive.
COMPILATION OF GNU MAKE FOR OS/2:
I. ***** SPECIAL OPTIONS *****
- At compile time you can turn off that cmd is used as default shell
(but only /bin/sh). Simply set CPPFLAGS="-DNO_CMD_DEFAULT" and make
will not use cmd unless you cause it to do so by setting MAKESHELL to
cmd or by specifying SHELL=cmd in your Makefile.
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
GNU Make prints drive letters. This is necessary if you want to run
the testsuite.
II. ***** REQUIREMENTS FOR THE COMPILATION *****
A standard Unix like build environment:
- sh compatible shell (ksh, bash, ash, but tested only with pdksh 5.2.14
release 2)
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
versions may not work! You can get this version at
https://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
- GNU file utilities (make sure that install.exe from the file utilities
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
also to change the filename to ginstall.exe instead of install.exe
to avoid confusion with X:\OS2\INSTALL\INSTALL.EXE)
- GNU shell utilities
- GNU text utilities
- gawk
- grep
- sed
- GNU Make 3.79.1 (special OS/2 patched version) or higher
- perl 5.005 or higher
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
If you want to recreate the configuration files (developers only!)
you need also: GNU m4 1.4, autoconf 2.59, automake 1.9.6 (or compatible)
III. ***** COMPILATION AND INSTALLATION *****
a) ** Developers only - Everyone else should skip this section **
To recreate the configuration files use:
export EMXSHELL=ksh
aclocal -I m4
automake
autoconf
autoheader
b) Installation into x:/usr
Note: Although it is possible to compile make using "./configure",
"make", "make install" this is not recommended. In particular,
you must ALWAYS use LDFLAGS="-Zstack 0x6000" because the default
stack size is far to small and make will not work properly!
Recommended environment variables and installation options:
export ac_executable_extensions=".exe"
export CPPFLAGS="-D__ST_MT_ERRNO__"
export CFLAGS="-O2 -Zomf -Zmt"
export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
export RANLIB="echo"
./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man
make AR=emxomfar
make install
Note: If you use gcc 2.9.x I recommend to set also LIBS="-lgcc"
Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
See section I. for details.
Note: If you use Open Watcom Linker instead of IBM Linker, remove
'-Zlinker /exepack:2' from LDFLAGS.
IV. ***** NLS support *****
GNU Make has NLS (National Language Support), with the following
caveats:
a) It will only work with GNU gettext, and
b) GNU gettext support is not included in the GNU Make package.
Therefore, if you wish to enable the internationalization features of
GNU Make you must install GNU gettext on your system before configuring
GNU Make.
You can choose the languages to be installed. To install support for
English, German and French only enter:
export LINGUAS="en de fr"
If you don't specify LINGUAS all languages are installed.
If you don't want NLS support (English only) use the option
--disable-nls for the configure script. Note if GNU gettext is not
installed then NLS will not be enabled regardless of this flag.
V. ***** Running the make test suite *****
To run the included make test suite you have to set
CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
before you compile make. This is due to some restrictions of the
testsuite itself. -DNO_CMD_DEFAULT causes make to use /bin/sh as default
shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
make not to use drive letters for directory names (i.e. _chdir2() and
_getcwd2() are NOT used). The testsuite interprets the whole output of
make, especially statements like make[1]: Entering directory
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
drive letter. This would be interpreted as an error even if there is
none.
To run the testsuite do the following:
export CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
export CFLAGS="-Zomf -O2 -Zmt"
export LDFLAGS="-Zcrtdll -s -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
export RANLIB="echo"
./configure --prefix=x:/usr --disable-nls
make AR=emxomfar
make check
All tests should work fine with the exception of one of the "INCLUDE_DIRS"
tests which will fail if your /usr/include directory is on a drive different
from the make source tree.
-------------------------------------------------------------------------------
Copyright (C) 2003-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

515
README.VMS Normal file
View File

@ -0,0 +1,515 @@
Overview: -*-text-mode-*-
---------
This version of GNU Make has been tested on:
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
This version of GNU Make is intended to be run from DCL to run
make scripts with a special syntax that is described below. It
likely will not be able to run unmodified Unix makefiles.
There is an older implementation of GNU Make that was ported to GNV.
Work is now in progress to merge that port to get a single version
of GNU Make available. When that merge is done, GNU Make will auto
detect that it is running under a POSIX shell and then operate as close to
GNU Make on Unix as possible.
The descriptions below are for running GNU Make from DCL or equivalent.
Recipe differences:
-------------------
GNU Make for OpenVMS can not currently run native Unix make files because of
differences in the implementation.
I am trying to document the current behavior in this section. This is based
on the information in the file NEWS. and running the test suite.
TODO: More tests are needed to validate and demonstrate the OpenVMS
expected behavior.
In some cases the older behavior of GNU Make when run from DCL is not
compatible with standard makefile behavior.
This behavior can be changed when running GNU Make from DCL by setting
either DCL symbols or logical names of the format GNV$. The settings
are enabled with a string starting with one of '1', 'T', or 'E' for "1",
"TRUE", or "ENABLE". They are disabled with a '0', 'F', or 'D' for "1",
"FALSE", or "DISABLE". If they are not explicitly set to one of these
values, then they will be set to their default values.
The value of the setting DECC$FILENAME_UNIX_REPORT or
DECC$FILENAME_UNIX_ONLY will now cause the $(dir x) function to return
'./' or '[]' as appropriate.
The name GNV$MAKE_OLD_VMS when enabled will cause GNU Make to behave as
much as the older method as can be done with out disabling VMS features.
When it is disabled GNU Make have the new behavior which more closely
matches Unix Make behavior.
The default is currently the old behavior when running GNU Make from DCL.
In the future this may change. When running make from GNV Bash the new
behavior is the default.
This is a global setting that sets the default behavior for several other
options that can be individually changed. Many of the individual settings
are to make it so that the self tests for GNU Make need less VMS specific
modifications.
The name GNV$MAKE_COMMA when enabled will cause GNU Make to expect a comma
for a path separator and use a comma for the separator for a list of files.
When disabled, it will cause GNU Make to use a colon for a path separator
and a space for the separator for a list of files. The default is to be
enabled if the GNU Make is set to the older behavior.
The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
simulate a POSIX shell more closely. The following behaviors occur:
* Single quotes are converted to double quotes and any double
quotes inside of them are doubled. No environment variable expansion
is simulated.
* A exit command status will be converted to a POSIX Exit
where 0 is success and non-zero is failure.
* The $ character will cause environment variable expansion.
* Environment variables can be set on the command line before a command.
VMS generally uses logical name search lists instead of path variables
where the resolution is handled by VMS independent of the program. Which
means that it is likely that nothing will notice if the default path
specifier is changed in the future.
Currently the built in VMS specific macros and recipes depend on the comma
being used as a file list separator.
TODO: Remove this dependency as other functions in GNU Make depend on a
space being used as a separator.
The format for recipes are a combination of Unix macros, a subset of
simulated UNIX commands, some shell emulation, and OpenVMS commands.
This makes the resulting makefiles unique to the OpenVMS port of GNU Make.
If you are creating a OpenVMS specific makefile from scratch, you should also
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
MMK uses full OpenVMS syntax and a persistent sub-process is used for the
recipe lines, allowing multiple line rules.
The default makefile search order is "makefile.vms", "gnumakefile",
"makefile". TODO: See if that lookup is case sensitive.
When Make is invoked from DCL, it will create a foreign command
using the name of executable image, with any facility prefix removed,
for the duration of the make program, so it can be used internally
to recursively run make(). The macro MAKE_COMMAND will be set to
this foreign command.
When make is launched from an exec*() command from a C program,
the foreign command is not created. The macro MAKE_COMMAND will be
set to the actual command passed as argv[0] to the exec*() function.
If the DCL symbol or logical name GNV$MAKE_USE_MCR exists, then
the macro MAKE_COMMAND will be set to be an "MCR" command with the
absolute path used by DCL to launch make. The foreign command
will not be created.
The macro MAKE is set to be the same value as the macro MAKE_COMMAND
on all platforms.
Each recipe command is normally run as a separate spawned processes,
except for the cases documented below where a temporary DCL command
file may be used.
BUG: Testing has shown that the commands in the temporary command files
are not always created properly. This issue is still under investigation.
Any macros marked as exported are temporarily created as DCL symbols
for child images to use. DCL symbol substitution is not done with these
commands.
Untested: Symbol substitution.
When a temporary DCL command file is used, DCL symbol substitution
will work.
For VMS 7.3-1 and earlier, command lines are limited to 255 characters
or 1024 characters in a command file.
For VMS 7.3-2 and later, command lines are limited to 4059 characters
or 8192 characters in a command file.
VMS limits each token of a command line to 256 characters, and limits
a command line to 127 tokens.
Command lines above the limit length are written to a command file
in sys$scratch:.
In order to handle Unix style extensions to VMS DCL, GNU Make has
parsed the recipe commands and them modified them as needed. The
parser has been re-written to resolve numerous bugs in handling
valid VMS syntax and potential buffer overruns.
The new parser may need whitespace characters where DCL does not require
it, and also may require that quotes are matched were DCL forgives if
they are not. There is a small chance that existing VMS specific makefiles
will be affected.
The '<', '>' was previously implemented using command files. Now
GNU Make will check to see if the is already a VMS "PIPE" command and
if it is not, will convert the command to a VMS "PIPE" command.
The '>>' redirection has been implemented by using a temporary command file.
This will be described later.
The DCL symbol or logical name GNV$MAKE_USE_CMD_FILE when set to a
string starting with one of '1','T', or 'E' for "1", "TRUE", or "ENABLE",
then temporary DCL command files are always used for running commands.
Some recipe strings with embedded new lines will not be handled correctly
when a command file is used.
GNU Make generally does text comparisons for the targets and sources. The
make program itself can handle either Unix or OpenVMS format filenames, but
normally does not do any conversions from one format to another.
TODO: The OpenVMS format syntax handling is incomplete.
TODO: ODS-5 EFS support is missing.
BUG: The internal routines to convert filenames to and from OpenVMS format
do not work correctly.
Note: In the examples below, line continuations such as a backslash may have
been added to make the examples easier to read in this format.
BUG: That feature does not completely work at this time.
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
usually have to use OpenVMS format paths for rules and targets.
BUG: Relative OpenVMS paths may not work in targets, especially combined
with vpaths. This is because GNU Make will just concatenate the directories
as it does on Unix.
The variables $^ and $@ separate files with commas instead of spaces.
This is controlled by the name GNV$MAKE_COMMA as documented in the
previous section.
While this may seem the natural thing to do with OpenVMS, it actually
causes problems when trying to use other make functions that expect the
files to be separated by spaces. If you run into this, you need the
following workaround to convert the output.
TODO: Look at have the $^ and $@ use spaces like on Unix and have
and easy to use function to do the conversions and have the built
in OpenVMS specific recipes and macros use it.
Example:
comma := ,
empty :=
space := $(empty) $(empty)
foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
Makefile variables are looked up in the current environment. You can set
symbols or logicals in DCL and evaluate them in the Makefile via
$(<name-of-symbol-or-logical>). Variables defined in the Makefile
override OpenVMS symbols/logicals.
OpenVMS logical and symbols names show up as "environment" using the
origin function. when the "-e" option is specified, the origin function
shows them as "environment override". On POSIX the test scripts indicate
that they should show up just as "environment".
When GNU Make reads in a symbol or logical name into the environment, it
converts any dollar signs found to double dollar signs for convenience in
using DCL symbols and logical names in recipes. When GNU Make exports a
DCL symbol for a child process, if the first dollar sign found is followed
by second dollar sign, then all double dollar signs will be converted to
single dollar signs.
The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
Makefiles for different OpenVMS systems can now be written by checking
$(ARCH). Since IA64 and ALPHA are similar, usually just a check for
VAX or not VAX is sufficient.
You may have to update makefiles that assume VAX if not ALPHA.
ifeq ($(ARCH),VAX)
$(ECHO) "On the VAX"
else
$(ECHO) "On the ALPHA or IA64"
endif
Empty commands are handled correctly and don't end in a new DCL process.
The exit command needs to have OpenVMS exit codes. To pass a POSIX code
back to the make script, you need to encode it by multiplying it by 8
and then adding %x1035a002 for a failure code and %x1035a001 for a
success. Make will interpret any POSIX code other than 0 as a failure.
TODO: Add an option have simulate POSIX exit commands in recipes.
Lexical functions can be used in pipes to simulate shell file test rules.
Example:
POSIX:
b : c ; [ -f $@ ] || echo >> $@
OpenVMS:
b : c ; if f$$search("$@") then pipe open/append xx $@ ; write xx "" ; close xx
You can also use pipes and turning messages off to silently test for a
failure.
x = %x1035a00a
%.b : %.c
<tab>pipe set mess/nofac/noiden/nosev/notext ; type $^/output=$@ || exit $(x)
Runtime issues:
The OpenVMS C Runtime has a convention for encoding a POSIX exit status into
to OpenVMS exit codes. These status codes will have the hex value of
0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
them. This is a flag to tell DCL not to write out the exit code.
To convert an OpenVMS encoded POSIX exit status code to the original code
You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
WARNING: Backward-incompatibility!
The make program exit now returns the same encoded POSIX exit code as on
Unix. Previous versions returned the OpenVMS exit status code if that is what
caused the recipe to fail.
TODO: Provide a way for scripts calling make to obtain that OpenVMS status
code.
Make internally has two error codes, MAKE_FAILURE and MAKE_TROUBLE. These
will have the error "-E-" severity set on exit.
MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
has a POSIX value of 1 and an OpenVMS status of %x1035a00a.
MAKE_FAILURE has a POSIX value of 2 and an OpenVMS status of %x1035a012.
Output from GNU Make may have single quotes around some values where on
other platforms it does not. Also output that would be in double quotes
on some platforms may show up as single quotes on VMS.
There may be extra blank lines in the output on VMS.
https://savannah.gnu.org/bugs/?func=detailitem&item_id=41760
There may be a "Waiting for unfinished jobs..." show up in the output.
Error messages generated by Make or Unix utilities may slightly vary from
POSIX platforms. Typically the case may be different.
When make deletes files, on POSIX platforms it writes out 'rm' and the list
of files. On VMS, only the files are written out, one per line.
TODO: VMS
There may be extra leading white space or additional or missing whitespace
in the output of recipes.
GNU Make uses sys$scratch: for the tempfiles that it creates.
The OpenVMS CRTL library maps /tmp to sys$scratch if the TMP: logical name
does not exist. As the CRTL may use both sys$scratch: and /tmp internally,
if you define the TMP logical name to be different than SYS$SCRATCH:,
you may end up with only some temporary files in TMP: and some in SYS$SCRATCH:
The default include directory for including other makefiles is
SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
SYS$LIBRARY: instead; maybe it wouldn't work that way).
TODO: A better default may be desired.
If the device for a file in a recipe does not exist, on OpenVMS an error
message of "stat: <file>: no such device or address" will be output.
Make ignores success, informational, or warning errors (-S-, -I-, or
-W-). But it will stop on -E- and -F- errors. (unless you do something
to override this in your makefile, or whatever).
Unix compatibility features:
----------------------------
If the command 'echo' is seen, any single quotes on the line will be
converted to double quotes.
The variable $(CD) is implemented as a built in Change Directory
command. This invokes the 'builtin_cd' Executing a 'set default'
recipe doesn't do the trick, since it only affects the sub-process
spawned for that command.
The 'builtin_cd' is generally expected to be on its own line.
The 'builtin_cd' either from the expansion of $(CD) or directly
put in a recipe line will be executed before any other commands in
that recipe line. DCL parameter substitution will not work for the
'builtin_cd' command.
Putting a 'builtin_cd' in a pipeline or an IF-THEN line should not be
done because the 'builtin_cd' is always executed
and executed first. The directory change is persistent.
Unix shell style I/O redirection is supported. You can now write lines like:
"<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
POSIX shells have ":" as a null command. These are now handled.
https://savannah.gnu.org/bugs/index.php?41761
A note on appending the redirected output. A simple mechanism is
implemented to make ">>" work in action lines. In OpenVMS there is no simple
feature like ">>" to have DCL command or program output redirected and
appended to a file. GNU Make for OpenVMS implements the redirection
of ">>" by using a command procedure.
The current algorithm creates the output file if it does not exist and
then uses the DCL open/append to extend it. SYS$OUTPUT is then directed
to that file.
The implementation supports only one redirected append output to a file
and that redirection is done before any other commands in that line
are executed, so it redirects all output for that command.
The older implementation wrote the output to a temporary file in
in sys$scratch: and then attempted to append the file to the existing file.
The temporary file names looked like "CMDxxxxx.". Any time the created
command procedure can not complete, this happens. Pressing CTRL+Y to
abort make is one case.
In case of CTRL+Y the associated command procedure is left in SYS$SCRATCH:.
The command procedures will be named gnv$make_cmd*.com.
The CtrlY handler now uses $delprc to delete all children. This way also
actions with DCL commands will be stopped. As before the CtrlY handler
then sends SIGQUIT to itself, which is handled in common code.
Temporary command files are now deleted in the OpenVMS child termination
handler. That deletes them even if a CTRL+C was pressed.
TODO: Does the previous section about >> leaving files still apply?
The behavior of pressing CTRL+C is not changed. It still has only an effect,
after the current action is terminated. If that doesn't happen or takes too
long, CTRL+Y should be used instead.
Build Options:
Added support to have case sensitive targets and dependencies but to
still use case blind file names. This is especially useful for Java
makefiles on VMS:
<TAB>.SUFFIXES :
<TAB>.SUFFIXES : .class .java
<TAB>.java.class :
<TAB><TAB>javac "$<"
<TAB>HelloWorld.class : HelloWorld.java
A new macro WANT_CASE_SENSITIVE_TARGETS in config.h-vms was introduced.
It needs to be enabled to get this feature; default is disabled.
TODO: This should be a run-time setting based on if the process
has been set to case sensitive.
Unimplemented functionality:
The new feature "Loadable objects" is not yet supported. If you need it,
please send a change request or submit a bug report.
The new option --output-sync (-O) is accepted but has no effect: GNU Make
for OpenVMS does not support running multiple commands simultaneously.
Self test failures and todos:
-----------------------------
The test harness can not handle testing some of the VMS specific modes
because of the features needed for to be set for the Perl to run.
Need to find a way to set the VMS features before running make as a
child.
GNU Make was not currently translating the OpenVMS encoded POSIX values
returned to it back to the POSIX values. I have temporarily modified the
Perl test script to compensate for it. This should be being handled
internally to Make.
TODO: Verify and update the Perl test script.
The features/parallelism test was failing. OpenVMS is executing the rules
in sequence not in parallel as this feature was not implemented.
GNU Make on VMS no longer claims it is implemented.
TODO: Implement it.
Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
later.
Error messages should be suppressed with the "-" at the beginning of a line.
On openVMS they were showing up. TODO: Is this still an issue?
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
names correctly.
Build instructions:
-------------------
Don't use the HP C V7.2-001 compiler, which has an incompatible change
how __STDC__ is defined. This results at least in compile time warnings.
Make a 1st version
$ @makefile.com ! ignore any compiler and/or linker warning
$ copy make.exe 1st-make.exe
Use the 1st version to generate a 2nd version as a test.
$ mc sys$disk:[]1st-make clean ! ignore any file not found messages
$ mc sys$disk:[]1st-make
Verify your 2nd version by building Make again.
$ copy make.exe 2nd-make.exe
$ mc sys$disk:[]2nd-make clean
$ mc sys$disk:[]2nd-make
Running the tests:
------------------
Running the tests on OpenVMS requires the following software to be installed
as most of the tests are Unix oriented.
* Perl 5.18 or later.
https://sourceforge.net/projects/vmsperlkit/files/
* GNV 2.1.3 + Updates including a minimum of:
* Bash 4.3.30
* ld_tools 3.0.2
* coreutils 8.21
https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/
https://sourceforge.net/projects/gnv/files/
As the test scripts need to create some foreign commands that persist
after the test is run, it is recommend that either you use a sub-process or
a dedicated login to run the tests.
To get detailed information for running the tests:
$ set default [.tests]
$ @run_make_tests help
Running the script with no parameters will run all the tests.
After the the test script has been run once in a session, assuming
that you built make in sys$disk:[make], you can redefined the
"bin" logical name as follows:
$ define bin sys$disk:[make],gnv$gnu:[bin]
Then you can use Perl to run the scripts.
$ perl run_make_tests.pl
Acknowledgments:
----------------
See NEWS. for details of past changes.
These are the currently known contributors to this port.
Hartmut Becker
John Malmberg
Michael Gehre
John Eisenbraun
Klaus Kaempf
Mike Moretti
John W. Eaton

363
README.W32 Normal file
View File

@ -0,0 +1,363 @@
This version of GNU Make has been tested on:
Microsoft Windows 2000/XP/2003/Vista/7/8/10/11
It has also been used on Windows 95/98/NT, and on OS/2.
It builds with the MinGW port of GCC (tested with GCC 3.4.2, 4.8.1,
and 4.9.3).
It also builds with MSVC 2.x, 4.x, 5.x, 6.x, 2005, 2008, 2010, 2012,
2013, and 2015 as well as with .NET 7.x and .NET 2003.
Building with Guile is supported (tested with Guile 2.0.x). To build
with Guile, you will need, in addition to Guile itself, its dependency
libraries and the pkg-config program. The latter is used to figure out
which compilation and link switches and libraries need to be mentioned
on the compiler command lines to correctly link with Guile. A Windows
port of pkg-config can be found on ezwinports site:
https://sourceforge.net/projects/ezwinports/
The libraries on which Guile depends can vary depending on your
version and build of Guile. At the very least, the Boehm's GC library
will be needed, and typically also GNU MP, libffi, libunistring, and
libtool's libltdl. Whoever built the port of Guile you have should
also provide you with these dependencies or a URL where to download
them. A precompiled 32-bit Windows build of Guile is available from
the ezwinports site mentioned above.
The Windows port of GNU Make is maintained jointly by various people.
It was originally made by Rob Tulloh.
It is currently maintained by Eli Zaretskii.
Do this first, regardless of the build method you choose:
---------------------------------------------------------
1. If you have special requirements, edit config.h.W32 to your liking
(especially the shell-related defines, or HAVE_CASE_INSENSITIVE_FS which
corresponds to './configure --enable-case-insensitive-file-system'). We
don't recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
consider that if you have a lot of files whose names are in upper case,
while Makefile rules are written for lower-case versions.
If you don't have special requirements no changes are needed.
Building with (MinGW-)GCC using build_w32.bat
---------------------------------------------
2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
correct PATH and other environment variables for it, then execute ...
.\build_w32.bat gcc
This produces gnumake.exe in the GccRel directory.
If you want a version of GNU Make built with debugging enabled,
add the --debug option. Output goes into the GccDebug directory.
The batch file will probe for Guile installation, and will build
gnumake.exe with Guile if it finds it. If you have Guile
installed, but want to build Make without Guile support, type
.\build_w32.bat --without-guile gcc
Building with (MSVC++-)cl using build_w32.bat
---------------------------------------------
2. Open a command shell, then execute ...
.\build_w32.bat
This produces a 64bit Release build of gnumake.exe in .\WinRel, using
the compiler found on the %Path%. If no compiler is found, the batch
file will probe your system and choose the newest MSVC version it can
find.
If you want a 32bit version of GNU Make, add the --x86 option.
If you want a Debug build of GNU Make, add the --debug option. Output
will go into the .\WinDebug directory.
The batch file will probe for Guile installation, and will build
gnumake.exe with Guile if it finds it. If Guile is installed,
but you prefer to build GNU Make without Guile support, add the
--without-guile option.
Building with (MinGW-)GCC using GNU Make
----------------------------------------
2. If you already have a version of GNU Make available you can use it
to build this version. Open a W32 command prompt for your installed
(MinGW-)GCC, setup a correct PATH and other environment variables
for it, then execute ...
make -f Basic.mk TOOLCHAIN=gcc
This produces GccRel\gnumake.exe.
If you want a version of GNU Make built with debugging enabled,
add the TARGET_TYPE=debug option:
make -f Basic.mk TOOLCHAIN=gcc TARGET_TYPE=debug
The makefile doesn't support Guile integration. Use build_w32.bat
if you want to build with Guile support.
Building with (MSVC++-)cl using GNU Make
----------------------------------------
2. If you already have a version of GNU Make available you can use it
to build this version. Open a W32 command prompt for your installed
(MSVC++-)cl, setup a correct PATH and other environment variables
for it (usually via executing vcvars32.bat or vsvars32.bat from the
cl-installation, or using a corresponding start menu entry from the
cl-installation), then execute ...
make -f Basic.mk
This produces an optimized WinRel/gnumake.exe.
If you want a version of GNU Make built with debugging enabled,
add the TARGET_TYPE=debug option:
make -f Basic.mk TARGET_TYPE=debug
The makefile doesn't support Guile integration. Use build_w32.bat
if you want to build with Guile support.
Running the test suite
----------------------
3. You will need an installation of Perl. Be sure to use a relatively
modern version: older versions will sometimes throw spurious errors.
To run the suite after building using GNU Make, use:
make -f Basic.mk check
Alternatively if you'd like to run tests by hand, use:
cd tests
.\run_make_tests.bat -make <path-to-make>
I've found <path-to-make> seems to want forward-slashes in the path.
For example if building with .\build_w32.bat non-debug, use:
cd tests
.\run_make_tests.bat -make ../WinRel/gnumake.exe
I've tested this with the MSYS2 shell and POSIX tools installation
that you get by installing Git for Windows.
-------------------
-- Notes/Caveats --
-------------------
GNU Make on Windows 32-bit platforms:
This version of make is ported natively to Windows32 platforms
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
Windows 95, and Windows 98). It does not rely on any 3rd party
software or add-on packages for building. The only thing
needed is a Windows compiler. Two compilers supported
officially are the MinGW port of GNU GCC, and the various
versions of the Microsoft C compiler.
Do not confuse this port of GNU Make with other Windows32 projects
which provide a GNU Make binary. These are separate projects
and are not connected to this port effort.
GNU Make and sh.exe:
This port prefers if you have a working sh.exe somewhere on
your system. If you don't have sh.exe, the port falls back to
MSDOS mode for launching programs (via a batch file). The
MSDOS mode style execution has not been tested that carefully
though (The author uses GNU bash as sh.exe).
There are very few true ports of Bourne shell for NT right now.
There is a version of GNU bash available from Cygnus "Cygwin"
porting effort (https://www.cygwin.com/).
Other possibilities are the MKS version of sh.exe, or building
your own with a package like NutCracker (DataFocus) or Portage
(Consensys). Also MinGW includes sh.
GNU Make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
Some versions of Bourne shell do not behave well when invoked
as 'sh -c' from CreateProcess(). The main problem is they seem
to have a hard time handling quoted strings correctly. This can
be circumvented by writing commands to be executed to a batch
file and then executing the command by calling 'sh file'.
To work around this difficulty, this version of make supports
a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
time, make forces all command lines to be executed via script
files instead of by command line. In this mode you must have a
working sh.exe in order to use parallel builds (-j).
A native Windows32 system with no Bourne shell will also run
in batch mode. All command lines will be put into batch files
and executed via $(COMSPEC) (%COMSPEC%). However, parallel
builds ARE supported with Windows shells (cmd.exe and
command.com). See the next section about some peculiarities
of parallel builds on Windows.
Support for parallel builds
Parallel builds (-jN) are supported in this port. The number of
concurrent processes has a hard limit of 4095.
GNU Make and Cygnus GNU Windows32 tools:
Good news! Make now has native support for Cygwin sh. To enable,
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
from scratch. This version of make tested with B20.1 of Cygwin.
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
GNU Make and the MKS shell:
There is now semi-official support for the MKS shell. To turn this
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
on HAVE_MKS_SHELL.
GNU Make handling of drive letters in pathnames (PATH, vpath, VPATH):
There is a caveat that should be noted with respect to handling
single character pathnames on Windows systems. When colon is
used in PATH variables, make tries to be smart about knowing when
you are using colon as a separator versus colon as a drive
letter. Unfortunately, something as simple as the string 'x:/'
could be interpreted 2 ways: (x and /) or (x:/).
Make chooses to interpret a letter plus colon (e.g. x:/) as a
drive letter pathname. If it is necessary to use single
character directories in paths (VPATH, vpath, Path, PATH), the
user must do one of two things:
a. Use semicolon as the separator to disambiguate colon. For
example use 'x;/' if you want to say 'x' and '/' are
separate components.
b. Qualify the directory name so that there is more than
one character in the path(s) used. For example, none
of these settings are ambiguous:
./x:./y
/some/path/x:/some/path/y
x:/some/path/x:x:/some/path/y
Please note that you are free to mix colon and semi-colon in the
specification of paths. Make is able to figure out the intended
result and convert the paths internally to the format needed
when interacting with the operating system, providing the path
is not within quotes, e.g. "x:/test/test.c".
You are encouraged to use colon as the separator character.
This should ease the pain of deciding how to handle various path
problems which exist between platforms. If colon is used on
both Unix and Windows systems, then no ifdef'ing will be
necessary in the makefile source.
Pathnames and white space:
Unlike Unix, Windows 95/NT systems encourage pathnames which
contain white space (e.g. C:\Program Files\). These sorts of
pathnames are valid on Unix too, but are never encouraged.
There is at least one place in make (VPATH/vpath handling) where
paths containing white space will simply not work. There may be
others too. I chose to not try and port make in such a way so
that these sorts of paths could be handled. I offer these
suggestions as workarounds:
1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
"x:\longpathtest". Type "dir /x" to view these filenames
within the cmd.exe shell.
2. Rename the directory so it does not contain white space.
If you are unhappy with this choice, this is free software
and you are free to take a crack at making this work. The code
in w32/pathstuff.c and vpath.c would be the places to start.
Pathnames and Case insensitivity:
Unlike Unix, Windows 95/NT systems are case insensitive but case
preserving. For example if you tell the file system to create a
file named "Target", it will preserve the case. Subsequent access to
the file with other case permutations will succeed (i.e. opening a
file named "target" or "TARGET" will open the file "Target").
By default, GNU Make retains its case sensitivity when comparing
target names and existing files or directories. It can be
configured, however, into a case preserving and case insensitive
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
config.h.W32.
For example, the following makefile will create a file named
Target in the directory subdir which will subsequently be used
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
will not be made:
subdir/Target:
touch $@
SUBDIR/DepTarget: SubDir/TARGET
cp $^ $@
Reliance on this behavior also eliminates the ability of GNU Make
to use case in comparison of matching rules. For example, it is
not possible to set up a C++ rule using %.C that is different
than a C rule using %.c. GNU Make will consider these to be the
same rule and will issue a warning.
SAMBA/NTFS/VFAT:
I have not had any success building the debug version of this
package using SAMBA as my file server. The reason seems to be
related to the way VC++ 4.0 changes the case name of the pdb
filename it is passed on the command line. It seems to change
the name always to to lower case. I contend that the VC++
compiler should not change the casename of files that are passed
as arguments on the command line. I don't think this was a
problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
The package builds fine on VFAT and NTFS filesystems.
Most all of the development I have done to date has been using
NTFS and long file names. I have not done any considerable work
under VFAT. VFAT users may wish to be aware that this port of
make does respect case sensitivity.
FAT:
Version 3.76 added support for FAT filesystems. Make works
around some difficulties with stat'ing of files and caching of
filenames and directories internally.
Bug reports:
Please submit bugs via the normal bug reporting mechanism which
is described in the GNU Make manual and the base README.
-------------------------------------------------------------------------------
Copyright (C) 1996-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

112
README.customs Normal file
View File

@ -0,0 +1,112 @@
-*-indented-text-*-
GNU Make can utilize the Customs library, distributed with Pmake, to
provide builds distributed across multiple hosts.
In order to utilize this capability, you must first download and build
the Customs library. It is contained in the Pmake distribution, which
can be obtained at:
ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/
This integration was tested (superficially) with Pmake 2.1.33.
BUILDING CUSTOMS
----------------
First, build pmake and Customs. You need to build pmake first, because
Customs require pmake to build. Unfortunately, this is not trivial;
please see the pmake and Customs documentation for details. The best
place to look for instructions is in the pmake-2.1.33/INSTALL file.
Note that the 2.1.33 Pmake distribution comes with a set of patches to
GNU Make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
patches are based on GNU Make 3.75 (there are patches for earlier
versions of GNU Make, also). The parts of this patchfile which relate
directly to Customs support have already been incorporated into this
version of GNU Make, so you should _NOT_ apply the patch file.
However, there are a few non-Customs specific (as far as I could tell)
changes here which are not incorporated (for example, the modification
to try expanding -lfoo to libfoo.so). If you rely on these changes
you'll need to re-apply them by hand.
Install the Customs library and header files according to the
documentation. You should also install the man pages (contrary to
comments in the documentation, they weren't installed automatically for
me; I had to cd to the 'pmake-2.1.33/doc' directory and run 'pmake
install' there directly).
BUILDING GNU MAKE
-----------------
Once you've installed Customs, you can build GNU Make to use it. When
configuring GNU Make, merely use the '--with-customs=DIR' option.
Provide the directory containing the 'lib' and 'include/customs'
subdirectories as DIR. For example, if you installed the customs
library in /usr/local/lib and the headers in /usr/local/include/customs,
then you'd pass '--with-customs=/usr/local' as an option to configure.
Run make (or use build.sh) normally to build GNU Make as described in
the INSTALL file.
See the documentation for Customs for information on starting and
configuring Customs.
INVOKING CUSTOMS-IZED GNU MAKE
-----------------------------
One thing you should be aware of is that the default build environment
for Customs requires root permissions. Practically, this means that GNU
make must be installed setuid root to use Customs.
If you don't want to do this, you can build Customs such that root
permissions are not necessary. Andreas Stolcke <stolcke@speech.sri.com>
writes:
> pmake, gnumake or any other customs client program is not required to
> be suid root if customs was compiled WITHOUT the USE_RESERVED_PORTS
> option in customs/config.h. Make sure the "customs" service in
> /etc/services is defined accordingly (port 8231 instead of 1001).
> Not using USE_RESERVED_PORTS means that a user with programming
> skills could impersonate another user by writing a fake customs
> client that pretends to be someone other than himself. See the
> discussion in etc/SECURITY.
PROBLEMS
--------
SunOS 4.1.x:
The customs/sprite.h header file #includes the <malloc.h> header
files; this conflicts with GNU Make's configuration so you'll get a
compile error if you use GCC (or any other ANSI-capable C compiler).
I commented out the #include in sprite.h:107:
#if defined(sun) || defined(ultrix) || defined(hpux) || defined(sgi)
/* #include <malloc.h> */
#else
YMMV.
-------------------------------------------------------------------------------
Copyright (C) 1998-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

409
README.git Normal file
View File

@ -0,0 +1,409 @@
-*-text-*-
-------------------------------------------------------------------------------
Copyright (C) 2002-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
-------------------------------------------------------------------------------
Obtaining Git Code
------------------
This seems redundant, since if you're reading this you most likely have
already performed this step; however, for completeness, you can obtain the GNU
make source code via Git from the FSF's Savannah project
<https://savannah.gnu.org/projects/make/>:
$ git clone git://git.savannah.gnu.org/make.git
Changes using Git
-----------------
If you do not have push privileges to the GNU Make Git repository, see the
README file section "Submitting Patches" for information.
If you have push privileges to the GNU Make Git repository keep this
information in mind:
Starting with GNU Make 4.0 we no longer keep a separate ChangeLog file in
source control. We use the Gnulib git-to-changelog conversion script to
convert the Git comments into ChangeLog-style entries for release. As a
result, please format your Git comments carefully so they will look clean
after conversion. In particular, each line of your comment will have a TAB
added before it so be sure your comment lines are not longer than 72
characters; prefer 70 or less. Please use standard ChangeLog formats for
your commit messages (sans the leading TAB of course).
Rule #1: Don't rewrite pushed history on master (no "git push --force").
Rule #2: Feel free to rewrite pushed history on personal branches.
Rule #3: Squash-merge or rebase + merge --ff-only, rather than merging from
personal branches into master.
Typical simple workflow might be:
* Edit files / make / make check
* Use "git status" and "git diff" to verify your changes
* Use "git add" to stage the changes you want to make
* Use "git commit" to commit the staged changes to your local repository
* Use "git pull -r" to accept new changes from the upstream repository
* Use "git push" to push your commits back to the upstream repository
For Emacs users, there are many options for Git integration but I strongly
recommend Magit: https://magit.vc/ It makes the workflow much clearer, and
has advanced features such as constructing multiple commits from various files
and even from different diff chunks in the same file. There is a video
available which helps a lot.
Coding Standards
----------------
GNU Make code adheres to the GNU Coding Standards. Please use only spaces and
no TAB characters in source code.
Additionally, GNU Make is a foundational bootstrap package for the GNU
project; as such it is conservative about language features it expects.
However, GNU Make does rely on the Gnulib portability library, and Gnulib
currently requires a ISO C99 compiler. So features in ISO C99 can be
assumed.
Building From Git for POSIX
---------------------------
To build GNU Make from Git on POSIX systems such as GNU/Linux, you will
need to install the following extra software:
* autoconf >= 2.69
* automake >= 1.16.1
* autopoint
* texinfo (for makeinfo)
* gettext
* pkg-config
* GCC
* GNU Make (POSIX make is not sufficient)
And any tools that those utilities require (GNU m4, etc.)
To run the tests you must install Perl.
To create dist files you will additionally need:
* lzip (to create tar.lz dist files)
* texlive (or some other TeX package)
GNU Make requires Gnulib to provide some facilities. If you want to maintain
a local installation of gnulib you can set GNULIB_SRCDIR to point to it.
Otherwise, ./bootstrap will obtain a clone for you.
Due to issues with gnulib's getloadavg, you must have automake 1.16.1 or
above. This version may not yet be available through GNU/Linux package
managers. If you need to install from source be sure to set ACLOCAL_PATH to
point to the pkg-config location (e.g., /usr/share/aclocal).
If you want to build from Git with a non-GCC compiler, add "MAKE_CFLAGS=" to
your make command line (or at least remove any flags your compiler does not
support).
When building from Git you must build in the source directory: "VPATH
builds" from remote directories are not supported. Once you've created
a distribution, of course, you can unpack it and do a VPATH build from
there.
After checking out the code, you will need to run the bootstrap script:
$ ./bootstrap
Alternatively you can just pull content from remote locations with:
$ ./bootstrap --pull
And/or just re-generate auto-generatable files with:
$ ./bootstrap --gen
(Running ./bootstrap does both in one step.)
At this point you have successfully brought your Git copy of the GNU
make source directory up to the point where it can be treated
more-or-less like the official package you would get from ftp.gnu.org.
That is, you can just run:
$ ./configure
$ make check
to build and test GNU Make.
NOTE! This method builds GNU Make in "maintainer mode". Make programs built
in this mode will be slower, possibly MUCH slower: there are various
sanity checks enabled. Further this mode assumes a modern GCC, GNU
libc, and well-formed system headers and enables a high level of
warnings AND enables -Werror to turn warnings into failures.
If you want to build from Git with "maintainer mode" disabled, add
"MAKE_MAINTAINER_MODE=" to the make command line. If you want to turn
off the extra warning flags, add "MAKE_CFLAGS=" to the make command
line. If you want to keep the warnings but not fail, add
"EXTRA_CFLAGS=-Wno-error" to the make command line.
For example:
$ ./configure
$ make check MAKE_MAINTAINER_MODE= MAKE_CFLAGS=
$ make install
Building From Git for Windows
-----------------------------
If you have a UNIX emulation like CYGWIN you can opt to run the general build
procedure above; it will work. Consult README.W32 for information on options
you might want to use when running ./configure.
If you can't or don't want to do that, then first run the .\bootstrap.bat
script to "prime" your Git workspace:
> .\bootstrap.bat
Next, follow the instructions in the README.W32 file.
Note, neither of these methods are tested regularly by the GNU Make
maintainers. Building for Windows from a distribution tarball IS tested
regularly.
NOTE! "Maintainer mode" (see above) IS ENABLED when building from Git using
the build_w32.bat file.
Debugging and Testing
---------------------
These instructions have been tested on GNU systems. I have no idea if they
work on non-GNU systems (Windows, MacOS, etc.)
* Alternate Configurations:
The maintMakefile has a rule for running configure with various different
options, with and without packages. Run:
make check-alt-config
* Valgrind:
You can run all tests under valgrind by passing the -memcheck option:
(cd tests && ./run_make_tests -make ../make -memcheck)
Note, this is slow! Also some tests will fail because of invoking valgrind.
* ASAN:
You can build with ASAN and run tests, like this:
make clean
make -j8 CFLAGS='-ggdb3 -fsanitize=address' LDFLAGS='-ggdb3 -fsanitize=address'
Then to check for corruption only but not memory leaks run:
ASAN_OPTIONS='detect_stack_after_use_return=true:detect_leaks=false' make check
To check for leaks too run:
make check
Note that ASAN is reporting many more errors than valgrind. I don't know
which one is wrong: I haven't looked at them closely.
Creating a Package
------------------
Once you have performed the above steps (including the configuration and
build) you can create a GNU Make package. This is very simple, just
run:
$ make dist-gzip
and, if you like:
$ make dist-lzip
Even better, you should run this:
$ make distcheck
Which will build both .gz and .lz package files, then unpack one into a
temporary location, try to build it and repack it, then verifying that
everything works, you get the same results, _and_ no extraneous files are
left over after the "distclean" rule.
This package can be unpacked and built to give a "normal" (non-maintainer
mode) result.
Steps to Release
----------------
Here are the things that need to be done (in more or less this order)
before making an official release. If something breaks such that you need to
change code, be sure to start over again sufficiently that everything is
consistent (that's why we don't finalize the Git tag, etc. until the end).
* Update the configure.ac file with the new release number.
* Update the EDITION value in the doc/make.texi file.
* Update the doc/make.1 file with the release date.
* Update the NEWS file with the release number and date.
* Ensure the Savannah bug list URL in the NEWS file uses the correct
"Fixed Release" ID number.
* Run "make distcheck" to be sure it all works.
* Run "make check-alt-config" to be sure alternative configurations work
* run "make tag-release" to create a Git tag for the release
* Push everything:
git push --tags origin master
The safest thing is to create an entirely new repository and build the final
package from there:
git clone git://git.savannah.gnu.org/make.git make-release
cd make-release
If you don't want to create a new repository then run "git clean -fdx".
Then:
./bootstrap
./configure
make distcheck
Perform test builds on whichever systems you have access to.
Use a previous announcement as a template to create an announcement in a text
file then sign it with GPG:
gpg --clearsign <announcement.txt>
Or, use your mail client's PGP/GPG signing capabilities.
NOTE! In order to publish a package on the FSF FTP site you need to have my
GPG private key, and my passphrase to unlock it.
Depending on your distribution (whether GnuPG is integrated with your
keyring etc.) the upload operation will either pop up a window asking
for the GPG key passphrase one time, or else it will use the CLI to ask
for the GPG passphrase _THREE_ times. Sigh.
Publishing a Release Candidate
------------------------------
Usually I publish one or two release candidates for people to test before
making an official release. Release candidates use a GNU numbering scheme,
which add a ".9x" release number to the PREVIOUS major release. So the first
release candidate for GNU Make 4.4 would be GNU Make 4.3.90, the second
release candidate would be 4.3.91, etc.
Upload a release candidate using:
make upload-alpha
Announce a release candidate to these mailing lists:
To: bug-make@gnu.org
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
You will have to approve the BCC's on the mailing list admin sites. Send
separate copies to (don't use CC as replies will go to these lists):
* coordinator@translationproject.org
* platform-testers@gnu.org
Publishing a Release
--------------------
When publishing a final release there are extra steps that need to be taken:
* Run "make update-makeweb" to get a copy of the GNU Make web pages
* Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
* Update the web page boilerplate if necessary:
( cd ~/src/make/make-web \
&& ~/src/gnu-www/www/server/standards/patch-from-parent \
make.html \
~/src/gnu-www/www/server/standards/boilerplate.html )
* Run "make gendocs" (requires gnulib) to generate the manual files for
the GNU Make web pages.
* Follow the directions from gendocs for the web page repository
Manage the Savannah project for GNU Make:
* In Savannah edit the "Component Version" field and choose the "SCM" entry.
Modify the "Value", "Rank", and "Description" values for the to refer to
the new release. The "Rank" field should be 10 less than the previous
release so it orders properly.
* In Savannah edit the "Fixed Release" field and choose the "SCM" entry.
Modify the "Value", "Rank", and "Description" values for the to refer to
the new release. The "Rank" field should be 10 less than the previous
release so it orders properly.
* In Savannah create a new entry for the "Component Version" field:
- Value: SCM
- Rank: 20
- Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
* In Savannah create a new entry for the "Fix Release" field:
- Value: SCM
- Rank: 20
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU Make.
Upload a release using:
make upload-ftp
Announce a release to these mailing lists:
To: info-gnu@gnu.org, bug-make@gnu.org
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
You will have to approve the BCC's on the mailing list admin sites. Send
separate copies to (don't use CC as replies will go to these lists):
* coordinator@translationproject.org
* platform-testers@gnu.org
Announce on Savannah:
* Add a news item to the Savannah project site.
Start the next release:
* Update configure.ac and add a ".90" to the release number.
* Update the NEWS file with a new section for the release / date.
* Update the Savannah URL for the bugs fixed in the NEWS section.
Appendix A - For The Brave
--------------------------
For those of you who trust me implicitly, or are just brave (or
foolhardy), here is a canned sequence of commands to build a GNU Make
distribution package from a virgin Git source checkout (assuming all the
prerequisites are available of course).
This list is eminently suitable for a quick swipe o' the mouse and a
swift click o' mouse-2 into an xterm. Go for it!
For a debugging version:
./bootstrap && ./configure CFLAGS=-g && make check
For an optimized version
./bootstrap && ./configure && make check

216
README.in Normal file
View File

@ -0,0 +1,216 @@
This directory contains the @PACKAGE_VERSION@ release of @PACKAGE_NAME@.
See the file NEWS for the user-visible changes from previous releases.
In addition, there have been bugs fixed.
>> If you are trying to build GNU Make from a Git clone rather than a
>> downloaded source distribution, see the README.git file for instructions.
Please check the system-specific notes below for any caveats related to your
operating system.
This README assumes you are building on a POSIX-based operating system.
For ports to other operating systems please see the system-specific README
files, as described in the "Ports" section below.
For source distribution building and installation instructions, see the file
INSTALL.
If you need to build GNU Make and have no other 'make' program to use, you can
use the shell script 'build.sh' instead. To do this, first run 'configure' as
described in INSTALL. Then, instead of typing 'make' to build the program,
type 'sh build.sh'. This will compile the program in the current directory.
Then you will have a 'make' program that you can use for './make install', or
whatever else.
Some systems' 'make' programs cannot process the Makefile for GNU Make.
If you get errors from your system's 'make' when building GNU Make, try using
'build.sh' instead.
GNU Make is free software. See the file COPYING for copying conditions.
GNU Make is copyright by the Free Software Foundation. Copyright notices
condense sequential years into a range; e.g. "1987-1994" means all years
from 1987 to 1994 inclusive.
Downloading
-----------
GNU Make can be obtained in many different ways. See a description here:
https://www.gnu.org/software/software.html
Documentation
-------------
GNU Make is fully documented in the GNU Make manual, which is contained in
this distribution as the file make.texi. You can also find on-line and
preformatted (PostScript and DVI) versions at the FSF's web site. There is
information there about ordering hardcopy documentation.
https://www.gnu.org/
https://www.gnu.org/doc/doc.html
https://www.gnu.org/manual/manual.html
Development
-----------
GNU Make development is hosted by Savannah, the FSF's online development
management tool. Savannah is here:
https://savannah.gnu.org
And the GNU Make development page is here:
https://savannah.gnu.org/projects/make/
You can find most information concerning the development of GNU Make at
this site.
Regression Tests
----------------
GNU Make contains a suite of regression tests. To run them use "make check"
after building GNU Make. If they fail a tar package will be created
containing useful information, which can be emailed (as an attachment) to
the <bug-make@gnu.org> mailing list.
Please note that since these tests rely on known-good-output comparisons,
they can show spurious failures on some systems (particularly non-POSIX systems
such as Windows).
Bug Reporting
-------------
If you need help using GNU Make, try asking on <help-make@gnu.org>.
If you found a bug, you can send a bug reports to <bug-make@gnu.org>.
Please see the section of the GNU Make manual entitled 'Problems and Bugs'
for information on submitting useful and complete bug reports.
You do not need to subscribe to these lists first.
You can also use the online bug tracking system in the Savannah GNU Make
project to submit new problem reports or search for existing ones:
https://savannah.gnu.org/bugs/?group=make
We prefer to use the bug tracking system ONLY for bugs or enhancements,
not for help requests: please use the mailing lists to get help.
Submitting Patches
------------------
If you'd like to propose a change to GNU Make, you can provide a patch with
your changes. If you are making your changes in a Git workspace you can run
"git format-patch" to create a patch file. If not, you can use the diff(1)
utility to create a patch file; please use "diff -u".
Once you have a patch you can submit it in any of these ways:
* Create a bug on Savannah and add the patch as an attachment:
https://savannah.gnu.org/bugs/?group=make&func=additem
* Send the patch via email to <bug-make@gnu.org>: be sure to add it as an
attachment to avoid interference by email processors.
All non-trivial changes require FSF copyright paperwork to be completed
before they can be accepted. Contact <bug-make@gnu.org> for help.
Git Access
----------
The GNU Make source repository is available via Git from the GNU Savannah Git
server; look here for details:
https://savannah.gnu.org/git/?group=make
Please note: you won't be able to build GNU Make from Git without installing
appropriate maintainer's tools, such as GNU m4, automake, autoconf, Perl, GNU
make, and GCC.
See the README.git file for instructions on how to build GNU Make once these
tools are available. We make no guarantees about the contents or quality of
the latest code in the Git repository: it is not unheard of for code that is
known to be broken to be checked in. Use at your own risk.
System-specific Notes
---------------------
One area that is often a problem in configuration and porting is the code
to check the system's current load average. To make it easier to test and
debug this code, you can do 'make check-loadavg' to see if it works
properly on your system. (You must run 'configure' beforehand, but you
need not build 'make' itself to run this test.)
Another potential source of porting problems is the support for large
files (LFS) in configure for those operating systems that provide it.
Please report any bugs that you find in this area. If you run into
difficulties, then as a workaround you should be able to disable LFS by
adding the '--disable-largefile' option to the 'configure' script.
On systems that support micro- and nano-second timestamp values and
where stat(2) provides this information, GNU Make will use it when
comparing timestamps to get the most accurate possible result. However,
note that many current implementations of tools that *set* timestamps do
not preserve micro- or nano-second granularity. This means that "cp -p"
and other similar tools (tar, etc.) may not exactly duplicate timestamps
with micro- and nano-second granularity on some systems. If your build
system contains rules that depend on proper behavior of tools like "cp
-p", you should consider using the .LOW_RESOLUTION_TIME pseudo-target to
force make to treat them properly. See the manual for details.
Ports
-----
- See README.customs for details on integrating GNU Make with the
Customs distributed build environment from the Pmake distribution.
- See README.VMS for details about GNU Make on OpenVMS.
- See README.zOS for details about GNU Make on z/OS.
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
using DJGPP tools.
A precompiled binary of the MSDOS port of GNU Make is available as part
of DJGPP; see the WWW page https://www.delorie.com/djgpp/ for more
information.
The Cygwin project maintains its own port of GNU Make. That port may have
patches which are not present in this version. If you are using Cygwin
you should use their version of GNU Make, and if you have questions about
it you should start by asking on those mailing lists and forums.
Please note there are two _separate_ ports of GNU Make for Microsoft
systems: a native Windows port built with (for example) MSVC or MinGW,
and a DOS-based port built with DJGPP. Please be sure you are looking
at the right README!
-------------------------------------------------------------------------------
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

83
README.zOS Normal file
View File

@ -0,0 +1,83 @@
-*-text-*-
GNU Make has been ported to z/OS, tested on z/OS V2R4.
PREREQUISITES
-------------
Building GNU Make requires certain tools be installed on your z/OS system.
These tools can be downloaded from: https://github.com/ZOSOpenTools
For detailed instructions on how to set up these tools, visit
https://zosopentools.github.io/meta/#/Guides/Pre-req
You will need curl, tar, and gzip to download and unpack the GNU Make release
package, but presumably you've already worked this out if you're reading this
document!
You will need the IBM C/C++ compiler. You can download a web deliverable
add-on feature to your XL C/C++ compiler here:
https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/xlCC++V241ForZOsV24
Alternatively, you can install and manage C/C++ for Open Enterprise Languages
on z/OS using RedHat OpenShift Container Platform and IBM Z and Cloud
Modernization Stack.
GNU Make has a dependency on the ZOSLIB library, which is documented here:
https://zosopentools.github.io/meta/#/Guides/Zoslib.
To obtain the latest release of zoslib, you can download it from here:
https://github.com/ZOSOpenTools/zoslibport/releases.
BUILDING
--------
If you are trying to build from a checked-out Git workspace, see README.git.
Before building GNU Make, you will need to ensure that the following
environment variables are set, to turn on z/OS enhanced ASCII support:
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="$_CEE_RUNOPTS FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
To ensure proper functioning of xlclang, set the following environment
variables before building:
export _CC_CCMODE=1
export _C89_CCMODE=1
export _CXX_CCMODE=1
Set PATH_TO_ZOSLIB to the location of your zoslib installation; e.g.:
PATH_TO_ZOSLIB=$HOME/zopen/prod/zoslib
Invoke ./configure as follows:
./configure \
CC=xlclang \
CPPFLAGS="-DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFF -DZOSLIB_OVERRIDE_CLIB=1" \
CFLAGS="-qascii -std=gnu11 -qnocsect -qenum=int -I$PATH_TO_ZOSLIB/include" \
LDFLAGS="-L$PATH_TO_ZOSLIB/lib" \
LIBS="-lzoslib $PATH_TO_ZOSLIB/lib/CXXRT64.x"
If you have an instance of make already available you can build with:
make
If not, you can build with:
./build.sh
TESTING
-------
To run the regression tests you'll need to install Perl and enable it.
Then you can run:
./make check
INSTALLING
----------
Copy the "make" program to wherever you want it to be installed, on your PATH.

117
TODO.private Normal file
View File

@ -0,0 +1,117 @@
-*-Indented-Text-*-
GNU Make TODO List
------------------
This list comes both from the authors and from users of GNU make.
They are listed in no particular order!
Also, I don't guarantee that all of them will be ultimately deemed "good
ideas" and implemented. These are just the ones that, at first blush,
seem to have some merit (and that I can remember).
However, if you see something here you really, really want, speak up.
All other things being equal, I will tend to implement things that seem
to maximize user satisfaction.
If you want to implement some of them yourself, barring the ones I've
marked below, have at it! Please contact me first to let me know you're
working on it, and give me some info about the design--and, critically,
information about any user-visible syntax change, etc.
The Top Item
------------
If you know perl (or want to learn DejaGNU or similar), the number one
priority on my list of things I don't have time to do right now is
fixing up the GNU make test suite. Most importantly it needs to be made
"parallelizable", so more than one regression can run at the same time
(essentially, make the "work" directory local). Also, the CWD during
the test should be in the work directory or, better, a test-specific
temporary directory so each test gets a new directory; right now
sometimes tests leak files into the main directory which causes
subsequent tests to fail (some tests may need to be tweaked). Beyond
that, any cleanup done to make writing, reading, or handling tests
simpler would be great! Please feel free to make whatever changes you
like to the current tests, given some high-level goals, and that you'll
port the current tests to whatever you do :).
The Rest of the List
--------------------
1) Option to check more than timestamps to determine if targets have
changed. This is also a very big one. It's _close_ to my plate :),
and I have very definite ideas about how I would like it done.
Please pick something else unless you must have this feature. If
you try it, please work _extremely_ closely with me on it.
1a) Possibly a special case of this is the .KEEP_STATE feature of Sun's
make. Some great folks at W U. in Canada did an implementation of
this for a class project. Their approach is reasonable and
workable, but doesn't really fit into my ideas for #2. Maybe
that's OK. I have paperwork for their work so if you want to do
this one talk to me to get what they've already done.
[K R Praveen <praveen@cair.res.in>]
2) Currently you can use "%.foo %.bar : %.baz" to mean that one
invocation of the rule builds both targets. GNU make needs a way to
do that for explicit rules, too. I heard a rumor that some versions
of make all you to say "a.foo + a.bar : a.baz" to do this (i.e., a
"+" means one invocation builds both). Don't know if this is the
best syntax or not... what if you say "a.foo + a.bar a.bam : a.baz";
what does that mean?
3) Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o,
etc., or something like that). Maybe using regex?
4) Provide a .TARGETS variable, containing the names of the targets
defined in the makefile.
Actually, I now think a $(targets ...) function, at least, might be
better than a MAKETARGETS variable. The argument would be types of
targets to list: "phony" is the most useful one. I suppose
"default" might also be useful. Maybe some others; check the
bitfields to see what might be handy.
5) Some sort of operating-system independent way of handling paths
would be outstanding, so makefiles can be written for UNIX, VMS,
DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
Or, perhaps related/instead of, some sort of meta-quoting syntax so
make can deal with filenames containing spaces, colons, etc. I
dunno, maybe something like $[...]? This may well not be worth
doing until #1 is done.
6) Right now the .PRECIOUS, .INTERMEDIATE, and .SECONDARY
pseudo-targets have different capabilities. For example, .PRECIOUS
can take a "%", the others can't. Etc. These should all work the
same, insofar as that makes sense.
7) Improved debugging/logging/etc. capabilities. Part of this is done:
I introduced a number of debugging enhancements. Tim Magill is (I
think) looking into options to control output more selectively.
One thing I want to do in debugging is add a flag to allow debugging
of variables as they're expanded (!). This would be incredibly
verbose, but could be invaluable when nothing else seems to work and
you just can't figure it out. The way variables are expanded now
means this isn't 100% trivial, but it probably won't be hard.
-------------------------------------------------------------------------------
Copyright (C) 1997-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

39
autogen.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
# Convenience script for regenerating all autogeneratable files that are
# omitted from the version control repository. In particular, this script
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
# with new versions of autoconf or automake.
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as top/autogen.sh in gnulib. However, to be
# useful to your package, you should place a copy of it under version
# control in the top-level directory of your package. The intent is
# that all customization can be done with a bootstrap.conf file also
# maintained in your version control; gnulib comes with a template
# build-aux/bootstrap.conf to get you started.
#
# Alternatively, you can use an autogen.sh script that is specific
# to your package.
me="$0"
medir=`dirname "$me"`
# Read the function library and the configuration.
. "$medir"/bootstrap-funclib.sh
autogen "$@"

37
autopull.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
# Convenience script for fetching auxiliary files that are omitted from
# the version control repository of this package.
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as top/autopull.sh in gnulib. However, to be
# useful to your package, you should place a copy of it under version
# control in the top-level directory of your package. The intent is
# that all customization can be done with a bootstrap.conf file also
# maintained in your version control; gnulib comes with a template
# build-aux/bootstrap.conf to get you started.
#
# Alternatively, you can use an autopull.sh script that is specific
# to your package.
me="$0"
medir=`dirname "$me"`
# Read the function library and the configuration.
. "$medir"/bootstrap-funclib.sh
autopull "$@"

226
bootstrap Executable file
View File

@ -0,0 +1,226 @@
#! /bin/sh
# Bootstrap this package from checked-out sources.
scriptversion=2022-12-27.07; # UTC
# Copyright (C) 2003-2023 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as top/bootstrap in gnulib. However, to be
# useful to your package, you should place a copy of it under version
# control in the top-level directory of your package. The intent is
# that all customization can be done with a bootstrap.conf file also
# maintained in your version control; gnulib comes with a template
# build-aux/bootstrap.conf to get you started.
# Please report bugs or propose patches to bug-gnulib@gnu.org.
me="$0"
medir=`dirname "$me"`
# Read the function library and the configuration.
. "$medir"/bootstrap-funclib.sh
usage() {
cat <<EOF
Usage: $me [OPTION]...
Bootstrap this package from the checked-out sources.
Optional environment variables:
GNULIB_SRCDIR Specifies the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again.
GNULIB_URL Cloneable URL of the gnulib repository.
Options:
--pull Do phase 1: pull files from network
--gen Do phase 2: generate from local files.
(The default is to do both phases.)
--gnulib-srcdir=DIRNAME specify the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
you want to use these sources. Defaults
to \$GNULIB_SRCDIR
--gnulib-refdir=DIRNAME specify the local directory where a gnulib
repository (with a .git subdirectory) resides.
Use this if you already have gnulib sources
and history on your machine, and do not want
to waste your bandwidth downloading them again.
Defaults to \$GNULIB_REFDIR
--bootstrap-sync if this bootstrap script is not identical to
the version in the local gnulib sources,
update this script, and then restart it with
/bin/sh or the shell \$CONFIG_SHELL
--no-bootstrap-sync do not check whether bootstrap is out of sync
--copy copy files instead of creating symbolic links
--force attempt to bootstrap even if the sources seem
not to have been checked out
--no-git do not use git to update gnulib. Requires that
\$GNULIB_SRCDIR or the --gnulib-srcdir option
points to a gnulib repository with the correct
revision
--skip-po do not download po files
EOF
bootstrap_print_option_usage_hook
cat <<EOF
If the file bootstrap.conf exists in the same directory as this script, its
contents are read as shell variables to configure the bootstrap.
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
are honored.
Gnulib sources can be fetched in various ways:
* If the environment variable GNULIB_SRCDIR is set (either as an
environment variable or via the --gnulib-srcdir option), then sources
are fetched from that local directory. If it is a git repository and
the configuration variable GNULIB_REVISION is set in bootstrap.conf,
then that revision is checked out.
* Otherwise, if this package is in a git repository with a 'gnulib'
submodule configured, then that submodule is initialized and updated
and sources are fetched from there. If GNULIB_REFDIR is set (either
as an environment variable or via the --gnulib-refdir option) and is
a git repository, then it is used as a reference.
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources
are cloned into that directory using git from \$GNULIB_URL, defaulting
to $default_gnulib_url.
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
then that revision is checked out.
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
used. If it is a git repository and the configuration variable
GNULIB_REVISION is set in bootstrap.conf, then that revision is
checked out.
If you maintain a package and want to pin a particular revision of the
Gnulib sources that has been tested with your package, then there are
two possible approaches: either configure a 'gnulib' submodule with the
appropriate revision, or set GNULIB_REVISION (and if necessary
GNULIB_URL) in bootstrap.conf.
Running without arguments will suffice in most cases.
EOF
}
# Parse options.
# Whether to pull and generate.
pull=false
gen=false
# Whether to use copies instead of symlinks.
copy=false
# Use git to update gnulib sources
use_git=true
for option
do
case $option in
--help)
usage
exit;;
--version)
set -e
echo "bootstrap $scriptversion lib $scriptlibversion"
echo "$copyright"
exit 0
;;
--pull)
pull=true;;
--gen)
gen=true;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
--gnulib-refdir=*)
GNULIB_REFDIR=${option#--gnulib-refdir=};;
--skip-po)
SKIP_PO=t;;
--force)
checkout_only_file=;;
--copy)
copy=true;;
--bootstrap-sync)
bootstrap_sync=true;;
--no-bootstrap-sync)
bootstrap_sync=false;;
--no-git)
use_git=false;;
*)
bootstrap_option_hook $option || die "$option: unknown option";;
esac
done
# Default is to do both.
$pull || $gen || pull=true gen=true
$use_git || test -n "$GNULIB_SRCDIR" \
|| die "Error: --no-git requires \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option"
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option is specified, but does not denote a directory"
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
die "Bootstrapping from a non-checked-out distribution is risky."
fi
check_build_prerequisites $use_git
if $bootstrap_sync; then
prepare_GNULIB_SRCDIR
upgrade_bootstrap
# Since we have now upgraded if needed, no need to try it a second time below.
bootstrap_sync=false
fi
echo "$0: Bootstrapping from checked-out $package sources..."
# Pass GNULIB_SRCDIR and GNULIB_REFDIR to any subsidiary commands that care.
export GNULIB_SRCDIR
export GNULIB_REFDIR
if $pull && { $use_git || test -z "$SKIP_PO"; }; then
autopull \
`if $bootstrap_sync; then echo ' --bootstrap-sync'; else echo ' --no-bootstrap-sync'; fi` \
`if test -z "$checkout_only_file"; then echo ' --force'; fi` \
`if ! $use_git; then echo ' --no-git'; fi` \
`if test -n "$SKIP_PO"; then echo ' --skip-po'; fi` \
|| die "could not fetch auxiliary files"
fi
if $gen; then
autogen \
`if $copy; then echo ' --copy'; fi` \
`if test -z "$checkout_only_file"; then echo ' --force'; fi` \
|| die "could not generate auxiliary files"
fi
# ----------------------------------------------------------------------------
# Local Variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

1285
bootstrap-funclib.sh Normal file

File diff suppressed because it is too large Load Diff

116
bootstrap.bat Normal file
View File

@ -0,0 +1,116 @@
@echo off
:: Copyright (C) 2018-2024 Free Software Foundation, Inc.
:: This file is part of GNU Make.
::
:: GNU Make is free software; you can redistribute it and/or modify it under
:: the terms of the GNU General Public License as published by the Free
:: Software Foundation; either version 3 of the License, or (at your option)
:: any later version.
::
:: GNU Make is distributed in the hope that it will be useful, but WITHOUT
:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
:: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
:: more details.
::
:: You should have received a copy of the GNU General Public License along
:: with this program. If not, see <https://www.gnu.org/licenses/>.
setlocal
set "svurl=https://git.savannah.gnu.org/cgit"
set "gnuliburl=%svurl%/gnulib.git/plain"
where curl >nul 2>&1
if ERRORLEVEL 1 (
echo Cannot find curl: it must be installed for bootstrap
exit /b 1
)
where sed >nul 2>&1
if ERRORLEVEL 1 (
echo Cannot find sed: it must be installed for bootstrap
echo Hint: you can use the sed provided in the Git for Windows install
exit /b 1
)
if exist lib goto Downloads
mkdir lib
if ERRORLEVEL 1 exit /b 1
:Downloads
echo -- Downloading Gnulib modules
call :Download lib getloadavg.c
call :Download lib intprops.h
call :Download lib intprops-internal.h
echo -- Configuring the workspace
copy /Y gl\lib\*.* lib > nul
:: In general it's tricky to use special characters as arguments to a program
:: in Windows batch files; the quoting rules are obscure and have changed over
:: time which means older systems may behave differently. However, Windows
:: echo is a dumb program that just writes out its command line without much
:: interpreting: all we have to be careful of is ^ quoting. So, use echo
:: to create script files to use with sed -f rather than using sed -e.
:: Create a sed script to convert templates
if exist convert.sed del /Q convert.sed
echo s,@PACKAGE@,make,g > convert.sed
if ERRORLEVEL 1 goto Failed
echo s,@PACKAGE_BUGREPORT@,bug-make@gnu.org,g >> convert.sed
if ERRORLEVEL 1 goto Failed
echo s,@PACKAGE_NAME@,GNU Make,g >> convert.sed
if ERRORLEVEL 1 goto Failed
echo s,@PACKAGE_TARNAME@,make,g >> convert.sed
if ERRORLEVEL 1 goto Failed
echo s,@PACKAGE_URL@,https://www.gnu.org/software/make/,g >> convert.sed
echo s/^^AC_INIT^(\[GNU.Make\],\[\^([0-9.]*\^)\].*/s,@PACKAGE_VERSION@,\1,g/p > cac.sed
sed -n -f cac.sed configure.ac >> convert.sed
if ERRORLEVEL 1 goto Failed
:: Get the list of sources from Makefile.am
echo s,\\\n,,g > mam.sed
echo s,[ \t][ \t]*, ,g >> mam.sed
echo s, [^^ ]*\.h,,g >> mam.sed
echo s,src/,$^(src^),g >> mam.sed
echo s,lib/,$^(lib^),g >> mam.sed
echo s/^^\^([A-Za-z0-9]*\^)_SRCS *= *\^(.*\^)/s,%%\1_SOURCES%%,\2,/p > mam2.sed
sed -z -f mam.sed Makefile.am | sed -n -f mam2.sed >> convert.sed
if ERRORLEVEL 1 goto Failed
echo - Creating Basic.mk
sed -f convert.sed Basic.mk.template > Basic.mk
if ERRORLEVEL 1 goto Failed
echo - Creating src\mkconfig.h
sed -f convert.sed src\mkconfig.h.in > src\mkconfig.h
if ERRORLEVEL 1 goto Failed
echo - Creating src\gmk-default.h
echo static const char *const GUILE_module_defn = ^" \ > src\gmk-default.h
echo s/;.*// > gmk.sed
echo /^^[ \t]*$/d >> gmk.sed
echo s/"/\\"/g >> gmk.sed
echo s/$/ \\/ >> gmk.sed
sed -f gmk.sed src\gmk-default.scm >> src\gmk-default.h
if ERRORLEVEL 1 goto Failed
echo ^";>> src\gmk-default.h
:: These files would be created by bootstrap; they are not needed on Windows
:: but our makefile depends on them
echo >> lib\alloca.in.h
del /Q convert.sed cac.sed mam.sed mam2.sed gmk.sed
echo.
echo Done. Run build_w32.bat to build GNU Make.
goto :EOF
:Download
if exist "%1\%2" goto :EOF
echo - Downloading %1\%2
curl -sS -o "%1\%2" "%gnuliburl%/%1/%2"
if ERRORLEVEL 1 exit /b 1
goto :EOF
:Failed
echo *** Bootstrap failed.
echo Resolve the issue, or use the configured source in the release tarball
exit /b 1

65
bootstrap.conf Normal file
View File

@ -0,0 +1,65 @@
# Bootstrap configuration. -*-shell-script-*-
# Copyright (C) 2018-2024 Free Software Foundation, Inc.
# GNU Make is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
# Allow bootstrap to know that this is not a package
checkout_only_file=README.git
# Choose a specific version of gnulib, when checking out
GNULIB_REVISION=stable-202407
# Always copy files rather than symlink
copy=true
# Additional xgettext options to use. Use "\\\newline" to break lines.
# Ensure that all our magical output macros are correctly marked as
# C (printf) format strings.
XGETTEXT_OPTIONS='\\\
--from-code=UTF-8\\\
--flag=_:1:pass-c-format\\\
--flag=N_:1:pass-c-format\\\
--flag=DB:2:c-format --flag=DBF:2:c-format --flag=DBS:2:c-format\\\
--flag=O:3:c-format --flag=OSN:3:c-format --flag=ONS:3:c-format\\\
--flag=OS:3:c-format --flag=OSS:3:c-format --flag=OSSS:3:c-format\\\
--flag=ON:3:c-format --flag=ONN:3:c-format\\\
'
# We manage our own .gitignore files
vc_ignore=
# Build prerequisites
buildreq="\
autoconf 2.72
automake 1.16.5
"
gnulib_name=libgnu
gnulib_files="doc/make-stds.texi m4/sig_atomic_t.m4"
# Using the full strtoll module pulls in a lot of stuff. But, it's pretty
# simple to use just the base source file, so pull that. We'll use it in
# src/misc.c if strtoll() is not found.
gnulib_files="$gnulib_files lib/strtol.c"
gnulib_modules="\
alloca
fdl
findprog-in
getloadavg
host-cpu-c-abi
largefile
make-glob
make-macros"

38
build.cfg.in Normal file
View File

@ -0,0 +1,38 @@
# Configuration for building GNU Make in the absence of any 'make' program.
# @configure_input@
# Copyright (C) 1993-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
# See Makefile.in for comments describing these variables.
top_srcdir='@top_srcdir@'
prefix='@prefix@'
exec_prefix=`eval echo @exec_prefix@`
CC='@CC@'
AR='@AR@'
CFLAGS='@CFLAGS@ @GUILE_CFLAGS@'
CPPFLAGS='@CPPFLAGS@'
DEFS='@DEFS@'
ARFLAGS='@ARFLAGS@'
LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@'
ALLOCA='@ALLOCA@'
LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@'
REMOTE='@REMOTE@'
OBJEXT='@OBJEXT@'
EXEEXT='@EXEEXT@'

176
build.sh Executable file
View File

@ -0,0 +1,176 @@
#!/bin/sh
# Shell script to build GNU Make in the absence of any 'make' program.
# Copyright (C) 1993-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
# Get configure-generated values
. ./build.cfg
die () { echo "$*" 1>&2; exit 1; }
usage () { echo "$0 [-k]"; exit $1; }
keep_going=false
: ${OUTDIR:=.}
OUTLIB="$OUTDIR/lib"
# Directory to find libraries in for '-lXXX'.
libdir=$exec_prefix/lib
# Directory to search by default for included makefiles.
includedir=$prefix/include
localedir=$prefix/share/locale
defines="-DLOCALEDIR=\"$localedir\" -DLIBDIR=\"$libdir\" -DINCLUDEDIR=\"$includedir\""
# Look up a make variable value.
# It can handle simple recursion where variables are separate words.
# Print the value to stdout.
get_mk_var ()
{
v=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "$1" | sed -n "s=^ *$2 *\= *==p")
for w in $v; do
case $w in
(\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; (get_mk_var "$1" "${w%[\)\}]}") ;;
(*) echo "$w" ;;
esac
done
}
# Compile source files. Object files are put into $objs.
compile ()
{
success=true
objs=
for ofile in "$@"; do
# We should try to use a Makefile variable like libgnu_a_SOURCES or
# something but just hardcode it.
file="${ofile%.$OBJEXT}.c"
case $file in
(lib/libgnu_a-*.c) file="lib/${file#lib/libgnu_a-}" ;;
esac
echo "compiling $file..."
of="$OUTDIR/$ofile"
mkdir -p "${of%/*}" || exit 1
if $CC $cflags $CPPFLAGS $CFLAGS -c -o "$of" "$top_srcdir/$file"; then
: worked
else
$keep_going || die "Compilation failed."
success=false
fi
objs="${objs:+$objs }$of"
done
$success
}
# Use config.status to convert a .in file. Output file is put into $out.
# $out will be empty if no conversion was needed.
convert ()
{
out=
base=$1
var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
# Is this file disabled?
grep "${var}_FALSE\"]=\"\"" config.status >/dev/null && return 0
# If there's no .in file then no conversion needed
in="$top_srcdir/lib/$(echo ${base%.*}.in.${base##*.} | tr / _)"
test -f "$in" || return 0
# Not disabled, so create it
out="$OUTLIB/$base"
mkdir -p "${out%/*}"
# First perform the normal replacements, using config.status
sed -e 's|@GUARD_PREFIX@|GL|g' \
-e 's/@GNULIB_UNISTD_H_GETOPT@/0/g' \
"$in" > "${out}_"
./config.status --file "${out}__:${out}_"
int="${out}__"
# Then see if there any files we need to include. Unfortunately there's no
# algorithmic conversion so we just have to hard-code it.
incls=$(sed -n 's/.*definitions* of \(_[^ $]*\).*/\1/p' "$in")
for inc in $incls; do
case $inc in
(_GL_FUNCDECL_RPL) fn=$(get_mk_var lib/Makefile CXXDEFS_H) ;;
(_GL_ARG_NONNULL) fn=$(get_mk_var lib/Makefile ARG_NONNULL_H) ;;
(_GL_WARN_ON_USE) fn=$(get_mk_var lib/Makefile WARN_ON_USE_H) ;;
(_Noreturn) fn=$(get_mk_var lib/Makefile _NORETURN_H) ;;
(*) echo "Unknown file replacement: $inc"; exit 1 ;;
esac
fn="$top_srcdir/lib/${fn##*/}"
test -f "$fn" || { echo "Missing file: $fn"; exit 1; }
sed "/definitions* of $inc/r $fn" "$int" > "${int}_"
int=${int}_
done
# Done!
mv "$int" "$out"
}
# Get source files provided from gnulib and convert to object files
LIBOBJS=
for lo in $( (get_mk_var lib/Makefile libgnu_a_OBJECTS; get_mk_var lib/Makefile libgnu_a_LIBADD) | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g"); do
LIBOBJS="${LIBOBJS:+$LIBOBJS }lib/$lo"
done
# Get object files from the Makefile
OBJS=$(get_mk_var Makefile make_OBJECTS | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g")
while test -n "$1"; do
case $1 in
(-k) keep_going=true; shift ;;
(--) shift; break ;;
(-[h?]) usage 0 ;;
(-*) echo "Unknown option: $1"; usage 1 ;;
esac
done
test -z "$1" || die "Unknown argument: $*"
# Generate gnulib header files that would normally be created by make
set -e
for b in $(get_mk_var lib/Makefile BUILT_SOURCES); do
convert $b
done
set +e
# Build the gnulib library
cflags="$DEFS -I$OUTLIB -Ilib -I$top_srcdir/lib -I$OUTDIR/src -Isrc -I$top_srcdir/src"
compile $LIBOBJS || die "Compilation failed."
echo "creating libgnu.a..."
$AR $ARFLAGS "$OUTLIB"/libgnu.a $objs || die "Archive of libgnu failed."
# Compile the source files into those objects.
cflags="$DEFS $defines -I$OUTDIR/src -Isrc -I$top_srcdir/src -I$OUTLIB -Ilib -I$top_srcdir/lib"
compile $OBJS || die "Compilation failed."
# Link all the objects together.
echo "linking make..."
$CC $CFLAGS $LDFLAGS -L"$OUTLIB" -o "$OUTDIR/makenew$EXEEXT" $objs -lgnu $LOADLIBES || die "Link failed."
mv -f "$OUTDIR/makenew$EXEEXT" "$OUTDIR/make$EXEEXT" || exit 1
echo done.

498
build_w32.bat Normal file
View File

@ -0,0 +1,498 @@
@echo off
:: Copyright (C) 1996-2024 Free Software Foundation, Inc.
:: This file is part of GNU Make.
::
:: GNU Make is free software; you can redistribute it and/or modify it under
:: the terms of the GNU General Public License as published by the Free
:: Software Foundation; either version 3 of the License, or (at your option)
:: any later version.
::
:: GNU Make is distributed in the hope that it will be useful, but WITHOUT
:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
:: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
:: more details.
::
:: You should have received a copy of the GNU General Public License along
:: with this program. If not, see <https://www.gnu.org/licenses/>.
setlocal
if not "%RECURSEME%"=="%~0" (
set "RECURSEME=%~0"
%ComSpec% /s /c ""%~0" %*"
goto :EOF
)
call :Reset
if "%1" == "-h" goto Usage
if "%1" == "--help" goto Usage
echo.
echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10/11
echo.
set MAKE=gnumake
set GUILE=Y
set COMPILER=cl.exe
set RC=rc.exe
set O=obj
set ARCH=x64
set DEBUG=N
set DIRENT=Y
set VERBOSE=N
if exist maintMakefile (
set MAINT=Y
) else (
set MAINT=N
)
:ParseSW
if "%1" == "--verbose" goto SetVerbose
if "%1" == "--debug" goto SetDebug
if "%1" == "--without-guile" goto NoGuile
if "%1" == "--x86" goto Set32Bit
if "%1" == "gcc" goto SetCC
if "%1" == "tcc" goto SetTCC
if "%1" == "" goto DoneSW
goto Usage
:SetVerbose
set VERBOSE=Y
shift
goto ParseSW
:SetDebug
set DEBUG=Y
echo - Building without compiler optimizations
shift
goto ParseSW
:NoGuile
set GUILE=N
echo - Building without Guile
shift
goto ParseSW
:Set32Bit
set ARCH=x86
echo - Building 32bit GNU Make
shift
goto ParseSW
:SetCC
set COMPILER=gcc
set RC=windres
set O=o
echo - Building with GCC
shift
goto ParseSW
:SetTCC
set COMPILER=tcc
set RC=windres
set O=o
echo - Building with TinyC
shift
goto ParseSW
:DoneSW
if "%MAINT%" == "Y" echo - Enabling maintainer mode
if "%COMPILER%" == "gcc" goto FindGcc
if "%COMPILER%" == "tcc" goto FindTcc
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.
call %COMPILER% >nul 2>&1
if not ERRORLEVEL 1 goto FoundMSVC
:: Visual Studio 15 2017 and above provides the "vswhere" tool
call :FindVswhere
if ERRORLEVEL 1 goto LegacyVS
for /f "tokens=* usebackq" %%i in (`"%VSWHERE%" -latest -property installationPath`) do (
set InstallPath=%%i
)
set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
:: No "vswhere" or it can't find a compiler. Go old-school.
:LegacyVS
set "VSVARS=%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS71COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%VS70COMNTOOLS%\..\..\VC\vcvarsall.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%V6TOOLS%\VC98\Bin\vcvars32.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%V6TOOLS%\VC97\Bin\vcvars32.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
set "VSVARS=%V5TOOLS%\VC\Bin\vcvars32.bat"
call :CheckMSVC
if not ERRORLEVEL 1 goto FoundMSVC
:: We did not find anything--fail
echo No MSVC compiler available.
echo Please run vcvarsall.bat and/or configure your Path.
exit 1
:FoundMSVC
set OUTDIR=.\WinRel
set LNKOUT=./WinRel
set "OPTS=/O2 /D NDEBUG"
set LINKOPTS=
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
if "%DEBUG%" == "Y" set LNKOUT=./WinDebug
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"
:: Show the compiler version that we found
:: Unfortunately this also shows a "usage" note; I can't find anything better.
echo.
call %COMPILER%
goto FindRC
:FindGcc
set OUTDIR=.\GccRel
set LNKOUT=./GccRel
set OPTS=-O2
set DIRENT=N
if "%DEBUG%" == "Y" set OPTS=-O0
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
:: Show the compiler version that we found
echo.
call %COMPILER% --version
if not ERRORLEVEL 1 goto FindRC
echo No %COMPILER% found.
exit 1
:FindTcc
set OUTDIR=.\TccRel
set LNKOUT=./TccRel
set OPTS=-O2
if "%DEBUG%" == "Y" set OPTS=-O0
if "%DEBUG%" == "Y" set OUTDIR=.\TccDebug
if "%DEBUG%" == "Y" set LNKOUT=./TccDebug
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
:: Show the compiler version that we found
echo.
call %COMPILER% -v
if not ERRORLEVEL 1 goto FindRC
echo No %COMPILER% found.
exit 1
:FindRC
set HAVE_RC=Y
call where %RC% >nul 2>&1
if not ERRORLEVEL 1 goto Build
echo.
echo %RC% was not found. Building without UTF-8 resource.
set HAVE_RC=N
:Build
echo.
:: Clean the directory if it exists
if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%
:: Recreate it
mkdir %OUTDIR%
mkdir %OUTDIR%\src
mkdir %OUTDIR%\src\w32
mkdir %OUTDIR%\src\w32\compat
mkdir %OUTDIR%\src\w32\subproc
mkdir %OUTDIR%\lib
if "%GUILE%" == "Y" call :ChkGuile
if not exist src\config.h.W32 goto NotConfig
echo.
echo Compiling %OUTDIR% version
copy src\config.h.W32 %OUTDIR%\src\config.h
copy lib\glob.in.h %OUTDIR%\lib\glob.h
copy lib\fnmatch.in.h %OUTDIR%\lib\fnmatch.h
if exist %OUTDIR%\link.sc del %OUTDIR%\link.sc
call :Compile src/ar
call :Compile src/arscan
call :Compile src/commands
call :Compile src/default
call :Compile src/dir
call :Compile src/expand
call :Compile src/file
call :Compile src/function
call :Compile src/getopt
call :Compile src/getopt1
call :Compile src/guile GUILE
call :Compile src/hash
call :Compile src/implicit
call :Compile src/job
call :Compile src/load
call :Compile src/loadapi
call :Compile src/main GUILE
call :Compile src/misc
call :Compile src/output
call :Compile src/read
call :Compile src/remake
call :Compile src/remote-stub
call :Compile src/rule
call :Compile src/shuffle
call :Compile src/signame
call :Compile src/strcache
call :Compile src/variable
call :Compile src/version
call :Compile src/vpath
call :Compile src/warning
call :Compile src/w32/pathstuff
call :Compile src/w32/w32os
call :Compile src/w32/compat/posixfcn
call :Compile src/w32/subproc/misc
call :Compile src/w32/subproc/sub_proc
call :Compile src/w32/subproc/w32err
call :Compile lib/fnmatch
call :Compile lib/glob
call :Compile lib/getloadavg
:: Compile dirent unless it is supported by compiler library (like with gcc).
if "%DIRENT%" == "Y" call :Compile src\w32\compat\dirent
:: Compile UTF-8 resource if a resource compiler is available.
if "%HAVE_RC%" == "Y" call :ResourceCompile src/w32/utf8
call :Link
echo.
if exist %OUTDIR%\%MAKE%.exe goto Success
echo %OUTDIR% build FAILED!
exit 1
:Success
echo %OUTDIR% build succeeded.
if exist Basic.mk copy /Y Basic.mk Makefile
if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm
call :Reset
goto :EOF
::
:: Subroutines
::
:Compile
if "%VERBOSE%" == "N" echo - Compiling %1.c
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
set EXTRAS=
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
if "%COMPILER%" == "gcc" goto GccCompile
if "%COMPILER%" == "tcc" goto TccCompile
:: MSVC Compile
if "%VERBOSE%" == "Y" echo on
call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
@echo off
goto CompileDone
:GccCompile
:: GCC Compile
if "%VERBOSE%" == "Y" echo on
call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
@echo off
goto CompileDone
:TccCompile
:: TCC Compile
if "%VERBOSE%" == "Y" echo on
call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
@echo off
goto CompileDone
:ResourceCompile
if "%VERBOSE%" == "N" echo - Compiling %1.rc
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
if "%COMPILER%" == "gcc" goto GccResourceCompile
if "%COMPILER%" == "tcc" goto TccResourceCompile
:: MSVC Resource Compile
if "%VERBOSE%" == "Y" echo on
call %RC% /fo %OUTDIR%\%1.%O% %1.rc
@echo off
goto CompileDone
:GccResourceCompile
:: GCC Resource Compile
if "%VERBOSE%" == "Y" echo on
call %RC% -o %OUTDIR%/%1.%O% -i %1.rc
@echo off
goto CompileDone
:TccResourceCompile
:: TCC Resource Compile
goto GccResourceCompile
:CompileDone
if not exist "%OUTDIR%\%1.%O%" exit 1
goto :EOF
:Link
echo.
echo - Linking %LNKOUT%/%MAKE%.exe
if "%COMPILER%" == "gcc" goto GccLink
if "%COMPILER%" == "tcc" goto TccLink
:: MSVC Link
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
if "%VERBOSE%" == "Y" echo on
call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
@echo off
goto :EOF
:GccLink
:: GCC Link
if "%VERBOSE%" == "Y" echo on
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
call %COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a
@echo off
goto :EOF
:TccLink
:: TCC Link
if "%VERBOSE%" == "Y" echo on
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc
@echo off
goto :EOF
:ChkGuile
:: Build with Guile is supported only on NT and later versions
if not "%OS%" == "Windows_NT" goto NoGuile
call pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
if ERRORLEVEL 1 goto NoPkgCfg
set PKGMSC=
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
echo Checking for Guile 2.0
call pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\gl-c2.tmp 2> NUL
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c2.tmp
call pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\gl-l2.tmp 2> NUL
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l2.tmp
if not "%GUILECFLAGS%" == "" goto GuileDone
echo Checking for Guile 1.8
call pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\gl-c18.tmp 2> NUL
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c18.tmp
call pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\gl-l18.tmp 2> NUL
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l18.tmp
if not "%GUILECFLAGS%" == "" goto GuileDone
echo - No Guile found, building without Guile
goto GuileDone
:NoPkgCfg
echo - pkg-config not found, building without Guile
:GuileDone
if "%GUILECFLAGS%" == "" goto :EOF
echo - Guile found: building with Guile
set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
goto :EOF
:FindVswhere
set VSWHERE=vswhere
call "%VSWHERE%" -help >nul 2>&1
if not ERRORLEVEL 1 exit /b 0
set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
call "%VSWHERE%" -help >nul 2>&1
if ERRORLEVEL 1 exit /b 1
goto :EOF
:CheckMSVC
if not exist "%VSVARS%" exit /b 1
call "%VSVARS%" %ARCH%
if ERRORLEVEL 1 exit /b 1
call %COMPILER% >nul 2>&1
if ERRORLEVEL 1 exit /b 1
goto :EOF
:NotConfig
echo.
echo *** This workspace is not configured.
echo Either retrieve the configured source in the release tarball
echo or, if building from Git, run the .\bootstrap.bat script first.
exit /b 1
:Usage
echo Usage: %0 [options] [gcc] OR [tcc]
echo Options:
echo. --without-guile Do not compile Guile support even if found
echo. --debug Make a Debug build--default is Release
echo. --x86 Make a 32bit binary--default is 64bit
echo. --help Display these instructions and exit
echo.
echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC
goto :EOF
:Reset
set ARCH=
set COMPILER=
set DEBUG=
set GUILE=
set GUILECFLAGS=
set GUILELIBS=
set LINKOPTS=
set MAKE=
set NOGUILE=
set O=
set OPTS=
set OUTDIR=
set LNKOUT=
set PKGMSC=
set VSVARS=
goto :EOF

98
builddos.bat Normal file
View File

@ -0,0 +1,98 @@
@echo off
rem Copyright (C) 1998-2024 Free Software Foundation, Inc.
rem This file is part of GNU Make.
rem
rem GNU Make is free software; you can redistribute it and/or modify it under
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 3 of the License, or (at your option)
rem any later version.
rem
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
rem more details.
rem
rem You should have received a copy of the GNU General Public License along
rem with this program. If not, see <https://www.gnu.org/licenses/>.
echo Building Make for MSDOS with DJGPP
rem The SmallEnv trick protects against too small environment block,
rem in which case the values will be truncated and the whole thing
rem goes awry. COMMAND.COM will say "Out of environment space", but
rem many people don't care, so we force them to care by refusing to go.
rem Where is the srcdir?
set XSRC=.
if not "%XSRC%"=="." goto SmallEnv
if "%1%"=="" goto SrcDone
if "%1%"=="." goto SrcDone
set XSRC=%1
if not "%XSRC%"=="%1" goto SmallEnv
:SrcDone
if not exist src mkdir src
if not exist lib mkdir lib
copy /Y %XSRC%\src\configh.dos .\src\config.h
copy /Y %XSRC%\lib\glob.in.h .\lib\glob.h
copy /Y %XSRC%\lib\fnmatch.in.h .\lib\fnmatch.h
rem Echo ON so they will see what is going on.
@echo on
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/commands.c -o commands.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/output.c -o output.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/job.c -o job.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/dir.c -o dir.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/file.c -o file.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/misc.c -o misc.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLOCALEDIR=\"/dev/env/DJDIR/share/locale\" -O2 -g %XSRC%/src/main.c -o main.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DINCLUDEDIR=\"/dev/env/DJDIR/include\" -O2 -g %XSRC%/src/read.c -o read.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLIBDIR=\"/dev/env/DJDIR/lib\" -O2 -g %XSRC%/src/remake.c -o remake.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/rule.c -o rule.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/implicit.c -o implicit.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/default.c -o default.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/variable.c -o variable.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/warning.c -o warning.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/expand.c -o expand.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/function.c -o function.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/vpath.c -o vpath.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/hash.c -o hash.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/strcache.c -o strcache.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/version.c -o version.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/ar.c -o ar.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/arscan.c -o arscan.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/signame.c -o signame.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/remote-stub.c -o remote-stub.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt.c -o getopt.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt1.c -o getopt1.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/shuffle.c -o shuffle.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/load.c -o load.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/glob.c -o lib/glob.o
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/fnmatch.c -o lib/fnmatch.o
@echo off
echo commands.o > respf.$$$
for %%f in (job output dir file misc main read remake rule implicit default variable warning load) do echo %%f.o >> respf.$$$
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1 shuffle) do echo %%f.o >> respf.$$$
for %%f in (lib\glob lib\fnmatch) do echo %%f.o >> respf.$$$
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/guile.c -o guile.o
echo guile.o >> respf.$$$
@echo Linking...
@echo on
gcc -o make.exe @respf.$$$
@echo off
if not exist make.exe echo Make.exe build failed...
if exist make.exe echo make.exe is now built!
if exist make.exe del respf.$$$
if exist make.exe copy /Y %XSRC%\Basic.mk Makefile
goto End
:SmallEnv
echo Your environment is too small. Please enlarge it and run me again.
:End
set XRSC=
@echo on

567
configure.ac Normal file
View File

@ -0,0 +1,567 @@
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 1993-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
AC_INIT([GNU Make],[4.4.90],[bug-make@gnu.org])
AC_PREREQ([2.69])
# Autoconf setup
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/vpath.c])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_LIBOBJ_DIR([lib])
# Automake setup
# We have to enable "foreign" because ChangeLog is auto-generated
# Automake 1.15 and gnulib don't get along: gnulib has some strange error
# in the way it handles getloadavg.c which causes make distcheck to fail.
# https://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
# Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_PROG_CXX
AC_DEFINE_UNQUOTED(MAKE_CXX, ["$CXX"], [Default C++ compiler.])
# Configure gnulib
gl_EARLY
gl_INIT
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CPP
AC_CHECK_PROG([AR], [ar], [ar], [ar])
# Perl is needed for the test suite (only)
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
# Specialized system macros
AC_CANONICAL_HOST
AC_C_BIGENDIAN
# Enable gettext, in "external" mode.
AM_GNU_GETTEXT_VERSION([0.19.4])
AM_GNU_GETTEXT([external])
# Checks for libraries.
AC_SEARCH_LIBS([strerror],[cposix])
AC_SEARCH_LIBS([getpwnam], [sun])
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_CHECK_HEADERS([stdlib.h string.h strings.h locale.h unistd.h limits.h \
memory.h sys/param.h sys/resource.h sys/time.h sys/select.h \
sys/file.h fcntl.h spawn.h])
AM_PROG_CC_C_O
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INTMAX_T
AC_TYPE_UINTMAX_T
# Check for sig_atomic_t
gt_TYPE_SIG_ATOMIC_T
# Find out whether our struct stat returns nanosecond resolution timestamps.
AC_STRUCT_ST_MTIM_NSEC
AC_CACHE_CHECK([whether to use high resolution file timestamps],
[make_cv_file_timestamp_hi_res],
[ make_cv_file_timestamp_hi_res=no
AS_IF([test "$ac_cv_struct_st_mtim_nsec" != no],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif]],
[[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
[make_cv_file_timestamp_hi_res=yes])
])])
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes], [val=1], [val=0])
AC_DEFINE_UNQUOTED([FILE_TIMESTAMP_HI_RES], [$val],
[Use high resolution file timestamps if nonzero.])
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
[ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
AS_IF([test "$ac_cv_search_clock_gettime" != no],
[ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
[Define to 1 if you have the clock_gettime function.])
])
])
# See if we have a standard version of gettimeofday(). Since actual
# implementations can differ, just make sure we have the most common
# one.
AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
[ac_cv_func_gettimeofday=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
int main ()
{
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
return gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0;
}]])],
[ac_cv_func_gettimeofday=yes],
[ac_cv_func_gettimeofday=no],
[ac_cv_func_gettimeofday="no (cross-compiling)"])])
AS_IF([test "$ac_cv_func_gettimeofday" = yes],
[ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
[Define to 1 if you have a standard gettimeofday function])
])
AC_CHECK_FUNCS([strtoll strdup strndup stpcpy memrchr mempcpy umask mkstemp \
mktemp fdopen dup dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \
mkfifo getrlimit setrlimit setvbuf pipe strerror strsignal \
lstat readlink atexit isatty ttyname pselect posix_spawn \
posix_spawnattr_setsigmask])
# We need to check declarations, not just existence, because on Tru64 this
# function is not declared without special flags, which themselves cause
# other problems. We'll just use our own.
AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
#include <signal.h>]])
AC_FUNC_FORK
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
# It doesn't hurt much to use our own if we can't find it so I don't
# make the effort here.
AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
# strcoll() is used by the GNU glob library
AC_FUNC_STRCOLL
AC_FUNC_CLOSEDIR_VOID
# dir.c and our glob.c use dirent.d_type if available
AC_STRUCT_DIRENT_D_TYPE
# See if the user wants to add (or not) GNU Guile support
AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
[Support GNU Guile for embedded scripting])])
# Annoyingly, each version of Guile comes with it's own PC file so we have to
# specify them as individual packages. Ugh.
PKG_PROG_PKG_CONFIG
AS_IF([test "x$with_guile" != xno],
[ guile_versions="3.0 2.2 2.0 1.8"
guile_version=no
have_guile=no
AC_MSG_CHECKING([for GNU Guile])
for v in $guile_versions; do
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
done
AC_MSG_RESULT([$guile_version])
AS_IF([test "$have_guile" = yes],
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
# Unfortunately pkg doesn't help in multi-arch environments where the
# package is installed for some architectures but not others; we need
# to try to link.
keep_CPPFLAGS="$CPPFLAGS"
keep_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
LIBS="$LIBS $GUILE_LIBS"
AC_CHECK_HEADER([libguile.h],
[have_guile=yes],
[have_guile=no],
[/* Avoid configuration error warnings. */])
AS_IF([test "$have_guile" = yes],
[ AC_MSG_CHECKING([whether we can link GNU Guile])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <libguile.h>
static void *
guile_init (void *arg)
{
(void) arg;
return 0;
}
]], [[
scm_with_guile (guile_init, 0);
]])],
[have_guile=yes],
[have_guile=no])
AC_MSG_RESULT([$have_guile])])
CPPFLAGS="$keep_CPPFLAGS"
LIBS="$keep_LIBS"
])
])
AS_IF([test "$have_guile" = yes],
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = "yes"])
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT
#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h. */
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
])
# Check out the wait reality.
AC_CHECK_HEADERS([sys/wait.h],[],[],[[#include <sys/types.h>]])
AC_CHECK_FUNCS([waitpid wait3])
AC_CACHE_CHECK([for union wait], [make_cv_union_wait],
[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/wait.h>]],
[[union wait status; int pid; pid = wait (&status);
#ifdef WEXITSTATUS
/* Some POSIXoid systems have both the new-style macros and the old
union wait type, and they do not work together. If union wait
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
if (WEXITSTATUS (status) != 0) pid = -1;
#ifdef WTERMSIG
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
-- blow chunks here --
#endif
#endif
#ifdef HAVE_WAITPID
/* Make sure union wait works with waitpid. */
pid = waitpid (-1, &status, 0);
#endif
]])],
[make_cv_union_wait=yes],
[make_cv_union_wait=no])
])
AS_IF([test "$make_cv_union_wait" = yes],
[ AC_DEFINE([HAVE_UNION_WAIT], [1],
[Define to 1 if you have the 'union wait' type in <sys/wait.h>.])
])
# If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
AS_IF([test "$PATH_SEPARATOR" = ';'],
[ AC_DEFINE([HAVE_DOS_PATHS], [1],
[Define to 1 if your system requires backslashes or drive specs in pathnames.])
])
# See if the user wants to use pmake's "customs" distributed build capability
AC_SUBST([REMOTE]) REMOTE=stub
use_customs=false
AC_ARG_WITH([customs],
[AS_HELP_STRING([--with-customs=DIR],[enable remote jobs via Customs--see README.customs])],
[ AS_CASE([$withval], [n|no], [:],
[make_cppflags="$CPPFLAGS"
AS_CASE([$withval],
[y|ye|yes], [:],
[CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
make_ldflags="$LDFLAGS -L$with_customs/lib"])
CF_NETLIBS
AC_CHECK_HEADER([customs.h],
[use_customs=true
REMOTE=cstms
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
[with_customs=no
CPPFLAGS="$make_cppflags" make_badcust=yes])
])
])
# Tell automake about this, so it can include the right .c files.
AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
# See if the user asked to handle case insensitive file systems.
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
AC_ARG_ENABLE([case-insensitive-file-system],
AS_HELP_STRING([--enable-case-insensitive-file-system],[assume file systems are case insensitive]),
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
# See if we can handle the job server feature, and if the user wants it.
AC_ARG_ENABLE([job-server],
AS_HELP_STRING([--disable-job-server],[disallow recursive make communication during -jN]),
[make_cv_job_server="$enableval" user_job_server="$enableval"],
[make_cv_job_server="yes"])
AS_IF([test "$ac_cv_func_waitpid" = no && test "$ac_cv_func_wait3" = no],
[has_wait_nohang=no],
[has_wait_nohang=yes])
AC_CACHE_CHECK([for SA_RESTART], [make_cv_sa_restart], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
[[return SA_RESTART;]])],
[make_cv_sa_restart=yes],
[make_cv_sa_restart=no])])
AS_IF([test "$make_cv_sa_restart" != no],
[ AC_DEFINE([HAVE_SA_RESTART], [1],
[Define to 1 if <signal.h> defines the SA_RESTART constant.])
])
# Only allow jobserver on systems that support it
AS_CASE([/$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/],
[*/no/*], [make_cv_job_server=no])
# Also supported on OS2 and MinGW
AS_CASE([$host_os], [os2*|mingw*], [make_cv_job_server=yes])
# If we support it and the user didn't disable it, build with jobserver
AS_CASE([/$make_cv_job_server/$user_job_server/],
[*/no/*], [: no jobserver],
[AC_DEFINE(MAKE_JOBSERVER, 1,
[Define to 1 to enable job server support in GNU Make.])
])
# If dl*() functions are supported we can enable the load operation
AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
[[#include <dlfcn.h>]])
AC_ARG_ENABLE([load],
AS_HELP_STRING([--disable-load],[disable support for the 'load' operation]),
[make_cv_load="$enableval" user_load="$enableval"],
[make_cv_load="yes"])
AS_CASE([/$ac_cv_have_decl_dlopen/$ac_cv_have_decl_dlsym/$ac_cv_have_decl_dlerror/],
[*/no/*], [make_cv_load=no])
# We might need -ldl
AS_IF([test "$make_cv_load" = yes], [
AC_SEARCH_LIBS([dlopen], [dl], [], [make_cv_load=])
])
AS_CASE([/$make_cv_load/$user_load/],
[*/no/*], [make_cv_load=no],
[AC_DEFINE(MAKE_LOAD, 1,
[Define to 1 to enable 'load' support in GNU Make.])
])
# If we want load support, we might need to link with export-dynamic.
# See if we can figure it out. Unfortunately this is very difficult.
# For example passing -rdynamic to the SunPRO linker gives a warning
# but succeeds and creates a shared object, not an executable!
AS_IF([test "$make_cv_load" = yes], [
AC_MSG_CHECKING([if the linker accepts -Wl,--export-dynamic])
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
[AC_MSG_RESULT([yes])
AC_SUBST([AM_LDFLAGS], [-Wl,--export-dynamic])],
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([if the linker accepts -rdynamic])
LDFLAGS="$old_LDFLAGS -rdynamic"
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
[AC_MSG_RESULT([yes])
AC_SUBST([AM_LDFLAGS], [-rdynamic])],
[AC_MSG_RESULT([no])])
])
LDFLAGS="$old_LDFLAGS"
])
# if we have both lstat() and readlink() then we can support symlink
# timechecks.
AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
[ AC_DEFINE([MAKE_SYMLINKS], [1],
[Define to 1 to enable symbolic link timestamp checking.])
])
# Use posix_spawn if we have support and the user didn't disable it
AC_ARG_ENABLE([posix-spawn],
AS_HELP_STRING([--disable-posix-spawn],[disable support for posix_spawn()]),
[make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
[make_cv_posix_spawn="yes"])
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
[*/no/*], [make_cv_posix_spawn=no])
AS_IF([test "$make_cv_posix_spawn" = yes],
AC_CACHE_CHECK([for posix_spawn that fails synchronously],
[make_cv_synchronous_posix_spawn],
[make_cv_synchronous_posix_spawn=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <errno.h>
#include <spawn.h>
extern char **environ;
int main () {
char path[[]] = "./xxx-non-existent";
char *argv[[]] = {path, 0};
return posix_spawn (0, path, 0, 0, argv, environ) == ENOENT ? 0 : 1;
}]])],
[make_cv_synchronous_posix_spawn=yes],
[make_cv_synchronous_posix_spawn=no],
[make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))
AS_CASE([/$user_posix_spawn/$make_cv_posix_spawn/$make_cv_synchronous_posix_spawn/],
[*/no/*], [make_cv_posix_spawn=no],
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
])
# Find the SCCS commands, so we can include them in our default rules.
AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
AS_IF([test -f /usr/sccs/get],
[make_cv_path_sccs_get=/usr/sccs/get],
[make_cv_path_sccs_get=get])
])
AC_DEFINE_UNQUOTED([SCCS_GET], ["$make_cv_path_sccs_get"],
[Define to the name of the SCCS 'get' command.])
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
test -f s.conftest],
[ # We successfully created an SCCS file.
AC_CACHE_CHECK([if SCCS get command understands -G], [make_cv_sys_get_minus_G],
[AS_IF([$make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast],
[make_cv_sys_get_minus_G=yes],
[make_cv_sys_get_minus_G=no])
])
AS_IF([test "$make_cv_sys_get_minus_G" = yes],
[AC_DEFINE([SCCS_GET_MINUS_G], [1],
[Define to 1 if the SCCS 'get' command understands the '-G<file>' option.])
])
])
rm -f s.conftest conftoast
# Let the makefile know what our build host is
AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
MAKE_HOST="$host"
AC_SUBST([MAKE_HOST])
w32_target_env=no
AM_CONDITIONAL([WINDOWSENV], [false])
AM_CONDITIONAL([HAVE_WINDRES], [false])
AS_CASE([$host],
[*-*-mingw32],
[AM_CONDITIONAL([WINDOWSENV], [true])
w32_target_env=yes
AC_DEFINE([MK_OS_W32], [1], [Build for the Windows32 API.])
AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
# Windows host tools.
# If windres is available, make will use UTF-8.
AC_CHECK_TOOL([WINDRES], [windres], [:])
AM_CONDITIONAL([HAVE_WINDRES], [test "$WINDRES" != ':'])
])
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
[Define to the character that separates directories in PATH.])
AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
[Define to 1 if you have the declaration of 'getloadavg'.])
# Remember that we ran configure to generate config.h
AC_DEFINE([MK_CONFIGURE], [1],
[Define to 1 if config.h is generated by running the configure script.])
# Include the Maintainer's Makefile section, if it's here.
MAINT_MAKEFILE=/dev/null
AS_IF([test -r "$srcdir/maintMakefile"],
[ MAINT_MAKEFILE="$srcdir/maintMakefile"
])
AC_SUBST_FILE([MAINT_MAKEFILE])
# Allow building with dmalloc
AM_WITH_DMALLOC
# Add custom header to config.h
AH_BOTTOM([/* Include customized declarations. */
#include "../src/mkcustom.h"])
# Forcibly disable SET_MAKE. If it's set it breaks things like the test
# scripts, etc.
SET_MAKE=
# Sanity check and inform the user of what we found
AS_IF([test "x$make_badcust" = xyes], [
echo
echo "WARNING: --with-customs specified but no customs.h could be found;"
echo " disabling Customs support."
echo
])
AS_CASE([$with_customs],
[""|n|no|y|ye|yes], [:],
[AS_IF([test -f "$with_customs/lib/libcustoms.a"], [:],
[ echo
echo "WARNING: '$with_customs/lib' does not appear to contain the"
echo " Customs library. You must build and install Customs"
echo " before compiling GNU Make."
echo
])])
AS_IF([test "x$has_wait_nohang" = xno],
[ echo
echo "WARNING: Your system has neither waitpid() nor wait3()."
echo " Without one of these, signal handling is unreliable."
echo " You should be aware that running GNU Make with -j"
echo " could result in erratic behavior."
echo
])
AS_IF([test "x$make_cv_job_server" = xno && test "x$user_job_server" = xyes],
[ echo
echo "WARNING: Make job server requires a POSIX-ish system that"
echo " supports the pipe(), sigaction(), and either"
echo " waitpid() or wait3() functions. Your system doesn't"
echo " appear to provide one or more of those."
echo " Disabling job server support."
echo
])
AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
[ echo
echo "WARNING: 'load' support requires a POSIX-ish system that"
echo " supports the dlopen(), dlsym(), and dlerror() functions."
echo " Your system doesn't appear to provide one or more of these."
echo " Disabling 'load' support."
echo
])
AS_IF([test "x$make_cv_posix_spawn" = xno && test "x$user_posix_spawn" = xyes],
[ echo
echo "WARNING: posix_spawn() is not supported on this system."
echo
])
# autoconf initializes $prefix to NONE.
AM_CONDITIONAL([KNOWN_PREFIX],
[test "x$prefix" = xNONE -o "x$prefix" = x/usr/local \
-o "x$prefix" = x/usr/gnu -o "x$prefix" = x/usr])
# Specify what files are to be created.
AC_CONFIG_FILES([build.cfg tests/config-flags.pm \
Makefile lib/Makefile doc/Makefile po/Makefile.in])
# We don't need this: the standard automake output suffices for POSIX systems.
#mk/Posix.mk
# Put build.sh in the build directory so it's easy to find
AC_CONFIG_LINKS([build.sh:build.sh])
# OK, do it!
AC_OUTPUT
dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl compile-command: "make configure config.h.in"
dnl End:

24
doc/.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
manual/
make.t2d/
make.t2p/
gendocs_template
fdl.texi
make-stds.texi
stamp-vti
version.texi
make.info*
make*.html
make.aux
make.cp
make.cps
make.dvi
make.fn
make.fns
make.ky
make.log
make.pdf
make.pg
make.ps
make.toc
make.tp
make.vr

24
doc/Makefile.am Normal file
View File

@ -0,0 +1,24 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 2000-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
TEXI2HTML = texi2html
TEXI2HTML_FLAGS = -split_chapter
info_TEXINFOS = make.texi
make_TEXINFOS = fdl.texi make-stds.texi
CLEANFILES = make*.html

467
doc/make.1 Normal file
View File

@ -0,0 +1,467 @@
.TH MAKE 1 "26 May 2023" "GNU" "User Commands"
.SH NAME
make \- GNU Make utility to maintain groups of programs
.SH SYNOPSIS
.B make
[\fIOPTION\fR]... [\fITARGET\fR]...
.SH DESCRIPTION
.LP
The
.I make
utility will determine automatically which pieces of a large program need to
be recompiled, and issue the commands to recompile them. The manual describes
the GNU implementation of
.BR make ,
which was written by Richard Stallman and Roland McGrath, and is currently
maintained by Paul Smith. Our examples show C programs, since they are very
common, but you can use
.B make
with any programming language whose compiler can be run with a shell command.
In fact,
.B make
is not limited to programs. You can use it to describe any task where some
files must be updated automatically from others whenever the others change.
.LP
To prepare to use
.BR make ,
you must write a file called the
.I makefile
that describes the relationships among files in your program, and provides
commands for updating each file. In a program, typically the executable file
is updated from object files, which are in turn made by compiling source
files.
.LP
Once a suitable makefile exists, each time you change some source files,
this simple shell command:
.sp 1
.RS
.B make
.RE
.sp 1
suffices to perform all necessary recompilations.
The
.B make
program uses the makefile description and the last-modification times of the
files to decide which of the files need to be updated. For each of those
files, it issues the commands recorded in the makefile.
.LP
.B make
executes commands in the
.I makefile
to update one or more
.IR targets ,
where
.I target
is typically a program.
If no
.B \-f
option is present,
.B make
will look for the makefiles
.IR GNUmakefile ,
.IR makefile ,
and
.IR Makefile ,
in that order.
.LP
Normally you should call your makefile either
.I makefile
or
.IR Makefile .
(We recommend
.I Makefile
because it appears prominently near the beginning of a directory
listing, right near other important files such as
.IR README .)
The first name checked,
.IR GNUmakefile ,
is not recommended for most makefiles. You should use this name if you have a
makefile that is specific to GNU Make, and will not be understood by other
versions of
.BR make .
If
.I makefile
is '\-', the standard input is read.
.LP
.B make
updates a target if it depends on prerequisite files
that have been modified since the target was last modified,
or if the target does not exist.
.SH OPTIONS
.sp 1
.TP 0.5i
\fB\-b\fR, \fB\-m\fR
These options are ignored for compatibility with other versions of
.BR make .
.TP 0.5i
\fB\-B\fR, \fB\-\-always\-make\fR
Unconditionally make all targets.
.TP 0.5i
\fB\-C\fR \fIdir\fR, \fB\-\-directory\fR=\fIdir\fR
Change to directory
.I dir
before reading the makefiles or doing anything else.
If multiple
.B \-C
options are specified, each is interpreted relative to the
previous one:
.BR "\-C " /
.BR "\-C " etc
is equivalent to
.BR "\-C " /etc.
This is typically used with recursive invocations of
.BR make .
.TP 0.5i
.B \-d
Print debugging information in addition to normal processing.
The debugging information says which files are being considered for
remaking, which file-times are being compared and with what results,
which files actually need to be remade, which implicit rules are
considered and which are applied---everything interesting about how
.B make
decides what to do.
.TP 0.5i
.BI \-\-debug "[=FLAGS]"
Print debugging information in addition to normal processing.
If the
.I FLAGS
are omitted, then the behavior is the same as if
.B \-d
was specified.
.I FLAGS
may be any or all of the following names, comma- or space-separated. Only the
first character is significant: the rest may be omitted:
.I all
for all debugging output (same as using
.BR \-d ),
.I basic
for basic debugging,
.I verbose
for more verbose basic debugging,
.I implicit
for showing implicit rule search operations,
.I jobs
for details on invocation of commands,
.I makefile
for debugging while remaking makefiles,
.I print
shows all recipes that are run even if they are silent, and
.I why
shows the reason
.BR make
decided to rebuild each target. Use
.I none
to disable all previous debugging flags.
.TP 0.5i
\fB\-e\fR, \fB\-\-environment\-overrides\fR
Give variables taken from the environment precedence over variables
from makefiles.
.TP 0.5i
\fB\-E\fR \fIstring\fR, \fB\-\-eval\fR \fIstring\fR
Interpret \fIstring\fR using the \fBeval\fR function, before parsing any
makefiles.
.TP 0.5i
\fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
Use
.I file
as a makefile.
.TP 0.5i
\fB\-i\fR, \fB\-\-ignore\-errors\fR
Ignore all errors in commands executed to remake files.
.TP 0.5i
\fB\-I\fR \fIdir\fR, \fB\-\-include\-dir\fR=\fIdir\fR
Specifies a directory
.I dir
to search for included makefiles.
If several
.B \-I
options are used to specify several directories, the directories are
searched in the order specified.
Unlike the arguments to other flags of
.BR make ,
directories given with
.B \-I
flags may come directly after the flag:
.BI \-I dir
is allowed, as well as
.B \-I
.IR dir .
This syntax is allowed for compatibility with the C
preprocessor's
.B \-I
flag.
.TP 0.5i
\fB\-j\fR [\fIjobs\fR], \fB\-\-jobs\fR[=\fIjobs\fR]
Specifies the number of
.I jobs
(commands) to run simultaneously.
If there is more than one
.B \-j
option, the last one is effective.
If the
.B \-j
option is given without an argument,
.BR make
will not limit the number of jobs that can run simultaneously.
.TP 0.5i
\fB\--jobserver-style=\fR\fIstyle\fR
The style of jobserver to use. The
.I style
may be one of
.BR fifo ,
.BR pipe ,
or
.B sem
(Windows only).
.TP 0.5i
\fB\-k\fR, \fB\-\-keep\-going\fR
Continue as much as possible after an error.
While the target that failed, and those that depend on it, cannot
be remade, the other dependencies of these targets can be processed
all the same.
.TP 0.5i
\fB\-l\fR [\fIload\fR], \fB\-\-load\-average\fR[=\fIload\fR]
Specifies that no new jobs (commands) should be started if there are
others jobs running and the load average is at least
.I load
(a floating-point number).
With no argument, removes a previous load limit.
.TP 0.5i
\fB\-L\fR, \fB\-\-check\-symlink\-times\fR
Use the latest mtime between symlinks and target.
.TP 0.5i
\fB\-n\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR, \fB\-\-recon\fR
Print the commands that would be executed, but do not execute them (except in
certain circumstances).
.TP 0.5i
\fB\-o\fR \fIfile\fR, \fB\-\-old\-file\fR=\fIfile\fR, \fB\-\-assume\-old\fR=\fIfile\fR
Do not remake the file
.I file
even if it is older than its dependencies, and do not remake anything
on account of changes in
.IR file .
Essentially the file is treated as very old and its rules are ignored.
.TP 0.5i
\fB\-O\fR[\fItype\fR], \fB\-\-output\-sync\fR[=\fItype\fR]
When running multiple jobs in parallel with \fB-j\fR, ensure the output of
each job is collected together rather than interspersed with output from
other jobs. If
.I type
is not specified or is
.B target
the output from the entire recipe for each target is grouped together. If
.I type
is
.B line
the output from each command line within a recipe is grouped together.
If
.I type
is
.B recurse
output from an entire recursive make is grouped together. If
.I type
is
.B none
output synchronization is disabled.
.TP 0.5i
\fB\-p\fR, \fB\-\-print\-data\-base\fR
Print the data base (rules and variable values) that results from
reading the makefiles; then execute as usual or as otherwise
specified.
This also prints the version information given by the
.B \-v
switch (see below). To print the built-in data base only, use
.IR "make \-p \-f/dev/null" .
.TP 0.5i
\fB\-\-print\-targets\fR
Print each target defined as a result of reading the makefiles, one target per
line, then exit with success. Implicit rule targets are not printed, nor are
special targets (target names that consist of "." followed by all upper-case
letters). No recipe commands are invoked and no makefiles are rebuilt.
.TP 0.5i
\fB\-q\fR, \fB\-\-question\fR
``Question mode''.
Do not run any commands, or print anything; just return an exit status
that is zero if the specified targets are already up to date, nonzero
otherwise.
.TP 0.5i
\fB\-r\fR, \fB\-\-no\-builtin\-rules\fR
Eliminate use of the built\-in implicit rules.
Also clear out the default list of suffixes for suffix rules.
.TP 0.5i
\fB\-R\fR, \fB\-\-no\-builtin\-variables\fR
Don't define any built\-in variables.
.TP 0.5i
\fB\-s\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR
Silent operation; do not print the commands as they are executed.
.TP 0.5i
.B \-\-no\-silent
Cancel the effect of the \fB\-s\fR option.
.TP 0.5i
\fB\-S\fR, \fB\-\-no\-keep\-going\fR, \fB\-\-stop\fR
Cancel the effect of the
.B \-k
option.
.TP 0.5i
\fB\-t\fR, \fB\-\-touch\fR
Touch files (mark them up to date without really changing them)
instead of running their commands.
This is used to pretend that the commands were done, in order to fool
future invocations of
.BR make .
.TP 0.5i
.B \-\-trace
Information about the disposition of each target is printed (why the target is
being rebuilt and what commands are run to rebuild it).
.TP 0.5i
\fB\-v\fR, \fB\-\-version\fR
Print the version of the
.B make
program plus a copyright, a list of authors and a notice that there
is no warranty.
.TP 0.5i
\fB\-w\fR, \fB\-\-print\-directory\fR
Print a message containing the working directory
before and after other processing.
This may be useful for tracking down errors from complicated nests of
recursive
.B make
commands.
.TP 0.5i
.B \-\-no\-print\-directory
Turn off
.BR \-w ,
even if it was turned on implicitly.
.TP 0.5i
.BI \-\-shuffle "[=MODE]"
Enable shuffling of goal and prerequisite ordering.
.I MODE
is one of
.I none
to disable shuffle mode,
.I random
to shuffle prerequisites in random order,
.I reverse
to consider prerequisites in reverse order, or an integer
.I <seed>
which enables
.I random
mode with a specific
.I seed
value. If
.I MODE
is omitted the default is
.IR random .
.TP 0.5i
\fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
Pretend that the target
.I file
has just been modified.
When used with the
.B \-n
flag, this shows you what would happen if you were to modify that file.
Without
.BR \-n ,
it is almost the same as running a
.I touch
command on the given file before running
.BR make ,
except that the modification time is changed only in the imagination of
.BR make .
.TP 0.5i
\fB\-\-warn\fR[=\fIARG[\fR,\fIARG\fR]]
Control warning reporting for makefiles. This option can appear multiple times.
In case of conflicts, later settings override earlier settings.
.I ARG
can be an action; one of
.IR ignore ,
.IR warn ,
or
.I error
to set the default action for all warnings, or it can be a specific warning:
.I circular-dep
(finding a circular dependency),
.I invalid-ref
(referencing an invalid variable name),
.I invalid-var
(assigning to an invalid variable name),
or
.I undefined-var
(referencing an undefined variable). The behavior of each warning can be set
by adding
.BI : action
after the warning name. If an action is not specified the default is
.IR warn .
If no
.I ARG
is provided the action for all warnings is
.IR warn .
If no
.B \-\-warn
option is provided the default action for
.I invalid-var
and
.I invalid-ref
is
.I warn
and the default action for
.I undefined-var
is
.IR ignore .
.TP 0.5i
.B \-\-warn\-undefined\-variables
A deprecated alternative for
.BR \-\-warn=undefined-var .
.TP 0.5i
.B \-
This option alone (not as an argument to the
.B \-f
option) is ignored, unless a target named
.B \-
is defined in the makefile, in which case that target is added to the makefile
goals.
.SH "EXIT STATUS"
GNU Make exits with a status of zero if all makefiles were successfully parsed
and no targets that were built failed. A status of one will be returned
if the
.B \-q
flag was used and
.B make
determines that a target needs to be rebuilt. A status of two will be
returned if any errors were encountered.
.SH "SEE ALSO"
The full documentation for
.B make
is maintained as a Texinfo manual. If the
.B info
and
.B make
programs are properly installed at your site, the command
.IP
.B info make
.PP
should give you access to the complete manual.
.SH BUGS
See the chapter ``Problems and Bugs'' in
.IR "The GNU Make Manual" .
.SH AUTHOR
This manual page contributed by Dennis Morse of Stanford University.
Further updates contributed by Mike Frysinger. It has been reworked by Roland
McGrath. Maintained by Paul Smith.
.SH "COPYRIGHT"
Copyright \(co 1992\(en1993, 1996\(en2024 Free Software Foundation, Inc.
This file is part of
.IR "GNU Make" .
.LP
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
.LP
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.LP
You should have received a copy of the GNU General Public License along with
this program. If not, see
.IR https://www.gnu.org/licenses/ .

14498
doc/make.texi Normal file

File diff suppressed because it is too large Load Diff

10
gl/.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
*~
#*
.#*
.*cache
*.diff
*.patch
*.orig
*.rej
*.out
*.log

65
gl/README Normal file
View File

@ -0,0 +1,65 @@
04 July 2022 -*-text-*-
The gnulib project provides a fantastic array of modules that can support both
POSIX and also extended features for GNU software.
Unfortunately using it in GNU make is problematic: GNU make is a foundational
utility (if you don't have a "make" program you pretty much can't build any
software), one of our goals in GNU make is to provide scripts (e.g.,
"build.sh") that will build GNU make without needing an instance of make.
Instead of running "./configure && make", you should be able to run
"./configure && ./build.sh" and get a build of GNU make as a result.
However, more and more gnulib modules are relying not on M4 macros and
the configure script to manage their configuration, but in addition special
makefile recipes that perform various post-configure operations. Since we
don't have an instance of "make", we cannot use these modules as-is.
There are various options we could choose for solving this:
- Avoid gnulib modules and write our own portability interfaces.
I really am not too excited about this.
- Give up on "build.sh" and require users to already have "make".
The argument here is that you must already have a compiler, and it couldn't
have been built without "make", and/or if you build it with a cross-compiler
then you should be able to use that cross-development environment to build
GNU make as well.
- Provide a "mini-make" with just enough functionality to support the gnulib
makefiles but no extra features, that didn't need any complex gnulib
modules. As with the first option, I'm not too excited about this.
Although arguably the second option is the sane one, I'm not really excited
about any of them for the time being. So I elected to try something between
the first and second options:
The gnulib-port Git branch will contain unmodified copies of gnulib modules
that we want to use with GNU make. From there, we merge them into the main
Git branch then modify / simplify them to avoid unnecessary extra modules and
allow "build.sh" to be used.
By keeping the unmodified versions on the gnulib-port branch, we enable Git
merge facilities to merge in new versions as follows:
* Check out the gnulib-port branch
* Update its content with any updates to gnulib modules. Something like:
(
cd gl \
&& find */. -type f \
| while read fn; do
test -f "$GNULIB_SRCDIR/$fn" && cp "$GNULIB_SRCDIR/$fn" "$fn"
done
)
* Commit the changes _without modification_
* Check out the main branch
* Run "git merge --no-ff gnulib-port" to merge in the changes
* Resolve any conflicts and commit the merge.
-- pds

459
gl/lib/fnmatch.c Normal file
View File

@ -0,0 +1,459 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB.
If not, see <https://www.gnu.org/licenses/>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Enable GNU extensions in fnmatch.h. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fnmatch.h>
#include <ctype.h>
#if HAVE_STRING_H || defined _LIBC
# include <string.h>
#else
# include <strings.h>
#endif
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#endif
/* For platform which support the ISO C amendement 1 functionality we
support user defined character classes. */
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
# include <wchar.h>
# include <wctype.h>
#endif
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined _LIBC || !defined __GNU_LIBRARY__
# if defined STDC_HEADERS || !defined isascii
# define ISASCII(c) 1
# else
# define ISASCII(c) isascii(c)
# endif
# ifdef isblank
# define ISBLANK(c) (ISASCII (c) && isblank (c))
# else
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
# endif
# ifdef isgraph
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
# else
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
# endif
# define ISPRINT(c) (ISASCII (c) && isprint (c))
# define ISDIGIT(c) (ISASCII (c) && isdigit (c))
# define ISALNUM(c) (ISASCII (c) && isalnum (c))
# define ISALPHA(c) (ISASCII (c) && isalpha (c))
# define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
# define ISLOWER(c) (ISASCII (c) && islower (c))
# define ISPUNCT(c) (ISASCII (c) && ispunct (c))
# define ISSPACE(c) (ISASCII (c) && isspace (c))
# define ISUPPER(c) (ISASCII (c) && isupper (c))
# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
/* The GNU C library provides support for user-defined character classes
and the functions from ISO C amendement 1. */
# ifdef CHARCLASS_NAME_MAX
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
# else
/* This shouldn't happen but some implementation might still have this
problem. Use a reasonable default value. */
# define CHAR_CLASS_MAX_LENGTH 256
# endif
# ifdef _LIBC
# define IS_CHAR_CLASS(string) __wctype (string)
# else
# define IS_CHAR_CLASS(string) wctype (string)
# endif
# else
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
# define IS_CHAR_CLASS(string) \
(STREQ (string, "alpha") || STREQ (string, "upper") \
|| STREQ (string, "lower") || STREQ (string, "digit") \
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|| STREQ (string, "space") || STREQ (string, "print") \
|| STREQ (string, "punct") || STREQ (string, "graph") \
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
# endif
/* Avoid depending on library functions or files
whose names are inconsistent. */
# if !defined _LIBC && !defined getenv
extern char *getenv ();
# endif
# ifndef errno
extern int errno;
# endif
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
static int
internal_fnmatch (const char *pattern, const char *string,
int no_leading_period, int flags)
{
const char *p = pattern, *n = string;
unsigned char c;
/* Note that this evaluates C many times. */
# ifdef _LIBC
# define FOLD(c) (unsigned char)((flags & FNM_CASEFOLD) ? tolower (c) : (c))
# else
# define FOLD(c) (unsigned char)((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
# endif
while ((c = *p++) != '\0')
{
c = FOLD (c);
switch (c)
{
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if (*n == '/' && (flags & FNM_FILE_NAME))
return FNM_NOMATCH;
else if (*n == '.' && no_leading_period
&& (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
break;
case '\\':
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
if (c == '\0')
/* Trailing \ loses. */
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD ((unsigned char) *n) != c)
return FNM_NOMATCH;
break;
case '*':
if (*n == '.' && no_leading_period
&& (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
if (*n == '/' && (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == '?')
{
/* A ? needs to match one character. */
if (*n == '\0')
/* There isn't another character; no match. */
return FNM_NOMATCH;
else
/* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are
less than three characters. */
++n;
}
}
if (c == '\0')
/* The wildcard(s) is/are the last element of the pattern.
If the name is a file name and contains another slash
this does mean it cannot match. */
return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
? FNM_NOMATCH : 0);
else
{
const char *endp;
endp = strchr (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
if (endp == NULL)
endp = n + strlen (n);
if (c == '[')
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
for (--p; n < endp; ++n)
if (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2)
== 0)
return 0;
}
else if (c == '/' && (flags & FNM_FILE_NAME))
{
while (*n != '\0' && *n != '/')
++n;
if (*n == '/'
&& (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
flags) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
if (c == '\\' && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
for (--p; n < endp; ++n)
if (FOLD ((unsigned char) *n) == c
&& (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2) == 0))
return 0;
}
}
/* If we come here no match is possible with the wildcard. */
return FNM_NOMATCH;
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
static int posixly_correct;
int not;
char cold;
if (posixly_correct == 0)
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (*n == '\0')
return FNM_NOMATCH;
if (*n == '.' && no_leading_period && (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME))))
return FNM_NOMATCH;
if (*n == '/' && (flags & FNM_FILE_NAME))
/* `/' cannot be matched. */
return FNM_NOMATCH;
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
if (not)
++p;
c = *p++;
for (;;)
{
unsigned char fn = FOLD ((unsigned char) *n);
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
c = FOLD ((unsigned char) *p);
++p;
if (c == fn)
goto matched;
}
else if (c == '[' && *p == ':')
{
/* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt;
# endif
const char *startp = p;
for (;;)
{
if (c1 == CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern
is ill-formed. */
return FNM_NOMATCH;
c = *++p;
if (c == ':' && p[1] == ']')
{
p += 2;
break;
}
if (c < 'a' || c >= 'z')
{
/* This cannot possibly be a character class name.
Match it as a normal range. */
p = startp;
c = '[';
goto normal_bracket;
}
str[c1++] = c;
}
str[c1] = '\0';
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
return FNM_NOMATCH;
if (__iswctype (__btowc ((unsigned char) *n), wt))
goto matched;
# else
if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|| (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|| (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|| (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|| (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|| (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|| (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|| (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|| (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|| (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|| (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|| (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
goto matched;
# endif
}
else if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
else
{
normal_bracket:
if (FOLD (c) == fn)
goto matched;
cold = c;
c = *p++;
if (c == '-' && *p != ']')
{
/* It is a range. */
unsigned char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend))
goto matched;
c = *p++;
}
}
if (c == ']')
break;
}
if (!not)
return FNM_NOMATCH;
break;
matched:
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
if (c == '\0')
/* [... (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
else if (c == '[' && *p == ':')
{
do
if (*++p == '\0')
return FNM_NOMATCH;
while (*p != ':' || p[1] == ']');
p += 2;
c = *p;
}
}
if (not)
return FNM_NOMATCH;
}
break;
default:
if (c != FOLD ((unsigned char) *n))
return FNM_NOMATCH;
}
++n;
}
if (*n == '\0')
return 0;
if ((flags & FNM_LEADING_DIR) && *n == '/')
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
return 0;
return FNM_NOMATCH;
# undef FOLD
}
int
fnmatch (const char *pattern, const char *string, int flags)
{
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */

62
gl/lib/fnmatch.in.h Normal file
View File

@ -0,0 +1,62 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB.
If not, see <https://www.gnu.org/licenses/>. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* This value is returned if the implementation does not support
`fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1)
#endif
/* Match NAME against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch (const char *pattern, const char *name, int flags);
#ifdef __cplusplus
}
#endif
#endif /* fnmatch.h */

1320
gl/lib/glob.c Normal file

File diff suppressed because it is too large Load Diff

161
gl/lib/glob.in.h Normal file
View File

@ -0,0 +1,161 @@
/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2023 Free Software
Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB.
If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GLOB_H
#define _GLOB_H 1
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Bits set in the FLAGS argument to `glob'. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|| defined _GNU_SOURCE)
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD)
#endif
/* Error returns from `glob'. */
#define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
#ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of
GLOB_ABORTED. Provide a compatibility definition here. */
# define GLOB_ABEND GLOB_ABORTED
#endif
/* Structure describing a globbing run. */
#if !defined _AMIGA && !MK_OS_VMS /* Buggy compiler. */
struct stat;
#endif
typedef struct
{
size_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */
size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */
void (*gl_closedir) (void *);
struct dirent *(*gl_readdir) (void *);
void * (*gl_opendir) (const char *);
int (*gl_lstat) (const char *, struct stat *);
#if MK_OS_VMS && defined(__DECC) && !defined(_POSIX_C_SOURCE)
int (*gl_stat) (const char *, struct stat *, ...);
#else
int (*gl_stat) (const char *, struct stat *);
#endif
} glob_t;
#ifdef _LARGEFILE64_SOURCE
struct stat64;
typedef struct
{
size_t gl_pathc;
char **gl_pathv;
size_t gl_offs;
int gl_flags;
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */
void (*gl_closedir) (void *);
struct dirent64 *(*gl_readdir) (void *);
void * (*gl_opendir) (const char *);
int (*gl_lstat) (const char *, struct stat64 *);
int (*gl_stat) (const char *, struct stat64 *);
} glob64_t;
#endif
#if _FILE_OFFSET_BITS == 64 && __GNUC__ < 2
# define glob glob64
# define globfree globfree64
#else
# ifdef _LARGEFILE64_SOURCE
extern int glob64 (const char *pattern, int flags,
int (*errfunc) (const char *, int),
glob64_t *pglob);
extern void globfree64 (glob64_t *pglob);
# endif
#endif
/* Do glob searching for PATTERN, placing results in PGLOB.
The bits defined above may be set in FLAGS.
If a directory cannot be opened or read and ERRFUNC is not nil,
it is called with the pathname that caused the error, and the
`errno' value from the failing call; if it returns non-zero
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
#if _FILE_OFFSET_BITS != 64 || __GNUC__ < 2
extern int glob (const char *pattern, int flags,
int (*errfunc) (const char *, int),
glob_t *pglob);
/* Free storage allocated in PGLOB by a previous `glob' call. */
extern void globfree (glob_t *pglob);
#else
extern int glob (const char *pattern, int flags,
int (*errfunc) (const char *, int),
glob_t *pglob) __asm__ ("glob64");
extern void globfree (glob_t *pglob) __asm__ ("globfree64");
#endif
#ifdef _GNU_SOURCE
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero.
This function is not part of the interface specified by POSIX.2
but several programs want to use it. */
extern int glob_pattern_p (const char *pattern, int quote);
#endif
#ifdef __cplusplus
}
#endif
#endif /* glob.h */

132
gl/m4/acinclude.m4 Normal file
View File

@ -0,0 +1,132 @@
dnl acinclude.m4 -- Extra macros needed for GNU Make.
dnl
dnl Automake will incorporate this into its generated aclocal.m4.
dnl Copyright (C) 1998-2024 Free Software Foundation, Inc.
dnl This file is part of GNU Make.
dnl
dnl GNU Make is free software; you can redistribute it and/or modify it under
dnl the terms of the GNU General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your option)
dnl any later version.
dnl
dnl GNU Make is distributed in the hope that it will be useful, but WITHOUT
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
dnl more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program. If not, see <https://www.gnu.org/licenses/>.
dnl ---------------------------------------------------------------------------
dnl Got this from the lynx 2.8 distribution.
dnl by T.E.Dickey <dickey@clark.net>
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
dnl and Philippe De Muyter <phdm@macqel.be>
dnl
dnl Created: 1997/1/28
dnl Updated: 1997/12/23
dnl ---------------------------------------------------------------------------
dnl After checking for functions in the default $LIBS, make a further check
dnl for the functions that are netlib-related (these aren't always in the
dnl libc, etc., and have to be handled specially because there are conflicting
dnl and broken implementations.
dnl Common library requirements (in order):
dnl -lresolv -lsocket -lnsl
dnl -lnsl -lsocket
dnl -lsocket
dnl -lbsd
AC_DEFUN([CF_NETLIBS],[
cf_test_netlibs=no
AC_MSG_CHECKING(for network libraries)
AC_CACHE_VAL(cf_cv_netlibs,[
AC_MSG_RESULT(working...)
cf_cv_netlibs=""
cf_test_netlibs=yes
AC_CHECK_FUNCS(gethostname,,[
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
#
# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
# I don't know the entrypoints - 97/7/22 TD
AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
#
if test "$ac_cv_func_lsocket" != no ; then
AC_CHECK_FUNCS(socket,,[
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
fi
#
AC_CHECK_FUNCS(gethostbyname,,[
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
])
LIBS="$LIBS $cf_cv_netlibs"
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
])dnl
dnl ---------------------------------------------------------------------------
dnl Re-check on a function to see if we can pick it up by adding a library.
dnl $1 = function to check
dnl $2 = library to check in
dnl $3 = environment to update (e.g., $LIBS)
dnl $4 = what to do if this fails
dnl
dnl This uses 'unset' if the shell happens to support it, but leaves the
dnl configuration variable set to 'unknown' if not. This is a little better
dnl than the normal autoconf test, which gives misleading results if a test
dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
dnl used (autoconf does not distinguish between a null token and one that is
dnl set to 'no').
AC_DEFUN([CF_RECHECK_FUNC],[
AC_CHECK_LIB($2,$1,[
CF_UPPER(cf_tr_func,$1)
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func,1,[Define if you have function $1])
ac_cv_func_$1=yes
$3="-l$2 [$]$3"],[
ac_cv_func_$1=unknown
unset ac_cv_func_$1 2>/dev/null
$4],
[[$]$3])
])dnl
dnl ---------------------------------------------------------------------------
dnl Make an uppercase version of a variable
dnl $1=uppercase($2)
AC_DEFUN([CF_UPPER],
[
changequote(,)dnl
$1=`echo $2 | tr '[a-z]' '[A-Z]'`
changequote([,])dnl
])dnl
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
dnl Update for Darwin by Troy Runkel <Troy.Runkel@mathworks.com>
dnl Update for AIX by Olexiy Buyanskyy (Savannah bug 32485)
AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
[AC_CACHE_CHECK([for nanoseconds field of struct stat],
ac_cv_struct_st_mtim_nsec,
[ac_save_CPPFLAGS="$CPPFLAGS"
ac_cv_struct_st_mtim_nsec=no
# st_mtim.tv_nsec -- the usual case
# st_mtim._tv_nsec -- Solaris 2.6, if
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
# && !defined __EXTENSIONS__)
# st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2
# st_mtime_n -- AIX 5.2 and above
# st_mtimespec.tv_nsec -- Darwin (Mac OSX)
for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
], [struct stat s; s.ST_MTIM_NSEC;],
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
done
CPPFLAGS="$ac_save_CPPFLAGS"
])
if test $ac_cv_struct_st_mtim_nsec != no; then
AC_DEFINE_UNQUOTED([ST_MTIM_NSEC], [$ac_cv_struct_st_mtim_nsec],
[Define if struct stat contains a nanoseconds field])
fi
]
)

33
gl/m4/dospaths.m4 Normal file
View File

@ -0,0 +1,33 @@
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
#
# Copyright (C) 1993-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
AC_DEFUN([pds_AC_DOS_PATHS], [
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __EMX__ && !defined __MSYS__ && !defined __CYGWIN__
neither MSDOS nor Windows nor OS2
#endif
]])],
[ac_cv_dos_paths=yes],
[ac_cv_dos_paths=no])])
AS_IF([test x"$ac_cv_dos_paths" = xyes],
[ AC_DEFINE_UNQUOTED([HAVE_DOS_PATHS], 1,
[Define if the system uses DOS-style pathnames.])])
])

216
gl/m4/getloadavg.m4 Normal file
View File

@ -0,0 +1,216 @@
# Check for getloadavg.
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free
# Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 10
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
# New applications should use gl_GETLOADAVG instead.
# gl_GETLOADAVG
# -------------
AC_DEFUN([gl_GETLOADAVG],
[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
# Persuade glibc <stdlib.h> to declare getloadavg().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
gl_save_LIBS=$LIBS
# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
HAVE_GETLOADAVG=1
AC_CHECK_FUNC([getloadavg], [],
[gl_func_getloadavg_done=no
# Some systems with -lutil have (and need) -lkvm as well, some do not.
# On Solaris, -lkvm requires nlist from -lelf, so check that first
# to get the right answer into the cache.
# For kstat on solaris, we need to test for libelf and libkvm to force the
# definition of SVR4 below.
if test $gl_func_getloadavg_done = no; then
AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
# Check for the 4.4BSD definition of getloadavg.
AC_CHECK_LIB([util], [getloadavg],
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
fi
if test $gl_func_getloadavg_done = no; then
# There is a commonly available library for RS/6000 AIX.
# Since it is not a standard part of AIX, it might be installed locally.
gl_getloadavg_LIBS=$LIBS
if test $cross_compiling != yes; then
LIBS="-L/usr/local/lib $LIBS"
fi
AC_CHECK_LIB([getloadavg], [getloadavg],
[LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
[LIBS=$gl_getloadavg_LIBS])
fi
# Set up the replacement function if necessary.
if test $gl_func_getloadavg_done = no; then
HAVE_GETLOADAVG=0
# Solaris has libkstat which does not require root.
AC_CHECK_LIB([kstat], [kstat_open])
test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
# AIX has libperfstat which does not require root
if test $gl_func_getloadavg_done = no; then
AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
fi
if test $gl_func_getloadavg_done = no; then
AC_CHECK_HEADER([sys/dg_sys_info.h],
[gl_func_getloadavg_done=yes
AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
AC_CHECK_LIB([dgc], [dg_sys_info])])
fi
fi])
if test "x$gl_save_LIBS" = x; then
GETLOADAVG_LIBS=$LIBS
else
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
fi
LIBS=$gl_save_LIBS
AC_SUBST([GETLOADAVG_LIBS])dnl
# Test whether the system declares getloadavg. Solaris has the function
# but declares it in <sys/loadavg.h>, not <stdlib.h>.
AC_CHECK_HEADERS([sys/loadavg.h])
if test $ac_cv_header_sys_loadavg_h = yes; then
HAVE_SYS_LOADAVG_H=1
else
HAVE_SYS_LOADAVG_H=0
fi
AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
[[#if HAVE_SYS_LOADAVG_H
/* OpenIndiana has a bug: <sys/time.h> must be included before
<sys/loadavg.h>. */
# include <sys/time.h>
# include <sys/loadavg.h>
#endif
#include <stdlib.h>]])
])# gl_GETLOADAVG
# gl_PREREQ_GETLOADAVG
# --------------------
# Set up the AC_LIBOBJ replacement of 'getloadavg'.
AC_DEFUN([gl_PREREQ_GETLOADAVG],
[
# Figure out what our getloadavg.c needs.
AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h])
# On HPUX9, an unprivileged user can get load averages this way.
if test $gl_func_getloadavg_done = no; then
AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
fi
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
# Irix 4.0.5F has the header but not the library.
if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
&& test "$ac_cv_lib_kvm_kvm_open" = yes; then
gl_func_getloadavg_done=yes
AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
fi
if test $gl_func_getloadavg_done = no; then
AC_CHECK_HEADER([inq_stats/cpustats.h],
[gl_func_getloadavg_done=yes
AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
AC_DEFINE([UMAX4_3], [1],
[Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>.])])
fi
if test $gl_func_getloadavg_done = no; then
AC_CHECK_HEADER([sys/cpustats.h],
[gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
fi
if test $gl_func_getloadavg_done = no; then
AC_CHECK_HEADERS([mach/mach.h])
fi
AC_CHECK_HEADERS([nlist.h],
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
[], [],
[#include <nlist.h>])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
[[struct nlist x;
#ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
x.n_un.n_name = "";
#else
x.n_name = "";
#endif]])],
[AC_DEFINE([N_NAME_POINTER], [1],
[Define to 1 if the nlist n_name member is a pointer])])
])dnl
])# gl_PREREQ_GETLOADAVG
# ---- GNU Make
# These macros are imported from stdlib which we don't want to include
# Only the getloadavg content is imported.
AC_DEFUN_ONCE([gl_STDLIB_H],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
#if HAVE_SYS_LOADAVG_H
/* OpenIndiana has a bug: <sys/time.h> must be included before
<sys/loadavg.h>. */
# include <sys/time.h>
# include <sys/loadavg.h>
#endif
#if HAVE_RANDOM_H
# include <random.h>
#endif
]], [getloadavg])
])
# gl_STDLIB_MODULE_INDICATOR([modulename])
# sets the shell variable that indicates the presence of the given module
# to a C preprocessor expression that will evaluate to 1.
# This macro invocation must not occur in macros that are AC_REQUIREd.
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
[
dnl Ensure to expand the default settings once only.
gl_STDLIB_H_REQUIRE_DEFAULTS
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
# Initializes the default values for AC_SUBSTed shell variables.
# This macro must not be AC_REQUIREd. It must only be invoked, and only
# outside of macros or in macros that are not AC_REQUIREd.
AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
])
m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
])
AC_DEFUN([gl_STDLIB_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
])

View File

@ -0,0 +1,24 @@
Description:
Construct a full filename by concatenating a directory name, a relative
filename, and a suffix.
Files:
lib/concat-filename.h
lib/concat-filename.c
Depends-on:
filename
configure.ac:
Makefile.am:
lib_SOURCES += concat-filename.c
Include:
"concat-filename.h"
License:
LGPLv2+
Maintainer:
all

28
gl/modules/findprog-in Normal file
View File

@ -0,0 +1,28 @@
Description:
Locating a program in a given path.
Files:
lib/findprog.h
lib/findprog-in.c
m4/findprog-in.m4
m4/eaccess.m4
Depends-on:
stdbool
filename
concat-filename
configure.ac:
gl_FINDPROG_IN
Makefile.am:
lib_SOURCES += findprog.h findprog-in.c
Include:
"findprog.h"
License:
LGPLv2+
Maintainer:
all

40
gl/modules/getloadavg Normal file
View File

@ -0,0 +1,40 @@
Description:
Return the current system load averages.
Files:
lib/getloadavg.c
m4/getloadavg.m4
Depends-on:
snippet/warn-on-use
extensions
intprops [test $HAVE_GETLOADAVG = 0]
stdbool [test $HAVE_GETLOADAVG = 0]
configure.ac:
gl_STDLIB_H
gl_STDLIB_H_REQUIRE_DEFAULTS
AC_REQUIRE([AC_CANONICAL_HOST])
gl_GETLOADAVG
gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0])
AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
gl_PREREQ_GETLOADAVG
])
gl_STDLIB_MODULE_INDICATOR([getloadavg])
Makefile.am:
if GL_COND_OBJ_GETLOADAVG
lib_SOURCES += getloadavg.c
endif
Include:
<stdlib.h>
Link:
$(GETLOADAVG_LIBS)
License:
GPL
Maintainer:
Jim Meyering

112
gl/modules/make-glob Normal file
View File

@ -0,0 +1,112 @@
Description:
GNU Make version of fnmatch()/glob() functions. This is a holdover from
a very old version of the globbing library.
Files:
lib/fnmatch.c
lib/fnmatch.in.h
lib/glob.c
lib/glob.in.h
configure.ac:
# Check the system to see if it provides GNU glob. If not, use our
# local version. Also avoid versions of glibc which have symlink bug
# https://sourceware.org/bugzilla/show_bug.cgi?id=866 (test from gnulib)
AC_CACHE_CHECK([if system libc has working GNU glob], [make_cv_sys_gnu_glob],[
if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
make_check_symlink=yes
else
make_check_symlink=no
fi
if test $cross_compiling = yes || test $make_check_symlink = no; then
# When cross-compiling or without symlink support, check the version
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <features.h>
#include <gnu-versions.h>
#include <glob.h>
#include <fnmatch.h>
]],
[[
#if _GNU_GLOB_INTERFACE_VERSION == 0
GNU glob not available in libc
#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 27)
GNU glob in libc has dangling symlink bug
#endif
]])],
[make_cv_sys_gnu_glob=yes],
[make_cv_sys_gnu_glob=no])
else
# Check for GNU glob, and that it handles dangling symlinks properly
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <features.h>
#include <gnu-versions.h>
#include <glob.h>
#include <fnmatch.h>
]],
[[
#if _GNU_GLOB_INTERFACE_VERSION == 0
return 1;
#else
glob_t found;
if (glob ("conf*-globtest", 0, 0, &found) == GLOB_NOMATCH)
return 1;
globfree (&found);
#endif
]])],
[make_cv_sys_gnu_glob=yes],
[make_cv_sys_gnu_glob=no],
[dnl We don't get here.
:
])
fi
test $make_check_symlink = no || rm -f conf$$-globtest
])
# Tell automake about this, so it can build the right .c files.
AM_CONDITIONAL([USE_SYSTEM_GLOB], [test "$make_cv_sys_gnu_glob" = yes])
# Tell build.sh which to use
USE_SYSTEM_GLOB="$make_cv_sys_gnu_glob"
AC_SUBST([USE_SYSTEM_GLOB])
Makefile.am:
if !USE_SYSTEM_GLOB
libgnu_a_SOURCES += fnmatch.c
BUILT_SOURCES += fnmatch.h
fnmatch.h: fnmatch.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/fnmatch.in.h; \
} > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
libgnu_a_SOURCES += glob.c
BUILT_SOURCES += glob.h
glob.h: glob.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/glob.in.h; \
} > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += glob.h glob.h-t
endif
EXTRA_DIST += fnmatch.in.h glob.in.h
Include:
<glob.h>
License:
LGPLv2+
Maintainer:
all, glibc

16
gl/modules/make-macros Normal file
View File

@ -0,0 +1,16 @@
Description:
Install m4 macros for GNU Make.
Files:
m4/acinclude.m4
m4/dospaths.m4
configure.ac:
# Check for DOS-style pathnames.
pds_AC_DOS_PATHS
License:
GPLv3+
Maintainer:
gnumake

536
maintMakefile Normal file
View File

@ -0,0 +1,536 @@
# Maintainer-only makefile segment. This contains things that are relevant
# only if you have the full copy of the GNU Make sources from the Git
# tree, not a dist copy.
# --------------------- #
# Updating everything. #
# --------------------- #
.PHONY: update
update:
BUGLIST := bug-make@gnu.org
# These are related to my personal setup.
GPG_KEYID := 80CB727A20C79BB2
# SRCROOTDIR is just a handy location to keep source files in
SRCROOTDIR ?= $(HOME)/src
# Where to put the CVS checkout of the GNU web repository
GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
# Where to put the CVS checkout of the GNU Make web repository
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
# Enable Perl warnings for the test suite
PERLFLAGS := -w
# We like mondo-warnings!
# Also force comments to be preserved. This helps when using ccache, in
# combination with GCC 7's implicit-fallthrough warning.
MAKE_CFLAGS := -C -Wall -Wextra -Werror -Wwrite-strings -Wshadow \
-Wdeclaration-after-statement -Wbad-function-cast -Wformat-security \
-Wtype-limits -Wunused-but-set-parameter -Wlogical-op -Wpointer-arith \
-Wignored-qualifiers -Wformat-signedness -Wduplicated-cond
# Allow extra options without overriding MAKE_CFLAGS
EXTRA_CFLAGS :=
AM_CFLAGS += $(MAKE_CFLAGS) $(EXTRA_CFLAGS)
# Unfortunately the Guile headers are sometimes broken. Convince GCC
# to treat them as system headers so warnings are ignored.
GUILE_CFLAGS := $(patsubst -I%,-isystem %,$(GUILE_CFLAGS))
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
# Create preprocessor output files--GCC specific!
%.i : %.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
# Create the mkconfig.h file for non-POSIX config headers
all: src/mkconfig.h
src/mkconfig.h: src/mkconfig.h.in config.status
./config.status --header=$@
# Build the README
all: README
README : README.in config.status
./config.status --file=$@
# Construct Makefiles by adding on dependencies, etc.
#
cvt = $(patsubst $1/%,$$($1)%,$(filter %.c,$2))
Basic.mk: Basic.mk.template .dep_segment Makefile
rm -f $@
sed -e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
-e 's@%w32_SOURCES%@$(call cvt,src,$(w32_SRCS))@g' \
-e 's@%vms_SOURCES%@$(call cvt,src,$(vms_SRCS))@g' \
-e 's@%loadavg_SOURCES%@$(call cvt,lib,$(loadavg_SRCS))@g' \
-e 's@%alloca_SOURCES%@$(call cvt,lib,$(alloca_SRCS))@g' \
-e 's@%glob_SOURCES%@$(call cvt,lib,$(glob_SRCS))@g' \
$< > $@
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
echo >>$@; echo '$$(OBJECTS): $$(SRCDIR)/src/mkconfig.h' >>$@; \
sed -e 's@^\([^ ]*\)\.o:@$$(OUTDIR)\1.$$(OBJEXT):@' \
-e 's@\([^ ]*\.[ch]\)@$$(SRCDIR)/\1@g' \
-e 's@$$(SRCDIR)/src/config.h@$$(OUTDIR)src/config.h@g' \
-e 's@$$(SRCDIR)/lib/alloca.h@@g' \
-e 's@$$(SRCDIR)/lib/stdbool.h@@g' \
$(word 2,$^) >>$@
chmod a-w $@
# Use automake to build a dependency list file, for Makebase.mk.
#
# Automake used to have a --generate-deps flag but it's gone now, so we have
# to do it ourselves.
#
DEP_FILES := $(wildcard src/$(DEPDIR)/*.Po)
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
rm -f $@
(for f in src/$(DEPDIR)/*.Po; do \
echo ""; \
echo "# $$f"; \
sed -e '/^[^:]*\.[ch] *:/d' \
-e 's, /usr/[^ ]*,,g' \
-e 's, $(srcdir)/, ,g' \
-e '/^ *\\$$/d' \
-e '/^ *$$/d' \
< $$f; \
done) > $@
# Cleaning
GIT := git
# git-clean: Clean all "ignored" files. Leave untracked files.
# git-very-clean: Clean all files that aren't stored in source control.
.PHONY: git-clean git-very-clean
git-clean:
-$(GIT) clean -fdX
git-very-clean: git-clean
-$(GIT) clean -fdx
## ---------------------- ##
## Generating ChangeLog. ##
## ---------------------- ##
# Where the gnulib project has been locally cloned
GNULIBDIR ?= $(or $(wildcard $(GNULIB_SRCDIR)),./gnulib)
gl2cl-date := 2013-10-10
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
# Rebuild the changelog whenever a new commit is added
ChangeLog: .check-git-HEAD
if test -f '$(gl2cl)'; then \
'$(gl2cl)' --since='$(gl2cl-date)' > '$@'; \
else \
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
fi
.check-git-HEAD: FORCE
sha="`git rev-parse HEAD`"; \
test -f '$@' && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|| echo "$$sha" > '$@'
.PHONY: FORCE
FORCE:;@:
## ---------------- ##
## Updating files. ##
## ---------------- ##
RSYNC = rsync -Lrtvz
WGET = wget --passive-ftp -np -nv
ftp-gnu = ftp://ftp.gnu.org/gnu
move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
echo $(target) is unchanged; rm -f $(target).t; \
else \
mv -f $(target).t $(target); \
fi
# ------------------- #
# Updating PO files. #
# ------------------- #
# NOTE: This is handled by the bootstrap script now
#update: po-update
update: po-check
# PO archive mirrors --- Be careful; some might not be fully populated!
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
po_repo = https://translationproject.org/latest/$(PACKAGE)
po_sync = translationproject.org::tp/latest/$(PACKAGE)/
.PHONY: do-po-update po-update
do-po-update:
tmppo="/tmp/po-$(PACKAGE)-$(PACKAGE_VERSION).$$$$" \
&& rm -rf "$$tmppo" \
&& mkdir "$$tmppo" \
&& $(RSYNC) $(po_sync) "$$tmppo" \
&& cp "$$tmppo"/*.po $(top_srcdir)/po \
&& rm -rf "$$tmppo"
cd po && $(MAKE) update-po
$(MAKE) po-check
po-update:
test -d "po" && $(MAKE) do-po-update
# -------------------------- #
# Updating GNU build files. #
# -------------------------- #
# Note: this is handled by the bootstrap script now
#update: scm-update
.PHONY: scm-update
scm-update: get-build-aux/texinfo.tex get-build-aux/config.guess \
get-build-aux/config.sub get-doc/make-stds.texi get-doc/fdl.texi
# The following pseudo table associates a local directory and a URL
# with each of the files that belongs to some other package and is
# regularly updated from the specified URL.
cvs-url = https://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
git-url = https://git.savannah.gnu.org/cgit
target = $(patsubst get-%,%,$@)
config-url = $(git-url)/config.git/plain/$(patsubst get-build-aux/%,%,$@)
get-build-aux/config.guess get-build-aux/config.sub:
@echo Retrieving $(target) from $(config-url)
$(WGET) $(config-url) -O $(target).t \
&& $(move_if_change)
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-build-aux/%,%,$@)
get-build-aux/texinfo.tex:
@echo Retrieving $(target) from $(gnulib-url)
$(WGET) $(gnulib-url) -O $(target).t \
&& $(move_if_change)
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
get-doc/make-stds.texi get-doc/fdl.texi:
@echo Retrieving $(target) from $(gnustandards-url)
$(WGET) $(gnustandards-url) -O $(target).t \
&& $(move_if_change)
# ---------------------------- #
# Extra configuration checks. #
# ---------------------------- #
# Make the dist file contents more regular, if we're using GNU tar.
# Suggested by Tzvetelin Katchov <katchov@gnu.org>
export TAR_OPTIONS := --mode=u+w,go-w --owner=0 --group=0 --numeric-owner --sort=name
# When I released 4.3 somehow the INSTALL file was missing.
# When I tried to build it again, it was there. I have no idea what happened
# but add a new check to be sure it doesn't happen again.
mk_dist_files = AUTHORS ChangeLog COPYING INSTALL README src/mkconfig.h
dist: mk-dist mk-distcheck
.PHONY: mk-distcheck
mk-distcheck: distdir
@echo "Checking for extra installed files..."
@for fn in $(mk_dist_files); do \
test -f '$(distdir)'/"$$fn" \
|| { echo "Missing dist file: $$fn"; exit 1; }; \
done; true
# Make sure that the files in lib/ have been updated from the files in gl/lib/
GL_LIB_FILES := $(wildcard gl/lib/*)
mk-dist:
@echo "Checking gl/lib files..."
@for fn in $(GL_LIB_FILES); do \
cmp $$fn $${fn##gl/} \
|| { echo "Run ./bootstrap --gen ?"; exit 1; }; \
done; true
# ---------------------------------- #
# Alternative configuration checks. #
# ---------------------------------- #
CFGCHECK_CONFIGFLAGS =
CFGCHECK_BUILDFLAGS =
# We can't use our mondo warnings as these are used to compile gnulib modules
# as well, and that will fail.
CFGCHECK_MAKEFLAGS = # CFLAGS='$(AM_CFLAGS)'
# We don't support C90 anymore, strictly, but this test still works (with lots
# of warnings) and it helps us avoid egregious incompatibilities.
checkcfg.strict-c90: CFGCHECK_CONFIGFLAGS = CFLAGS='-std=c90 -pedantic'
checkcfg.strict-c90: CFGCHECK_MAKEFLAGS =
checkcfg.job-pipe: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DJOBSERVER_USE_FIFO=0
checkcfg.no-jobserver:CFGCHECK_CONFIGFLAGS = --disable-job-server
checkcfg.no-load: CFGCHECK_CONFIGFLAGS = --disable-load
checkcfg.no-guile: CFGCHECK_CONFIGFLAGS = --without-guile
checkcfg.no-spawn: CFGCHECK_CONFIGFLAGS = --disable-posix-spawn
checkcfg.no-sysglob: CFGCHECK_CONFIGFLAGS = make_cv_sys_gnu_glob=no
checkcfg.no-loadavg: CFGCHECK_CONFIGFLAGS = ac_cv_func_getloadavg=no \
ac_cv_have_decl_getloadavg=no \
gl_cv_have_raw_decl_getloadavg=no \
ac_cv_lib_util_getloadavg=no \
ac_cv_lib_getloadavg_getloadavg=no
checkcfg.no-sync: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_OUTPUT_SYNC
checkcfg.no-archives: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_ARCHIVES
CONFIG_CHECKS := \
checkcfg.strict-c90 \
checkcfg.job-pipe \
checkcfg.no-jobserver \
checkcfg.no-load \
checkcfg.no-guile \
checkcfg.no-spawn \
checkcfg.no-sysglob \
checkcfg.no-loadavg \
checkcfg.no-sync \
checkcfg.no-archives
.PHONY: check-alt-config
check-alt-config: $(CONFIG_CHECKS)
@echo --- $@ SUCCESS
# Trick GNU Make so it doesn't run the submake as a recursive make.
NR_MAKE = $(MAKE)
# Check builds both with build.sh and with make
build.sh_SCRIPT = exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \
&& OUTDIR=_bld ../build.sh -k $(CFGCHECK_BUILD_FLAGS) \
&& _bld/make GMK_OUTDIR=../_bld $(AM_MAKEFLAGS) check-local \
&& _bld/make GMK_OUTDIR=../_bld $(AM_MAKEFLAGS) clean
nrmake_SCRIPT = exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \
&& $(NR_MAKE) $(AM_MAKEFLAGS) $(CFGCHECK_MAKEFLAGS) \
&& ./make $(AM_MAKEFLAGS) check \
&& ./make $(AM_MAKEFLAGS) clean
$(CONFIG_CHECKS): checkcfg.%: distdir
@echo "Building $@ (output in checkcfg.$*.log)"
exec >'checkcfg.$*.log' 2>&1; \
echo "Testing configure with $(CFGCHECK_CONFIGFLAGS)"; set -x; \
rm -rf $(distdir)/_build \
&& mkdir $(distdir)/_build \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
$(build.sh_SCRIPT)
$(nrmake_SCRIPT)
# Try using Basic.mk. I can't test this on POSIX systems because it is only
# used for non-POSIX systems; POSIX systems can just use normal
# configure/Makefile.in etc.
checkcfg.basicmk: checkcfg.% : distdir
@echo "Building $@ (output in checkcfg.$*.log)"
exec >'checkcfg.$*.log' 2>&1; \
echo "Testing Basic.mk SRCDIR=.."; set -x; \
rm -rf $(distdir)/_build \
&& mkdir $(distdir)/_build \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
exec >>'checkcfg.$*.log' 2>&1; set -x; \
cd $(distdir)/_build \
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. $(CFGCHECK_MAKEFLAGS)
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. check \
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. clean
exec >>'checkcfg.$*.log' 2>&1; \
echo "Testing Basic.mk SRCDIR=."; set -x; \
&& rm -rf $(distdir)/_build \
&& cd $(distdir) \
&& ./configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk '$(CFGCHECK_MAKEFLAGS)' \
&& ./make $(AM_MAKEFLAGS) -f Basic.mk check \
&& ./make $(AM_MAKEFLAGS) -f Basic.mk clean
## --------------- ##
## Sanity checks. ##
## --------------- ##
# Before we build a distribution be sure we run our local checks
#distdir: local-check
.PHONY: local-check po-check changelog-check
# Checks that don't require Git. Run 'changelog-check' last as
# previous test may reveal problems requiring new ChangeLog entries.
local-check: po-check changelog-check
# copyright-check writable-files
changelog-check:
if head $(top_srcdir)/ChangeLog | grep 'Version $(PACKAGE_VERSION)' >/dev/null; then \
:; \
else \
echo "$(PACKAGE_VERSION) not in ChangeLog" 1>&2; \
exit 1; \
fi
# Verify that all source files using _() are listed in po/POTFILES.in.
# Ignore src/makeint.h; it defines _().
po-check:
if test -f po/POTFILES.in; then \
grep '^[^#]' po/POTFILES.in | sort > $@-1; \
find [a-z]* -name '*.[ch]' | xargs grep -l '\b_(' | grep -v src/makeint.h | sort > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
## --------------- ##
## Generate docs. ##
## --------------- ##
.PHONY: update-makeweb gendocs
CVS = cvs
makeweb-repo = $(USER)@cvs.sv.gnu.org:/web/make
gnuweb-repo = :pserver:anonymous@cvs.sv.gnu.org:/web/www
gnuweb-dir = www/server/standards
# Get the GNU Make web page boilerplate etc.
update-makeweb:
test -d '$(MAKEWEBDIR)' || mkdir -p '$(MAKEWEBDIR)'
test -d '$(MAKEWEBDIR)'/CVS \
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
# Get the GNU web page boilerplate etc.
update-gnuweb:
test -d '$(GNUWEBDIR)' || mkdir -p '$(GNUWEBDIR)'
test -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS \
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
gendocs: update-gnuweb update-makeweb
cp $(GNULIBDIR)/doc/gendocs_template doc
cd doc \
&& rm -rf doc/manual \
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
make '$(PACKAGE_NAME) Manual'
find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
cp -r doc/manual '$(MAKEWEBDIR)'
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
&& cvs -q -n update | grep -v '^M '
@echo '- cvs add <new files>' \
&& echo '- cvs remove <deleted files>' \
&& echo '- cvs commit' \
&& echo '- cvs tag make-$(subst .,-,$(PACKAGE_VERSION))'
## --------------------------------------------- ##
## Submitting Coverity cov-build results to Scan ##
## --------------------------------------------- ##
# Note you must have set COVERITY_TOKEN and COVERITY_EMAIL properly
# to submit results. COVERITY_PATH can be set to the root of the
# cov-build tools if it's not already on your PATH.
COV_BUILD_FILE := cov-build.tgz
.PHONY: cov-build cov-submit
cov-build: $(COV_BUILD_FILE)
$(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
$(MAKE) distdir
@echo "Running Coverity cov-build"
rm -rf '$(distdir)'/_build
mkdir '$(distdir)'/_build
cd '$(distdir)'/_build \
&& ../configure --srcdir=.. \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
$(CFGCHECK_MAKEFLAGS)
PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \
cd '$(distdir)'/_build \
&& cov-build --dir cov-int ../build.sh
rm -f '$@'
(cd '$(distdir)'/_build && tar czf - cov-int) > '$@'
cov-submit: $(COV_BUILD_FILE)-submitted
$(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
@test -n "$(COVERITY_TOKEN)" || { echo 'COVERITY_TOKEN not set'; exit 1; }
@test -n "$(COVERITY_EMAIL)" || { echo 'COVERITY_EMAIL not set'; exit 1; }
rm -f '$@'
case '$(PACKAGE_VERSION)' in \
(*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \
(*) type="release"; ext= ;; \
esac; \
curl --form token='$(COVERITY_TOKEN)' \
--form email='$(COVERITY_EMAIL)' \
--form file='@$<' \
--form version="$(PACKAGE_VERSION)$$ext" \
--form description="$(PACKAGE_NAME) $$type" \
'https://scan.coverity.com/builds?project=gmake'
cp '$<' '$@'
## ------------------------- ##
## Make release targets. ##
## ------------------------- ##
.PHONY: tag-release
tag-release:
case '$(PACKAGE_VERSION)' in \
(*.*.9*) message=" candidate" ;; \
(*) message= ;; \
esac; \
$(GIT) tag -m "$(PACKAGE_NAME) release$$message $(PACKAGE_VERSION)" -u '$(GPG_KEYID)' '$(PACKAGE_VERSION)'
## ------------------------- ##
## GNU FTP upload artifacts. ##
## ------------------------- ##
# This target creates the upload artifacts.
# Sign it with my key. If you don't have my key/passphrase then sorry,
# you're SOL! :)
GNUPLOAD := $(GNULIBDIR)/build-aux/gnupload
UPLOADS = upload-alpha upload-ftp
.PHONY: $(UPLOADS)
$(UPLOADS): upload-%: $(DIST_ARCHIVES)
$(GNUPLOAD) --user "$(GPG_KEYID)" --to "$*.gnu.org:make" -- $^
# Rebuild Makefile.in if this file is modified.
Makefile.in: maintMakefile
# Copyright (C) 1997-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

281
make-gdb.py Normal file
View File

@ -0,0 +1,281 @@
"""GDB pretty-printer macros for GNU Make."""
import gdb # pylint: disable=import-error
import gdb.printing # pylint: disable=import-error
# Memoize types we commonly use
_TYPES = {}
def getType(tname):
"""Given a type name return a GDB type."""
global _TYPES
if tname not in _TYPES:
tn = tname.rstrip('*')
if tn not in _TYPES:
_TYPES[tn] = gdb.lookup_type(tn)
while tn != tname:
# Want a pointer type
t = tn
tn += '*'
_TYPES[tn] = _TYPES[t].pointer()
return _TYPES[tname]
def isNullptr(val):
"""Return True if the value is a null pointer."""
return int(val.cast(getType('unsigned long long'))) == 0
class ShowArgv(gdb.Command):
"""Print a null-terminated array of strings.
Argument:
A char** where the last one is NULL (e.g., argv)
"""
def __init__(self):
"""Create the showargv function."""
gdb.Command.__init__(self, "showargv", gdb.COMMAND_USER)
def invoke(self, arg, from_tty):
"""Show the argv."""
args = gdb.string_to_argv(arg)
if len(args) != 1:
raise gdb.GdbError(self._usage)
val = gdb.parse_and_eval(args[0])
if val is None:
raise gdb.GdbError('%s is not a valid expression' % (args[0]))
strs = []
while not isNullptr(val.dereference()):
strs.append('"'+val.dereference().string()+'"')
val += 1
gdb.write("[%d] = [%s]\n" % (len(strs), ', '.join(strs)))
gdb.flush()
ShowArgv()
class ShowNextList(gdb.Command):
"""Print a structure that has a "next" pointer.
Argument:
A pointer to a struct which contains a "next" member.
"""
_usage = 'usage: showlist <listptr>'
def __init__(self):
"""Create a "showlist" function."""
gdb.Command.__init__(self, "showlist", gdb.COMMAND_USER)
def invoke(self, arg, from_tty):
"""Show the elements in the provided list."""
args = gdb.string_to_argv(arg)
if len(args) != 1:
raise gdb.GdbError(self._usage)
val = gdb.parse_and_eval(args[0])
if val is None:
raise gdb.GdbError('%s is not a valid expression' % (args[0]))
i = 0
while not isNullptr(val):
gdb.write("%s : %s\n" % (val, val.dereference()))
gdb.flush()
i += 1
val = val['next']
gdb.write("%s contains %d elements\n" % (args[0], i))
gdb.flush()
ShowNextList()
class FileLocation(object):
"""Print a file location."""
def __init__(self, val):
"""Create a FileLocation object."""
self.val = val
def to_string(self):
"""Convert a FileLocation to a string."""
if int(self.val['filenm']):
return "%s:%d" % (str(self.val['filenm']), self.val['lineno'])
return 'NILF'
class StringListPrinter(object):
"""Print a stringlist."""
def __init__(self, val):
"""Create a StringListPrinter object."""
self.val = val
def to_string(self):
"""Convert a HashTable into a string."""
return "size=%d, capacity=%d" % (self.val['idx'], self.val['max'])
def children(self):
"""Yield each string in the list."""
i = 0
elts = self.val['list']
while i < self.val['idx']:
nm = '[%d] ' % i
yield (nm, elts.dereference())
i += 1
elts += 1
def display_hint(self):
"""Show the display hint for the pretty-printer."""
return 'array'
class VariablePrinter(object):
"""Print a struct variable."""
def __init__(self, val):
"""Create a VariablePrinter object."""
self.val = val
def to_string(self):
"""Convert a VariablePrinter object into a string."""
if self.val['append']:
a = '+='
elif self.val['conditional']:
a = '?='
else:
a = '='
flags = []
s = str(self.val['flavor'])
if s != 'f_bogus':
flags.append(s)
s = str(self.val['origin'])
if s != 'o_default':
flags.append(s)
s = str(self.val['export'])
if s != 'v_default':
flags.append(s)
return '%s[%s]: "%s" %s "%s"' % (
self.val['fileinfo'], ','.join(flags),
self.val['name'].string(), a, self.val['value'].string())
class HashTablePrinter(object):
"""Pretty-print a hash table."""
DELITEM = None
def __init__(self, val):
"""Create a HashTablePrinter object."""
self.val = val
def to_string(self):
"""Convert a HashTable into a string."""
return "size=%d, capacity=%d, empty=%d, collisions=%d, rehashes=%d" % (
self.val['ht_size'], self.val['ht_capacity'],
self.val['ht_empty_slots'], self.val['ht_collisions'],
self.val['ht_rehashes'])
def children(self):
"""Yield each ID and value."""
for (i, v) in self.iterator():
nm = '[%d] ' % i
yield (nm, i)
yield (nm, v)
def iterator(self):
"""Provide an iterator for HashTable."""
if HashTablePrinter.DELITEM is None:
HashTablePrinter.DELITEM = gdb.lookup_global_symbol('hash_deleted_item').value()
lst = self.val['ht_vec']
for i in range(0, self.val['ht_size']):
v = lst[i]
if int(v) != 0 and v != HashTablePrinter.DELITEM:
yield (i, v)
def display_hint(self):
"""Show the display hint for the pretty-printer."""
return 'map'
class VariableSetPrinter(object):
"""Print a variable_set."""
def __init__(self, val):
"""Create a variable_set pretty-printer."""
self.tbl = HashTablePrinter(val['table'])
def to_string(self):
"""Convert a variable_set to string."""
return self.tbl.to_string()
def children(self):
"""Iterate through variables and values."""
for (i, v) in self.tbl.iterator():
ptr = v.cast(getType('struct variable*'))
nm = '[%d] ' % (i)
yield (nm, ptr)
yield (nm, str(ptr.dereference()))
def display_hint(self):
"""Show the display hint for the pretty-printer."""
return 'map'
class VariableSetListPrinter(object):
"""Print a variable_set_list."""
GLOBALSET = None
def __init__(self, val):
"""Create a variable_set_list pretty-printer."""
self.val = val
def to_string(self):
"""Convert a variable_set_list to string."""
return str(self.val.address)
def children(self):
"""Iterate through variables and values."""
if VariableSetListPrinter.GLOBALSET is None:
block = gdb.lookup_global_symbol('init_hash_global_variable_set').symtab.static_block()
VariableSetListPrinter.GLOBALSET = gdb.lookup_symbol(
'global_variable_set', block)[0].value().address
ptr = self.val.address
i = 0
while not isNullptr(ptr):
nm = '[%d] ' % (i)
yield (nm, ptr['set'])
if int(ptr['set']) == int(VariableSetListPrinter.GLOBALSET):
yield (nm, "global_variable_set")
else:
yield (nm, str(ptr['set'].dereference()))
i += 1
ptr = ptr['next']
def display_hint(self):
"""Show the display hint for the pretty-printer."""
return 'map'
def build_pretty_printer():
"""Install all the pretty-printers."""
pp = gdb.printing.RegexpCollectionPrettyPrinter("gnumake")
pp.add_printer('floc', r'^floc$', FileLocation)
pp.add_printer('stringlist', r'^stringlist$', StringListPrinter)
pp.add_printer('variable', r'^variable$', VariablePrinter)
pp.add_printer('hashtable', r'^hash_table$', HashTablePrinter)
pp.add_printer('variableset', r'^variable_set$', VariableSetPrinter)
pp.add_printer('variablesetlist', r'^variable_set_list$', VariableSetListPrinter)
return pp
# Use replace=True so we can re-source this file
gdb.printing.register_pretty_printer(gdb.current_objfile(),
build_pretty_printer(), replace=True)

File diff suppressed because it is too large Load Diff

171
makefile.com Normal file
View File

@ -0,0 +1,171 @@
$!
$! Makefile.com - builds GNU Make for VMS
$!
$! P1 = LIST will provide compiler listings.
$! P2 = DEBUG will build an image with debug information
$! P3 = WALL will enable all warning messages (some are suppressed since
$! one macro intentionally causes an error condition)
$!
$! In case of problems with the install you might contact me at
$! zinser@decus.de (preferred) or zinser@sysdev.deutsche-boerse.com
$
$! hb
$! But don't ask Martin Zinser about the lines, I added/changed.
$! In case of an error do some cleanup
$ on error then $ goto cleanup
$! in case somebody set up her/his own symbol for cc
$ set symbol/scope=(nolocal,noglobal)
$!
$! Just some general constants...
$!
$ true = 1
$ false = 0
$ tmpnam = "temp_" + f$getjpi("","pid")
$ tt = tmpnam + ".txt"
$ tc = tmpnam + ".c"
$!
$! Look for the compiler used
$!
$ lval = ""
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
$ then
$ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
$ ccopt = ""
$ else
$ ccopt = "/decc/prefix=(all,except=(globfree,glob))"
$ if f$trnlnm("SYS").eqs.""
$ then
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
$ then
$ define sys decc$library_include:
$ else
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
$ lval=lval+"SYS$LIBRARY:"
$ define sys 'lval
$ endif
$ endif
$ endif
$!
$!
$ if (p1 .eqs. "LIST")
$ then
$ ccopt = ccopt + "/list/show=(expan,inclu)"
$ endif
$!
$! Should we build a debug image
$!
$ if (p2.eqs."DEBUG")
$ then
$ ccopt = ccopt + "/noopt/debug"
$ lopt = "/debug"
$ else
$ lopt = ""
$ endif
$!
$! Do we want to see all warnings
$!
$ if (p3.nes."WALL")
$ then
$ gosub check_cc_qual
$ endif
$ filelist = "[.src]ar [.src]arscan [.src]commands [.src]default [.src]dir " + -
"[.src]expand [.src]file [.src]function [.src]guile " + -
"[.src]hash [.src]implicit [.src]job [.src]load [.src]main " + -
"[.src]misc [.src]read [.src]remake [.src]remote-stub " + -
"[.src]rule [.src]output [.src]signame [.src]variable " + -
"[.src]version [.src]shuffle [.src]strcache [.src]vpath " + -
"[.src]vmsfunctions [.src]vmsify [.src]vms_progname " + -
"[.src]vms_exit [.src]vms_export_symbol " + -
"[.lib]alloca [.lib]fnmatch [.lib]glob [.src]getopt1 [.src]getopt"
$!
$ copy [.src]config.h-vms [.src]config.h
$ copy [.lib]fnmatch.in.h [.lib]fnmatch.h
$ copy [.lib]glob.in.h [.lib]glob.h
$ n=0
$ open/write optf make.opt
$ loop:
$ cfile = f$elem(n," ",filelist)
$ if cfile .eqs. " " then goto linkit
$ write sys$output "Compiling ''cfile'..."
$ call compileit 'cfile'
$ n = n + 1
$ goto loop
$ linkit:
$ close optf
$ link/exe=make make.opt/opt'lopt
$ goto cleanup
$
$ cleanup:
$ if f$trnlnm("SYS").nes."" then $ deassign sys
$ if f$trnlnm("OPTF").nes."" then $ close optf
$ if f$search("make.opt").nes."" then $ del make.opt;*
$ exit
$!
$!-----------------------------------------------------------------------------
$!
$! Check if this is a define relating to the properties of the C/C++
$! compiler
$!
$CHECK_CC_QUAL:
$ open/write tmpc 'tc
$ ccqual = "/warn=(disable=questcompare)"
$ write tmpc "#include <stdio.h>"
$ write tmpc "unsigned int i = 1;"
$ write tmpc "int main(){"
$ write tmpc "if (i < 0){printf(""Mission impossible\n"");}}"
$ close tmpc
$ gosub cc_qual_check
$ return
$!
$!-----------------------------------------------------------------------------
$!
$! Check for properties of C/C++ compiler
$!
$CC_QUAL_CHECK:
$ cc_qual = false
$ set message/nofac/noident/nosever/notext
$ cc 'ccqual' 'tmpnam'
$ if $status then cc_qual = true
$ set message/fac/ident/sever/text
$ delete/nolog 'tmpnam'.*;*
$ if cc_qual then ccopt = ccopt + ccqual
$ return
$!-----------------------------------------------------------------------------
$!
$ compileit : subroutine
$ ploc = f$locate("]",p1)
$! filnam = p1
$ if ploc .lt. f$length(p1)
$ then
$ objdir = f$extract(0, ploc+1, p1)
$ write optf p1
$ else
$ objdir := []
$ write optf objdir+p1
$ endif
$ cc'ccopt'/nested=none/include=([],[.src],[.lib])/obj='objdir' -
/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file",-
"unlink=remove","HAVE_CONFIG_H","VMS") -
'p1'
$ exit
$ endsubroutine : compileit
$!
$!-----------------------------------------------------------------------------
$!Copyright (C) 1996-2024 Free Software Foundation, Inc.
$!This file is part of GNU Make.
$!
$!GNU Make is free software; you can redistribute it and/or modify it under
$!the terms of the GNU General Public License as published by the Free Software
$!Foundation; either version 3 of the License, or (at your option) any later
$!version.
$!
$!GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
$!WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
$!FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
$!details.
$!
$!You should have received a copy of the GNU General Public License along with
$!this program. If not, see <https://www.gnu.org/licenses/>.

28
mk/Posix.mk.in Normal file
View File

@ -0,0 +1,28 @@
# GNU -*-Makefile-*- to build GNU Make on POSIX systems
#
# POSIX overrides for use with Basic.mk.
#
# Copyright (C) 2017-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
# Very little is needed here since the default Basic.mk assumes POSIX
prog_SOURCES += $(src)/posixos.c
extra_CPPFLAGS += @GUILE_CFLAGS@
extra_LDFLAGS += @AM_LDFLAGS@
LDLIBS += @LIBOBJS@ @gl_LIBOBS@ @ALLOCA@
LDLIBS += @GUILE_LIBS@ @GETLOADAVG_LIBS@ @LIBINTL@ @LIBS@

97
mk/VMS.mk Normal file
View File

@ -0,0 +1,97 @@
# GNU -*-Makefile-*- to build GNU Make on VMS
#
# VMS overrides for use with Basic.mk.
#
# Copyright (C) 2017-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
src = [.src]
lib = [.lib]
SRCDIR = []
OBJEXT = .obj
EXEEXT = .exe
e =
s = $e $e
c = ,
defs = HAVE_CONFIG_H
ifeq ($(CC),cc)
defs += VMS unlink=remove allocated_variable_expand_for_file=alloc_var_expand_for_file
else
defs += GCC_IS_NATIVE
ifeq ($(ARCH),VAX)
defs += VAX
endif
endif
extra_CPPFLAGS = /define=($(subst $s,$c,$(patsubst %,"%",$(defs))))
cinclude = /nested=none/include=($(src),$(lib))
ifeq ($(CC),cc)
cprefix = /prefix=(all,except=(glob,globfree))
cwarn = /standard=relaxed/warn=(disable=questcompare)
endif
extra_CFLAGS = $(cinclude)$(cprefix)$(cwarn)
#extra_LDFLAGS = /deb
extra_LDFLAGS =
# If your system needs extra libraries loaded in, define them here.
# System V probably need -lPW for alloca.
# if on vax, uncomment the following line
#LDLIBS = ,c.opt/opt
ifeq ($(CC),cc)
#LDLIBS =,sys$$library:vaxcrtl.olb/lib
else
LDLIBS =,gnu_cc_library:libgcc.olb/lib
endif
# If your system doesn't have alloca, or the one provided is bad,
# uncomment this
#ALLOCA = $(alloca_SOURCES)
# If your system doesn't have alloca.h, or the one provided is bad,
# uncomment this
#BUILT_SOURCES += $(lib)alloca.h
prog_SOURCES += $(ALLOCA) $(glob_SOURCES) $(vms_SOURCES)
BUILT_SOURCES += $(lib)fnmatch.h $(lib)glob.h
COMPILE.cmd = $(CC) $(extra_CFLAGS)$(CFLAGS)/obj=$@ $(extra_CPPFLAGS)$(CPPFLAGS) $1
LINK.cmd = $(LD)$(extra_LDFLAGS)$(LDFLAGS)/exe=$@ $(subst $s,$c,$1)$(LDLIBS)
# Don't know how to do this
CHECK.cmd =
MKDIR.cmd = create/dir $1
RM.cmd = delete $1
CP.cmd = copy $1 $2
define CLEANSPACE
-purge [...]
-delete $(PROG);
-delete $(src)*.$(OBJEXT);
endef
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h-vms
$(call CP.cmd,$<,$@)

139
mk/Windows32.mk Normal file
View File

@ -0,0 +1,139 @@
# GNU -*-Makefile-*- to build GNU Make on Windows
#
# Windows overrides for use with Basic.mk.
#
# Copyright (C) 2017-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
# TARGET_TYPE can be either "release" or "debug"
TARGET_TYPE = release
# TOOLCHAIN can be either "msvc" or "gcc"
TOOLCHAIN = msvc
# Translate a POSIX path into a Windows path. Don't bother with drives.
# Used only inside recipes, with DOS/CMD tools that require it.
P2W = $(subst /,\,$1)
prog_SOURCES += $(loadavg_SOURCES) $(glob_SOURCES) $(w32_SOURCES)
utf8_SOURCES = $(src)w32/utf8.rc $(src)w32/utf8.manifest
BUILT_SOURCES += $(lib)alloca.h $(lib)fnmatch.h $(lib)glob.h
w32_LIBS = kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 \
oleaut32 uuid odbc32 odbccp32
CPPFLAGS =
CFLAGS =
LDFLAGS =
# --- Visual Studio
msvc_CC = cl.exe
msvc_RC = rc.exe
msvc_LD = link.exe
msvc_CPPFLAGS = /DHAVE_CONFIG_H /DMK_OS_W32=1 /DWIN32 /D_CONSOLE
msvc_CPPFLAGS += /I$(OUTDIR)src /I$(SRCDIR)/src /I$(SRCDIR)/src/w32/include /I$(OUTDIR)lib /I$(SRCDIR)/lib
msvc_CFLAGS = /nologo /MT /W4 /EHsc
msvc_CFLAGS += /FR$(OUTDIR) /Fp$(BASE_PROG).pch /Fd$(BASE_PROG).pdb
msvc_LDFLAGS = /nologo /SUBSYSTEM:console /PDB:$(BASE_PROG).pdb
msvc_LDLIBS = $(addsuffix .lib,$(w32_LIBS))
msvc_C_SOURCE = /c
msvc_RC_SOURCE =
msvc_OUTPUT_OPTION = /Fo$@
msvc_LINK_OUTPUT = /OUT:$@
release_msvc_OUTDIR = ./WinRel/
release_msvc_CPPFLAGS = /D NDEBUG
release_msvc_CFLAGS = /O2
debug_msvc_OUTDIR = ./WinDebug/
debug_msvc_CPPFLAGS = /D _DEBUG
debug_msvc_CFLAGS = /Zi /Od
debug_msvc_LDFLAGS = /DEBUG
# --- GCC
gcc_CC = gcc
gcc_RC = windres
gcc_LD = $(gcc_CC)
release_gcc_OUTDIR = ./GccRel/
debug_gcc_OUTDIR = ./GccDebug/
gcc_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR)src -I$(SRCDIR)/src -I$(SRCDIR)/src/w32/include -I$(OUTDIR)lib -I$(SRCDIR)/lib
gcc_CFLAGS = -mthreads -Wall -std=gnu99 -gdwarf-2 -g3
gcc_LDFLAGS = -mthreads -gdwarf-2 -g3
gcc_LDLIBS = $(addprefix -l,$(w32_libs))
gcc_C_SOURCE = -c
gcc_RC_SOURCE = -i
gcc_OUTPUT_OPTION = -o $@
gcc_LINK_OUTPUT = -o $@
debug_gcc_CFLAGS = -O0
release_gcc_CFLAGS = -O2
# ---
RES_COMPILE.cmd = $(RC) $(OUTPUT_OPTION) $(RC_SOURCE) $1
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
CHECK.cmd = cmd /c cd tests \& .\run_make_tests.bat -make ../$(PROG)
MKDIR.cmd = cmd /c mkdir $(call P2W,$1)
RM.cmd = cmd /c del /F /Q $(call P2W,$1)
CP.cmd = cmd /c copy /Y $(call P2W,$1 $2)
CC = $($(TOOLCHAIN)_CC)
RC = $($(TOOLCHAIN)_RC)
LD = $($(TOOLCHAIN)_LD)
C_SOURCE = $($(TOOLCHAIN)_C_SOURCE)
RC_SOURCE = $($(TOOLCHAIN)_RC_SOURCE)
OUTPUT_OPTION = $($(TOOLCHAIN)_OUTPUT_OPTION)
LINK_OUTPUT = $($(TOOLCHAIN)_LINK_OUTPUT)
OUTDIR = $($(TARGET_TYPE)_$(TOOLCHAIN)_OUTDIR)
OBJEXT = obj
EXEEXT = .exe
_CUSTOM = $($(TOOLCHAIN)_$1) $($(TARGET_TYPE)_$1) $($(TARGET_TYPE)_$(TOOLCHAIN)_$1)
# I'm not sure why this builds gnumake rather than make...?
PROG = $(OUTDIR)gnumake$(EXEEXT)
BASE_PROG = $(basename $(PROG))
extra_CPPFLAGS = $(call _CUSTOM,CPPFLAGS)
extra_CFLAGS = $(call _CUSTOM,CFLAGS)
extra_LDFLAGS = $(call _CUSTOM,LDFLAGS)
LDLIBS = $(call _CUSTOM,LDLIBS)
$(OUTDIR)src/config.h: $(SRCDIR)/src/config.h.W32
$(call CP.cmd,$<,$@)
w32_UTF8OBJ = $(OUTDIR)src/w32/utf8.$(OBJEXT)
$(w32_UTF8OBJ): $(utf8_SOURCES)
$(call RES_COMPILE.cmd,$<)
ifneq (, $(shell where $(RC) 2>nul))
RESOURCE_OBJECTS = $(w32_UTF8OBJ)
endif

43
mk/msdosdjgpp.mk Normal file
View File

@ -0,0 +1,43 @@
# GNU -*-Makefile-*- to build GNU Make on MS-DOS with DJGPP
#
# MS-DOS overrides for use with Basic.mk.
#
# Copyright (C) 2017-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
OBJEXT = o
EXEEXT = .exe
CC = gcc
# Translate a POSIX path into a Windows path. Don't bother with drives.
# Used only inside recipes, with DOS/CMD tools that require it.
P2W = $(subst /,\,$1)
prog_SOURCES += $(loadavg_SOURCES) $(glob_SOURCES)
BUILT_SOURCES += $(lib)alloca.h $(lib)fnmatch.h $(lib)glob.h
INCLUDEDIR = c:/djgpp/include
LIBDIR = c:/djgpp/lib
LOCALEDIR = c:/djgpp/share
MKDIR.cmd = command.com /c mkdir $(call P2W,$1)
RM.cmd = command.com /c del /F /Q $(call P2W,$1)
CP.cmd = command.com /c copy /Y $(call P2W,$1 $2)
$(OUTDIR)src/config.h: $(SRCDIR)/src/configh.dos
$(call CP.cmd,$<,$@)

4
po/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*
!.gitignore
!LINGUAS
!POTFILES.in

31
po/LINGUAS Normal file
View File

@ -0,0 +1,31 @@
be
bg
cs
da
de
es
fi
fr
ga
gl
he
hr
id
it
ja
ka
ko
lt
nl
pl
pt
pt_BR
ro
ru
sr
sv
tr
uk
vi
zh_CN
zh_TW

48
po/POTFILES.in Normal file
View File

@ -0,0 +1,48 @@
# List of source files containing translatable strings.
# Copyright (C) 2000-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
src/ar.c
src/arscan.c
src/commands.c
src/dir.c
src/expand.c
src/file.c
src/function.c
src/getopt.c
src/guile.c
src/hash.c
src/implicit.c
src/job.c
src/load.c
src/main.c
src/misc.c
src/output.c
src/posixos.c
src/read.c
src/remake.c
src/remote-cstms.c
src/rule.c
src/shuffle.c
src/signame.c
src/strcache.c
src/variable.c
src/vmsfunctions.c
src/vmsjobs.c
src/vpath.c
src/warning.c
src/warning.h
src/w32/w32os.c

63
prepare_vms.com Normal file
View File

@ -0,0 +1,63 @@
$!
$! prepare_vms.com - Build config.h-vms from master on VMS.
$!
$! This is used for building off the master instead of a release tarball.
$!
$!
$! First try ODS-5, Pathworks V6 or UNZIP name.
$!
$ config_template = f$search("sys$disk:[.src]mkconfig*h.in")
$ if config_template .eqs. ""
$ then
$!
$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
$!
$ config_template = f$search("sys$disk:[.src]mkconfig.h*in")
$ if config_template .eqs. ""
$ then
$ write sys$output "Could not find mkconfig.h.in!"
$ exit 44
$ endif
$ endif
$ config_template_file = f$parse(config_template,,,"name")
$ config_template_type = f$parse(config_template,,,"type")
$ config_template = "sys$disk:[.src]" + config_template_file + config_template_type
$!
$!
$! Pull the version from configure.ac
$!
$ open/read ac_file sys$disk:[]configure.ac
$ac_read_loop:
$ read ac_file/end=ac_read_loop_end line_in
$ key = f$extract(0, 7, line_in)
$ if key .nes. "AC_INIT" then goto ac_read_loop
$ package = f$element (1,"[",line_in)
$ package = f$element (0,"]",package)
$ version = f$element (2,"[",line_in)
$ version = f$element (0,"]",version)
$ac_read_loop_end:
$ close ac_file
$!
$ if (version .eqs. "")
$ then
$ write sys$output "Unable to determine version!"
$ exit 44
$ endif
$!
$!
$ outfile = "sys$disk:[.src]mkconfig.h"
$!
$! Note the pipe command is close to the length of 255, which is the
$! maximum token length prior to VMS V8.2:
$! %DCL-W-TKNOVF, command element is too long - shorten
$! PDS: Blown out; someone else will have to figure this out
$ pipe (write sys$output "sub,@PACKAGE@,make,WHOLE/NOTYPE" ;-
write sys$output "sub,@PACKAGE_BUGREPORT@,bug-make@gnu.org,WHOLE/NOTYPE" ;-
write sys$output "sub,@PACKAGE_NAME@,GNU Make,WHOLE/NOTYPE" ;-
write sys$output "sub,@PACKAGE_TARNAME@,make,WHOLE/NOTYPE" ;-
write sys$output "sub,@PACKAGE_URL@,https://www.gnu.org/software/make/,WHOLE/NOTYPE" ;-
write sys$output "sub,@PACKAGE_VERSION@,''version',WHOLE/NOTYPE" ;-
write sys$output "exit") |-
edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
$!
$ write sys$output "GNU Make version: ", version, " prepared for VMS"

63
scripts/copyright-update Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
#
# Copyright (C) 2014-2024 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# Update GNU Make copyrights using gnulib update-copyright
EXCLUDE='^\(\.[a-z].*\|.*/\.[a-z].*\|.*COPYING\|src/hash\.[ch]\|ChangeLog.*\|.*/ChangeLog.*\|INSTALL\|doc/make\.texi\|bootstrap\)$'
update=${UPDATE_COPYRIGHT:-${GNULIB_SRCDIR:-../../gnulib}/build-aux/update-copyright}
die () { echo "$*"; exit 1; }
getfiles () {
git ls-files | grep -v "$EXCLUDE"
}
run () {
cmd=$(command -v "$update") || die "Cannot locate update-copyright ($update)"
test -x "$cmd" || die "Cannot locate update-copyright ($update)"
force=false
case $1 in
(-v) getfiles | sort; exit 0 ;;
(-f) force=true ;;
(--) : ;;
(-*) echo "usage: $0 [-v]"; exit 1 ;;
esac
if $force; then
: just do it
elif test ! -f src/makeint.h; then
die "Run in the root of the GNU Make workspace"
elif test -f configure; then
die "Run in a clean workspace (git clean -fdX)"
fi
# We use intervals
export UPDATE_COPYRIGHT_USE_INTERVALS=1
"$cmd" $(getfiles)
echo "*** Update doc/make.texi copyright by hand!"
echo "*** Update src/main.c:print_version() copyright by hand!"
exit 0
}
run "$@"
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

332
src/ar.c Normal file
View File

@ -0,0 +1,332 @@
/* Interface to 'ar' archives for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#ifndef NO_ARCHIVES
#include "filedef.h"
#include "dep.h"
#include <fnmatch.h>
#include <intprops.h>
/* Return nonzero if NAME is an archive-member reference, zero if not. An
archive-member reference is a name like 'lib(member)' where member is a
non-empty string.
If a name like 'lib((entry))' is used, a fatal error is signaled at
the attempt to use this unsupported feature. */
int
ar_name (const char *name)
{
const char *p = strchr (name, '(');
const char *end;
if (p == NULL || p == name)
return 0;
end = p + strlen (p) - 1;
if (*end != ')' || end == p + 1)
return 0;
if (p[1] == '(' && end[-1] == ')')
OS (fatal, NILF, _("attempt to use unsupported feature: '%s'"), name);
return 1;
}
/* Parse the archive-member reference NAME into the archive and member names.
Creates one allocated string containing both names, pointed to by ARNAME_P.
MEMNAME_P points to the member. */
void
ar_parse_name (const char *name, char **arname_p, char **memname_p)
{
char *p;
*arname_p = xstrdup (name);
p = strchr (*arname_p, '(');
/* This is never called unless ar_name() is true so p cannot be NULL. */
if (!p)
OS (fatal, NILF, "INTERNAL: ar_parse_name: bad name '%s'", *arname_p);
*(p++) = '\0';
p[strlen (p) - 1] = '\0';
*memname_p = p;
}
/* This function is called by 'ar_scan' to find which member to look at. */
/* ARGSUSED */
static intmax_t
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, intmax_t date,
int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
const void *name)
{
return ar_name_equal (name, mem, truncated) ? date : 0;
}
/* Return the modtime of NAME. */
time_t
ar_member_date (const char *name)
{
char *arname;
char *memname;
intmax_t val;
ar_parse_name (name, &arname, &memname);
/* Make sure we know the modtime of the archive itself because we are
likely to be called just before commands to remake a member are run,
and they will change the archive itself.
But we must be careful not to enter_file the archive itself if it does
not exist, because pattern_search assumes that files found in the data
base exist or can be made. */
{
struct file *arfile;
arfile = lookup_file (arname);
if (arfile == 0 && file_exists_p (arname))
arfile = enter_file (strcache_add (arname));
if (arfile != 0)
(void) f_mtime (arfile, 0);
}
val = ar_scan (arname, ar_member_date_1, memname);
free (arname);
return 0 < val && val <= TYPE_MAXIMUM (time_t) ? val : -1;
}
/* Set the archive-member NAME's modtime to now. */
#if MK_OS_VMS
int
ar_touch (const char *name)
{
O (error, NILF, _("touch archive member is not available on VMS"));
return -1;
}
#else
int
ar_touch (const char *name)
{
char *arname, *memname;
int val;
ar_parse_name (name, &arname, &memname);
/* Make sure we know the modtime of the archive itself before we
touch the member, since this will change the archive modtime. */
{
struct file *arfile;
arfile = enter_file (strcache_add (arname));
f_mtime (arfile, 0);
}
val = 1;
switch (ar_member_touch (arname, memname))
{
case -1:
OS (error, NILF, _("touch: archive '%s' does not exist"), arname);
break;
case -2:
OS (error, NILF, _("touch: '%s' is not a valid archive"), arname);
break;
case -3:
perror_with_name ("touch: ", arname);
break;
case 1:
OSS (error, NILF,
_("touch: member '%s' does not exist in '%s'"), memname, arname);
break;
case 0:
val = 0;
break;
default:
OS (error, NILF,
_("touch: bad return code from ar_member_touch on '%s'"), name);
}
free (arname);
return val;
}
#endif /* !MK_OS_VMS */
/* State of an 'ar_glob' run, passed to 'ar_glob_match'. */
/* On VMS, (object) modules in libraries do not have suffixes. That is, to
find a match for a pattern, the pattern must not have any suffix. So the
suffix of the pattern is saved and the pattern is stripped (ar_glob).
If there is a match and the match, which is a module name, is added to
the chain, the saved suffix is added back to construct a source filename
(ar_glob_match). */
struct ar_glob_state
{
const char *arname;
const char *pattern;
#if MK_OS_VMS
char *suffix;
#endif
size_t size;
struct nameseq *chain;
unsigned int n;
};
/* This function is called by 'ar_scan' to match one archive
element against the pattern in STATE. */
static intmax_t
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, intmax_t date UNUSED, int uid UNUSED,
int gid UNUSED, unsigned int mode UNUSED, const void *arg)
{
struct ar_glob_state *state = (struct ar_glob_state *)arg;
if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0)
{
/* We have a match. Add it to the chain. */
struct nameseq *new = xcalloc (state->size);
#if MK_OS_VMS
if (state->suffix)
new->name = strcache_add(
concat(5, state->arname, "(", mem, state->suffix, ")"));
else
#endif
new->name = strcache_add(concat(4, state->arname, "(", mem, ")"));
new->next = state->chain;
state->chain = new;
++state->n;
}
return 0;
}
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int
ar_glob_pattern_p (const char *pattern, int quote)
{
const char *p;
int opened = 0;
for (p = pattern; *p != '\0'; ++p)
switch (*p)
{
case '?':
case '*':
return 1;
case '\\':
if (quote)
++p;
break;
case '[':
opened = 1;
break;
case ']':
if (opened)
return 1;
break;
}
return 0;
}
/* Glob for MEMBER_PATTERN in archive ARNAME.
Return a malloc'd chain of matching elements (or nil if none). */
struct nameseq *
ar_glob (const char *arname, const char *member_pattern, size_t size)
{
struct ar_glob_state state;
struct nameseq *n;
const char **names;
unsigned int i;
#if MK_OS_VMS
char *vms_member_pattern;
#endif
if (! ar_glob_pattern_p (member_pattern, 1))
return 0;
/* Scan the archive for matches.
ar_glob_match will accumulate them in STATE.chain. */
state.arname = arname;
state.pattern = member_pattern;
#if MK_OS_VMS
{
/* In a copy of the pattern, find the suffix, save it and remove it from
the pattern */
char *lastdot;
vms_member_pattern = xstrdup(member_pattern);
lastdot = strrchr(vms_member_pattern, '.');
state.suffix = lastdot;
if (lastdot)
{
state.suffix = xstrdup(lastdot);
*lastdot = 0;
}
state.pattern = vms_member_pattern;
}
#endif
state.size = size;
state.chain = 0;
state.n = 0;
ar_scan (arname, ar_glob_match, &state);
#if MK_OS_VMS
/* Deallocate any duplicated string */
free(vms_member_pattern);
if (state.suffix)
{
free(state.suffix);
}
#endif
if (state.chain == 0)
return 0;
/* Now put the names into a vector for sorting. */
names = alloca (state.n * sizeof (const char *));
i = 0;
for (n = state.chain; n != 0; n = n->next)
names[i++] = n->name;
/* Sort them alphabetically. */
/* MSVC erroneously warns without a cast here. */
qsort ((void *)names, i, sizeof (*names), alpha_compare);
/* Put them back into the chain in the sorted order. */
i = 0;
for (n = state.chain; n != 0; n = n->next)
n->name = names[i++];
return state.chain;
}
#endif /* Not NO_ARCHIVES. */

1014
src/arscan.c Normal file

File diff suppressed because it is too large Load Diff

704
src/commands.c Normal file
View File

@ -0,0 +1,704 @@
/* Command processing for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "filedef.h"
#include "os.h"
#include "dep.h"
#include "variable.h"
#include "job.h"
#include "commands.h"
#if MK_OS_W32
#include <windows.h>
#include "w32err.h"
#endif
#if MK_OS_VMS
# define FILE_LIST_SEPARATOR (vms_comma_separator ? ',' : ' ')
#else
# define FILE_LIST_SEPARATOR ' '
#endif
static unsigned long
dep_hash_1 (const void *key)
{
const struct dep *d = key;
return_STRING_HASH_1 (dep_name (d));
}
static unsigned long
dep_hash_2 (const void *key)
{
const struct dep *d = key;
return_STRING_HASH_2 (dep_name (d));
}
static int
dep_hash_cmp (const void *x, const void *y)
{
const struct dep *dx = x;
const struct dep *dy = y;
return strcmp (dep_name (dx), dep_name (dy));
}
/* Set FILE's automatic variables up.
* Use STEM to set $*.
* If STEM is 0, then set FILE->STEM and $* to the target name with any
* suffix in the .SUFFIXES list stripped off. */
void
set_file_variables (struct file *file, const char *stem)
{
struct dep *d;
const char *at, *percent, *star, *less;
#ifndef NO_ARCHIVES
/* If the target is an archive member 'lib(member)',
then $@ is 'lib' and $% is 'member'. */
if (ar_name (file->name))
{
size_t len;
const char *cp;
char *p;
cp = strchr (file->name, '(');
p = alloca (cp - file->name + 1);
memcpy (p, file->name, cp - file->name);
p[cp - file->name] = '\0';
at = p;
len = strlen (cp + 1);
p = alloca (len);
memcpy (p, cp + 1, len - 1);
p[len - 1] = '\0';
percent = p;
}
else
#endif /* NO_ARCHIVES. */
{
at = file->name;
percent = "";
}
/* $* is the stem from an implicit or static pattern rule. */
if (stem == 0)
{
/* In Unix make, $* is set to the target name with
any suffix in the .SUFFIXES list stripped off for
explicit rules. We store this in the 'stem' member. */
const char *name;
size_t len;
#ifndef NO_ARCHIVES
if (ar_name (file->name))
{
name = strchr (file->name, '(') + 1;
len = strlen (name) - 1;
}
else
#endif
{
name = file->name;
len = strlen (name);
}
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
{
const char *dn = dep_name (d);
size_t slen = strlen (dn);
if (len > slen && memcmp (dn, name + (len - slen), slen) == 0)
{
file->stem = stem = strcache_add_len (name, len - slen);
break;
}
}
if (d == 0)
file->stem = stem = "";
}
star = stem;
/* $< is the first not order-only dependency. */
less = "";
for (d = file->deps; d != 0; d = d->next)
if (!d->ignore_mtime && !d->ignore_automatic_vars && !d->need_2nd_expansion)
{
less = dep_name (d);
break;
}
if (file->cmds != 0 && file->cmds == default_file->cmds)
/* This file got its commands from .DEFAULT.
In this case $< is the same as $@. */
less = at;
#define DEFINE_VARIABLE(name, len, value) \
(void) define_variable_for_file (name,len,value,o_automatic,0,file)
/* Define the variables. */
DEFINE_VARIABLE ("<", 1, less);
DEFINE_VARIABLE ("*", 1, star);
DEFINE_VARIABLE ("@", 1, at);
DEFINE_VARIABLE ("%", 1, percent);
/* Compute the values for $^, $+, $?, and $|. */
{
static char *plus_value=0, *bar_value=0, *qmark_value=0;
static size_t plus_max=0, bar_max=0, qmark_max=0;
size_t qmark_len, plus_len, bar_len;
char *cp;
char *caret_value;
char *qp;
char *bp;
size_t len;
struct hash_table dep_hash;
void **slot;
/* Compute first the value for $+, which is supposed to contain
duplicate dependencies as they were listed in the makefile. */
plus_len = 0;
bar_len = 0;
for (d = file->deps; d != 0; d = d->next)
{
if (!d->need_2nd_expansion && !d->ignore_automatic_vars)
{
if (d->ignore_mtime)
bar_len += strlen (dep_name (d)) + 1;
else
plus_len += strlen (dep_name (d)) + 1;
}
}
if (bar_len == 0)
bar_len++;
if (plus_len == 0)
plus_len++;
if (plus_len > plus_max)
plus_value = xrealloc (plus_value, plus_max = plus_len);
cp = plus_value;
qmark_len = plus_len + 1; /* Will be this or less. */
for (d = file->deps; d != 0; d = d->next)
if (! d->ignore_mtime && ! d->need_2nd_expansion && ! d->ignore_automatic_vars)
{
const char *c = dep_name (d);
#ifndef NO_ARCHIVES
if (ar_name (c))
{
c = strchr (c, '(') + 1;
len = strlen (c) - 1;
}
else
#endif
len = strlen (c);
cp = mempcpy (cp, c, len);
*cp++ = FILE_LIST_SEPARATOR;
if (! (d->changed || always_make_flag))
qmark_len -= len + 1; /* Don't space in $? for this one. */
}
/* Kill the last space and define the variable. */
cp[cp > plus_value ? -1 : 0] = '\0';
DEFINE_VARIABLE ("+", 1, plus_value);
/* Compute the values for $^, $?, and $|. */
cp = caret_value = plus_value; /* Reuse the buffer; it's big enough. */
if (qmark_len > qmark_max)
qmark_value = xrealloc (qmark_value, qmark_max = qmark_len);
qp = qmark_value;
if (bar_len > bar_max)
bar_value = xrealloc (bar_value, bar_max = bar_len);
bp = bar_value;
/* Make sure that no dependencies are repeated in $^, $?, and $|. It
would be natural to combine the next two loops but we can't do it
because of a situation where we have two dep entries, the first
is order-only and the second is normal (see below). */
hash_init (&dep_hash, 500, dep_hash_1, dep_hash_2, dep_hash_cmp);
for (d = file->deps; d != 0; d = d->next)
{
if (d->need_2nd_expansion || d->ignore_automatic_vars)
continue;
slot = hash_find_slot (&dep_hash, d);
if (HASH_VACANT (*slot))
hash_insert_at (&dep_hash, d, slot);
else
{
/* Check if the two prerequisites have different ignore_mtime.
If so then we need to "upgrade" one that is order-only. */
struct dep* hd = (struct dep*) *slot;
if (d->ignore_mtime != hd->ignore_mtime)
d->ignore_mtime = hd->ignore_mtime = 0;
}
}
for (d = file->deps; d != 0; d = d->next)
{
const char *c;
if (d->need_2nd_expansion || d->ignore_automatic_vars || hash_find_item (&dep_hash, d) != d)
continue;
c = dep_name (d);
#ifndef NO_ARCHIVES
if (ar_name (c))
{
c = strchr (c, '(') + 1;
len = strlen (c) - 1;
}
else
#endif
len = strlen (c);
if (d->ignore_mtime)
{
bp = mempcpy (bp, c, len);
*bp++ = FILE_LIST_SEPARATOR;
}
else
{
cp = mempcpy (cp, c, len);
*cp++ = FILE_LIST_SEPARATOR;
if (d->changed || always_make_flag)
{
qp = mempcpy (qp, c, len);
*qp++ = FILE_LIST_SEPARATOR;
}
}
}
hash_free (&dep_hash, 0);
/* Kill the last spaces and define the variables. */
cp[cp > caret_value ? -1 : 0] = '\0';
DEFINE_VARIABLE ("^", 1, caret_value);
qp[qp > qmark_value ? -1 : 0] = '\0';
DEFINE_VARIABLE ("?", 1, qmark_value);
bp[bp > bar_value ? -1 : 0] = '\0';
DEFINE_VARIABLE ("|", 1, bar_value);
}
#undef DEFINE_VARIABLE
}
/* Chop CMDS up into individual command lines if necessary.
Also set the 'lines_flags' and 'any_recurse' members. */
void
chop_commands (struct commands *cmds)
{
unsigned short nlines;
unsigned short i;
char **lines;
/* If we don't have any commands, or we already parsed them, never mind. */
if (!cmds || cmds->command_lines != NULL)
return;
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
if (one_shell)
{
size_t l = strlen (cmds->commands);
nlines = 1;
lines = xmalloc (nlines * sizeof (char *));
lines[0] = xstrdup (cmds->commands);
/* Strip the trailing newline. */
if (l > 0 && lines[0][l-1] == '\n')
lines[0][l-1] = '\0';
}
else
{
const char *p = cmds->commands;
size_t max = 5;
nlines = 0;
lines = xmalloc (max * sizeof (char *));
while (*p != '\0')
{
const char *end = p;
find_end:;
end = strchr (end, '\n');
if (end == NULL)
end = p + strlen (p);
else if (end > p && end[-1] == '\\')
{
int backslash = 1;
if (end > p + 1)
{
const char *b;
for (b = end - 2; b >= p && *b == '\\'; --b)
backslash = !backslash;
}
if (backslash)
{
++end;
goto find_end;
}
}
if (nlines == USHRT_MAX)
ON (fatal, &cmds->fileinfo,
_("recipe has too many lines (limit %hu)"), nlines);
if (nlines == max)
{
max += 2;
lines = xrealloc (lines, max * sizeof (char *));
}
lines[nlines++] = xstrndup (p, (size_t) (end - p));
p = end;
if (*p != '\0')
++p;
}
}
/* Finally, set the corresponding CMDS->lines_flags elements and the
CMDS->any_recurse flag. */
cmds->ncommand_lines = nlines;
cmds->command_lines = lines;
cmds->any_recurse = 0;
cmds->lines_flags = xmalloc (nlines);
for (i = 0; i < nlines; ++i)
{
unsigned char flags = 0;
const char *p = lines[i];
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
switch (*(p++))
{
case '+':
flags |= COMMANDS_RECURSE;
break;
case '@':
flags |= COMMANDS_SILENT;
break;
case '-':
flags |= COMMANDS_NOERROR;
break;
}
/* If no explicit '+' was given, look for MAKE variable references. */
if (! ANY_SET (flags, COMMANDS_RECURSE)
&& (strstr (p, "$(MAKE)") != 0 || strstr (p, "${MAKE}") != 0))
flags |= COMMANDS_RECURSE;
cmds->lines_flags[i] = flags;
cmds->any_recurse |= ANY_SET (flags, COMMANDS_RECURSE) ? 1 : 0;
}
}
/* Execute the commands to remake FILE. If they are currently executing,
return or have already finished executing, just return. Otherwise,
fork off a child process to run the first command line in the sequence. */
void
execute_file_commands (struct file *file)
{
const char *p;
/* Don't go through all the preparations if
the commands are nothing but whitespace. */
for (p = file->cmds->commands; *p != '\0'; ++p)
if (!ISSPACE (*p) && *p != '-' && *p != '@' && *p != '+')
break;
if (*p == '\0')
{
/* If there are no commands, assume everything worked. */
set_command_state (file, cs_running);
file->update_status = us_success;
notice_finished_file (file);
return;
}
/* First set the automatic variables according to this file. */
initialize_file_variables (file, 0);
set_file_variables (file, file->stem);
/* Some systems don't support overwriting a loaded object so if this one
unload it before remaking. Keep its name in .LOADED: it will be rebuilt
and loaded again. If rebuilding or loading again fail, then we'll exit
anyway and it won't matter. */
if (file->loaded && unload_file (file->name) == 0)
{
file->loaded = 0;
file->unloaded = 1;
}
/* Start the commands running. */
new_job (file);
}
/* This is set while we are inside fatal_error_signal,
so things can avoid nonreentrant operations. */
volatile sig_atomic_t handling_fatal_signal = 0;
/* Handle fatal signals. */
void
fatal_error_signal (int sig)
{
#if MK_OS_DOS
extern int dos_status, dos_command_running;
if (dos_command_running)
{
/* That was the child who got the signal, not us. */
dos_status |= (sig << 8);
return;
}
remove_intermediates (1);
exit (EXIT_FAILURE);
#else /* not MK_OS_DOS */
#if MK_OS_W32
extern HANDLE main_thread;
/* Windows creates a separate thread for handling Ctrl+C, so we need
to suspend the main thread, or else we will have race conditions
when both threads call reap_children. */
if (main_thread)
{
DWORD susp_count = SuspendThread (main_thread);
if (susp_count != 0)
fprintf (stderr, "SuspendThread: suspend count = %lu\n", susp_count);
else if (susp_count == (DWORD)-1)
{
DWORD ierr = GetLastError ();
fprintf (stderr, "SuspendThread: error %lu: %s\n",
ierr, map_windows32_error_to_string (ierr));
}
}
#endif
handling_fatal_signal = 1;
/* Set the handling for this signal to the default.
It is blocked now while we run this handler. */
signal (sig, SIG_DFL);
temp_stdin_unlink ();
osync_clear ();
jobserver_clear ();
/* A termination signal won't be sent to the entire
process group, but it means we want to kill the children. */
if (sig == SIGTERM)
{
struct child *c;
for (c = children; c != 0; c = c->next)
if (!c->remote && c->pid > 0)
(void) kill (c->pid, SIGTERM);
}
/* If we got a signal that means the user
wanted to kill make, remove pending targets. */
if (sig == SIGTERM || sig == SIGINT
#ifdef SIGHUP
|| sig == SIGHUP
#endif
#ifdef SIGQUIT
|| sig == SIGQUIT
#endif
)
{
struct child *c;
/* Remote children won't automatically get signals sent
to the process group, so we must send them. */
for (c = children; c != 0; c = c->next)
if (c->remote && c->pid > 0)
(void) remote_kill (c->pid, sig);
for (c = children; c != 0; c = c->next)
delete_child_targets (c);
/* Clean up the children. We don't just use the call below because
we don't want to print the "Waiting for children" message. */
while (job_slots_used > 0)
reap_children (1, 0);
}
else
/* Wait for our children to die. */
while (job_slots_used > 0)
reap_children (1, 1);
/* Delete any non-precious intermediate files that were made. */
remove_intermediates (1);
#ifdef SIGQUIT
if (sig == SIGQUIT)
/* We don't want to send ourselves SIGQUIT, because it will
cause a core dump. Just exit instead. */
exit (MAKE_TROUBLE);
#endif
#if MK_OS_W32
if (main_thread)
CloseHandle (main_thread);
/* Cannot call W32_kill with a pid (it needs a handle). The exit
status of 130 emulates what happens in Bash. */
exit (130);
#else
/* Signal the same code; this time it will really be fatal. The signal
will be unblocked when we return and arrive then to kill us. */
if (kill (make_pid (), sig) < 0)
pfatal_with_name ("kill");
#endif /* not MK_OS_W32 */
#endif /* not MK_OS_DOS */
}
/* Delete FILE unless it's precious or not actually a file (phony),
and it has changed on disk since we last stat'd it. */
static void
delete_target (struct file *file, const char *on_behalf_of)
{
struct stat st;
int e;
if (file->precious || file->phony)
return;
#ifndef NO_ARCHIVES
if (ar_name (file->name))
{
time_t file_date = (file->last_mtime == NONEXISTENT_MTIME
? (time_t) -1
: (time_t) FILE_TIMESTAMP_S (file->last_mtime));
if (ar_member_date (file->name) != file_date)
{
if (on_behalf_of)
OSS (error, NILF,
_("*** [%s] archive member '%s' may be bogus; not deleted"),
on_behalf_of, file->name);
else
OS (error, NILF,
_("*** archive member '%s' may be bogus; not deleted"),
file->name);
}
return;
}
#endif
EINTRLOOP (e, stat (file->name, &st));
if (e == 0
&& S_ISREG (st.st_mode)
&& FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime)
{
if (on_behalf_of)
OSS (error, NILF,
_("*** [%s] deleting file '%s'"), on_behalf_of, file->name);
else
OS (error, NILF, _("*** deleting file '%s'"), file->name);
if (unlink (file->name) < 0
&& errno != ENOENT) /* It disappeared; so what. */
perror_with_name ("unlink: ", file->name);
}
}
/* Delete all non-precious targets of CHILD unless they were already deleted.
Set the flag in CHILD to say they've been deleted. */
void
delete_child_targets (struct child *child)
{
struct dep *d;
if (child->deleted || child->pid < 0)
return;
/* Delete the target file if it changed. */
delete_target (child->file, NULL);
/* Also remove any non-precious targets listed in the 'also_make' member. */
for (d = child->file->also_make; d != 0; d = d->next)
delete_target (d->file, child->file->name);
child->deleted = 1;
}
/* Print out the commands in CMDS. */
void
print_commands (const struct commands *cmds)
{
const char *s;
fputs (_("# recipe to execute"), stdout);
if (cmds->fileinfo.filenm == 0)
puts (_(" (built-in):"));
else
printf (_(" (from '%s', line %lu):\n"),
cmds->fileinfo.filenm, cmds->fileinfo.lineno);
s = cmds->commands;
while (*s != '\0')
{
const char *end;
int bs;
/* Print one full logical recipe line: find a non-escaped newline. */
for (end = s, bs = 0; *end != '\0'; ++end)
{
if (*end == '\n' && !bs)
break;
bs = *end == '\\' ? !bs : 0;
}
printf ("%c%.*s\n", cmd_prefix, (int) (end - s), s);
s = end + (end[0] == '\n');
}
}

45
src/commands.h Normal file
View File

@ -0,0 +1,45 @@
/* Definition of data structures describing shell commands for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
/* Structure that gives the commands to make a file
and information about where these commands came from. */
struct commands
{
floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
char **command_lines; /* Commands chopped up into lines. */
unsigned char *lines_flags; /* One set of flag bits for each line. */
unsigned short ncommand_lines;/* Number of command lines. */
char recipe_prefix; /* Recipe prefix for this command set. */
unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
/* the COMMANDS_RECURSE bit set. */
};
/* Bits in 'lines_flags'. */
#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */
struct file;
struct child;
void fatal_error_signal (int sig);
void execute_file_commands (struct file *file);
void print_commands (const struct commands *cmds);
void delete_child_targets (struct child *child);
void chop_commands (struct commands *cmds);
void set_file_variables (struct file *file, const char *stem);

428
src/config.h-vms Normal file
View File

@ -0,0 +1,428 @@
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
Copyright (C) 1996-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "mkconfig.h"
#define MK_OS_VMS 1
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
compiler which don't define it. */
#ifdef __DECC
# include <types.h>
#endif
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define to 1 if NLS is requested. */
/* #undef ENABLE_NLS */
/* Define as 1 if you have dcgettext. */
/* #undef HAVE_DCGETTEXT */
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Embed GNU Guile support */
/* #undef HAVE_GUILE */
/* Define to 1 if your locale.h file contains LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */
/* Define to the installation directory for locales. */
#define LOCALEDIR ""
/* Define as 1 if you have the stpcpy function. */
/* #undef HAVE_STPCPY */
/* Define to 1 if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
not define. */
#define intmax_t unsigned long
/* Define to 'unsigned long' or 'unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define to 'int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to 1 if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if you have the declaration of 'getloadavg'. */
/* #undef HAVE_DECL_GETLOADAVG */
/* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define to 1 if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define to 1 if you have the getmntent function. */
/* #undef HAVE_GETMNTENT */
/* Define to 1 if the 'long double' type works. */
/* #undef HAVE_LONG_DOUBLE */
/* Define to 1 if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define to 1 if you have a working 'mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to 1 if system calls automatically restart after interruption
by a signal. */
/* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define to 1 if your struct stat has st_blksize. */
/* #undef HAVE_ST_BLKSIZE */
/* Define to 1 if your struct stat has st_blocks. */
/* #undef HAVE_ST_BLOCKS */
/* Define to 1 if you have the strcoll function and it is properly defined. */
/* #undef HAVE_STRCOLL */
/* Define to 1 if you have the strncasecmp' function. */
#if __CRTL_VER >= 70000000
#define HAVE_STRNCASECMP 1
#endif
/* Define to 1 if your struct stat has st_rdev. */
/* #undef HAVE_ST_RDEV */
/* Define to 1 if you have the strftime function. */
/* #undef HAVE_STRFTIME */
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
/* Define to 1 if your struct tm has tm_zone. */
/* #undef HAVE_TM_ZONE */
/* Define to 1 if you don't have tm_zone but do have the external array
tzname. */
/* #undef HAVE_TZNAME */
/* Define to 1 if you have <unistd.h>. */
#ifdef __DECC
#define HAVE_UNISTD_H 1
#endif
/* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */
/* #undef HAVE_UTIME_NULL */
/* Define to 1 if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define to 1 if your struct nlist has an n_un member. */
/* #undef NLIST_NAME_UNION */
/* Define to 1 if you have <nlist.h>. */
/* #undef NLIST_STRUCT */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define to 'int' if <sys/types.h> doesn't define. */
/* I assume types.h is available for all 5.0 cc/cxx compilers */
#if __DECC_VER < 50090000
#define pid_t int
#endif
/* Define to 1 if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */
/* Define on System V Release 4. */
/* #undef SVR4 */
/* Define to 1 if 'sys_siglist' is declared by <signal.h>. */
/* #undef SYS_SIGLIST_DECLARED */
/* Define to 'int' if <sys/types.h> doesn't define. */
#if __DECC_VER < 50090000
#define uid_t int
#endif
/* Define for Encore UMAX. */
/* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */
/* Define to the name of the SCCS 'get' command. */
/* #undef SCCS_GET */
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
/* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU Make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define to 1 if the C library defines the variable 'sys_siglist'. */
/* #undefine HAVE_SYS_SIGLIST */
/* Define to 1 if the C library defines the variable '_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */
/* Define to 1 if you have the 'union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */
/* Define to 1 if you have the dup2 function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the getgroups function. */
/* #undef HAVE_GETGROUPS */
/* Define to 1 if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define to 1 if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define to 1 if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the 'mkfifo' function. */
/* #undef HAVE_MKFIFO */
/* Define to 1 if you have the mktemp function. */
#define HAVE_MKTEMP 1
/* Define to 1 if you have the psignal function. */
/* #undef HAVE_PSIGNAL */
/* Define to 1 if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define to 1 if you have the setegid function. */
/* #undef HAVE_SETEGID */
/* Define to 1 if you have the seteuid function. */
/* #undef HAVE_SETEUID */
/* Define to 1 if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF */
/* Define to 1 if you have the setregid function. */
/* #undefine HAVE_SETREGID */
/* Define to 1 if you have the setreuid function. */
/* #define HAVE_SETREUID */
/* Define to 1 if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1
/* Define to 1 if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define to 1 if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the strcmpi function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the stricmp function. */
/* #undef HAVE_STRICMP */
/* Define to 1 if you have the strsignal function. */
/* #undef HAVE_STRSIGNAL */
/* Define to 1 if you have the `strtoll' function. */
#define HAVE_STRTOLL 1
/* Define to 1 if you have the wait3 function. */
/* #undef HAVE_WAIT3 */
/* Define to 1 if you have the waitpid function. */
/* #undef HAVE_WAITPID */
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#ifdef __DECC
#define HAVE_FCNTL_H 1
#endif
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define to 1 if you have the `mempcpy' function. */
/* #undef HAVE_MEMPCPY */
/* Define to 1 if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */
/* Define to 1 if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define to 1 if you have the dgc library (-ldgc). */
/* #undef HAVE_LIBDGC */
/* Define to 1 if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT *
/* Define to 1 if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */
/* Define to 1 if you have the `isatty' function. */
/* #undef HAVE_ISATTY */
/* Define to 1 if you have the `ttyname' function. */
/* #undef HAVE_TTYNAME */
/* Use high resolution file timestamps if nonzero. */
#define FILE_TIMESTAMP_HI_RES 0
/* Define for case insensitve filenames */
#define HAVE_CASE_INSENSITIVE_FS 1
/* VMS specific, define it if you want to use case sensitive targets */
/* #undef WANT_CASE_SENSITIVE_TARGETS */
/* VMS specific, V7.0 has opendir() and friends, so it's undefined */
/* If you want to use non-VMS code for opendir() etc. on V7.0 and greater
define the first or both macros AND change the compile command to get the
non-VMS versions linked: (prefix=(all,except=(opendir,... */
/* #undef HAVE_VMSDIR_H */
/* #undef _DIRENT_HAVE_D_NAMLEN */
/* On older systems without 7.0 backport of CRTL use non-VMS code for opendir() etc. */
#if __CRTL_VER < 70000000
# define HAVE_VMSDIR_H 1
#endif
#if defined(HAVE_VMSDIR_H) && defined(HAVE_DIRENT_H)
#undef HAVE_DIRENT_H
#endif
#define HAVE_STDLIB_H 1
#define INCLUDEDIR "sys$sysroot:[syslib]"
#define LIBDIR "sys$sysroot:[syslib]"
/* Don't use RTL functions of OpenVMS */
#ifdef __DECC
#include <stdio.h>
#include <unistd.h>
#define getopt gnu_getopt
#define optarg gnu_optarg
#define optopt gnu_optopt
#define optind gnu_optind
#define opterr gnu_opterr
#define globfree gnu_globfree
#define glob gnu_glob
#endif
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* maybe this should be placed into makeint.h */
#if defined(__VAX) && defined(__DECC)
#define alloca(n) __ALLOCA(n)
#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
/* # undef WORDS_BIGENDIAN */
/* Output sync sypport */
#define NO_OUTPUT_SYNC
/* Define to 1 to write even short single-line actions into a VMS/DCL command
file; this also enables exporting make environment variables into the
(sub-)process, which executes the action.
The usual make rules apply whether a shell variable - here a DCL symbol or
VMS logical [see CRTL getenv()] - is added to the make environment and
is exported. */
#define USE_DCL_COM_FILE 1
/* Build host information. */
#define MAKE_HOST "VMS"
/* Include customized declarations. */
#include "../src/mkcustom.h"

629
src/config.h.W32 Normal file
View File

@ -0,0 +1,629 @@
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
Copyright (C) 1996-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "mkconfig.h"
/* Build for the Windows32 API. */
#define MK_OS_W32 1
/* Suppress some Visual C++ warnings.
Maybe after the code cleanup for ISO C we can remove some/all of these. */
#if _MSC_VER > 1000
# pragma warning(disable:4100) /* unreferenced formal parameter */
# pragma warning(disable:4130) /* logical operation on address of string constant */
# pragma warning(disable:4131) /* uses old-style declarator */
# pragma warning(disable:4702) /* unreachable code */
# define _CRT_SECURE_NO_WARNINGS 1 /* function or variable may be unsafe */
# define _CRT_NONSTDC_NO_WARNINGS 1 /* functions w/o a leading underscore */
#endif
/* Define to 1 if the 'closedir' function returns void instead of 'int'. */
/* #undef CLOSEDIR_VOID */
/* Define to 1 if using 'alloca.c'. */
/* #undef C_ALLOCA */
/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
/* #undef ENABLE_NLS */
/* Use high resolution file timestamps if nonzero. */
#define FILE_TIMESTAMP_HI_RES 0
/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
may be supplied by this distribution. */
#define HAVE_ALLOCA 1
/* Define to 1 if <alloca.h> works. */
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if you have the 'atexit' function. */
#define HAVE_ATEXIT 1
/* Use case insensitive file names */
/* #undef HAVE_CASE_INSENSITIVE_FS */
/* Define to 1 if you have the clock_gettime function. */
/* #undef HAVE_CLOCK_GETTIME */
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* Define to 1 if you have the declaration of 'bsd_signal', and to 0 if you
don't. */
#define HAVE_DECL_BSD_SIGNAL 0
/* Define to 1 if you have the declaration of `dlerror', and to 0 if you
don't. */
#define HAVE_DECL_DLERROR 0
/* Define to 1 if you have the declaration of `dlopen', and to 0 if you don't.
*/
#define HAVE_DECL_DLOPEN 0
/* Define to 1 if you have the declaration of `dlsym', and to 0 if you don't.
*/
#define HAVE_DECL_DLSYM 0
/* Define to 1 if you have the declaration of 'getloadavg'. */
/* #undef HAVE_DECL_GETLOADAVG */
/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you
don't. */
#define HAVE_DECL_SYS_SIGLIST 0
/* Define to 1 if you have the declaration of '_sys_siglist', and to 0 if you
don't. */
#define HAVE_DECL__SYS_SIGLIST 0
/* Define to 1 if you have the declaration of '__sys_siglist', and to 0 if you
don't. */
#define HAVE_DECL___SYS_SIGLIST 0
/* Define to 1 if you have the <dirent.h> header file, and it defines 'DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <direct.h> header file, and it defines getcwd()
and chdir().
*/
#if (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__TINYC__)) && !defined(__INTERIX)
# define HAVE_DIRECT_H 1
#endif
/* Support DOS-style pathnames. */
#define HAVE_DOS_PATHS 1
/* Define to 1 if you have the 'dup' function. */
#define HAVE_DUP 1
/* Define to 1 if you have the 'dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the 'fdopen' function. */
#ifdef __MINGW32__
#define HAVE_FDOPEN 1
#endif
/* Define to 1 if you have the `fork' function. */
/* #undef HAVE_FORK */
/* Define to 1 if you have the 'getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the 'getgroups' function. */
/* #undef HAVE_GETGROUPS */
/* Define to 1 if you have the 'gethostbyname' function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define to 1 if you have the 'gethostname' function. */
/* #undef HAVE_GETHOSTNAME */
/* Define to 1 if you have the 'getrlimit' function. */
/* #undef HAVE_GETRLIMIT */
/* Define if the GNU gettext() function is already present or preinstalled. */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have a standard gettimeofday function */
#ifdef __MINGW32__
#define HAVE_GETTIMEOFDAY 1
#endif
/* Embed GNU Guile support. Windows build sets this on the
compilation command line. */
/* #undef HAVE_GUILE */
/* Define if you have the iconv() function. */
/* #undef HAVE_ICONV */
/* Define to 1 if you have the <inttypes.h> header file. */
#ifdef __MINGW32__
#define HAVE_INTTYPES_H 1
#endif
/* Define to 1 if you have the `isatty' function. */
#define HAVE_ISATTY 1
/* Define to 1 if you have the 'dgc' library (-ldgc). */
/* #undef HAVE_LIBDGC */
/* Define to 1 if you have the 'kstat' library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define to 1 if you have the `perfstat' library (-lperfstat). */
/* #undef HAVE_LIBPERFSTAT */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <locale.h> header file. */
/* #undef HAVE_LOCALE_H */
/* Define to 1 if the system has the type 'long long int'. */
#define HAVE_LONG_LONG_INT 1
/* Define to 1 if you have the 'lstat' function. */
/* #undef HAVE_LSTAT */
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mempcpy' function. */
/* #undef HAVE_MEMPCPY */
/* Define to 1 if you have the `memrchr' function. */
/* #undef HAVE_MEMRCHR */
/* Define to 1 if you have the <minix/config.h> header file. */
/* #undef HAVE_MINIX_CONFIG_H */
/* Define to 1 if you have the 'mkfifo' function. */
/* #undef HAVE_MKFIFO */
/* Define to 1 if you have the 'mkstemp' function. */
/* #undef HAVE_MKSTEMP */
/* Define to 1 if you have the `mkstemp' function. */
/* #undef HAVE_MKSTEMP */
/* Define to 1 if you have the 'mktemp' function. */
#define HAVE_MKTEMP 1
/* Define to 1 if you have the <ndir.h> header file, and it defines 'DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <nlist.h> header file. */
/* #undef HAVE_NLIST_H */
/* Define to 1 if you have the 'pipe' function. */
/* #undef HAVE_PIPE */
/* Define to 1 if you have the `posix_spawn' function. */
/* #undef HAVE_POSIX_SPAWN */
/* Define to 1 if you have the `posix_spawnattr_setsigmask' function. */
/* #undef HAVE_POSIX_SPAWNATTR_SETSIGMASK */
/* Define to 1 if you have the `pselect' function. */
/* #undef HAVE_PSELECT */
/* Define to 1 if you have the 'pstat_getdynamic' function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define to 1 if you have the 'readlink' function. */
/* #undef HAVE_READLINK */
/* Define to 1 if you have the 'realpath' function. */
/* #undef HAVE_REALPATH */
/* Define to 1 if <signal.h> defines the SA_RESTART constant. */
/* #undef HAVE_SA_RESTART */
/* Define to 1 if you have the 'setegid' function. */
/* #undef HAVE_SETEGID */
/* Define to 1 if you have the 'seteuid' function. */
/* #undef HAVE_SETEUID */
/* Define to 1 if you have the 'setlinebuf' function. */
/* #undef HAVE_SETLINEBUF */
/* Define to 1 if you have the 'setregid' function. */
/* #undef HAVE_SETREGID */
/* Define to 1 if you have the 'setreuid' function. */
/* #undef HAVE_SETREUID */
/* Define to 1 if you have the 'setrlimit' function. */
/* #undef HAVE_SETRLIMIT */
/* Define to 1 if you have the 'setvbuf' function. */
#define HAVE_SETVBUF 1
/* Define to 1 if you have the 'sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if you have the 'sigsetmask' function. */
/* #undef HAVE_SIGSETMASK */
/* Define to 1 if you have the 'socket' function. */
/* #undef HAVE_SOCKET */
/* Define to 1 if you have the <spawn.h> header file. */
/* #undef HAVE_SPAWN_H */
/* Define to 1 if you have the <stdint.h> header file. */
#ifdef __MINGW32__
#define HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `stpcpy' function. */
/* #undef HAVE_STPCPY */
/* Define to 1 if you have the 'strcasecmp' function. */
#if defined(__MINGW32__) || defined(__TINYC__)
#define HAVE_STRCASECMP 1
#endif
/* Define to 1 if you have the 'strcmpi' function. */
#define HAVE_STRCMPI 1
/* Define to 1 if you have the 'strcoll' function and it is properly defined.
*/
#define HAVE_STRCOLL 1
/* Define to 1 if you have the 'strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the 'stricmp' function. */
#define HAVE_STRICMP 1
/* Define to 1 if you have the <strings.h> header file. */
#ifdef __MINGW32__
#define HAVE_STRINGS_H 1
#endif
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the 'strncasecmp' function. */
#if defined(__MINGW32__) || defined(__TINYC__)
#define HAVE_STRNCASECMP 1
#endif
/* Define to 1 if you have the 'strncmpi' function. */
/* #undef HAVE_STRNCMPI */
/* Define to 1 if you have the 'strndup' function. */
/* #undef HAVE_STRNDUP */
/* Define to 1 if you have the 'strnicmp' function. */
#ifdef __MINGW32__
#define HAVE_STRNICMP 1
#endif
/* Define to 1 if you have the 'strsignal' function. */
/* #undef HAVE_STRSIGNAL */
/* Define to 1 if you have the `strtoll' function. */
#define HAVE_STRTOLL 1
#ifdef __TINYC__
# ifndef strtoll
# define strtoll _strtoi64
# endif
# ifndef strtoull
# define strtoull _strtoui64
# endif
#endif
/* Define to 1 if `d_type' is a member of `struct dirent'. */
/* SV 57152: MinGW64 version of dirent doesn't support d_type. */
#ifndef __MINGW64__
# define HAVE_STRUCT_DIRENT_D_TYPE 1
#endif
/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
/* #undef HAVE_STRUCT_NLIST_N_UN_N_NAME */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines 'DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/file.h> header file. */
/* #undef HAVE_SYS_FILE_H */
/* Define to 1 if you have the <sys/loadavg.h> header file. */
/* #undef HAVE_SYS_LOADAVG_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#ifdef __MINGW32__
#define HAVE_SYS_PARAM_H 1
#endif
/* Define to 1 if you have the <sys/resource.h> header file. */
/* #undef HAVE_SYS_RESOURCE_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#ifdef __MINGW32__
#define HAVE_SYS_TIME_H 1
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define to 1 if you have the `ttyname' function. */
#define HAVE_TTYNAME 1
char *ttyname (int);
/* Define to 1 if the system has the type `intmax_t'. */
#define HAVE_INTMAX_T 1
/* Define to 1 if the system has the type `uintmax_t'. */
#define HAVE_UINTMAX_T 1
/* Define to 1 if you have the `umask' function. */
#if defined(__MINGW32__) || defined(__TINYC__)
# define HAVE_UMASK 1
#endif
/* Define to 1 if you have the \'union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */
/* Define to 1 if you have the <unistd.h> header file. */
#ifdef __MINGW32__
#define HAVE_UNISTD_H 1
#endif
/* Define to 1 if the system has the type 'unsigned long long int'. */
#define HAVE_UNSIGNED_LONG_LONG_INT 1
/* Define to 1 if you have the `vfork' function. */
/* #undef HAVE_VFORK */
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if you have the 'wait3' function. */
/* #undef HAVE_WAIT3 */
/* Define to 1 if you have the 'waitpid' function. */
/* #undef HAVE_WAITPID */
/* Define to 1 if you have the <wchar.h> header file. */
/* #undef HAVE_WCHAR_H */
/* Define to 1 if `fork' works. */
/* #undef HAVE_WORKING_FORK */
/* Define to 1 if `vfork' works. */
/* #undef HAVE_WORKING_VFORK */
/* Define to 1 if the system has the type `_Bool'. */
/* #undef HAVE__BOOL */
/* Build host information. */
#define MAKE_HOST "Windows32"
/* Define to 1 to enable job server support in GNU Make. */
#define MAKE_JOBSERVER 1
/* Define to 1 to enable 'load' support in GNU Make. */
#define MAKE_LOAD 1
/* Define to 1 to enable symbolic link timestamp checking. */
/* #undef MAKE_SYMLINKS */
/* Define to 1 if your 'struct nlist' has an 'n_un' member. Obsolete, depend
on 'HAVE_STRUCT_NLIST_N_UN_N_NAME */
/* #undef NLIST_NAME_UNION */
/* Define to 1 if struct nlist.n_name is a pointer rather than an array. */
/* #undef NLIST_STRUCT */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define to the character that separates directories in PATH. */
#define PATH_SEPARATOR_CHAR ';'
/* Define to the name of the SCCS 'get' command. */
#define SCCS_GET "echo no sccs get"
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
/* #undef SCCS_GET_MINUS_G */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */
/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if struct stat contains a nanoseconds field */
/* #undef ST_MTIM_NSEC */
/* Define to 1 on System V Release 4. */
/* #undef SVR4 */
/* Define to 1 for Encore UMAX. */
/* #undef UMAX */
/* Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> instead of
<sys/cpustats.h>. */
/* #undef UMAX4_3 */
/* Define if using the dmalloc debugging malloc package */
/* #undef WITH_DMALLOC */
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* # undef _ALL_SOURCE */
#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
/* # undef WORDS_BIGENDIAN */
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for 'stat' and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define to empty if 'const' does not conform to ANSI C. */
/* #undef const */
#ifdef __MINGW32__
# undef __USE_MINGW_ANSI_STDIO
# define __USE_MINGW_ANSI_STDIO 1
#endif
/* Number of bits in a timestamp, on hosts where this is settable. */
/* #undef _TIME_BITS */
/* For 64-bit time_t on 32-bit mingw. */
#ifdef __MINGW32__
# define __MINGW_USE_VC2005_COMPAT 1
#endif
#include <sys/types.h>
/* Define to 'int' if <sys/types.h> doesn't define. */
#define gid_t int
/* Define to 'int' if <sys/types.h> does not define. */
/* GCC 4.x reportedly defines pid_t. */
#ifndef _PID_T_
#ifdef _WIN64
#define pid_t __int64
#else
#define pid_t int
#endif
#endif
/* Define to `int' if <sys/types.h> does not define. */
#define ssize_t int
/* Define to 'int' if <sys/types.h> doesn't define. */
#define uid_t int
/* Define {u,}intmax_t if not defined in <stdint.h> or <inttypes.h>. */
#if !HAVE_STDINT_H && !HAVE_INTTYPES_H
#define intmax_t long long
#define uintmax_t unsigned long long
#endif
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
/* Define to the installation directory for locales. */
#define LOCALEDIR ""
/*
* Refer to README.W32 for info on the following settings
*/
/*
* If you have a shell that does not grok 'sh -c quoted-command-line'
* correctly, you need this setting; it is the default for tcc.
* Please see below for specific shell support.
*/
#if defined(__TINYC__)
#define BATCH_MODE_ONLY_SHELL 1
#else
/*#define BATCH_MODE_ONLY_SHELL 1 */
#endif
/*
* Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
* Do NOT define BATCH_MODE_ONLY_SHELL if you define HAVE_CYGWIN_SHELL
*/
/*#define HAVE_CYGWIN_SHELL 1 */
/*
* Define if you have the MKS tool set or shell. Do NOT define
* BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
*/
/*#define HAVE_MKS_SHELL 1 */
/*
* Enforce the mutual exclusivity restriction.
*/
#ifdef HAVE_MKS_SHELL
#undef BATCH_MODE_ONLY_SHELL
#endif
#ifdef HAVE_CYGWIN_SHELL
#undef BATCH_MODE_ONLY_SHELL
#endif
/* Include customized declarations. */
#include "../src/mkcustom.h"

114
src/configh.dos Normal file
View File

@ -0,0 +1,114 @@
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
Copyright (C) 1994-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "mkconfig.h"
#define MK_OS_DOS 1
/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
of GCC 4.3.0 and later no longer do it automatically. */
#include <sys/version.h>
/* Many things are defined already by a system header. */
#include <sys/config.h>
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
/* Define to 1 if 'sys_siglist' is declared by <signal.h> or <unistd.h>. */
# define SYS_SIGLIST_DECLARED 1
/* Define to 1 if the C library defines the variable '_sys_siglist'. */
# define HAVE_DECL_SYS_SIGLIST 1
#else
/* Define NSIG. */
# define NSIG SIGMAX
#endif
/* Use high resolution file timestamps if nonzero. */
#define FILE_TIMESTAMP_HI_RES 0
/* Define to 1 if you have 'alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define to 1 if you have the 'getgroups' function. */
#define HAVE_GETGROUPS 1
/* Define to 1 if the system has the type 'long long int'. */
#define HAVE_LONG_LONG_INT 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the 'mktemp' function. */
#define HAVE_MKTEMP 1
/* Define to 1 if you have the 'setlinebuf' function. */
#define HAVE_SETLINEBUF 1
/* Define to 1 if you have the 'setvbuf' function. */
#define HAVE_SETVBUF 1
#define SCCS_GET "get"
/* Define to 1 if you have the select function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the stricmp function. */
#define HAVE_STRICMP 1
/* Define to 1 if you have the 'strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strtoll' function. */
#define HAVE_STRTOLL 1
/* Output sync support */
#define NO_OUTPUT_SYNC 1
/* Build host information. */
#define MAKE_HOST "i386-pc-msdosdjgpp"
/* Grok DOS paths (drive specs and backslash path element separators) */
#define HAVE_DOS_PATHS 1
/* Define the type of the first arg to select(). */
#define fd_set_size_t int
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
not define. */
#define intmax_t long long
/* Define to `int' if <sys/types.h> does not define. */
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 5
#define ssize_t int
#endif
/* Define to 'unsigned long' or 'unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long long
/* Include customized declarations. */
#include "../src/mkcustom.h"

41
src/debug.h Normal file
View File

@ -0,0 +1,41 @@
/* Debugging macros and interface.
Copyright (C) 1999-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#define DB_NONE (0x000)
#define DB_BASIC (0x001)
#define DB_VERBOSE (0x002)
#define DB_JOBS (0x004)
#define DB_IMPLICIT (0x008)
#define DB_PRINT (0x010)
#define DB_WHY (0x020)
#define DB_MAKEFILES (0x100)
#define DB_ALL (0xfff)
extern int db_level;
#define ISDB(_l) ((_l)&db_level)
/* When adding macros to this list be sure to update the value of
XGETTEXT_OPTIONS in the po/Makevars file. */
#define DBS(_l,_x) do{ if(ISDB(_l)) {print_spaces (depth); \
printf _x; fflush (stdout);} }while(0)
#define DBF(_l,_x) do{ if(ISDB(_l)) {print_spaces (depth); \
printf (_x, file->name); \
fflush (stdout);} }while(0)
#define DB(_l,_x) do{ if(ISDB(_l)) {printf _x; fflush (stdout);} }while(0)

768
src/default.c Normal file
View File

@ -0,0 +1,768 @@
/* Data base of default implicit rules for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include <assert.h>
#include "filedef.h"
#include "variable.h"
#include "rule.h"
#include "dep.h"
#include "job.h"
#include "commands.h"
/* Define GCC_IS_NATIVE if gcc is the native development environment on
your system (gcc/bison/flex vs cc/yacc/lex). */
#if MK_OS_DOS || MK_OS_OS2
# define GCC_IS_NATIVE
#endif
/* This is the default list of suffixes for suffix rules.
'.s' must come last, so that a '.o' file will be made from
a '.c' or '.p' or ... file rather than from a .s file. */
static const char default_suffixes[]
#if MK_OS_VMS
/* VMS should include all UNIX/POSIX + some VMS extensions */
= ".out .exe .a .olb .hlb .tlb .mlb .ln .o .obj .c .cxx .cc .cpp .pas .p \
.for .f .r .y .l .ym .yl .mar .s .ss .i .ii .mod .sym .def .h .info .dvi \
.tex .texinfo .texi .txinfo .mem .hlp .brn .rnh .rno .rnt .rnx .w .ch .cweb \
.web .com .sh .elc .el";
#elif MK_OS_OS2
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el .obj .exe .dll .lib";
#else
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el";
#endif
static const struct pspec default_pattern_rules[] =
{
#if MK_OS_VMS
{ "(%)", "%",
"@if f$$search(\"$@\") .eqs. \"\" then $(LIBRARY)/CREATE/"
"$(or "
"$(patsubst %,TEXT,$(filter %.tlb %.TLB,$@)),"
"$(patsubst %,HELP,$(filter %.hlb %.HLB,$@)),"
"$(patsubst %,MACRO,$(filter %.mlb %.MLB,$@)),"
"$(and "
"$(patsubst %,SHARE,$(filter %.olb %.OLB,$@)),"
"$(patsubst %,SHARE,$(filter %.exe %.EXE,$<))),"
"OBJECT)"
" $@\n"
"$(AR) $(ARFLAGS) $@ $<" },
#else
{ "(%)", "%",
"$(AR) $(ARFLAGS) $@ $<" },
#endif
/* The X.out rules are only in BSD's default set because
BSD Make has no null-suffix rules, so 'foo.out' and
'foo' are the same thing. */
#if MK_OS_VMS
{ "%.exe", "%",
"$(CP) $< $@" },
#endif
{ "%.out", "%",
"@rm -f $@ \n cp $< $@" },
/* Syntax is "ctangle foo.w foo.ch foo.c". */
{ "%.c", "%.w %.ch",
"$(CTANGLE) $^ $@" },
{ "%.tex", "%.w %.ch",
"$(CWEAVE) $^ $@" },
{ 0, 0, 0 }
};
static const struct pspec default_terminal_rules[] =
{
#if MK_OS_VMS
/* RCS. */
{ "%", "%$$5lv", /* Multinet style */
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
{ "%", "[.$$rcs]%$$5lv", /* Multinet style */
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
{ "%", "%_v", /* Normal style */
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
{ "%", "[.rcs]%_v", /* Normal style */
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
/* SCCS. */
/* ain't no SCCS on vms */
#else
/* RCS. */
{ "%", "%,v",
"$(CHECKOUT,v)" },
{ "%", "RCS/%,v",
"$(CHECKOUT,v)" },
{ "%", "RCS/%",
"$(CHECKOUT,v)" },
/* SCCS. */
{ "%", "s.%",
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
{ "%", "SCCS/s.%",
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
#endif /* !MK_OS_VMS */
{ 0, 0, 0 }
};
static const char *const default_suffix_rules[] =
{
#if MK_OS_VMS
".o",
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".obj",
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".s",
"$(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".S",
"$(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".c",
"$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".cc",
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".C",
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".cpp",
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".f",
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".m",
"$(LINK.m) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".p",
"$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".F",
"$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".r",
"$(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".mod",
"$(COMPILE.mod) -o $@ -e $@ $^",
".def.sym",
"$(COMPILE.def) -o $@ $<",
".sh",
"copy $< >$@",
".obj.exe",
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
".mar.exe",
"$(COMPILE.mar) $^ \n $(LINK.obj) $(subst .mar,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
".s.o",
"$(COMPILE.s) -o $@ $<",
".s.exe",
"$(COMPILE.s) $^ \n $(LINK.obj) $(subst .s,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
".c.exe",
"$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
".cc.exe",
#ifdef GCC_IS_NATIVE
"$(COMPILE.cc) $^ \n $(LINK.obj) $(CXXSTARTUP),sys$$disk:[]$(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
#else
"$(COMPILE.cc) $^ \n $(CXXLINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
".cxx.exe",
"$(COMPILE.cxx) $^ \n $(CXXLINK.obj) $(subst .cxx,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
#endif
".for.exe",
"$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
".pas.exe",
"$(COMPILE.pas) $^ \n $(LINK.obj) $(subst .pas,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
".com",
"copy $< >$@",
".mar.obj",
"$(COMPILE.mar) /obj=$@ $<",
".s.obj",
"$(COMPILE.s) /obj=$@ $<",
".ss.obj",
"$(COMPILE.s) /obj=$@ $<",
".c.i",
"$(COMPILE.c)/prep /list=$@ $<",
".c.s",
"$(COMPILE.c)/noobj/machine /list=$@ $<",
".i.s",
"$(COMPILE.c)/noprep/noobj/machine /list=$@ $<",
".c.obj",
"$(COMPILE.c) /obj=$@ $<",
".c.o",
"$(COMPILE.c) /obj=$@ $<",
".cc.ii",
"$(COMPILE.cc)/prep /list=$@ $<",
".cc.ss",
"$(COMPILE.cc)/noobj/machine /list=$@ $<",
".ii.ss",
"$(COMPILE.cc)/noprep/noobj/machine /list=$@ $<",
".cc.obj",
"$(COMPILE.cc) /obj=$@ $<",
".cc.o",
"$(COMPILE.cc) /obj=$@ $<",
".cxx.obj",
"$(COMPILE.cxx) /obj=$@ $<",
".cxx.o",
"$(COMPILE.cxx) /obj=$@ $<",
".for.obj",
"$(COMPILE.for) /obj=$@ $<",
".for.o",
"$(COMPILE.for) /obj=$@ $<",
".pas.obj",
"$(COMPILE.pas) /obj=$@ $<",
".pas.o",
"$(COMPILE.pas) /obj=$@ $<",
".y.c",
"$(YACC.y) $< \n rename y_tab.c $@",
".l.c",
"$(LEX.l) $< \n rename lexyy.c $@",
".texinfo.info",
"$(MAKEINFO) $<",
".tex.dvi",
"$(TEX) $<",
".cpp.o",
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o",
"$(COMPILE.f) $(OUTPUT_OPTION) $<",
".m.o",
"$(COMPILE.m) $(OUTPUT_OPTION) $<",
".p.o",
"$(COMPILE.p) $(OUTPUT_OPTION) $<",
".r.o",
"$(COMPILE.r) $(OUTPUT_OPTION) $<",
".mod.o",
"$(COMPILE.mod) -o $@ $<",
".c.ln",
"$(LINT.c) -C$* $<",
".y.ln",
"$(YACC.y) $< \n rename y_tab.c $@",
".l.ln",
"@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
#else /* ! MK_OS_VMS */
".o",
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".s",
"$(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".S",
"$(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".c",
"$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".cc",
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".C",
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".cpp",
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".f",
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".m",
"$(LINK.m) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".p",
"$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".F",
"$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".r",
"$(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".mod",
"$(COMPILE.mod) -o $@ -e $@ $^",
".def.sym",
"$(COMPILE.def) -o $@ $<",
".sh",
"cat $< >$@ \n chmod a+x $@",
".s.o",
"$(COMPILE.s) -o $@ $<",
".S.o",
"$(COMPILE.S) -o $@ $<",
".c.o",
"$(COMPILE.c) $(OUTPUT_OPTION) $<",
".cc.o",
"$(COMPILE.cc) $(OUTPUT_OPTION) $<",
".C.o",
"$(COMPILE.C) $(OUTPUT_OPTION) $<",
".cpp.o",
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o",
"$(COMPILE.f) $(OUTPUT_OPTION) $<",
".m.o",
"$(COMPILE.m) $(OUTPUT_OPTION) $<",
".p.o",
"$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o",
"$(COMPILE.F) $(OUTPUT_OPTION) $<",
".r.o",
"$(COMPILE.r) $(OUTPUT_OPTION) $<",
".mod.o",
"$(COMPILE.mod) -o $@ $<",
".c.ln",
"$(LINT.c) -C$* $<",
".y.ln",
#if MK_OS_DOS
"$(YACC.y) $< \n $(LINT.c) -C$* y_tab.c \n $(RM) y_tab.c",
#else
"$(YACC.y) $< \n $(LINT.c) -C$* y.tab.c \n $(RM) y.tab.c",
#endif
".l.ln",
"@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
".y.c",
#if MK_OS_DOS
"$(YACC.y) $< \n mv -f y_tab.c $@",
#else
"$(YACC.y) $< \n mv -f y.tab.c $@",
#endif
".l.c",
"@$(RM) $@ \n $(LEX.l) $< > $@",
".ym.m",
"$(YACC.m) $< \n mv -f y.tab.c $@",
".lm.m",
"@$(RM) $@ \n $(LEX.m) $< > $@",
".F.f",
"$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f",
"$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
/* This might actually make lex.yy.c if there's no %R% directive in $*.l,
but in that case why were you trying to make $*.r anyway? */
".l.r",
"$(LEX.l) $< > $@ \n mv -f lex.yy.r $@",
".S.s",
"$(PREPROCESS.S) $< > $@",
".texinfo.info",
"$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
".texi.info",
"$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
".txinfo.info",
"$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
".tex.dvi",
"$(TEX) $<",
".texinfo.dvi",
"$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
".texi.dvi",
"$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
".txinfo.dvi",
"$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
".w.c",
"$(CTANGLE) $< - $@", /* The '-' says there is no '.ch' file. */
".web.p",
"$(TANGLE) $<",
".w.tex",
"$(CWEAVE) $< - $@", /* The '-' says there is no '.ch' file. */
".web.tex",
"$(WEAVE) $<",
#endif /* !MK_OS_VMS */
0, 0,
};
static const char *const default_variables[] =
{
#if MK_OS_VMS
#ifdef __ALPHA
"ARCH", "ALPHA",
#endif
#ifdef __ia64
"ARCH", "IA64",
#endif
#ifdef __VAX
"ARCH", "VAX",
#endif
"AR", "library",
"LIBRARY", "library",
"ARFLAGS", "/replace",
"AS", "macro",
"MACRO", "macro",
#ifdef GCC_IS_NATIVE
"CC", "gcc",
#else
"CC", "cc",
#endif
"CD", "builtin_cd",
"ECHO", "builtin_echo",
#ifdef GCC_IS_NATIVE
"C++", "gcc/plus",
"CXX", "gcc/plus",
#else
"C++", "cxx",
"CXX", "cxx",
#ifndef __ia64
"CXXLD", "cxxlink",
"CXXLINK", "cxxlink",
#else
/* CXXLINK is not used on VMS/IA64 */
"CXXLD", "link",
"CXXLINK", "link",
#endif
#endif
"CO", "co",
"CPP", "$(CC) /preprocess_only",
"FC", "fortran",
/* System V uses these, so explicit rules using them should work.
However, there is no way to make implicit rules use them and FC. */
"F77", "$(FC)",
"F77FLAGS", "$(FFLAGS)",
"LD", "link",
"LEX", "lex",
"PC", "pascal",
"YACC", "bison/yacc",
"YFLAGS", "/Define/Verbose",
"BISON", "bison",
"MAKEINFO", "makeinfo",
"TEX", "tex",
"TEXINDEX", "texindex",
"RM", "delete/nolog",
"CSTARTUP", "",
#ifdef GCC_IS_NATIVE
"CRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj",
"CXXSTARTUP", "gnu_cc_library:crtbegin.obj",
"CXXRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crtend.obj,gnu_cc_library:gxx_main.obj",
"LXLIBS", ",gnu_cc_library:libstdcxx.olb/lib,gnu_cc_library:libgccplus.olb/lib",
"LDLIBS", ",gnu_cc_library:libgcc.olb/lib",
#else
"CRT0", "",
"CXXSTARTUP", "",
"CXXRT0", "",
"LXLIBS", "",
"LDLIBS", "",
#endif
"LINK.o", "$(LD) $(LDFLAGS)",
"LINK.obj", "$(LD) $(LDFLAGS)",
#ifndef GCC_IS_NATIVE
"CXXLINK.obj", "$(CXXLD) $(LDFLAGS)",
"COMPILE.cxx", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
#endif
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
"COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
"COMPILE.C", "$(COMPILE.cc)",
"COMPILE.cpp", "$(COMPILE.cc)",
"LINK.C", "$(LINK.cc)",
"LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS)",
"YACC.m", "$(YACC) $(YFLAGS)",
"LEX.m", "$(LEX) $(LFLAGS) -t",
"COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
"LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c",
"LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
"COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)",
"COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)",
"COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.mar", "$(MACRO) $(MACROFLAGS)",
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
"PREPROCESS.S", "$(CPP) $(CPPFLAGS)",
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
"MV", "rename/new_version",
"CP", "copy",
".LIBPATTERNS", "%.olb lib%.a",
#else /* !MK_OS_VMS */
"AR", "ar",
#ifdef _AIX
/* AIX requires object file format specification: choose -Xany. */
"ARFLAGS", "-Xany -rv",
#else
"ARFLAGS", "-rv",
#endif
"AS", "as",
#ifdef GCC_IS_NATIVE
"CC", "gcc",
"OBJC", "gcc",
#else
"CC", "cc",
"OBJC", "cc",
#endif
#ifdef MAKE_CXX
"CXX", MAKE_CXX,
#else
# ifdef GCC_IS_NATIVE
# ifdef MK_OS_DOS
"CXX", "gpp", /* g++ is an invalid name on MSDOS */
# else
"CXX", "gcc",
# endif /* __MSDOS__ */
# else
"CXX", "g++",
# endif
#endif
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
and to the empty string if $@ does exist. */
"CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
"CO", "co",
"COFLAGS", "",
"CPP", "$(CC) -E",
#ifdef CRAY
"CF77PPFLAGS", "-P",
"CF77PP", "/lib/cpp",
"CFT", "cft77",
"CF", "cf77",
"FC", "$(CF)",
#else /* Not CRAY. */
#ifdef _IBMR2
"FC", "xlf",
#else
#ifdef __convex__
"FC", "fc",
#else
"FC", "f77",
#endif /* __convex__ */
#endif /* _IBMR2 */
/* System V uses these, so explicit rules using them should work.
However, there is no way to make implicit rules use them and FC. */
"F77", "$(FC)",
"F77FLAGS", "$(FFLAGS)",
#endif /* Cray. */
"GET", SCCS_GET,
"LD", "ld",
#ifdef GCC_IS_NATIVE
"LEX", "flex",
#else
"LEX", "lex",
#endif
"LINT", "lint",
"M2C", "m2c",
#ifdef pyr
"PC", "pascal",
#else
#ifdef CRAY
"PC", "PASCAL",
"SEGLDR", "segldr",
#else
"PC", "pc",
#endif /* CRAY. */
#endif /* pyr. */
#ifdef GCC_IS_NATIVE
"YACC", "bison -y",
#else
"YACC", "yacc", /* Or "bison -y" */
#endif
"MAKEINFO", "makeinfo",
"TEX", "tex",
"TEXI2DVI", "texi2dvi",
"WEAVE", "weave",
"CWEAVE", "cweave",
"TANGLE", "tangle",
"CTANGLE", "ctangle",
"RM", "rm -f",
"LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
#ifndef HAVE_CASE_INSENSITIVE_FS
/* On case-insensitive filesystems, treat *.C files as *.c files,
to avoid erroneously compiling C sources as C++, which will
probably fail. */
"COMPILE.C", "$(COMPILE.cc)",
#else
"COMPILE.C", "$(COMPILE.c)",
#endif
"COMPILE.cpp", "$(COMPILE.cc)",
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
#ifndef HAVE_CASE_INSENSITIVE_FS
"LINK.C", "$(LINK.cc)",
#else
"LINK.C", "$(LINK.c)",
#endif
"LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS) -t",
"YACC.m", "$(YACC) $(YFLAGS)",
"LEX.m", "$(LEX) $(LFLAGS) -t",
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
"LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c",
"LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)",
"COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)",
"COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"LINK.s", "$(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH)",
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
"PREPROCESS.S", "$(CPP) $(CPPFLAGS)",
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
#ifndef NO_MINUS_C_MINUS_O
"OUTPUT_OPTION", "-o $@",
#endif
#ifdef SCCS_GET_MINUS_G
"SCCS_OUTPUT_OPTION", "-G$@",
#endif
#if MK_OS_DOS
".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
#elif defined(__APPLE__)
".LIBPATTERNS", "lib%.dylib lib%.a",
#elif defined(__CYGWIN__) || MK_OS_W32
".LIBPATTERNS", "lib%.dll.a %.dll.a lib%.a %.lib lib%.dll %.dll",
#else
".LIBPATTERNS", "lib%.so lib%.a",
#endif
#endif /* !MK_OS_VMS */
/* Make this assignment to avoid undefined variable warnings. */
GNUMAKEFLAGS_NAME, "",
0, 0
};
/* Set up the default .SUFFIXES list. */
void
set_default_suffixes (void)
{
suffix_file = enter_file (strcache_add (".SUFFIXES"));
suffix_file->builtin = 1;
if (no_builtin_rules_flag)
define_variable_cname ("SUFFIXES", "", o_default, 0);
else
{
struct dep *d;
const char *p = default_suffixes;
suffix_file->deps = enter_prereqs (PARSE_SIMPLE_SEQ ((char **)&p, struct dep),
NULL);
for (d = suffix_file->deps; d; d = d->next)
d->file->builtin = 1;
define_variable_cname ("SUFFIXES", default_suffixes, o_default, 0);
}
}
/* Enter the default suffix rules as file rules. This used to be done in
install_default_implicit_rules, but that loses because we want the
suffix rules installed before reading makefiles, and the pattern rules
installed after. */
void
install_default_suffix_rules ()
{
const char *const *s;
if (no_builtin_rules_flag)
return;
for (s = default_suffix_rules; *s != 0; s += 2)
{
struct file *f = enter_file (strcache_add (s[0]));
/* Install the default rule only if there is no user defined rule. */
if (!f->cmds)
{
f->cmds = xmalloc (sizeof (struct commands));
f->cmds->fileinfo.filenm = NULL;
f->cmds->commands = xstrdup (s[1]);
f->cmds->command_lines = NULL;
f->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
f->builtin = 1;
}
}
}
/* Install the default pattern rules. */
void
install_default_implicit_rules (void)
{
const struct pspec *p;
if (no_builtin_rules_flag)
return;
for (p = default_pattern_rules; p->target != 0; ++p)
install_pattern_rule (p, 0);
for (p = default_terminal_rules; p->target != 0; ++p)
install_pattern_rule (p, 1);
}
void
define_default_variables (void)
{
const char *const *s;
if (no_builtin_variables_flag)
return;
for (s = default_variables; *s != 0; s += 2)
define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
}
void
undefine_default_variables (void)
{
const char *const *s;
for (s = default_variables; *s != 0; s += 2)
undefine_variable_global (NILF, s[0], strlen (s[0]), o_default);
}

139
src/dep.h Normal file
View File

@ -0,0 +1,139 @@
/* Definitions of dependency data structures for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
/* Structure used in chains of names, for parsing and globbing. */
#define NAMESEQ(_t) \
_t *next; \
const char *name
struct nameseq
{
NAMESEQ (struct nameseq);
};
/* Flag bits for the second argument to 'read_makefile'.
These flags are saved in the 'flags' field of each
'struct goaldep' in the chain returned by 'read_all_makefiles'. */
#define RM_NOFLAG 0
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
/* Structure representing one dependency of a file.
Each struct file's 'deps' points to a chain of these, through 'next'.
'stem' is the stem for this dep line of static pattern rule or NULL.
explicit is set when implicit rule search is performed and the prerequisite
does not contain %. When explicit is set the file is not intermediate. */
#define DEP(_t) \
NAMESEQ (_t); \
struct file *file; \
_t *shuf; \
const char *stem; \
unsigned int flags : 8; \
unsigned int changed : 1; \
unsigned int ignore_mtime : 1; \
unsigned int staticpattern : 1; \
unsigned int need_2nd_expansion : 1; \
unsigned int ignore_automatic_vars : 1; \
unsigned int is_explicit : 1; \
unsigned int wait_here : 1
struct dep
{
DEP (struct dep);
};
/* Structure representing one goal.
The goals to be built constitute a chain of these, chained through 'next'.
'stem' is not used, but it's simpler to include and ignore it. */
struct goaldep
{
DEP (struct goaldep);
int error;
floc floc;
};
/* Options for parsing lists of filenames. */
#define PARSEFS_NONE 0x0000
#define PARSEFS_NOSTRIP 0x0001
#define PARSEFS_NOAR 0x0002
#define PARSEFS_NOGLOB 0x0004
#define PARSEFS_EXISTS 0x0008
#define PARSEFS_NOCACHE 0x0010
#define PARSEFS_ONEWORD 0x0020
#define PARSEFS_WAIT 0x0040
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
#define PARSE_SIMPLE_SEQ(_s,_t) \
(_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE)
#if MK_OS_VMS
void *parse_file_seq ();
#else
void *parse_file_seq (char **stringp, size_t size,
int stopmap, const char *prefix, int flags);
#endif
char *tilde_expand (const char *name);
#ifndef NO_ARCHIVES
struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t size);
#endif
#define dep_name(d) ((d)->name ? (d)->name : (d)->file->name)
#define alloc_seq_elt(_t) xcalloc (sizeof (_t))
void free_ns_chain (struct nameseq *n);
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
/* Use inline to get real type-checking. */
#define SI static inline
SI struct nameseq *alloc_ns (void) { return alloc_seq_elt (struct nameseq); }
SI struct dep *alloc_dep (void) { return alloc_seq_elt (struct dep); }
SI struct goaldep *alloc_goaldep (void) { return alloc_seq_elt (struct goaldep); }
SI void free_ns (struct nameseq *n) { free (n); }
SI void free_dep (struct dep *d) { free_ns ((struct nameseq *)d); }
SI void free_goaldep (struct goaldep *g) { free_dep ((struct dep *)g); }
SI void free_dep_chain (struct dep *d) { free_ns_chain((struct nameseq *)d); }
SI void free_goal_chain (struct goaldep *g) { free_dep_chain((struct dep *)g); }
#else
# define alloc_ns() alloc_seq_elt (struct nameseq)
# define alloc_dep() alloc_seq_elt (struct dep)
# define alloc_goaldep() alloc_seq_elt (struct goaldep)
# define free_ns(_n) free (_n)
# define free_dep(_d) free_ns (_d)
# define free_goaldep(_g) free_dep (_g)
# define free_dep_chain(_d) free_ns_chain ((struct nameseq *)(_d))
# define free_goal_chain(_g) free_ns_chain ((struct nameseq *)(_g))
#endif
struct dep *copy_dep (const struct dep *d);
struct dep *copy_dep_chain (const struct dep *d);
struct goaldep *read_all_makefiles (const char **makefiles);
void eval_buffer (char *buffer, const floc *floc);
enum update_status update_goal_chain (struct goaldep *goals);

1361
src/dir.c Normal file

File diff suppressed because it is too large Load Diff

710
src/expand.c Normal file
View File

@ -0,0 +1,710 @@
/* Variable expansion functions for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include <assert.h>
#include "commands.h"
#include "debug.h"
#include "filedef.h"
#include "job.h"
#include "variable.h"
#include "rule.h"
#include "warning.h"
/* Initially, any errors reported when expanding strings will be reported
against the file where the error appears. */
const floc **expanding_var = &reading_file;
/* The next two describe the variable output buffer.
This buffer is used to hold the variable-expansion of a line of the
makefile. It is made bigger with realloc whenever it is too small.
variable_buffer_length is the size currently allocated.
variable_buffer is the address of the buffer.
For efficiency, it's guaranteed that the buffer will always have
VARIABLE_BUFFER_ZONE extra bytes allocated. This allows you to add a few
extra chars without having to call a function. Note you should never use
these bytes unless you're _sure_ you have room (you know when the buffer
length was last checked. */
#define VARIABLE_BUFFER_ZONE 5
static size_t variable_buffer_length;
char *variable_buffer;
/* Append LENGTH chars of STRING at PTR which must point into variable_buffer.
The buffer will always be kept nul-terminated.
The updated pointer into the buffer is returned as the value. Thus, the
value returned by each call to variable_buffer_output should be the first
argument to the following call. */
char *
variable_buffer_output (char *ptr, const char *string, size_t length)
{
size_t newlen = length + (ptr - variable_buffer);
assert (ptr >= variable_buffer);
assert (ptr < variable_buffer + variable_buffer_length);
if (newlen + VARIABLE_BUFFER_ZONE + 1 > variable_buffer_length)
{
size_t offset = ptr - variable_buffer;
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
? newlen + 100
: 2 * variable_buffer_length);
variable_buffer = xrealloc (variable_buffer, variable_buffer_length + 1);
ptr = variable_buffer + offset;
}
ptr = mempcpy (ptr, string, length);
*ptr = '\0';
return ptr;
}
/* Return a pointer to the beginning of the variable buffer.
This is called from main() and it should never be null afterward. */
char *
initialize_variable_output ()
{
/* If we don't have a variable output buffer yet, get one. */
if (!variable_buffer)
{
variable_buffer_length = 200;
variable_buffer = xmalloc (variable_buffer_length);
}
variable_buffer[0] = '\0';
return variable_buffer;
}
/* Install a new variable_buffer context, returning the current one for
safe-keeping. */
void
install_variable_buffer (char **bufp, size_t *lenp)
{
*bufp = variable_buffer;
*lenp = variable_buffer_length;
variable_buffer = NULL;
initialize_variable_output ();
}
/* Free the current variable_buffer and restore a previously-saved one.
*/
void
restore_variable_buffer (char *buf, size_t len)
{
free (variable_buffer);
variable_buffer = buf;
variable_buffer_length = len;
}
/* Restore a previously-saved variable_buffer context, and return the
current one.
*/
char *
swap_variable_buffer (char *buf, size_t len)
{
char *p = variable_buffer;
variable_buffer = buf;
variable_buffer_length = len;
return p;
}
/* Recursively expand V. The returned string is malloc'd. */
static char *allocated_variable_append (const struct variable *v);
char *
recursively_expand_for_file (struct variable *v, struct file *file)
{
char *value;
const floc *this_var;
const floc **saved_varp;
struct variable_set_list *savev = 0;
int set_reading = 0;
size_t nl = strlen (v->name);
struct variable *parent = NULL;
/* If we're expanding to put into the environment of a shell function then
ignore any recursion issues: for backward-compatibility we will use
the value of the environment variable we were started with. */
if (v->expanding && env_recursion)
{
char **ep;
DB (DB_VERBOSE,
(_("%s:%lu: not recursively expanding %s to export to shell function\n"),
v->fileinfo.filenm, v->fileinfo.lineno, v->name));
/* We could create a hash for the original environment for speed, but a
reasonably written makefile shouldn't hit this situation... */
for (ep = environ; *ep != 0; ++ep)
if (strncmp (*ep, v->name, nl) == 0 && (*ep)[nl] == '=')
return xstrdup ((*ep) + nl + 1);
/* If there's nothing in the parent environment, use the empty string.
This isn't quite correct since the variable should not exist at all,
but getting that to work would be involved. */
return xstrdup ("");
}
/* Don't install a new location if this location is empty.
This can happen for command-line variables, builtin variables, etc. */
saved_varp = expanding_var;
if (v->fileinfo.filenm)
{
this_var = &v->fileinfo;
expanding_var = &this_var;
}
/* If we have no other file-reading context, use the variable's context. */
if (!reading_file)
{
set_reading = 1;
reading_file = &v->fileinfo;
}
if (v->expanding)
{
if (!v->exp_count)
/* Expanding V causes infinite recursion. Lose. */
OS (fatal, *expanding_var,
_("recursive variable '%s' references itself (eventually)"),
v->name);
--v->exp_count;
}
if (file)
install_file_context (file, &savev, NULL);
v->expanding = 1;
if (v->append)
{
/* Find a parent definition which is marked override. */
struct variable_set_list *sl;
for (sl = current_variable_set_list; sl && !parent; sl = sl->next)
{
struct variable *vp = lookup_variable_in_set (v->name, nl, sl->set);
if (vp && vp != v && vp->origin == o_override)
parent = vp;
}
}
if (parent)
/* PARENT is an override, V is appending. If V is also an override:
override hello := first
al%: override hello += second
Then construct the value from its appended parts in the parent sets.
Else if V is not an override:
override hello := first
al%: hello += second
Then ignore the value of V and use the value of PARENT. */
value = v->origin == o_override
? allocated_variable_append (v)
: xstrdup (parent->value);
else if (v->origin == o_command || v->origin == o_env_override)
/* Avoid appending to a pattern-specific variable, unless the origin of this
pattern-specific variable beats or equals the origin of one of the parent
definitions of this variable.
This is needed, because if there is a command line definition or an env
override, then the value defined in the makefile should only be appended
in the case of a file override.
In the presence of command line definition or env override and absence of
makefile override, the value should be expanded, rather than appended. In
this case, at parse time record_target_var already set the value of this
pattern-specific variable to the value defined on the command line or to
the env override value.
User provided a command line definition or an env override.
PARENT does not have an override directive, so ignore it. */
value = allocated_expand_string (v->value);
else if (v->append)
/* Construct the value from its appended parts in the parent sets. */
value = allocated_variable_append (v);
else
/* A definition without appending. */
value = allocated_expand_string (v->value);
v->expanding = 0;
if (set_reading)
reading_file = 0;
if (file)
restore_file_context (savev, NULL);
expanding_var = saved_varp;
return value;
}
/* Expand a simple reference to variable NAME, which is LENGTH chars long.
The result is written to PTR which must point into the variable_buffer.
Returns a pointer to the new end of the variable_buffer. */
char *
expand_variable_output (char *ptr, const char *name, size_t length)
{
struct variable *v;
unsigned int recursive;
char *value;
v = lookup_variable (name, length);
if (!v)
warn_undefined (name, length);
/* If there's no variable by that name or it has no value, stop now. */
if (!v || (v->value[0] == '\0' && !v->append))
return ptr;
/* Remember this since expansion could change it. */
recursive = v->recursive;
value = recursive ? recursively_expand (v) : v->value;
ptr = variable_buffer_output (ptr, value, strlen (value));
if (recursive)
free (value);
return ptr;
}
/* Expand a simple reference to variable NAME, which is LENGTH chars long.
The result is written to BUF which must point into the variable_buffer.
If BUF is NULL, start at the beginning of the current variable_buffer.
Returns a pointer to the START of the expanded value of the variable.
The returned value is located inside variable_buffer.
The returned value is valid until the next call to one of the functions
which use variable_buffer. expand_variable_buf may reallocate
variable_buffer and render the passed-in BUF invalid. */
char *
expand_variable_buf (char *buf, const char *name, size_t length)
{
size_t offs;
if (!buf)
buf = initialize_variable_output ();
assert (buf >= variable_buffer);
assert (buf < variable_buffer + variable_buffer_length);
offs = buf - variable_buffer;
expand_variable_output (buf, name, length);
return variable_buffer + offs;
}
/* Expand a simple reference to variable NAME, which is LENGTH chars long.
Returns an allocated buffer containing the value. */
char *
allocated_expand_variable (const char *name, size_t length)
{
char *obuf;
size_t olen;
install_variable_buffer (&obuf, &olen);
expand_variable_output (variable_buffer, name, length);
return swap_variable_buffer (obuf, olen);
}
/* Expand a simple reference to variable NAME, which is LENGTH chars long.
Error messages refer to the file and line where FILE's commands were found.
Expansion uses FILE's variable set list.
Returns an allocated buffer containing the value. */
char *
allocated_expand_variable_for_file (const char *name, size_t length, struct file *file)
{
char *result;
struct variable_set_list *savev;
const floc *savef;
if (!file)
return allocated_expand_variable (name, length);
install_file_context (file, &savev, &savef);
result = allocated_expand_variable (name, length);
restore_file_context (savev, savef);
return result;
}
/* Scan STRING for variable references and expansion-function calls. Only
LENGTH bytes of STRING are actually scanned.
If LENGTH is SIZE_MAX, scan until a null byte is found.
Write the results to BUF, which must point into variable_buffer. If
BUF is NULL, start at the beginning of the current variable_buffer.
Return a pointer to BUF, or to the beginning of the new buffer if BUF is
NULL.
*/
char *
expand_string_buf (char *buf, const char *string, size_t length)
{
struct variable *v;
const char *p, *p1;
char *save;
char *o;
size_t line_offset;
if (!buf)
buf = initialize_variable_output ();
o = buf;
line_offset = buf - variable_buffer;
if (length == 0)
return variable_buffer;
/* We need a copy of STRING: due to eval, it's possible that it will get
freed as we process it (it might be the value of a variable that's reset
for example). Also having a nil-terminated string is handy. */
save = length == SIZE_MAX ? xstrdup (string) : xstrndup (string, length);
p = save;
while (1)
{
/* Copy all following uninteresting chars all at once to the
variable output buffer, and skip them. Uninteresting chars end
at the next $ or the end of the input. */
p1 = strchr (p, '$');
o = variable_buffer_output (o, p, p1 != 0 ? (size_t) (p1 - p) : strlen (p) + 1);
if (p1 == 0)
break;
p = p1 + 1;
/* Dispatch on the char that follows the $. */
switch (*p)
{
case '$':
case '\0':
/* $$ or $ at the end of the string means output one $ to the
variable output buffer. */
o = variable_buffer_output (o, p1, 1);
break;
case '(':
case '{':
/* $(...) or ${...} is the general case of substitution. */
{
char openparen = *p;
char closeparen = (openparen == '(') ? ')' : '}';
const char *beg = p + 1;
char *abeg = NULL;
const char *end, *colon;
if (handle_function (&o, &p))
break;
/* Is there a variable reference inside the parens or braces?
If so, expand it before expanding the entire reference. */
end = strchr (beg, closeparen);
if (end == NULL)
/* Unterminated variable reference. */
O (fatal, *expanding_var, _("unterminated variable reference"));
p1 = lindex (beg, end, '$');
if (p1 != NULL)
{
/* BEG now points past the opening paren or brace.
Count parens or braces until it is matched. */
int count = 1;
for (p = beg; *p != '\0'; ++p)
{
if (*p == openparen)
++count;
else if (*p == closeparen && --count == 0)
break;
}
/* If COUNT is > 0, there were unmatched opening parens
or braces, so we go to the simple case of a variable name
such as '$($(a)'. */
if (count == 0)
{
/* Expand the name. */
abeg = expand_argument (beg, p);
beg = abeg;
end = strchr (beg, '\0');
}
}
else
/* Advance P to the end of this reference. After we are
finished expanding this one, P will be incremented to
continue the scan. */
p = end;
/* This is not a reference to a built-in function and
any variable references inside are now expanded.
Is the resultant text a substitution reference? */
colon = lindex (beg, end, ':');
if (colon)
{
/* This looks like a substitution reference: $(FOO:A=B). */
const char *subst_beg = colon + 1;
const char *subst_end = lindex (subst_beg, end, '=');
if (subst_end == 0)
/* There is no = in sight. Punt on the substitution
reference and treat this as a variable name containing
a colon, in the code below. */
colon = 0;
else
{
const char *replace_beg = subst_end + 1;
const char *replace_end = end;
/* Extract the variable name before the colon
and look up that variable. */
v = lookup_variable (beg, colon - beg);
if (v == 0)
warn_undefined (beg, colon - beg);
/* If the variable is not empty, perform the
substitution. */
if (v != 0 && *v->value != '\0')
{
char *pattern, *replace, *ppercent, *rpercent;
char *value = (v->recursive
? recursively_expand (v)
: v->value);
/* Copy the pattern and the replacement. Add in an
extra % at the beginning to use in case there
isn't one in the pattern. */
pattern = alloca (subst_end - subst_beg + 2);
*(pattern++) = '%';
memcpy (pattern, subst_beg, subst_end - subst_beg);
pattern[subst_end - subst_beg] = '\0';
replace = alloca (replace_end - replace_beg + 2);
*(replace++) = '%';
memcpy (replace, replace_beg,
replace_end - replace_beg);
replace[replace_end - replace_beg] = '\0';
/* Look for %. Set the percent pointers properly
based on whether we find one or not. */
ppercent = find_percent (pattern);
if (ppercent)
{
++ppercent;
rpercent = find_percent (replace);
if (rpercent)
++rpercent;
}
else
{
ppercent = pattern;
rpercent = replace;
--pattern;
--replace;
}
o = patsubst_expand_pat (o, value, pattern, replace,
ppercent, rpercent);
if (v->recursive)
free (value);
}
}
}
if (colon == 0)
/* This is an ordinary variable reference.
Look up the value of the variable. */
o = expand_variable_output (o, beg, end - beg);
free (abeg);
}
break;
default:
if (ISSPACE (p[-1]))
break;
/* A $ followed by a random char is a variable reference:
$a is equivalent to $(a). */
o = expand_variable_output (o, p, 1);
break;
}
if (*p == '\0')
break;
++p;
}
free (save);
return (variable_buffer + line_offset);
}
/* Expand an argument for an expansion function.
The text starting at STR and ending at END is variable-expanded
into a null-terminated string that is returned as the value.
This is done without clobbering 'variable_buffer' or the current
variable-expansion that is in progress. */
char *
expand_argument (const char *str, const char *end)
{
char *tmp, *alloc = NULL;
char *r;
if (str == end)
return xstrdup ("");
if (!end || *end == '\0')
return allocated_expand_string (str);
if (end - str + 1 > 1000)
tmp = alloc = xmalloc (end - str + 1);
else
tmp = alloca (end - str + 1);
memcpy (tmp, str, end - str);
tmp[end - str] = '\0';
r = allocated_expand_string (tmp);
free (alloc);
return r;
}
/* Expand STRING for FILE, into the current variable_buffer.
Error messages refer to the file and line where FILE's commands were found.
Expansion uses FILE's variable set list. */
char *
expand_string_for_file (const char *string, struct file *file)
{
char *result;
struct variable_set_list *savev;
const floc *savef;
if (!file)
return expand_string (string);
install_file_context (file, &savev, &savef);
result = expand_string (string);
restore_file_context (savev, savef);
return result;
}
/* Like expand_string_for_file, but the returned string is malloc'd. */
char *
allocated_expand_string_for_file (const char *string, struct file *file)
{
char *obuf;
size_t olen;
install_variable_buffer (&obuf, &olen);
expand_string_for_file (string, file);
return swap_variable_buffer (obuf, olen);
}
/* Like allocated_expand_string, but for += target-specific variables.
First recursively construct the variable value from its appended parts in
any upper variable sets. Then expand the resulting value. */
static char *
variable_append (const char *name, size_t length,
const struct variable_set_list *set, int local)
{
const struct variable *v;
char *buf = 0;
int nextlocal;
/* If there's nothing left to check, return the empty buffer. */
if (!set)
return initialize_variable_output ();
/* If this set is local and the next is not a parent, then next is local. */
nextlocal = local && set->next_is_parent == 0;
/* Try to find the variable in this variable set. */
v = lookup_variable_in_set (name, length, set->set);
/* If there isn't one, or this one is private, try the set above us. */
if (!v || (!local && v->private_var))
return variable_append (name, length, set->next, nextlocal);
/* If this variable type is append, first get any upper values.
If not, initialize the buffer. */
if (v->append)
buf = variable_append (name, length, set->next, nextlocal);
else
buf = initialize_variable_output ();
/* Append this value to the buffer, and return it.
If we already have a value, first add a space. */
if (buf > variable_buffer)
buf = variable_buffer_output (buf, " ", 1);
/* Either expand it or copy it, depending. */
if (! v->recursive)
return variable_buffer_output (buf, v->value, strlen (v->value));
buf = expand_string_buf (buf, v->value, strlen (v->value));
return (buf + strlen (buf));
}
static char *
allocated_variable_append (const struct variable *v)
{
/* Construct the appended variable value. */
char *obuf;
size_t olen;
install_variable_buffer (&obuf, &olen);
variable_append (v->name, strlen (v->name), current_variable_set_list, 1);
return swap_variable_buffer (obuf, olen);
}

1327
src/file.c Normal file

File diff suppressed because it is too large Load Diff

230
src/filedef.h Normal file
View File

@ -0,0 +1,230 @@
/* Definition of target file data structures for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
/* Structure that represents the info on one file
that the makefile says how to make.
All of these are chained together through 'next'. */
#include "hash.h"
struct commands;
struct dep;
struct variable;
struct variable_set_list;
struct file
{
const char *name;
const char *hname; /* Hashed filename */
const char *vpath; /* VPATH/vpath pathname */
struct dep *deps; /* all dependencies, including duplicates */
struct commands *cmds; /* Commands to execute for this target. */
const char *stem; /* Implicit stem, if an implicit
rule has been used */
struct dep *also_make; /* Targets that are made by making this. */
struct file *prev; /* Previous entry for same file name;
used when there are multiple double-colon
entries for the same file. */
struct file *last; /* Last entry for the same file name. */
/* File that this file was renamed to. After any time that a
file could be renamed, call 'check_renamed' (below). */
struct file *renamed;
/* List of variable sets used for this file. */
struct variable_set_list *variables;
/* Pattern-specific variable reference for this target, or null if there
isn't one. Also see the pat_searched flag, below. */
struct variable_set_list *pat_variables;
/* Immediate dependent that caused this target to be remade,
or nil if there isn't one. */
struct file *parent;
/* For a double-colon entry, this is the first double-colon entry for
the same file. Otherwise this is null. */
struct file *double_colon;
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
unsigned int considered; /* equal to 'considered' if file has been
considered on current scan of goal chain */
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
enum update_status /* Status of the last attempt to update. */
{
us_success = 0, /* Successfully updated. Must be 0! */
us_none, /* No attempt to update has been made. */
us_question, /* Needs to be updated (-q is is set). */
us_failed /* Update failed. */
} update_status ENUM_BITFIELD (2);
enum cmd_state /* State of commands. ORDER IS IMPORTANT! */
{
cs_not_started = 0, /* Not yet started. Must be 0! */
cs_deps_running, /* Dep commands running. */
cs_running, /* Commands running. */
cs_finished /* Commands finished. */
} command_state ENUM_BITFIELD (2);
unsigned int builtin:1; /* True if the file is a builtin rule. */
unsigned int precious:1; /* Non-0 means don't delete file on quit */
unsigned int loaded:1; /* True if the file is a loaded object. */
unsigned int unloaded:1; /* True if this loaded object was unloaded. */
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
has only one-second resolution. */
unsigned int tried_implicit:1; /* Nonzero if have searched
for implicit rule for making
this file; don't search again. */
unsigned int updating:1; /* Nonzero while updating deps of this file */
unsigned int updated:1; /* Nonzero if this file has been remade. */
unsigned int is_target:1; /* Nonzero if file is described as target. */
unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */
unsigned int phony:1; /* Nonzero if this is a phony file
i.e., a prerequisite of .PHONY. */
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
unsigned int is_explicit:1; /* Nonzero if explicitly mentioned. */
unsigned int secondary:1; /* Nonzero means remove_intermediates should
not delete it. */
unsigned int notintermediate:1; /* Nonzero means a file is a prereq to
.NOTINTERMEDIATE. */
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
this target cannot be remade. */
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
unsigned int pat_searched:1;/* Nonzero if we already searched for
pattern-specific variables. */
unsigned int no_diag:1; /* True if the file failed to update and no
diagnostics has been issued (dontcare). */
unsigned int was_shuffled:1; /* Did we already shuffle 'deps'? used when
--shuffle passes through the graph. */
unsigned int snapped:1; /* True if the deps of this file have been
secondary expanded. */
unsigned int suffix:1; /* True if this is a suffix rule. */
};
extern struct file *default_file;
struct file *lookup_file (const char *name);
struct file *enter_file (const char *name);
struct dep *split_prereqs (char *prereqstr);
struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
void expand_deps (struct file *f);
struct dep *expand_extra_prereqs (const struct variable *extra);
void remove_intermediates (int sig);
void snap_deps (void);
void rename_file (struct file *file, const char *name);
void rehash_file (struct file *file, const char *name);
void set_command_state (struct file *file, enum cmd_state state);
void notice_finished_file (struct file *file);
void init_hash_files (void);
void verify_file_data_base (void);
char *build_target_list (char *old_list);
void print_file_data_base (void);
void print_targets (void);
int try_implicit_rule (struct file *file, unsigned int depth);
int stemlen_compare (const void *v1, const void *v2);
#if FILE_TIMESTAMP_HI_RES
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, (st).ST_MTIM_NSEC)
#else
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, 0)
#endif
/* If FILE_TIMESTAMP is 64 bits (or more), use nanosecond resolution.
(Multiply by 2**30 instead of by 10**9 to save time at the cost of
slightly decreasing the number of available timestamps.) With
64-bit FILE_TIMESTAMP, this stops working on 2514-05-30 01:53:04
UTC, but by then uintmax_t should be larger than 64 bits. */
#define FILE_TIMESTAMPS_PER_S (FILE_TIMESTAMP_HI_RES ? 1000000000 : 1)
#define FILE_TIMESTAMP_LO_BITS (FILE_TIMESTAMP_HI_RES ? 30 : 0)
#define FILE_TIMESTAMP_S(ts) (((ts) - ORDINARY_MTIME_MIN) \
>> FILE_TIMESTAMP_LO_BITS)
#define FILE_TIMESTAMP_NS(ts) ((int) (((ts) - ORDINARY_MTIME_MIN) \
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
representing a file timestamp. The upper bound is not necessarily 29,
since the year might be less than -999 or greater than 9999.
Subtract one for the sign bit if in case file timestamps can be negative;
subtract FLOOR_LOG2_SECONDS_PER_YEAR to yield an upper bound on how many
file timestamp bits might affect the year;
302 / 1000 is log10 (2) rounded up;
add one for integer division truncation;
add one more for a minus sign if file timestamps can be negative;
add 4 to allow for any 4-digit epoch year (e.g. 1970);
add 25 to allow for "-MM-DD HH:MM:SS.NNNNNNNNN". */
#define FLOOR_LOG2_SECONDS_PER_YEAR 24
#define FILE_TIMESTAMP_PRINT_LEN_BOUND \
(((sizeof (FILE_TIMESTAMP) * CHAR_BIT - 1 - FLOOR_LOG2_SECONDS_PER_YEAR) \
* 302 / 1000) \
+ 1 + 1 + 4 + 25)
FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, long int);
FILE_TIMESTAMP file_timestamp_now (int *);
void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts);
/* Return the mtime of file F (a struct file *), caching it.
The value is NONEXISTENT_MTIME if the file does not exist. */
#define file_mtime(f) file_mtime_1 ((f), 1)
/* Return the mtime of file F (a struct file *), caching it.
Don't search using vpath for the file--if it doesn't actually exist,
we don't find it.
The value is NONEXISTENT_MTIME if the file does not exist. */
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
FILE_TIMESTAMP f_mtime (struct file *file, int search);
#define file_mtime_1(f, v) \
((f)->last_mtime == UNKNOWN_MTIME ? f_mtime ((f), v) : (f)->last_mtime)
/* Special timestamp values. */
/* The file's timestamp is not yet known. */
#define UNKNOWN_MTIME 0
/* The file does not exist. */
#define NONEXISTENT_MTIME 1
/* The file does not exist, and we assume that it is older than any
actual file. */
#define OLD_MTIME 2
/* The smallest and largest ordinary timestamps. */
#define ORDINARY_MTIME_MIN (OLD_MTIME + 1)
#define ORDINARY_MTIME_MAX ((FILE_TIMESTAMP_S (NEW_MTIME) \
<< FILE_TIMESTAMP_LO_BITS) \
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
#define is_ordinary_mtime(_t) ((_t) >= ORDINARY_MTIME_MIN && (_t) <= ORDINARY_MTIME_MAX)
/* Modtime value to use for 'infinitely new'. We used to get the current time
from the system and use that whenever we wanted 'new'. But that causes
trouble when the machine running make and the machine holding a file have
different ideas about what time it is; and can also lose for 'force'
targets, which need to be considered newer than anything that depends on
them, even if said dependents' modtimes are in the future. */
#define NEW_MTIME INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP)
#define check_renamed(file) \
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
/* Have we snapped deps yet? */
extern int snapped_deps;

2742
src/function.c Normal file

File diff suppressed because it is too large Load Diff

1031
src/getopt.c Normal file

File diff suppressed because it is too large Load Diff

130
src/getopt.h Normal file
View File

@ -0,0 +1,130 @@
/* Declarations for getopt.
Copyright (C) 1989-2024 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#if defined (__STDC__) && __STDC__
#ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
#else /* not __STDC__ */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* getopt.h */

176
src/getopt1.c Normal file
View File

@ -0,0 +1,176 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987-1994, 1996-2024 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "getopt.h"
#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
#include <stdio.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long (int argc, char *const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only (int argc, char *const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
}
#endif /* Not ELIDE_CODE. */
#ifdef TEST
#include <stdio.h>
int
main (int argc, char **argv)
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
{"delete", 1, 0, 0},
{"verbose", 0, 0, 0},
{"create", 0, 0, 0},
{"file", 1, 0, 0},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == -1)
break;
switch (c)
{
case 0:
printf ("option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value '%s'\n", optarg);
break;
case 'd':
printf ("option d with value '%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

57
src/gettext.h Normal file
View File

@ -0,0 +1,57 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _LIBGETTEXT_H
#define _LIBGETTEXT_H 1
/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
#else
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
# define gettext(Msgid) ((const char *) (Msgid))
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define textdomain(Domainname) ((const char *) (Domainname))
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
#endif
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
The argument, String, should be a literal string. Concatenated strings
and other string expressions won't work.
The macro's expansion is not parenthesized, so that it is suitable as
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
#endif /* _LIBGETTEXT_H */

53
src/gmk-default.scm Normal file
View File

@ -0,0 +1,53 @@
;; Contents of the (GNU Make) Guile module
;; Copyright (C) 2011-2024 Free Software Foundation, Inc.
;; This file is part of GNU Make.
;;
;; GNU Make is free software; you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free
;; Software Foundation; either version 3 of the License, or (at your option)
;; any later version.
;;
;; GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.
;;
;; You should have received a copy of the GNU General Public License along
;; with this program. If not, see <https://www.gnu.org/licenses/>.
(define (to-string-maybe x)
(cond
;; In GNU Make, "false" is the empty string
((or (not x)
(unspecified? x)
(variable? x)
(null? x)
(and (string? x) (string-null? x)))
#f)
;; We want something not false... not sure about this
((eq? x #t) "#t")
;; Basics
((or (symbol? x) (number? x))
(object->string x))
((char? x)
(string x))
;; Printable string (no special characters)
((and (string? x) (string-every char-set:printing x))
x)
;; No idea: fail
(else (error "Unknown object:" x))))
(define (obj-to-str x)
(let ((acc '()))
(define (walk x)
(cond ((pair? x) (walk (car x)) (walk (cdr x)))
((to-string-maybe x) => (lambda (s) (set! acc (cons s acc))))))
(walk x)
(string-join (reverse! acc))))
;; Return the value of the GNU Make variable V
(define (gmk-var v)
(gmk-expand (format #f "$(~a)" (obj-to-str v))))
;; Export the public interfaces
(export gmk-expand gmk-eval gmk-var)

97
src/gnumake.h Normal file
View File

@ -0,0 +1,97 @@
/* External interfaces usable by dynamic objects loaded into GNU Make.
Copyright (C) 2013-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GNUMAKE_H_
#define _GNUMAKE_H_
#define GMK_ABI_VERSION 1
/* Specify the location of elements read from makefiles. */
typedef struct
{
const char *filenm;
unsigned long lineno;
} gmk_floc;
typedef char *(*gmk_func_ptr)(const char *nm, unsigned int argc, char **argv);
/* When an object is loaded by GNU Make, a setup method will be invoked.
The name of the method is either derived from the filename of the object,
or specified explicitly in the makefile. It has the signature:
int <setup_fn> (unsigned int abi_version, const gmk_floc *flocp);
The abi_version will be set to GMK_ABI_VERSION.
When an object is unloaded by GNU Make, an unload method will be invoked.
The name of the method is derived from the filename of the object, with
_gmk_unload appended. It has the signature:
void <object>_gmk_unload (void);
There will only be one unload method invoked regardless of the number of
setup methods within the object. */
#ifdef _WIN32
# ifdef GMK_BUILDING_MAKE
# define GMK_EXPORT __declspec(dllexport)
# else
# define GMK_EXPORT __declspec(dllimport)
# endif
#else
# define GMK_EXPORT
#endif
/* Free memory returned by the gmk_expand() and gmk_free() functions. */
GMK_EXPORT void gmk_free (char *str);
/* Allocate memory in GNU Make's context. */
GMK_EXPORT char *gmk_alloc (unsigned int len);
/* Run $(eval ...) on the provided string BUFFER. */
GMK_EXPORT void gmk_eval (const char *buffer, const gmk_floc *floc);
/* Run GNU Make expansion on the provided string STR.
Returns an allocated buffer that the caller must free with gmk_free(). */
GMK_EXPORT char *gmk_expand (const char *str);
/* Register a new GNU Make function NAME (maximum of 255 chars long).
When the function is expanded in the makefile, FUNC will be invoked with
the appropriate arguments.
The return value of FUNC must be either NULL, in which case it expands to
the empty string, or a pointer to the result of the expansion in a string
created by gmk_alloc(). GNU Make will free the memory when it's done.
MIN_ARGS is the minimum number of arguments the function requires.
MAX_ARGS is the maximum number of arguments (or 0 if there's no maximum).
MIN_ARGS and MAX_ARGS may not exceed 255.
The FLAGS value may be GMK_FUNC_DEFAULT, or one or more of the following
flags OR'd together:
GMK_FUNC_NOEXPAND: the arguments to the function will be not be expanded
before FUNC is called.
*/
GMK_EXPORT void gmk_add_function (const char *name, gmk_func_ptr func,
unsigned int min_args, unsigned int max_args,
unsigned int flags);
#define GMK_FUNC_DEFAULT 0x00
#define GMK_FUNC_NOEXPAND 0x01
#endif /* _GNUMAKE_H_ */

159
src/guile.c Normal file
View File

@ -0,0 +1,159 @@
/* GNU Guile interface for GNU Make.
Copyright (C) 2011-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#ifdef HAVE_GUILE
#include "gnumake.h"
#include "debug.h"
#include "filedef.h"
#include "dep.h"
#include "variable.h"
#include <libguile.h>
/* Pre-2.0 versions of Guile don't have a typedef for gsubr function types. */
#if SCM_MAJOR_VERSION < 2
# define GSUBR_TYPE SCM (*) ()
/* Guile 1.x doesn't really support i18n. */
# define EVAL_STRING(_s) scm_c_eval_string (_s)
#else
# define GSUBR_TYPE scm_t_subr
# define EVAL_STRING(_s) scm_eval_string (scm_from_utf8_string (_s))
#endif
static SCM make_mod = SCM_EOL;
static SCM obj_to_str = SCM_EOL;
/* Convert an SCM object into a string. */
static char *
cvt_scm_to_str (SCM obj)
{
return scm_to_locale_string (scm_call_1 (obj_to_str, obj));
}
/* Perform the GNU Make expansion function. */
static SCM
guile_expand_wrapper (SCM obj)
{
char *str = cvt_scm_to_str (obj);
SCM ret;
char *res;
DB (DB_BASIC, (_("guile: Expanding '%s'\n"), str));
res = gmk_expand (str);
ret = scm_from_locale_string (res);
free (str);
free (res);
return ret;
}
/* Perform the GNU Make eval function. */
static SCM
guile_eval_wrapper (SCM obj)
{
char *str = cvt_scm_to_str (obj);
DB (DB_BASIC, (_("guile: Evaluating '%s'\n"), str));
gmk_eval (str, 0);
return SCM_BOOL_F;
}
/* Invoked by scm_c_define_module(), in the context of the GNU Make module. */
static void
guile_define_module (void *data UNUSED)
{
/* Ingest the predefined Guile module for GNU Make. */
#include "gmk-default.h"
/* Register a subr for GNU Make's eval capability. */
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (GSUBR_TYPE) guile_expand_wrapper);
/* Register a subr for GNU Make's eval capability. */
scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (GSUBR_TYPE) guile_eval_wrapper);
/* Define the rest of the module. */
scm_c_eval_string (GUILE_module_defn);
}
/* Initialize the GNU Make Guile module. */
static void *
guile_init (void *arg UNUSED)
{
/* Define the module. */
make_mod = scm_c_define_module ("gnu make", guile_define_module, NULL);
/* Get a reference to the object-to-string translator, for later. */
obj_to_str = scm_variable_ref (scm_c_module_lookup (make_mod, "obj-to-str"));
/* Import the GNU Make module exports into the generic space. */
scm_c_eval_string ("(use-modules (gnu make))");
return NULL;
}
static void *
internal_guile_eval (void *arg)
{
return cvt_scm_to_str (EVAL_STRING (arg));
}
/* This is the function registered with make */
static char *
func_guile (const char *funcname UNUSED, unsigned int argc UNUSED, char **argv)
{
static int init = 0;
if (! init)
{
/* Initialize the Guile interpreter. */
scm_with_guile (guile_init, NULL);
init = 1;
}
if (argv[0] && argv[0][0] != '\0')
return scm_with_guile (internal_guile_eval, argv[0]);
return NULL;
}
/* ----- Public interface ----- */
/* We could send the flocp to define_new_function(), but since guile is
"kind of" built-in, that didn't seem so useful. */
int
guile_gmake_setup (const floc *flocp UNUSED)
{
/* Create a make function "guile". */
gmk_add_function ("guile", func_guile, 0, 1, GMK_FUNC_DEFAULT);
return 1;
}
#else
int
guile_gmake_setup (const floc *flocp UNUSED)
{
return 1;
}
#endif

501
src/hash.c Normal file
View File

@ -0,0 +1,501 @@
/* hash.c -- hash table maintenance
Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "hash.h"
#include <assert.h>
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
#define CLONE(o, t, n) ((t *) memcpy (MALLOC (t, (n)), (o), sizeof (t) * (n)))
static void hash_rehash __P((struct hash_table* ht));
static unsigned long round_up_2 __P((unsigned long rough));
/* Implement double hashing with open addressing. The table size is
always a power of two. The secondary ('increment') hash function
is forced to return an odd-value, in order to be relatively prime
to the table size. This guarantees that the increment can
potentially hit every slot in the table during collision
resolution. */
const void *hash_deleted_item = &hash_deleted_item;
/* Force the table size to be a power of two, possibly rounding up the
given size. */
void
hash_init (struct hash_table *ht, unsigned long size,
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp)
{
ht->ht_size = round_up_2 (size);
ht->ht_empty_slots = ht->ht_size;
ht->ht_vec = CALLOC (void *, ht->ht_size);
if (ht->ht_vec == 0)
{
fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
ht->ht_size * (unsigned long) sizeof (void *));
exit (MAKE_TROUBLE);
}
ht->ht_capacity = ht->ht_size - (ht->ht_size / 16); /* 93.75% loading factor */
ht->ht_fill = 0;
ht->ht_collisions = 0;
ht->ht_lookups = 0;
ht->ht_rehashes = 0;
ht->ht_hash_1 = hash_1;
ht->ht_hash_2 = hash_2;
ht->ht_compare = hash_cmp;
}
/* Load an array of items into 'ht'. */
void
hash_load (struct hash_table *ht, const void *item_table,
unsigned long cardinality, unsigned long size)
{
const char *items = (const char *) item_table;
while (cardinality--)
{
hash_insert (ht, items);
items += size;
}
}
/* Returns the address of the table slot matching 'key'. If 'key' is
not found, return the address of an empty slot suitable for
inserting 'key'. The caller is responsible for incrementing
ht_fill on insertion. */
void **
hash_find_slot (struct hash_table *ht, const void *key)
{
void **slot;
void **deleted_slot = 0;
unsigned int hash_2 = 0;
unsigned int hash_1 = (*ht->ht_hash_1) (key);
ht->ht_lookups++;
for (;;)
{
hash_1 &= (ht->ht_size - 1);
slot = &ht->ht_vec[hash_1];
if (*slot == 0)
return (deleted_slot ? deleted_slot : slot);
if (*slot == hash_deleted_item)
{
if (deleted_slot == 0)
deleted_slot = slot;
}
else
{
if (key == *slot)
return slot;
if ((*ht->ht_compare) (key, *slot) == 0)
return slot;
ht->ht_collisions++;
}
if (!hash_2)
hash_2 = (*ht->ht_hash_2) (key) | 1;
hash_1 += hash_2;
}
}
void *
hash_find_item (struct hash_table *ht, const void *key)
{
void **slot = hash_find_slot (ht, key);
return ((HASH_VACANT (*slot)) ? 0 : *slot);
}
void *
hash_insert (struct hash_table *ht, const void *item)
{
void **slot = hash_find_slot (ht, item);
const void *old_item = *slot;
hash_insert_at (ht, item, slot);
return (void *)((HASH_VACANT (old_item)) ? 0 : old_item);
}
void *
hash_insert_at (struct hash_table *ht, const void *item, const void *slot)
{
const void *old_item = *(void **) slot;
if (HASH_VACANT (old_item))
{
ht->ht_fill++;
if (old_item == 0)
ht->ht_empty_slots--;
old_item = item;
}
*(void const **) slot = item;
if (ht->ht_empty_slots < ht->ht_size - ht->ht_capacity)
{
hash_rehash (ht);
return (void *) hash_find_slot (ht, item);
}
else
return (void *) slot;
}
void *
hash_delete (struct hash_table *ht, const void *item)
{
void **slot = hash_find_slot (ht, item);
return hash_delete_at (ht, slot);
}
void *
hash_delete_at (struct hash_table *ht, const void *slot)
{
void *item = *(void **) slot;
if (!HASH_VACANT (item))
{
*(void const **) slot = hash_deleted_item;
ht->ht_fill--;
return item;
}
else
return 0;
}
void
hash_free_items (struct hash_table *ht)
{
void **vec = ht->ht_vec;
void **end = &vec[ht->ht_size];
for (; vec < end; vec++)
{
void *item = *vec;
if (!HASH_VACANT (item))
free (item);
*vec = 0;
}
ht->ht_fill = 0;
ht->ht_empty_slots = ht->ht_size;
}
void
hash_delete_items (struct hash_table *ht)
{
void **vec = ht->ht_vec;
void **end = &vec[ht->ht_size];
for (; vec < end; vec++)
*vec = 0;
ht->ht_fill = 0;
ht->ht_collisions = 0;
ht->ht_lookups = 0;
ht->ht_rehashes = 0;
ht->ht_empty_slots = ht->ht_size;
}
void
hash_free (struct hash_table *ht, int free_items)
{
if (free_items)
hash_free_items (ht);
else
{
ht->ht_fill = 0;
ht->ht_empty_slots = ht->ht_size;
}
free (ht->ht_vec);
ht->ht_vec = 0;
ht->ht_capacity = 0;
}
void
hash_map (struct hash_table *ht, hash_map_func_t map)
{
void **slot;
void **end = &ht->ht_vec[ht->ht_size];
for (slot = ht->ht_vec; slot < end; slot++)
{
if (!HASH_VACANT (*slot))
(*map) (*slot);
}
}
void
hash_map_arg (struct hash_table *ht, hash_map_arg_func_t map, void *arg)
{
void **slot;
void **end = &ht->ht_vec[ht->ht_size];
for (slot = ht->ht_vec; slot < end; slot++)
{
if (!HASH_VACANT (*slot))
(*map) (*slot, arg);
}
}
/* Double the size of the hash table in the event of overflow... */
static void
hash_rehash (struct hash_table *ht)
{
unsigned long old_ht_size = ht->ht_size;
void **old_vec = ht->ht_vec;
void **ovp;
if (ht->ht_fill >= ht->ht_capacity)
{
ht->ht_size *= 2;
ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
}
ht->ht_rehashes++;
ht->ht_vec = CALLOC (void *, ht->ht_size);
for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++)
{
if (! HASH_VACANT (*ovp))
{
void **slot = hash_find_slot (ht, *ovp);
*slot = *ovp;
}
}
ht->ht_empty_slots = ht->ht_size - ht->ht_fill;
free (old_vec);
}
void
hash_print_stats (struct hash_table *ht, FILE *out_FILE)
{
fprintf (out_FILE, _("Load=%lu/%lu=%.0f%%, "), ht->ht_fill, ht->ht_size,
100.0 * (double) ht->ht_fill / (double) ht->ht_size);
fprintf (out_FILE, _("Rehash=%u, "), ht->ht_rehashes);
fprintf (out_FILE, _("Collisions=%lu/%lu=%.0f%%"), ht->ht_collisions, ht->ht_lookups,
(ht->ht_lookups
? (100.0 * (double) ht->ht_collisions / (double) ht->ht_lookups)
: 0));
}
/* Dump all items into a NULL-terminated vector. Use the
user-supplied vector, or malloc one. */
void **
hash_dump (struct hash_table *ht, void **vector_0, qsort_cmp_t compare)
{
void **vector;
void **slot;
void **end = &ht->ht_vec[ht->ht_size];
if (vector_0 == 0)
vector_0 = MALLOC (void *, ht->ht_fill + 1);
vector = vector_0;
for (slot = ht->ht_vec; slot < end; slot++)
if (!HASH_VACANT (*slot))
*vector++ = *slot;
*vector = 0;
if (compare)
qsort (vector_0, ht->ht_fill, sizeof (void *), compare);
return vector_0;
}
/* Round a given number up to the nearest power of 2. */
static unsigned long
round_up_2 (unsigned long n)
{
n |= (n >> 1);
n |= (n >> 2);
n |= (n >> 4);
n |= (n >> 8);
n |= (n >> 16);
#if !defined(HAVE_LIMITS_H) || ULONG_MAX > 4294967295
/* We only need this on systems where unsigned long is >32 bits. */
n |= (n >> 32);
#endif
return n + 1;
}
#define rol32(v, n) \
((v) << (n) | ((v) >> (32 - (n))))
/* jhash_mix -- mix 3 32-bit values reversibly. */
#define jhash_mix(a, b, c) \
{ \
a -= c; a ^= rol32(c, 4); c += b; \
b -= a; b ^= rol32(a, 6); a += c; \
c -= b; c ^= rol32(b, 8); b += a; \
a -= c; a ^= rol32(c, 16); c += b; \
b -= a; b ^= rol32(a, 19); a += c; \
c -= b; c ^= rol32(b, 4); b += a; \
}
/* jhash_final - final mixing of 3 32-bit values (a,b,c) into c */
#define jhash_final(a, b, c) \
{ \
c ^= b; c -= rol32(b, 14); \
a ^= c; a -= rol32(c, 11); \
b ^= a; b -= rol32(a, 25); \
c ^= b; c -= rol32(b, 16); \
a ^= c; a -= rol32(c, 4); \
b ^= a; b -= rol32(a, 14); \
c ^= b; c -= rol32(b, 24); \
}
/* An arbitrary initial parameter */
#define JHASH_INITVAL 0xdeadbeef
#define sum_get_unaligned_32(r, p) \
do { \
unsigned int val; \
memcpy (&val, (p), 4); \
r += val; \
} while(0);
unsigned int
jhash(unsigned const char *k, int length)
{
unsigned int a, b, c;
/* Set up the internal state */
a = b = c = JHASH_INITVAL + length;
/* All but the last block: affect some 32 bits of (a,b,c) */
while (length > 12) {
sum_get_unaligned_32(a, k);
sum_get_unaligned_32(b, k + 4);
sum_get_unaligned_32(c, k + 8);
jhash_mix(a, b, c);
length -= 12;
k += 12;
}
if (!length)
return c;
if (length > 8)
{
sum_get_unaligned_32(a, k);
length -= 4;
k += 4;
}
if (length > 4)
{
sum_get_unaligned_32(b, k);
length -= 4;
k += 4;
}
if (length == 4)
c += (unsigned)k[3]<<24;
if (length >= 3)
c += (unsigned)k[2]<<16;
if (length >= 2)
c += (unsigned)k[1]<<8;
c += k[0];
jhash_final(a, b, c);
return c;
}
#define UINTSZ sizeof (unsigned int)
#ifdef WORDS_BIGENDIAN
/* The ifs are ordered from the first byte in memory to the last.
Help the compiler optimize by using static memcpy length. */
#define sum_up_to_nul(r, p, plen, flag) \
do { \
unsigned int val = 0; \
size_t pn = (plen); \
if (pn >= UINTSZ) \
memcpy (&val, (p), UINTSZ); \
else \
memcpy (&val, (p), pn); \
if ((val & 0xFF000000) == 0) \
flag = 1; \
else if ((val & 0xFF0000) == 0) \
r += val & ~0xFFFF, flag = 1; \
else if ((val & 0xFF00) == 0) \
r += val & ~0xFF, flag = 1; \
else \
r += val, flag = (val & 0xFF) == 0; \
} while (0)
#else
/* First detect the presence of zeroes. If there is none, we can
sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
big endian case, from the first byte in memory to the last.
Help the compiler optimize by using static memcpy length. */
#define sum_up_to_nul(r, p, plen, flag) \
do { \
unsigned int val = 0; \
size_t pn = (plen); \
if (pn >= UINTSZ) \
memcpy (&val, (p), UINTSZ); \
else \
memcpy (&val, (p), pn); \
flag = ((val - 0x01010101) & ~val) & 0x80808080; \
if (!flag) \
r += val; \
else if (val & 0xFF) \
{ \
if ((val & 0xFF00) == 0) \
r += val & 0xFF; \
else if ((val & 0xFF0000) == 0) \
r += val & 0xFFFF; \
else \
r += val; \
} \
} while (0)
#endif
unsigned int
jhash_string(unsigned const char *k)
{
unsigned int a, b, c;
unsigned int have_nul = 0;
unsigned const char *start = k;
size_t klen = strlen ((const char*)k);
/* Set up the internal state */
a = b = c = JHASH_INITVAL;
/* All but the last block: affect some 32 bits of (a,b,c) */
for (;;) {
sum_up_to_nul(a, k, klen, have_nul);
if (have_nul)
break;
k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
sum_up_to_nul(b, k, klen, have_nul);
if (have_nul)
break;
k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
sum_up_to_nul(c, k, klen, have_nul);
if (have_nul)
break;
k += UINTSZ;
assert (klen >= UINTSZ);
klen -= UINTSZ;
jhash_mix(a, b, c);
}
jhash_final(a, b, c);
return c + (unsigned) (k - start);
}

234
src/hash.h Normal file
View File

@ -0,0 +1,234 @@
/* hash.h -- decls for hash table
Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _hash_h_
#define _hash_h_
#include <stdio.h>
#include <ctype.h>
#if defined __cplusplus || (defined __STDC__ && __STDC__) || MK_OS_W32
# if !defined __GLIBC__ || !defined __P
# undef __P
# define __P(protos) protos
# endif
#else /* Not C++ or ANSI C. */
# undef __P
# define __P(protos) ()
/* We can get away without defining 'const' here only because in this file
it is used only inside the prototype for 'fnmatch', which is elided in
non-ANSI C where 'const' is problematical. */
#endif /* C++ or ANSI C. */
typedef unsigned long (*hash_func_t) __P((void const *key));
typedef int (*hash_cmp_func_t) __P((void const *x, void const *y));
typedef void (*hash_map_func_t) __P((void const *item));
typedef void (*hash_map_arg_func_t) __P((void const *item, void *arg));
struct hash_table
{
void **ht_vec;
hash_func_t ht_hash_1; /* primary hash function */
hash_func_t ht_hash_2; /* secondary hash function */
hash_cmp_func_t ht_compare; /* comparison function */
unsigned long ht_size; /* total number of slots (power of 2) */
unsigned long ht_capacity; /* usable slots, limited by loading-factor */
unsigned long ht_fill; /* items in table */
unsigned long ht_empty_slots; /* empty slots not including deleted slots */
unsigned long ht_collisions; /* # of failed calls to comparison function */
unsigned long ht_lookups; /* # of queries */
unsigned int ht_rehashes; /* # of times we've expanded table */
};
typedef int (*qsort_cmp_t) __P((void const *, void const *));
void hash_init __P((struct hash_table *ht, unsigned long size,
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
void hash_load __P((struct hash_table *ht, const void *item_table,
unsigned long cardinality, unsigned long size));
void **hash_find_slot __P((struct hash_table *ht, void const *key));
void *hash_find_item __P((struct hash_table *ht, void const *key));
void *hash_insert __P((struct hash_table *ht, const void *item));
void *hash_insert_at __P((struct hash_table *ht, const void *item, void const *slot));
void *hash_delete __P((struct hash_table *ht, void const *item));
void *hash_delete_at __P((struct hash_table *ht, void const *slot));
void hash_delete_items __P((struct hash_table *ht));
void hash_free_items __P((struct hash_table *ht));
void hash_free __P((struct hash_table *ht, int free_items));
void hash_map __P((struct hash_table *ht, hash_map_func_t map));
void hash_map_arg __P((struct hash_table *ht, hash_map_arg_func_t map, void *arg));
void hash_print_stats __P((struct hash_table *ht, FILE *out_FILE));
void **hash_dump __P((struct hash_table *ht, void **vector_0, qsort_cmp_t compare));
extern unsigned jhash(unsigned char const *key, int n);
extern unsigned jhash_string(unsigned char const *key);
extern const void *hash_deleted_item;
#define HASH_VACANT(item) ((item) == 0 || (void *) (item) == hash_deleted_item)
/* hash and comparison macros for case-sensitive string keys. */
/* Due to the strcache, it's not uncommon for the string pointers to
be identical. Take advantage of that to short-circuit string compares. */
#define STRING_HASH_1(KEY, RESULT) do { \
unsigned char const *_key_ = (unsigned char const *) (KEY); \
(RESULT) += jhash_string(_key_); \
} while (0)
#define return_STRING_HASH_1(KEY) do { \
unsigned long _result_ = 0; \
STRING_HASH_1 ((KEY), _result_); \
return _result_; \
} while (0)
/* No need for a second hash because jhash already provides
pretty good results. However, do evaluate the arguments
to avoid warnings. */
#define STRING_HASH_2(KEY, RESULT) do { \
(void)(KEY); \
} while (0)
#define return_STRING_HASH_2(KEY) do { \
unsigned long _result_ = 0; \
STRING_HASH_2 ((KEY), _result_); \
return _result_; \
} while (0)
#define STRING_COMPARE(X, Y, RESULT) do { \
RESULT = (X) == (Y) ? 0 : strcmp ((X), (Y)); \
} while (0)
#define return_STRING_COMPARE(X, Y) do { \
return (X) == (Y) ? 0 : strcmp ((X), (Y)); \
} while (0)
#define STRING_N_HASH_1(KEY, N, RESULT) do { \
unsigned char const *_key_ = (unsigned char const *) (KEY); \
(RESULT) += jhash(_key_, N); \
} while (0)
#define return_STRING_N_HASH_1(KEY, N) do { \
unsigned long _result_ = 0; \
STRING_N_HASH_1 ((KEY), (N), _result_); \
return _result_; \
} while (0)
/* No need for a second hash because jhash already provides
pretty good results. However, do evaluate the arguments
to avoid warnings. */
#define STRING_N_HASH_2(KEY, N, RESULT) do { \
(void)(KEY); \
(void)(N); \
} while (0)
#define return_STRING_N_HASH_2(KEY, N) do { \
unsigned long _result_ = 0; \
STRING_N_HASH_2 ((KEY), (N), _result_); \
return _result_; \
} while (0)
#define STRING_N_COMPARE(X, Y, N, RESULT) do { \
RESULT = (X) == (Y) ? 0 : memcmp ((X), (Y), (N)); \
} while (0)
#define return_STRING_N_COMPARE(X, Y, N) do { \
return (X) == (Y) ? 0 : memcmp ((X), (Y), (N)); \
} while (0)
#ifdef HAVE_CASE_INSENSITIVE_FS
/* hash and comparison macros for case-insensitive string _key_s. */
#define ISTRING_HASH_1(KEY, RESULT) do { \
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
while (*++_key_) \
(RESULT) += (tolower (*_key_) << (_key_[1] & 0xf)); \
} while (0)
#define return_ISTRING_HASH_1(KEY) do { \
unsigned long _result_ = 0; \
ISTRING_HASH_1 ((KEY), _result_); \
return _result_; \
} while (0)
#define ISTRING_HASH_2(KEY, RESULT) do { \
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
while (*++_key_) \
(RESULT) += (tolower (*_key_) << (_key_[1] & 0x7)); \
} while (0)
#define return_ISTRING_HASH_2(KEY) do { \
unsigned long _result_ = 0; \
ISTRING_HASH_2 ((KEY), _result_); \
return _result_; \
} while (0)
#define ISTRING_COMPARE(X, Y, RESULT) do { \
RESULT = (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
} while (0)
#define return_ISTRING_COMPARE(X, Y) do { \
return (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
} while (0)
#else
#define ISTRING_HASH_1(KEY, RESULT) STRING_HASH_1 ((KEY), (RESULT))
#define return_ISTRING_HASH_1(KEY) return_STRING_HASH_1 (KEY)
#define ISTRING_HASH_2(KEY, RESULT) STRING_HASH_2 ((KEY), (RESULT))
#define return_ISTRING_HASH_2(KEY) return_STRING_HASH_2 (KEY)
#define ISTRING_COMPARE(X, Y, RESULT) STRING_COMPARE ((X), (Y), (RESULT))
#define return_ISTRING_COMPARE(X, Y) return_STRING_COMPARE ((X), (Y))
#endif
/* hash and comparison macros for integer _key_s. */
#define INTEGER_HASH_1(KEY, RESULT) do { \
(RESULT) += ((unsigned long)(KEY)); \
} while (0)
#define return_INTEGER_HASH_1(KEY) do { \
unsigned long _result_ = 0; \
INTEGER_HASH_1 ((KEY), _result_); \
return _result_; \
} while (0)
#define INTEGER_HASH_2(KEY, RESULT) do { \
(RESULT) += ~((unsigned long)(KEY)); \
} while (0)
#define return_INTEGER_HASH_2(KEY) do { \
unsigned long _result_ = 0; \
INTEGER_HASH_2 ((KEY), _result_); \
return _result_; \
} while (0)
#define INTEGER_COMPARE(X, Y, RESULT) do { \
(RESULT) = X - Y; \
} while (0)
#define return_INTEGER_COMPARE(X, Y) do { \
int _result_; \
INTEGER_COMPARE (X, Y, _result_); \
return _result_; \
} while (0)
/* hash and comparison macros for address keys. */
#define ADDRESS_HASH_1(KEY, RESULT) INTEGER_HASH_1 (((unsigned long)(KEY)) >> 3, (RESULT))
#define ADDRESS_HASH_2(KEY, RESULT) INTEGER_HASH_2 (((unsigned long)(KEY)) >> 3, (RESULT))
#define ADDRESS_COMPARE(X, Y, RESULT) INTEGER_COMPARE ((X), (Y), (RESULT))
#define return_ADDRESS_HASH_1(KEY) return_INTEGER_HASH_1 (((unsigned long)(KEY)) >> 3)
#define return_ADDRESS_HASH_2(KEY) return_INTEGER_HASH_2 (((unsigned long)(KEY)) >> 3)
#define return_ADDRESS_COMPARE(X, Y) return_INTEGER_COMPARE ((X), (Y))
#endif /* not _hash_h_ */

1138
src/implicit.c Normal file

File diff suppressed because it is too large Load Diff

3763
src/job.c Normal file

File diff suppressed because it is too large Load Diff

88
src/job.h Normal file
View File

@ -0,0 +1,88 @@
/* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "output.h"
/* Structure describing a running or dead child process. */
#if MK_OS_VMS
#define VMSCHILD \
char *comname; /* Temporary command file name */ \
int efn; /* Completion event flag number */ \
int cstatus; /* Completion status */ \
int vms_launch_status; /* non-zero if lib$spawn, etc failed */
#else
#define VMSCHILD
#endif
#define CHILDBASE \
char *cmd_name; /* Allocated copy of command run. */ \
char **environment; /* Environment for commands. */ \
VMSCHILD \
struct output output /* Output for this child. */
struct childbase
{
CHILDBASE;
};
struct child
{
CHILDBASE;
struct child *next; /* Link in the chain. */
struct file *file; /* File being remade. */
char *sh_batch_file; /* Script file for shell commands */
char **command_lines; /* Array of variable-expanded cmd lines. */
char *command_ptr; /* Ptr into command_lines[command_line]. */
unsigned int command_line; /* Index into command_lines. */
pid_t pid; /* Child process's ID number. */
unsigned int remote:1; /* Nonzero if executing remotely. */
unsigned int noerror:1; /* Nonzero if commands contained a '-'. */
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */
unsigned int jobslot:1; /* Nonzero if it's reserved a job slot. */
unsigned int dontcare:1; /* Saved dontcare flag. */
};
extern struct child *children;
/* A signal handler for SIGCHLD, if needed. */
void child_handler (int sig);
int is_bourne_compatible_shell(const char *path);
void new_job (struct file *file);
void reap_children (int block, int err);
void start_waiting_jobs (void);
void free_childbase (struct childbase* child);
char **construct_command_argv (char *line, char **restp, struct file *file,
int cmd_flags, char** batch_file);
pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv);
pid_t exec_command (char **argv, char **envp);
void unblock_all_sigs (void);
extern unsigned int job_slots_used;
extern unsigned int jobserver_tokens;

314
src/load.c Normal file
View File

@ -0,0 +1,314 @@
/* Loading dynamic objects for GNU Make.
Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#if MAKE_LOAD
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <errno.h>
#include "debug.h"
#include "filedef.h"
#include "variable.h"
/* Tru64 V4.0 does not have this flag */
#ifndef RTLD_GLOBAL
# define RTLD_GLOBAL 0
#endif
#define GMK_SETUP "_gmk_setup"
#define GMK_UNLOAD "_gmk_unload"
typedef int (*setup_func_t)(unsigned int abi, const floc *flocp);
typedef void (*unload_func_t)(void);
struct load_list
{
struct load_list *next;
const char *name;
void *dlp;
unload_func_t unload;
};
static struct load_list *loaded_syms = NULL;
static setup_func_t
load_object (const floc *flocp, int noerror, const char *ldname,
const char *setupnm)
{
static void *global_dl = NULL;
char *buf;
const char *fp;
char *endp;
void *dlp;
struct load_list *new;
setup_func_t symp;
if (! global_dl)
{
global_dl = dlopen (NULL, RTLD_NOW|RTLD_GLOBAL);
if (! global_dl)
{
const char *err = dlerror ();
OS (fatal, flocp, _("failed to open global symbol table: %s"), err);
}
}
/* Find the prefix of the ldname. */
fp = strrchr (ldname, '/');
#ifdef HAVE_DOS_PATHS
if (fp)
{
const char *fp2 = strchr (fp, '\\');
if (fp2 > fp)
fp = fp2;
}
else
fp = strrchr (ldname, '\\');
/* The (improbable) case of d:foo. */
if (fp && *fp && fp[1] == ':')
fp++;
#endif
if (!fp)
fp = ldname;
else
++fp;
endp = buf = alloca (strlen (fp) + CSTRLEN (GMK_UNLOAD) + 1);
while (isalnum ((unsigned char) *fp) || *fp == '_')
*(endp++) = *(fp++);
/* If we didn't find a symbol name yet, construct it from the prefix. */
if (! setupnm)
{
memcpy (endp, GMK_SETUP, CSTRLEN (GMK_SETUP) + 1);
setupnm = buf;
}
DB (DB_VERBOSE, (_("Loading symbol %s from %s\n"), setupnm, ldname));
symp = (setup_func_t) dlsym (global_dl, setupnm);
if (symp)
return symp;
/* If the path has no "/", try the current directory first. */
dlp = NULL;
if (! strchr (ldname, '/')
#ifdef HAVE_DOS_PATHS
&& ! strchr (ldname, '\\')
#endif
)
dlp = dlopen (concat (2, "./", ldname), RTLD_LAZY|RTLD_GLOBAL);
/* If we haven't opened it yet, try the default search path. */
if (! dlp)
dlp = dlopen (ldname, RTLD_LAZY|RTLD_GLOBAL);
/* Still no? Then fail. */
if (! dlp)
{
const char *err = dlerror ();
if (noerror)
DB (DB_BASIC, ("%s\n", err));
else
OS (error, flocp, "%s", err);
return NULL;
}
DB (DB_VERBOSE, (_("Loaded shared object %s\n"), ldname));
/* Assert that the GPL license symbol is defined. */
symp = (setup_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
if (! symp)
OS (fatal, flocp,
_("loaded object %s is not declared to be GPL compatible"), ldname);
symp = (setup_func_t) dlsym (dlp, setupnm);
if (! symp)
{
const char *err = dlerror ();
OSSS (fatal, flocp, _("failed to load symbol %s from %s: %s"),
setupnm, ldname, err);
}
new = xcalloc (sizeof (struct load_list));
new->next = loaded_syms;
loaded_syms = new;
new->name = ldname;
new->dlp = dlp;
/* Compute the name of the unload function and look it up. */
memcpy (endp, GMK_UNLOAD, CSTRLEN (GMK_UNLOAD) + 1);
new->unload = (unload_func_t) dlsym (dlp, buf);
if (new->unload)
DB (DB_VERBOSE, (_("Detected symbol %s in %s\n"), buf, ldname));
return symp;
}
int
load_file (const floc *flocp, struct file *file, int noerror)
{
const char *ldname = file->name;
char *buf;
char *setupnm = NULL;
const char *fp;
int r;
setup_func_t symp;
/* Break the input into an object file name and a symbol name. If no symbol
name was provided, compute one from the object file name. */
fp = strchr (ldname, '(');
if (fp)
{
const char *ep;
/* There's an open paren, so see if there's a close paren: if so use
that as the symbol name. We can't have whitespace: it would have
been chopped up before this function is called. */
ep = strchr (fp+1, ')');
if (ep && ep[1] == '\0')
{
size_t l = fp - ldname;
++fp;
if (fp == ep)
OS (fatal, flocp, _("empty symbol name for load: %s"), ldname);
/* Make a copy of the ldname part. */
buf = alloca (strlen (ldname) + 1);
memcpy (buf, ldname, l);
buf[l] = '\0';
ldname = buf;
/* Make a copy of the symbol name part. */
setupnm = buf + l + 1;
memcpy (setupnm, fp, ep - fp);
setupnm[ep - fp] = '\0';
}
}
/* Make sure this name is in the string cache. */
ldname = file->name = strcache_add (ldname);
/* If this object has been loaded, we're done: return -1 to ensure make does
not rebuild again. If a rebuild is allowed it was set up when this
object was initially loaded. */
file = lookup_file (ldname);
if (file && file->loaded)
return -1;
/* Load it! */
symp = load_object (flocp, noerror, ldname, setupnm);
if (! symp)
return 0;
/* Invoke the setup function. */
{
unsigned int abi = GMK_ABI_VERSION;
r = (*symp) (abi, flocp);
}
/* If the load didn't fail, add the file to the .LOADED variable. */
if (r)
do_variable_definition(flocp, ".LOADED", ldname, o_file, f_append_value, 0,
s_global);
return r;
}
int
unload_file (const char *name)
{
struct load_list **dp = &loaded_syms;
/* Unload and remove the entry for this file. */
while (*dp != NULL)
{
struct load_list *d = *dp;
if (streq (d->name, name))
{
int rc;
DB (DB_VERBOSE, (_("Unloading shared object %s\n"), name));
if (d->unload)
(*d->unload) ();
rc = dlclose (d->dlp);
if (rc)
perror_with_name ("dlclose: ", d->name);
*dp = d->next;
free (d);
return rc;
}
dp = &d->next;
}
return 0;
}
void
unload_all ()
{
while (loaded_syms)
{
struct load_list *d = loaded_syms;
loaded_syms = loaded_syms->next;
if (d->unload)
(*d->unload) ();
if (dlclose (d->dlp))
perror_with_name ("dlclose: ", d->name);
free (d);
}
}
#else
int
load_file (const floc *flocp, struct file *file UNUSED, int noerror)
{
if (! noerror)
O (fatal, flocp,
_("'load' is not supported on this platform"));
return 0;
}
int
unload_file (const char *name UNUSED)
{
O (fatal, NILF, "INTERNAL: cannot unload when load is not supported");
}
void
unload_all ()
{
}
#endif /* MAKE_LOAD */

82
src/loadapi.c Normal file
View File

@ -0,0 +1,82 @@
/* API for GNU Make dynamic objects.
Copyright (C) 2013-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "filedef.h"
#include "variable.h"
#include "dep.h"
/* Allocate a buffer in our context, so we can free it. */
char *
gmk_alloc (unsigned int len)
{
return xmalloc (len);
}
/* Free a buffer returned by gmk_expand(). */
void
gmk_free (char *s)
{
free (s);
}
/* Evaluate a buffer as make syntax.
Ideally eval_buffer() will take const char *, but not yet. */
void
gmk_eval (const char *buffer, const gmk_floc *gfloc)
{
/* Preserve existing variable buffer context. */
char *pbuf;
size_t plen;
char *s;
floc fl;
floc *flp;
if (gfloc)
{
fl.filenm = gfloc->filenm;
fl.lineno = gfloc->lineno;
fl.offset = 0;
flp = &fl;
}
else
flp = NULL;
install_variable_buffer (&pbuf, &plen);
s = xstrdup (buffer);
eval_buffer (s, flp);
free (s);
restore_variable_buffer (pbuf, plen);
}
/* Expand a string and return an allocated buffer.
Caller must call gmk_free() with this buffer. */
char *
gmk_expand (const char *ref)
{
return allocated_expand_string (ref);
}
/* Register a function to be called from makefiles. */
void
gmk_add_function (const char *name, gmk_func_ptr func,
unsigned int min, unsigned int max, unsigned int flags)
{
define_new_function (reading_file, name, min, max, flags, func);
}

3906
src/main.c Normal file

File diff suppressed because it is too large Load Diff

893
src/makeint.h Normal file
View File

@ -0,0 +1,893 @@
/* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
/* We use <config.h> instead of "config.h" so that a compilation
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because makeint.h was found in $srcdir). */
#include <config.h>
/* Some versions of GCC (e.g., 10.x) set the warn_unused_result attribute on
__builtin_alloca. This causes alloca(0) to fail and is not easily worked
around so avoid it via the preprocessor.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98055 */
#if defined (__has_builtin)
# if __has_builtin (__builtin_alloca)
# define free_alloca()
# else
# define free_alloca() alloca (0)
# endif
#else
# define free_alloca() alloca (0)
#endif
/* Disable assert() unless we're a maintainer.
Some asserts are compute-intensive. */
#ifndef MAKE_MAINTAINER_MODE
# define NDEBUG 1
#endif
/* Include the externally-visible content.
Be sure to use the local one, and not one installed on the system.
Define GMK_BUILDING_MAKE for proper selection of dllexport/dllimport
declarations for MS-Windows. */
#if MK_OS_W32
# define GMK_BUILDING_MAKE
#endif
#include "gnumake.h"
#ifdef CRAY
/* This must happen before #include <signal.h> so
that the declaration therein is changed. */
# define signal bsdsignal
#endif
/* If we're compiling for the dmalloc debugger, turn off string inlining. */
#if defined(HAVE_DMALLOC_H) && defined(__GNUC__)
# define __NO_STRING_INLINES
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
#include <ctype.h>
#if HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
/* Define macros specifying which OS we are building for. */
#if __gnu_hurd__
# define MK_OS_HURD 1
#endif
#if __CYGWIN__
# define MK_OS_CYGWIN 1
#endif
#if defined(__MVS__)
# define MK_OS_ZOS 1
#endif
#if defined(__EMX__)
# define MK_OS_OS2 1
#endif
#ifdef __VMS
# define MK_OS_VMS 1
/* In strict ANSI mode, VMS compilers should not be defining the
VMS macro. Define it here instead of a bulk edit for the correct code.
*/
# ifndef VMS
# define VMS
# endif
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */
# if defined (_POSIX_VERSION) && !defined (ultrix) && !MK_OS_VMS
# define POSIX 1
# endif
#endif
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
#if (defined (butterfly) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
# undef POSIX
#endif
#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE)
# define POSIX 1
#endif
#ifndef sigmask
# define sigmask(sig) (1 << ((sig) - 1))
#endif
#ifndef HAVE_SA_RESTART
# define SA_RESTART 0
#endif
#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifndef PATH_MAX
# ifdef MAXPATHLEN
# define PATH_MAX MAXPATHLEN
# else
/* Some systems (HURD) have fully dynamic pathnames with no maximum.
Ideally we'd support this but it will take some work. */
# define PATH_MAX 4096
# endif
#endif
#define GET_PATH_MAX PATH_MAX
#define PATH_VAR(var) char var[PATH_MAX+1]
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#ifndef USHRT_MAX
# define USHRT_MAX 65535
#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t)~(size_t)0)
#endif
/* Nonzero if the integer type T is signed.
Use <= to avoid GCC warnings about always-false expressions. */
#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0)
/* The minimum and maximum values for the integer type T.
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */
#define INTEGER_TYPE_MINIMUM(t) \
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
#ifndef CHAR_MAX
# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char)
#endif
#ifdef STAT_MACROS_BROKEN
# ifdef S_ISREG
# undef S_ISREG
# endif
# ifdef S_ISDIR
# undef S_ISDIR
# endif
#endif /* STAT_MACROS_BROKEN. */
#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
#ifndef S_ISDIR
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#if MK_OS_VMS
# include <fcntl.h>
# include <types.h>
# include <unixlib.h>
# include <unixio.h>
# include <perror.h>
/* Needed to use alloca on VMS. */
# include <builtins.h>
extern int vms_use_mcr_command;
extern int vms_always_use_cmd_file;
extern int vms_gnv_shell;
extern int vms_comma_separator;
extern int vms_legacy_behavior;
extern int vms_unix_simulation;
#endif
#if !defined(__attribute__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
/* Don't use __attribute__ if it's not supported. */
# define ATTRIBUTE(x)
#else
# define ATTRIBUTE(x) __attribute__ (x)
#endif
/* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
#endif
#define UNUSED ATTRIBUTE ((unused))
#define NORETURN ATTRIBUTE ((noreturn))
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
# include <stdlib.h>
# include <string.h>
# define ANSI_STRING 1
#else /* No standard headers. */
# ifdef HAVE_STRING_H
# include <string.h>
# define ANSI_STRING 1
# endif
# ifdef HAVE_MEMORY_H
# include <memory.h>
# endif
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# else
void *malloc (int);
void *realloc (void *, int);
void free (void *);
void abort (void) NORETURN;
void exit (int) NORETURN;
# endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */
/* These should be in stdlib.h. Make sure we have them. */
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#ifndef ANSI_STRING
/* SCO Xenix has a buggy macro definition in <string.h>. */
#undef strerror
#if !defined(__DECC)
char *strerror (int errnum);
#endif
#endif /* !ANSI_STRING. */
#undef ANSI_STRING
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h> /* Needed for strcasecmp / strncasecmp. */
#endif
#if defined _MSC_VER || defined __MINGW32__
# define MK_PRI64_PREFIX "I64"
#else
# define MK_PRI64_PREFIX "ll"
#endif
#ifndef PRIdMAX
# define PRIdMAX MK_PRI64_PREFIX "d"
#endif
#ifndef PRIuMAX
# define PRIuMAX MK_PRI64_PREFIX "u"
#endif
#ifndef SCNdMAX
# define SCNdMAX PRIdMAX
#endif
#define FILE_TIMESTAMP uintmax_t
#if !defined(HAVE_STRSIGNAL)
char *strsignal (int signum);
#endif
#if !defined(HAVE_UMASK)
typedef int mode_t;
extern mode_t umask (mode_t);
#endif
/* ISDIGIT offers the following features:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
- It's guaranteed to evaluate its argument exactly once.
NOTE! Make relies on this behavior, don't change it!
- It's typically faster.
POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
it's important to use the locale's definition of 'digit' even when the
host does not conform to POSIX. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
/* Test if two strings are equal. Is this worthwhile? Should be profiled. */
#define streq(a, b) \
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
/* Test if two strings are equal, but match case-insensitively on systems
which have case-insensitive filesystems. Should only be used for
filenames! */
#ifdef HAVE_CASE_INSENSITIVE_FS
# define patheq(a, b) \
((a) == (b) \
|| (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \
&& (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1))))
#else
# define patheq(a, b) streq(a, b)
#endif
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
#if defined(ENUM_BITFIELDS) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define ENUM_BITFIELD(bits) :bits
#else
# define ENUM_BITFIELD(bits)
#endif
/* Handle gettext and locales. */
#if HAVE_LOCALE_H
# include <locale.h>
#else
# define setlocale(category, locale)
#endif
#include <gettext.h>
#define _(msgid) gettext (msgid)
#define N_(msgid) gettext_noop (msgid)
#define S_(msg1,msg2,num) ngettext (msg1,msg2,num)
/* This is needed for getcwd() and chdir(), on some W32 systems. */
#if defined(HAVE_DIRECT_H)
# include <direct.h>
#endif
#if MK_OS_W32
# include <fcntl.h>
# include <malloc.h>
# define pipe(_p) _pipe((_p), 512, O_BINARY)
# define kill(_pid,_sig) w32_kill((_pid),(_sig))
/* MSVC and Watcom C don't have ftruncate. */
# if defined(_MSC_VER) || defined(__WATCOMC__)
# define ftruncate(_fd,_len) _chsize(_fd,_len)
# endif
/* MinGW64 doesn't have _S_ISDIR. */
# ifndef _S_ISDIR
# define _S_ISDIR(m) S_ISDIR(m)
# endif
void sync_Path_environment (void);
int w32_kill (pid_t pid, int sig);
int find_and_set_default_shell (const char *token);
/* indicates whether or not we have Bourne shell */
extern int no_default_sh_exe;
/* is default_shell unixy? */
extern int unixy_shell;
/* We don't have a preferred fixed value for LOCALEDIR. */
# ifndef LOCALEDIR
# define LOCALEDIR NULL
# endif
/* Include only the minimal stuff from windows.h. */
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
#endif /* MK_OS_W32 */
/* ALL_SET() evaluates the second argument twice. */
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
#define ALL_SET(_v,_m) (((_v)&(_m)) == (_m))
/* Bitmasks for the STOPCHAR array. */
#define MAP_NUL 0x0001
#define MAP_BLANK 0x0002 /* space, TAB */
#define MAP_NEWLINE 0x0004
#define MAP_COMMENT 0x0008
#define MAP_SEMI 0x0010
#define MAP_EQUALS 0x0020
#define MAP_COLON 0x0040
#define MAP_VARSEP 0x0080
#define MAP_PIPE 0x0100
#define MAP_DOT 0x0200
#define MAP_COMMA 0x0400
/* These are the valid characters for a user-defined function. */
#define MAP_USERFUNC 0x2000
/* This means not only a '$', but skip the variable reference. */
#define MAP_VARIABLE 0x4000
/* The set of characters which are directory separators is OS-specific. */
#define MAP_DIRSEP 0x8000
#if MK_OS_VMS
# define MAP_VMSCOMMA MAP_COMMA
#else
# define MAP_VMSCOMMA 0x0000
#endif
#define MAP_SPACE (MAP_BLANK|MAP_NEWLINE)
/* Handle other OSs.
To overcome an issue parsing paths in a DOS/Windows environment when
built in a unix based environment, override the PATH_SEPARATOR_CHAR
definition unless being built for Cygwin. */
#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__)
# undef PATH_SEPARATOR_CHAR
# define PATH_SEPARATOR_CHAR ';'
# define MAP_PATHSEP MAP_SEMI
#elif !defined(PATH_SEPARATOR_CHAR)
# if MK_OS_VMS
# define PATH_SEPARATOR_CHAR (vms_comma_separator ? ',' : ':')
# define MAP_PATHSEP (vms_comma_separator ? MAP_COMMA : MAP_SEMI)
# else
# define PATH_SEPARATOR_CHAR ':'
# define MAP_PATHSEP MAP_COLON
# endif
#elif PATH_SEPARATOR_CHAR == ':'
# define MAP_PATHSEP MAP_COLON
#elif PATH_SEPARATOR_CHAR == ';'
# define MAP_PATHSEP MAP_SEMI
#elif PATH_SEPARATOR_CHAR == ','
# define MAP_PATHSEP MAP_COMMA
#else
# error "Unknown PATH_SEPARATOR_CHAR"
#endif
#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
/* True if C is whitespace but not newline. */
#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
/* True if C is whitespace including newlines. */
#define ISSPACE(c) STOP_SET((c),MAP_SPACE)
/* True if C is nul or whitespace (including newline). */
#define END_OF_TOKEN(c) STOP_SET((c),MAP_SPACE|MAP_NUL)
/* Move S past all whitespace (including newlines). */
#define NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s)
/* True if C is a directory separator on the current system. */
#define ISDIRSEP(c) STOP_SET((c),MAP_DIRSEP)
/* True if S starts with a drive specifier. */
#if defined(HAVE_DOS_PATHS)
# define HAS_DRIVESPEC(_s) ((((_s)[0] >= 'a' && (_s)[0] <= 'z') \
|| ((_s)[0] >= 'A' && (_s)[0] <= 'Z')) \
&& (_s)[1] == ':')
#else
# define HAS_DRIVESPEC(_s) 0
#endif
/* We can't run setrlimit when using posix_spawn. */
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) && !defined(USE_POSIX_SPAWN)
# define SET_STACK_SIZE
#endif
#ifdef SET_STACK_SIZE
# include <sys/resource.h>
extern struct rlimit stack_limit;
#endif
#include <glob.h>
#define NILF ((floc *)0)
/* Number of elements in an array. */
#define ARRAYLEN(_a) (sizeof (_a) / sizeof ((_a)[0]))
/* Number of characters in a string constant. Does NOT include the \0 byte. */
#define CSTRLEN(_s) (sizeof (_s)-1)
/* Only usable when NOT calling a macro: only use it for local functions. */
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
/* The number of bytes needed to represent the largest signed and unsigned
integers as a string.
Does NOT include space for \0 so be sure to add it if needed.
Math suggested by Edward Welbourne <edward.welbourne@qt.io> */
#define INTSTR_LENGTH (53 * sizeof(uintmax_t) / 22 + 3)
#define DEFAULT_TTYNAME "true"
#ifdef HAVE_TTYNAME
# define TTYNAME(_f) ttyname (_f)
#else
# define TTYNAME(_f) DEFAULT_TTYNAME
#endif
#if MK_OS_VMS
# define DEFAULT_TMPDIR "/sys$scratch/"
#elif defined(P_tmpdir)
# define DEFAULT_TMPDIR P_tmpdir
#else
# define DEFAULT_TMPDIR "/tmp"
#endif
struct file;
/* Specify the location of elements read from makefiles. */
typedef struct
{
const char *filenm;
unsigned long lineno;
unsigned long offset;
} floc;
const char *concat (unsigned int, ...);
void message (int prefix, size_t length, const char *fmt, ...)
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void error (const floc *flocp, size_t length, const char *fmt, ...)
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void fatal (const floc *flocp, size_t length, const char *fmt, ...)
ATTRIBUTE ((noreturn, __format__ (__printf__, 3, 4)));
char *format (const char *prefix, size_t length, const char *fmt, ...)
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
void out_of_memory (void) NORETURN;
/* When adding macros to this list be sure to update the value of
XGETTEXT_OPTIONS in the po/Makevars file. */
#define O(_t,_a,_f) _t((_a), 0, (_f))
#define OS(_t,_a,_f,_s) _t((_a), strlen (_s), (_f), (_s))
#define OSS(_t,_a,_f,_s1,_s2) _t((_a), strlen (_s1) + strlen (_s2), \
(_f), (_s1), (_s2))
#define OSSS(_t,_a,_f,_s1,_s2,_s3) _t((_a), strlen (_s1) + strlen (_s2) + strlen (_s3), \
(_f), (_s1), (_s2), (_s3))
#define ON(_t,_a,_f,_n) _t((_a), INTSTR_LENGTH, (_f), (_n))
#define ONN(_t,_a,_f,_n1,_n2) _t((_a), INTSTR_LENGTH*2, (_f), (_n1), (_n2))
#define OSN(_t,_a,_f,_s,_n) _t((_a), strlen (_s) + INTSTR_LENGTH, \
(_f), (_s), (_n))
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
(_f), (_n), (_s))
enum variable_origin;
struct variable;
void reset_makeflags (enum variable_origin origin);
struct variable *define_makeflags (int makefile);
int should_print_dir (void);
void temp_stdin_unlink (void);
void die (int) NORETURN;
void pfatal_with_name (const char *) NORETURN;
void perror_with_name (const char *, const char *);
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
unsigned int make_toui (const char*, const char**);
char *make_lltoa (long long, char *);
char *make_ulltoa (unsigned long long, char *);
void make_seed (unsigned int);
unsigned int make_rand (void);
pid_t make_pid (void);
void *xmalloc (size_t);
void *xcalloc (size_t);
void *xrealloc (void *, size_t);
char *xstrdup (const char *);
char *xstrndup (const char *, size_t);
char *find_next_token (const char **, size_t *);
char *next_token (const char *);
char *end_of_token (const char *);
char *skip_reference (const char *);
void collapse_continuations (char *);
char *lindex (const char *, const char *, int);
int alpha_compare (const void *, const void *);
void print_spaces (unsigned int);
char *find_percent (char *);
const char *find_percent_cached (const char **);
const char *get_tmpdir (void);
int get_tmpfd (char **);
FILE *get_tmpfile (char **);
ssize_t writebuf (int, const void *, size_t);
ssize_t readbuf (int, void *, size_t);
#ifndef HAVE_MEMRCHR
void *memrchr(const void *, int, size_t);
#endif
#ifndef NO_ARCHIVES
int ar_name (const char *);
void ar_parse_name (const char *, char **, char **);
int ar_touch (const char *);
time_t ar_member_date (const char *);
typedef intmax_t (*ar_member_func_t) (int desc, const char *mem, int truncated,
long int hdrpos, long int datapos,
long int size, intmax_t date, int uid,
int gid, unsigned int mode,
const void *arg);
intmax_t ar_scan (const char *archive, ar_member_func_t function,
const void *arg);
int ar_name_equal (const char *name, const char *mem, int truncated);
#if !MK_OS_VMS
int ar_member_touch (const char *arname, const char *memname);
#endif
#endif
int dir_file_exists_p (const char *, const char *);
int file_exists_p (const char *);
int file_impossible_p (const char *);
void file_impossible (const char *);
const char *dir_name (const char *);
void print_dir_data_base (void);
void dir_setup_glob (glob_t *);
void hash_init_directories (void);
void define_default_variables (void);
void undefine_default_variables (void);
void set_default_suffixes (void);
void install_default_suffix_rules (void);
void install_default_implicit_rules (void);
void build_vpath_lists (void);
void construct_vpath_list (char *pattern, char *dirpath);
const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr,
unsigned int* vpath_index, unsigned int* path_index);
int gpath_search (const char *file, size_t len);
void construct_include_path (const char **arg_dirs);
char *strip_whitespace (const char **begpp, const char **endpp);
void show_goal_error (void);
/* String caching */
void strcache_init (void);
void strcache_print_stats (const char *prefix);
int strcache_iscached (const char *str);
const char *strcache_add (const char *str);
const char *strcache_add_len (const char *str, size_t len);
/* Guile support */
int guile_gmake_setup (const floc *flocp);
/* Loadable object support. Sets to the strcached name of the loaded file. */
int load_file (const floc *flocp, struct file *file, int noerror);
int unload_file (const char *name);
void unload_all (void);
/* Maintainer mode support */
#ifdef MAKE_MAINTAINER_MODE
# define SPIN(_s) spin (_s)
void spin (const char* suffix);
# define DBG(_f) dbg _f
void dbg (const char *fmt, ...);
#else
# define SPIN(_s)
/* Never put this code into Git or a release. */
# define DBG(_f) compile-error
#endif
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
because such systems often declare them in header files anyway. */
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !MK_OS_W32
# if !MK_OS_VMS
long int lseek ();
# endif
# ifdef HAVE_GETCWD
# if !MK_OS_VMS && !defined(__DECC)
char *getcwd (void);
# endif
# else
char *getwd (void);
# define getcwd(buf, len) getwd (buf)
# endif
#endif /* Not GNU C library or POSIX. */
#if !HAVE_STRCASECMP
# if HAVE_STRICMP
# define strcasecmp stricmp
# elif HAVE_STRCMPI
# define strcasecmp strcmpi
# endif
#endif
#if !HAVE_STRNCASECMP
# if HAVE_STRNICMP
# define strncasecmp strnicmp
# elif HAVE_STRNCMPI
# define strncasecmp strncmpi
# endif
#endif
#define OUTPUT_SYNC_NONE 0
#define OUTPUT_SYNC_LINE 1
#define OUTPUT_SYNC_TARGET 2
#define OUTPUT_SYNC_RECURSE 3
/* Non-GNU systems may not declare this in unistd.h. */
extern char **environ;
extern const floc *reading_file;
extern const floc **expanding_var;
extern unsigned short stopchar_map[];
extern int just_print_flag, run_silent, ignore_errors_flag, keep_going_flag;
extern int print_data_base_flag, question_flag, touch_flag, always_make_flag;
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
extern int print_version_flag, check_symlink_flag, posix_pedantic;
extern int not_parallel, second_expansion, clock_skew_detected;
extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
extern int export_all_variables;
extern unsigned long command_count;
extern const char *default_shell;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
#define GNUMAKEFLAGS_NAME "GNUMAKEFLAGS"
#define MAKEFLAGS_NAME "MAKEFLAGS"
#define MAKELEVEL_NAME "MAKELEVEL"
#define MAKELEVEL_LENGTH (CSTRLEN (MAKELEVEL_NAME))
/* Resetting the command script introduction prefix character. */
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
#define RECIPEPREFIX_DEFAULT '\t'
extern char cmd_prefix;
/* Setting warning actions. */
#define WARNINGS_NAME ".WARNINGS"
extern unsigned int no_intermediates;
#if HAVE_MKFIFO
/* It seems that mkfifo() is not working correctly, or at least not the way
GNU make wants it to work, on: GNU/Hurd, Cygwin, OS2; don't use it there. */
# if !defined(JOBSERVER_USE_FIFO) && !MK_OS_HURD && !MK_OS_CYGWIN && !MK_OS_OS2
# define JOBSERVER_USE_FIFO 1
# endif
#endif
#define JOBSERVER_AUTH_OPT "jobserver-auth"
extern char *jobserver_auth;
extern unsigned int job_slots;
extern double max_load_average;
extern const char *program;
#if MK_OS_VMS
const char *vms_command (const char *argv0);
const char *vms_progname (const char *argv0);
void vms_exit (int);
# define _exit(foo) vms_exit(foo)
# define exit(foo) vms_exit(foo)
extern char *program_name;
void
set_program_name (const char *arv0);
int
need_vms_symbol (void);
int
create_foreign_command (const char *command, const char *image);
int
vms_export_dcl_symbol (const char *name, const char *value);
int
vms_putenv_symbol (const char *string);
void
vms_restore_symbol (const char *string);
#endif
void remote_setup (void);
void remote_cleanup (void);
int start_remote_job_p (int);
int start_remote_job (char **, char **, int, int *, pid_t *, int *);
int remote_status (int *, int *, int *, int);
void block_remote_children (void);
void unblock_remote_children (void);
int remote_kill (pid_t id, int sig);
void print_variable_data_base (void);
void print_vpath_data_base (void);
extern char *starting_directory;
extern unsigned int makelevel;
extern char *version_string, *remote_description, *make_host;
extern unsigned int commands_started;
extern volatile sig_atomic_t handling_fatal_signal;
#ifndef MIN
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#endif
#ifndef MAX
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
#endif
#define MAKE_SUCCESS 0
#define MAKE_TROUBLE 1
#define MAKE_FAILURE 2
/* Set up heap debugging library dmalloc. */
#ifdef HAVE_DMALLOC_H
#include <dmalloc.h>
#endif
#ifndef initialize_main
# if MK_OS_OS2
# define initialize_main(pargc, pargv) \
{ _wildcard(pargc, pargv); _response(pargc, pargv); }
# else
# define initialize_main(pargc, pargv)
# endif
#endif
#if MK_OS_OS2
# if !defined chdir
# define chdir _chdir2
# endif
# if !defined getcwd
# define getcwd _getcwd2
# endif
/* NO_CHDIR2 causes make not to use _chdir2() and _getcwd2() instead of
chdir() and getcwd(). This avoids some error messages for the
make testsuite but restricts the drive letter support. */
# ifdef NO_CHDIR2
# warning NO_CHDIR2: usage of drive letters restricted
# undef chdir
# undef getcwd
# endif
#endif
#ifndef initialize_main
# define initialize_main(pargc, pargv)
#endif
/* Some systems (like Solaris, PTX, etc.) do not support the SA_RESTART flag
properly according to POSIX. So, we try to wrap common system calls with
checks for EINTR. Note that there are still plenty of system calls that
can fail with EINTR but this, reportedly, gets the vast majority of
failure cases. If you still experience failures you'll need to either get
a system where SA_RESTART works, or you need to avoid -j. */
#define EINTRLOOP(_v,_c) while (((_v)=_c)==-1 && errno==EINTR)
/* While system calls that return integers are pretty consistent about
returning -1 on failure and setting errno in that case, functions that
return pointers are not always so well behaved. Sometimes they return
NULL for expected behavior: one good example is readdir() which returns
NULL at the end of the directory--and _doesn't_ reset errno. So, we have
to do it ourselves here. */
#define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \
while((_v)==0 && errno==EINTR)

1099
src/misc.c Normal file

File diff suppressed because it is too large Load Diff

36
src/mkconfig.h.in Normal file
View File

@ -0,0 +1,36 @@
/* Autoconf values for use on non-POSIX systems.
Copyright (C) 2022-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
/* Name of package */
#define PACKAGE "@PACKAGE@"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
/* Define to the full name of this package. */
#define PACKAGE_NAME "@PACKAGE_NAME@"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "@PACKAGE_NAME@ @PACKAGE_VERSION@"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
/* Define to the home page for this package. */
#define PACKAGE_URL "@PACKAGE_URL@"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@PACKAGE_VERSION@"

65
src/mkcustom.h Normal file
View File

@ -0,0 +1,65 @@
/* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 2023-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
/*
This file is included at the end of config.h
That means it's included _everywhere_ as the first thing,
INCLUDING content imported from gnulib. BE AWARE!!
*/
#undef HAVE_CONFIG_H
#define HAVE_CONFIG_H 1
/* Specify we want GNU source code. This must be defined before any
system headers are included. */
#define _GNU_SOURCE 1
/* AIX requires this to be the first thing in the file. */
#if HAVE_ALLOCA_H
# include <alloca.h>
#else
# ifdef _AIX
#pragma alloca
# else
# if !defined(__GNUC__) && !MK_OS_W32
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
# endif
# endif
#endif
/* Declare function prototypes for src/misc.c functions if needed. */
#include <stddef.h>
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
int strcasecmp (const char *s1, const char *s2);
#endif
#if !HAVE_STRNCASECMP && !HAVE_STRNICMP && !HAVE_STRNCMPI
int strncasecmp (const char *s1, const char *s2, size_t n);
#endif
#if !HAVE_MEMPCPY
void *mempcpy (void *dest, const void *src, size_t n);
#endif
#if !HAVE_STPCPY
char *stpcpy (char *dest, const char *src);
#endif

168
src/os.h Normal file
View File

@ -0,0 +1,168 @@
/* Declarations for operating system interfaces for GNU Make.
Copyright (C) 2016-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#define IO_UNKNOWN 0x0001
#define IO_COMBINED_OUTERR 0x0002
#define IO_STDIN_OK 0x0004
#define IO_STDOUT_OK 0x0008
#define IO_STDERR_OK 0x0010
#if MK_OS_VMS || MK_OS_DOS
# define check_io_state() (IO_STDIN_OK|IO_STDOUT_OK|IO_STDERR_OK)
# define fd_inherit(_i) (0)
# define fd_noinherit(_i) (0)
# define fd_set_append(_i) (-1)
# define fd_reset_append(_i,_f) (void)(0)
# define os_anontmp() (-1)
#else
/* Determine the state of stdin/stdout/stderr. */
unsigned int check_io_state (void);
/* Set a file descriptor to close/not close in a subprocess. */
void fd_inherit (int fd);
void fd_noinherit (int fd);
/* If the file descriptor is for a file put it into append mode.
Return the original flags for the file descriptor, or -1 if not found. */
int fd_set_append (int fd);
/* Reset the append mode to the flags returned by fd_set_append(). */
void fd_reset_append (int fd, int flags);
/* Return a file descriptor for a new anonymous temp file, or -1. */
int os_anontmp (void);
#endif
/* This section provides OS-specific functions to support the jobserver. */
#ifdef MAKE_JOBSERVER
/* Returns 1 if the jobserver is enabled, else 0. */
unsigned int jobserver_enabled (void);
/* Called in the parent make to set up the jobserver initially. */
unsigned int jobserver_setup (int job_slots, const char *style);
/* Called in a child instance to connect to the jobserver.
Return 1 if we got a valid auth, else 0. */
unsigned int jobserver_parse_auth (const char* auth);
/* Returns an allocated buffer used to pass to child instances. */
char *jobserver_get_auth (void);
/* Returns a pointer to a static string used to indicate that the child
cannot access the jobserver, or NULL if it always can. */
const char *jobserver_get_invalid_auth (void);
/* Clear this instance's jobserver configuration.
This method might be invoked from a signal handler. */
void jobserver_clear (void);
/* Recover all the jobserver tokens and return the number we got.
Will also run jobserver_clear() as a side-effect. */
unsigned int jobserver_acquire_all (void);
/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
void jobserver_release (int is_fatal);
/* Notify the jobserver that a child exited. */
void jobserver_signal (void);
/* Get ready to start a non-recursive child. */
void jobserver_pre_child (int);
/* Complete starting a non-recursive child. */
void jobserver_post_child (int);
/* Set up to acquire a new token. */
void jobserver_pre_acquire (void);
/* Wait until we can acquire a jobserver token.
TIMEOUT is 1 if we have other jobs waiting for the load to go down;
in this case we won't wait forever, so we can check the load.
Returns 1 if we got a token, or 0 if we stopped waiting due to a child
exiting or a timeout. */
unsigned int jobserver_acquire (int timeout);
#else
#define jobserver_enabled() (0)
#define jobserver_setup(_slots, _style) (0)
#define jobserver_parse_auth(_auth) (0)
#define jobserver_get_auth() (NULL)
#define jobserver_get_invalid_auth() (NULL)
#define jobserver_clear() (void)(0)
#define jobserver_release(_fatal) (void)(0)
#define jobserver_acquire_all() (0)
#define jobserver_signal() (void)(0)
#define jobserver_pre_child(_r) (void)(0)
#define jobserver_post_child(_r) (void)(0)
#define jobserver_pre_acquire() (void)(0)
#define jobserver_acquire(_tmout) (0)
#endif /* MAKE_JOBSERVER */
#ifndef NO_OUTPUT_SYNC
/* Returns 1 if output sync is enabled, else 0. */
unsigned int osync_enabled (void);
/* Called in the parent make to set up output sync initially. */
void osync_setup (void);
/* Returns an allocated buffer containing output sync info to pass to child
instances, or NULL if not needed. */
char *osync_get_mutex (void);
/* Called in a child instance to obtain info on the output sync mutex.
Return 1 if we got a valid mutex, else 0. */
unsigned int osync_parse_mutex (const char *mutex);
/* Clean up this instance's output sync facilities.
This method might be invoked from a signal handler. */
void osync_clear (void);
/* Acquire the output sync lock. This will wait until available.
Returns 0 if there was an error getting the semaphore. */
unsigned int osync_acquire (void);
/* Release the output sync lock. */
void osync_release (void);
#else
#define osync_enabled() (0)
#define osync_setup() (void)(0)
#define osync_get_mutex() (0)
#define osync_parse_mutex(_s) (0)
#define osync_clear() (void)(0)
#define osync_acquire() (1)
#define osync_release() (void)(0)
#endif /* NO_OUTPUT_SYNC */
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
#if MK_OS_VMS || MK_OS_W32 || MK_OS_DOS
# define get_bad_stdin() (-1)
#else
int get_bad_stdin (void);
#endif
#if MK_OS_W32
#include <windows.h> /* Needed for HANDLE */
HANDLE get_handle_for_fd (int);
#endif

559
src/output.c Normal file
View File

@ -0,0 +1,559 @@
/* Output to stdout / stderr for GNU Make
Copyright (C) 2013-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "os.h"
#include "output.h"
/* GNU Make no longer supports pre-ANSI89 environments. */
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
# include <sys/file.h>
#endif
#if MK_OS_W32
# include <windows.h>
# include <io.h>
# include "sub_proc.h"
#endif
struct output *output_context = NULL;
unsigned int stdio_traced = 0;
#define OUTPUT_NONE (-1)
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
/* Write a string to the current STDOUT or STDERR. */
static void
_outputs (struct output *out, int is_err, const char *msg)
{
FILE *f;
if (out && out->syncout)
{
int fd = is_err ? out->err : out->out;
if (fd != OUTPUT_NONE)
{
size_t len = strlen (msg);
int r;
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
writebuf (fd, msg, len);
return;
}
}
f = is_err ? stderr : stdout;
fputs (msg, f);
fflush (f);
}
/* Write a message indicating that we've just entered or
left (according to ENTERING) the current directory. */
static int
log_working_directory (int entering)
{
static char *buf = NULL;
static size_t len = 0;
size_t need;
const char *fmt;
char *p;
/* Get enough space for the longest possible output. */
need = strlen (program) + INTSTR_LENGTH + 2 + 1;
if (starting_directory)
need += strlen (starting_directory);
/* Use entire sentences to give the translators a fighting chance. */
if (makelevel == 0)
if (starting_directory == 0)
if (entering)
fmt = _("%s: Entering an unknown directory\n");
else
fmt = _("%s: Leaving an unknown directory\n");
else
if (entering)
fmt = _("%s: Entering directory '%s'\n");
else
fmt = _("%s: Leaving directory '%s'\n");
else
if (starting_directory == 0)
if (entering)
fmt = _("%s[%u]: Entering an unknown directory\n");
else
fmt = _("%s[%u]: Leaving an unknown directory\n");
else
if (entering)
fmt = _("%s[%u]: Entering directory '%s'\n");
else
fmt = _("%s[%u]: Leaving directory '%s'\n");
need += strlen (fmt);
if (need > len)
{
buf = xrealloc (buf, need);
len = need;
}
p = buf;
if (print_data_base_flag)
{
*(p++) = '#';
*(p++) = ' ';
}
if (makelevel == 0)
if (starting_directory == 0)
sprintf (p, fmt , program);
else
sprintf (p, fmt, program, starting_directory);
else if (starting_directory == 0)
sprintf (p, fmt, program, makelevel);
else
sprintf (p, fmt, program, makelevel, starting_directory);
_outputs (NULL, 0, buf);
return 1;
}
#ifndef NO_OUTPUT_SYNC
/* Support routine for output_sync() */
static void
pump_from_tmp (int from, FILE *to)
{
static char buffer[8192];
#if MK_OS_W32
int prev_mode;
/* "from" is opened by open_tmpfd, which does it in binary mode, so
we need the mode of "to" to match that. */
prev_mode = _setmode (fileno (to), _O_BINARY);
#endif
if (lseek (from, 0, SEEK_SET) == -1)
perror ("lseek()");
while (1)
{
int len;
EINTRLOOP (len, read (from, buffer, sizeof (buffer)));
if (len < 0)
perror ("read()");
if (len <= 0)
break;
if (fwrite (buffer, len, 1, to) < 1)
{
perror ("fwrite()");
break;
}
fflush (to);
}
#if MK_OS_W32
/* Switch "to" back to its original mode, so that log messages by
Make have the same EOL format as without --output-sync. */
_setmode (fileno (to), prev_mode);
#endif
}
/* Returns a file descriptor to a temporary file, that will be automatically
deleted on exit. */
int
output_tmpfd (void)
{
int fd = get_tmpfd (NULL);
fd_set_append (fd);
return fd;
}
/* Adds file descriptors to the child structure to support output_sync; one
for stdout and one for stderr as long as they are open. If stdout and
stderr share a device they can share a temp file too.
Will reset output_sync on error. */
static void
setup_tmpfile (struct output *out)
{
static unsigned int in_setup = 0;
unsigned int io_state;
/* If something fails during setup we might recurse back into this function
while writing errors. Make sure we don't do so infinitely. */
if (in_setup)
return;
in_setup = 1;
io_state = check_io_state ();
if (NONE_SET (io_state, IO_STDOUT_OK|IO_STDERR_OK))
{
/* This is probably useless since stdout/stderr aren't working. */
perror_with_name ("output-sync suppressed: ", "stderr");
goto error;
}
if (ANY_SET (io_state, IO_STDOUT_OK))
{
int fd = output_tmpfd ();
if (fd < 0)
goto error;
fd_noinherit (fd);
out->out = fd;
}
if (ANY_SET (io_state, IO_STDERR_OK))
{
if (out->out != OUTPUT_NONE && ANY_SET (io_state, IO_COMBINED_OUTERR))
out->err = out->out;
else
{
int fd = output_tmpfd ();
if (fd < 0)
goto error;
fd_noinherit (fd);
out->err = fd;
}
}
in_setup = 0;
return;
/* If we failed to create a temp file, disable output sync going forward. */
error:
O (error, NILF,
_("cannot open output-sync lock file: suppressing output-sync"));
output_close (out);
output_sync = OUTPUT_SYNC_NONE;
osync_clear ();
in_setup = 0;
}
/* Synchronize the output of jobs in -j mode to keep the results of
each job together. This is done by holding the results in temp files,
one for stdout and potentially another for stderr, and only releasing
them to "real" stdout/stderr when a semaphore can be obtained. */
void
output_dump (struct output *out)
{
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
int outfd_not_empty = FD_NOT_EMPTY (out->out);
int errfd_not_empty = FD_NOT_EMPTY (out->err);
if (outfd_not_empty || errfd_not_empty)
{
int traced = 0;
/* Try to acquire the semaphore. If it fails, dump the output
unsynchronized; still better than silently discarding it.
We want to keep this lock for as little time as possible. */
if (!osync_acquire ())
{
O (error, NILF,
_("warning: cannot acquire output lock: disabling output sync"));
osync_clear ();
}
/* Log the working directory for this dump. */
if (output_sync != OUTPUT_SYNC_RECURSE && should_print_dir ())
traced = log_working_directory (1);
if (outfd_not_empty)
pump_from_tmp (out->out, stdout);
if (errfd_not_empty && out->err != out->out)
pump_from_tmp (out->err, stderr);
if (traced)
log_working_directory (0);
/* Exit the critical section. */
osync_release ();
/* Truncate and reset the output, in case we use it again. */
if (out->out != OUTPUT_NONE)
{
int e;
lseek (out->out, 0, SEEK_SET);
EINTRLOOP (e, ftruncate (out->out, 0));
}
if (out->err != OUTPUT_NONE && out->err != out->out)
{
int e;
lseek (out->err, 0, SEEK_SET);
EINTRLOOP (e, ftruncate (out->err, 0));
}
}
}
#endif /* NO_OUTPUT_SYNC */
static int stdout_flags = -1;
static int stderr_flags = -1;
void
output_init (struct output *out)
{
if (out)
{
out->out = out->err = OUTPUT_NONE;
out->syncout = !!output_sync;
return;
}
/* Force stdout/stderr into append mode (if they are files) to ensure
parallel jobs won't lose output due to overlapping writes. */
stdout_flags = fd_set_append (fileno (stdout));
stderr_flags = fd_set_append (fileno (stderr));
}
void
output_close (struct output *out)
{
if (! out)
{
if (stdio_traced)
log_working_directory (0);
fd_reset_append(fileno (stdout), stdout_flags);
fd_reset_append(fileno (stderr), stderr_flags);
return;
}
#ifndef NO_OUTPUT_SYNC
output_dump (out);
#endif
if (out->out >= 0)
close (out->out);
if (out->err >= 0 && out->err != out->out)
close (out->err);
output_init (out);
}
/* We're about to generate output: be sure it's set up. */
void
output_start (void)
{
#ifndef NO_OUTPUT_SYNC
/* If we're syncing output make sure the temporary file is set up. */
if (output_context && output_context->syncout)
if (! OUTPUT_ISSET(output_context))
setup_tmpfile (output_context);
#endif
/* If we're not syncing this output per-line or per-target, make sure we emit
the "Entering..." message where appropriate. */
if (output_sync == OUTPUT_SYNC_NONE || output_sync == OUTPUT_SYNC_RECURSE)
if (! stdio_traced && should_print_dir ())
stdio_traced = log_working_directory (1);
}
void
outputs (int is_err, const char *msg)
{
if (! msg || *msg == '\0')
return;
output_start ();
_outputs (output_context, is_err, msg);
}
static struct fmtstring
{
char *buffer;
size_t size;
} fmtbuf = { NULL, 0 };
static char *
get_buffer (size_t need)
{
/* Make sure we have room. NEED includes space for \0. */
if (need > fmtbuf.size)
{
fmtbuf.size += need * 2;
fmtbuf.buffer = xrealloc (fmtbuf.buffer, fmtbuf.size);
}
fmtbuf.buffer[need-1] = '\0';
return fmtbuf.buffer;
}
/* Print a message on stdout. */
void
message (int prefix, size_t len, const char *fmt, ...)
{
va_list args;
char *start;
char *p;
len += strlen (fmt) + strlen (program) + INTSTR_LENGTH + 4 + 1 + 1;
start = p = get_buffer (len);
if (prefix)
p += (makelevel == 0
? sprintf (p, "%s: ", program)
: sprintf (p, "%s[%u]: ", program, makelevel));
va_start (args, fmt);
vsprintf (p, fmt, args);
va_end (args);
strcat (p, "\n");
assert (start[len-1] == '\0');
outputs (0, start);
}
/* Print an error message. */
void
error (const floc *flocp, size_t len, const char *fmt, ...)
{
va_list args;
char *start;
char *p;
len += (strlen (fmt) + strlen (program)
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
+ INTSTR_LENGTH + 4 + 1 + 1);
start = p = get_buffer (len);
p += (flocp && flocp->filenm
? sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno + flocp->offset)
: makelevel == 0
? sprintf (p, "%s: ", program)
: sprintf (p, "%s[%u]: ", program, makelevel));
va_start (args, fmt);
vsprintf (p, fmt, args);
va_end (args);
strcat (p, "\n");
assert (start[len-1] == '\0');
outputs (1, start);
}
/* Print an error message and exit. */
void
fatal (const floc *flocp, size_t len, const char *fmt, ...)
{
const char *stop = _(". Stop.\n");
va_list args;
char *start;
char *p;
len += (strlen (fmt) + strlen (program)
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
+ INTSTR_LENGTH + 8 + strlen (stop) + 1);
start = p = get_buffer (len);
p += (flocp && flocp->filenm
? sprintf (p, "%s:%lu: *** ", flocp->filenm,
flocp->lineno + flocp->offset)
: makelevel == 0
? sprintf (p, "%s: *** ", program)
: sprintf (p, "%s[%u]: *** ", program, makelevel));
va_start (args, fmt);
vsprintf (p, fmt, args);
va_end (args);
strcat (p, stop);
assert (start[len-1] == '\0');
outputs (1, start);
die (MAKE_FAILURE);
}
/* Format a message and return a pointer to an internal buffer. */
char *
format (const char *prefix, size_t len, const char *fmt, ...)
{
va_list args;
size_t plen = prefix ? strlen (prefix) : 0;
char *start;
char *p;
len += strlen (fmt) + plen + 1;
start = p = get_buffer (len);
if (plen)
p = mempcpy (p, prefix, plen);
va_start (args, fmt);
vsprintf (p, fmt, args);
va_end (args);
return start;
}
/* Print an error message from errno. */
void
perror_with_name (const char *str, const char *name)
{
const char *err = strerror (errno);
OSSS (error, NILF, _("%s%s: %s"), str, name, err);
}
/* Print an error message from errno and exit. */
void
pfatal_with_name (const char *name)
{
const char *err = strerror (errno);
OSS (fatal, NILF, _("%s: %s"), name, err);
/* NOTREACHED */
}
/* Print a message about out of memory (not using more heap) and exit.
Our goal here is to be sure we don't try to allocate more memory, which
means we don't want to use string translations or normal cleanup. */
void
out_of_memory ()
{
writebuf (FD_STDOUT, program, strlen (program));
writebuf (FD_STDOUT, STRING_SIZE_TUPLE (": *** virtual memory exhausted\n"));
exit (MAKE_FAILURE);
}

58
src/output.h Normal file
View File

@ -0,0 +1,58 @@
/* Output to stdout / stderr for GNU Make
Copyright (C) 2013-2024 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. */
struct output
{
int out;
int err;
unsigned int syncout:1; /* True if we want to synchronize output. */
};
extern struct output *output_context;
extern unsigned int stdio_traced;
#define FD_STDIN (fileno (stdin))
#define FD_STDOUT (fileno (stdout))
#define FD_STDERR (fileno (stderr))
#define OUTPUT_SET(_new) do{ output_context = (_new)->syncout ? (_new) : NULL; }while(0)
#define OUTPUT_UNSET() do{ output_context = NULL; }while(0)
#define OUTPUT_TRACED() do{ stdio_traced = 1; }while(0)
#define OUTPUT_IS_TRACED() (!!stdio_traced)
/* Write a buffer directly to the given file descriptor.
This handles errors etc. */
int output_write (int fd, const void *buffer, size_t len);
/* Initialize and close a child output structure: if NULL do this program's
output (this should only be done once). */
void output_init (struct output *out);
void output_close (struct output *out);
/* In situations where output may be about to be displayed but we're not
sure if we've set it up yet, call this. */
void output_start (void);
/* Show a message on stdout or stderr. Will start the output if needed. */
void outputs (int is_err, const char *msg);
#if defined(NO_OUTPUT_SYNC)
# define output_dump(_o) (void)(0)
#else
/* Dump any child output content to stdout, and reset it. */
void output_dump (struct output *out);
#endif

Some files were not shown because too many files have changed in this diff Show More