summaryrefslogtreecommitdiff
path: root/NEWS
Commit message (Collapse)AuthorAgeFilesLines
* Release GNU Make 4.44.4Paul Smith2022-10-311-2/+2
| | | | | | * NEWS: Update the version and date. * configure.ac: Update the version. * doc/make.texi: Update the EDITION.
* Release GNU Make 4.3.924.3.92Paul Smith2022-10-241-6/+6
| | | | | * configure.ac: Modify the release version. * NEWS: Update the version and date.
* * NEWS: Release GNU make 4.3.914.3.91Paul Smith2022-10-181-2/+3
|
* * NEWS: Use GNU Make instead of GNU makePaul Smith2022-10-181-23/+23
| | | | | | | | | | | | * 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.
* Update URLs to use https rather than httpPaul Smith2022-10-181-3/+3
| | | | | * (all): Change http:// to https:// * README.W32: Remove invalid link to mingw.org.
* * NEWS: Deprecate XenixPaul Smith2022-10-031-0/+1
|
* [SV 63098] Temporarily revert the change to pattern rule behaviorPaul Smith2022-10-021-6/+16
| | | | | | | | | | | | | | | | | | | | 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.
* * NEWS: Announce deprecation of OS/2 and AmigaOS portsPaul Smith2022-10-021-3/+10
|
* * configure.ac: Update to GNU make 4.3.91Paul Smith2022-09-251-9/+18
| | | | * NEWS: Update the version and clarify some backward-compat issues.
* Release GNU make 4.3.904.3.90Paul Smith2022-09-201-2/+2
| | | | | | * NEWS: Update for the prerelease. * bootstrap.conf: Choose the latest stable gnulib. * README.git: Updates.
* * doc/make.texi (Parallel Disable): Add clarifications.Paul Smith2022-09-131-2/+4
| | | | * NEWS: Suggest how to change makefiles that use $(MAKEFLAGS).
* [SV 13862] Implement the .WAIT special targetPaul Smith2022-09-121-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Support the MAKE_TMPDIR environment variablePaul Smith2022-09-111-0/+8
| | | | | | | | | | | 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.
* [SV 63040] shell: Fall back to the callers environmentPaul Smith2022-09-101-1/+2
| | | | | | | | | | | | | | | | | | | 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.
* Rework output sync to lock a temp file on POSIXPaul Smith2022-08-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* Support implementing the jobserver using named pipesPaul Smith2022-08-021-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [SV 62706] Only second-expand targets that might be builtDmitry Goncharov2022-07-301-0/+5
| | | | | | | | | | | | | | | | | | | | | 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.
* Disable the jobserver in non-recursive childrenPaul Smith2022-07-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [SV 10593] Export variables to $(shell ...) commandsPaul Smith2022-07-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | 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.
* [SV 62100] Add '--shuffle' option supportSergei Trofimovich2022-06-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * <all>: Update copyright notices.Paul Smith2022-02-101-1/+1
|
* * tests/scripts/features/implicit_search: [SV 48643] Cleanups.Paul Smith2022-02-061-9/+9
|
* * src/job.c (load_too_high): Re-enable Linux /proc/loadavg checks.Paul Smith2022-02-061-0/+6
| | | | | | | 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.
* * NEWS: Update with author detailsPaul Smith2021-11-281-0/+2
|
* Introduce $(intcmp ...) for numerical comparisonJouke Witteveen2021-11-281-0/+4
| | | | | | | | | | | | 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.
* [SV 48643] Update the implicit rule search docsPaul Smith2021-11-271-0/+8
| | | | | | * 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.
* [SV 45211] Parse MAKEFLAGS immediately when it's resetPaul Smith2021-09-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [SV 60412] Allow -I- to throw out the current directory pathPaul Smith2021-09-031-0/+4
| | | | | | | | | | | | | 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-.
* * NEWS: Add a few missing attributionsPaul Smith2021-07-251-4/+4
| | | | * AUTHORS: Add some missing attributions
* [SV 60297] Add .NOTINTERMEDIATE special targetDmitry Goncharov2021-07-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [SV 58341] Add non-trivial options to $(MAKEFLAGS)Paul Smith2021-05-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* More correctly describe the scope of variablesJouke Witteveen2021-03-071-2/+2
| | | | | * NEWS: Use "local" instead of the incorrect "lexically-scoped". * doc/make.texi: Refer to let/foreach variables as local variables.
* Create $(let ...) providing lexically scoped variablesJouke Witteveen2020-12-061-0/+6
| | | | | | | | | 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.
* [SV 59169] Add --debug=why and --debug=print optionsPaul Smith2020-12-051-0/+8
| | | | | | | | | | | | | | | | | | | | 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.
* [SV 41273] Allow the directory cache to be invalidatedPaul Smith2020-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Support "unexport" in target-specific variables.Paul Smith2020-11-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [SV 35711] Check for special targets earlierPaul Smith2020-11-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
* * NEWS: [SV 58435] Document minimum C compiler version requirementPaul Smith2020-07-191-0/+6
| | | | * configure.ac: Require c99 via AC_PROG_CC_C99
* [SV 58735] Define the order that makefiles are rebuilt.Paul Smith2020-07-191-1/+8
| | | | | | | | | | | | 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.
* * NEWS: Fix some tortured grammar.Paul Smith2020-05-141-4/+3
|
* Obey order of multiple print/no-print directory optionsPaul Smith2020-03-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * NEWS: Update 4.3 with information on .SILENT / -sPaul Smith2020-03-291-1/+9
|
* * NEWS: Mention the new tcc support.Eli Zaretskii2020-02-291-0/+2
|
* Update to GNU make 4.3.90Paul Smith2020-01-201-1/+8
| | | | | * NEWS: Add a 4.3.90 section and update Savannah bug URL * configure.ac (AC_INIT): Change release to 4.3.90
* GNU Make release 4.34.3Paul Smith2020-01-191-11/+11
| | | | | | * NEWS: Update for the release * configure.ac: New release number * doc/make.texi: New edition number
* [SV 40657] Reinstate old behavior for suffix rules with prereqsPaul Smith2020-01-191-4/+12
| | | | | | | | | | | | | | | | | 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.
* * NEWS: Clarify authorship of new features.Paul Smith2020-01-041-2/+3
|
* Release GNU make 4.2.934.2.93Paul Smith2020-01-031-2/+2
| | | | | * NEWS: Update the release and date * configure.ac: Update the release number
* Update copyright statements for 2020Paul Smith2020-01-031-1/+1
|
* Support the .EXTRA_PREREQS special variablePaul Smith2020-01-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.