diff options
author | Paul Smith <psmith@gnu.org> | 2006-01-04 14:45:16 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2006-01-04 14:45:16 +0000 |
commit | 64e16d6c00a59fcff9681e032ac8dbec46d3e960 (patch) | |
tree | 48a8511b273fdfc555442951b97cca3fceb79ee6 | |
parent | 3d0d9e5d75eecd48d106918e0f568590f67fc26a (diff) | |
download | gunmake-64e16d6c00a59fcff9681e032ac8dbec46d3e960.tar.gz |
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.
-rw-r--r-- | ChangeLog | 60 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | NEWS | 35 | ||||
-rw-r--r-- | README.W32.template | 28 | ||||
-rw-r--r-- | config.h-vms.template | 2 | ||||
-rw-r--r-- | config.h.W32.template | 8 | ||||
-rw-r--r-- | dir.c | 4 | ||||
-rw-r--r-- | doc/make.texi | 196 | ||||
-rw-r--r-- | job.c | 4 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | make.1 | 11 | ||||
-rw-r--r-- | makefile.com | 16 | ||||
-rw-r--r-- | read.c | 6 | ||||
-rw-r--r-- | readme.vms | 62 | ||||
-rw-r--r-- | remake.c | 5 | ||||
-rw-r--r-- | tests/ChangeLog | 6 | ||||
-rw-r--r-- | tests/README | 75 | ||||
-rw-r--r-- | tests/scripts/variables/automatic | 21 | ||||
-rw-r--r-- | vmsfunctions.c | 3 | ||||
-rw-r--r-- | vmsify.c | 2 |
20 files changed, 396 insertions, 156 deletions
@@ -1,3 +1,63 @@ +2006-01-04 Paul D. Smith <psmith@gnu.org> + + * readme.vms: Updates for case-insensitive VMS file systems from + Hartmut Becker <Hartmut.Becker@hp.com>. + * dir.c (vms_hash): Ditto. + * vmsify.c (copyto): Ditto. + * vmsfunctions.c (readdir): Ditto. + + * make.1: Add a section on the exit codes for make. + + * doc/make.texi: A number of minor updates to the documentation. + +2006-01-03 Paul D. Smith <psmith@gnu.org> + + * remake.c (update_file_1): Mark a prerequisite changed if it + doesn't exist. + + * read.c (eval): Be sure to strip off trailing whitespace from the + prerequisites list properly. Also, initialize all fields in + struct dep when creating a new one. + +2005-12-28 Paul D. Smith <psmith@gnu.org> + + * config.h.W32.template [WINDOWS32]: Add in some pragmas to + disable warnings for MSC. + Patch by Rob Tulloh <rtulloh@yahoo.com>. + +2005-12-18 Paul D. Smith <psmith@gnu.org> + + * Makefile.am (EXTRA_DIST): Distribute prepare_w32.bat. + +2005-12-17 Eli Zaretskii <eliz@gnu.org> + + * doc/make.texi (Execution): Add a footnote about changes in + handling of backslash-newline sequences. Mention the differences + on MS-DOS and MS-Windows. + + * NEWS: More details about building the MinGW port and a pointer + to README.W32. Fix the section name that describes the new + backward-incompatible processing of backslash-newline sequences. + The special processing of SHELL set to "cmd" is only relevant to + MS-Windows, not MS-DOS. + +2005-12-17 Eli Zaretskii <eliz@gnu.org> + + * main.c (handle_runtime_exceptions): Cast exrec->ExceptionAddress + to DWORD, to avoid compiler warnings. + * job.c (exec_command): Cast hWaitPID and hPID to DWORD, and + use %ld in format, to avoid compiler warnings. + + * doc/make.texi (Special Targets): Fix a typo. + (Appending): Fix cross-reference to Setting. + (Special Variables, Secondary Expansion, File Name Functions) + (Flavor Function, Pattern Match, Quick Reference): Ensure two + periods after a sentence. + (Execution): Add @: after "e.g.". + (Environment): Fix punctuation. + (Target-specific, Call Function, Quick Reference): Add @: after "etc." + (Shell Function, Target-specific): Add @: after "vs." + 2005-12-14 Boris Kolpackov <boris@kolpackov.net> * read.c (record_target_var): Initialize variable's export field diff --git a/Makefile.am b/Makefile.am index 96b3075..2c54794 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,7 +59,7 @@ EXTRA_DIST = README build.sh.in $(man_MANS) \ README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \ README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\ README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \ - make_msvc_net2003.sln make_msvc_net2003.vcproj \ + make_msvc_net2003.sln make_msvc_net2003.vcproj prepare_w32.bat\ readme.vms makefile.vms makefile.com config.h-vms \ vmsdir.h vmsfunctions.c vmsify.c @@ -137,7 +137,7 @@ check-loadavg: loadavg$(EXEEXT) -./loadavg$(EXEEXT) # The loadavg function is invoked during "make check" to test getloadavg. -noinst_PROGRAMS = loadavg +check_PROGRAMS = loadavg nodist_loadavg_SOURCES = getloadavg.c loadavg_CPPFLAGS = -DTEST loadavg_LDADD = @GETLOADAVG_LIBS@ @@ -1,6 +1,6 @@ GNU make NEWS -*-indented-text-*- History of user-visible changes. - 12 December 2005 + 28 December 2005 Copyright (C) 2002,2003,2004,2005 Free Software Foundation, Inc. See the end for copying conditions. @@ -14,7 +14,9 @@ Version 3.81beta4 * GNU make is ported to OS/2. -* GNU make is ported to MinGW. +* GNU make is ported to MinGW. The MinGW build is only supported by + the build_w32.bat batch file; see the file README.W32 for more + details. * WARNING: Backward-incompatibility! GNU make now implements a generic "second expansion" feature on the @@ -36,8 +38,11 @@ Version 3.81beta4 * WARNING: Backward-incompatibility! In order to comply with POSIX, the way in which GNU make processes - backslash-newline sequences in command strings has changed. See the - GNU make manual section "Shell Execution" for details. + backslash-newline sequences in command strings has changed. If your + makefiles use backslash-newline sequences inside of single-quoted + strings in command scripts you will be impacted by this change. See + the GNU make manual section "Command Execution" (node "Execution") for + details. * New command-line option: -L (--check-symlink-times). On systems that support symbolic links, if this option is given then GNU make will @@ -45,7 +50,7 @@ Version 3.81beta4 used to resolve target files. The default behavior remains as it always has: use the modification time of the actual target file only. -* The "else" conditional line can now be followed by any other legal +* The "else" conditional line can now be followed by any other valid conditional on the same line: this does not increase the depth of the conditional nesting, so only one "endif" is required to close the conditional. @@ -98,10 +103,13 @@ Version 3.81beta4 an enhancement to POSIX, if you export the make variable SHELL then it will be set in the environment, just as before. -* On DOS and MS Windows systems, explicitly setting SHELL to a pathname - ending in "cmd" or "cmd.exe" (case-insensitive) will force GNU make to - use the DOS command interpreter in batch mode even if a UNIX-like - shell could be found on the system. +* On MS Windows systems, explicitly setting SHELL to a pathname ending + in "cmd" or "cmd.exe" (case-insensitive) will force GNU make to use + the DOS command interpreter in batch mode even if a UNIX-like shell + could be found on the system. + +* On VMS there is now support for case-sensitive filesystems such as ODS5. + See the readme.vms file for information. * Updated to autoconf 2.59, automake 1.9.5, and gettext 0.14.1. Users should not be impacted. @@ -110,6 +118,10 @@ Version 3.81beta4 Belarusian, Finnish, Kinyarwandan, and Irish. Many updated translations. +A complete list of bugs fixed in this version is available here: + + http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101 + Version 3.80 @@ -187,6 +199,11 @@ Version 3.80 See ABOUT-NLS for more information. * Updated to autoconf 2.54 and automake 1.7. Users should not be impacted. + +A complete list of bugs fixed in this version is available here: + + http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102 + Version 3.79.1 diff --git a/README.W32.template b/README.W32.template index c9b7bfa..f40884e 100644 --- a/README.W32.template +++ b/README.W32.template @@ -1,6 +1,10 @@ -Port of GNU make to Microsoft Windows 95/98/NT/2000/XP -Builds natively with MSVC 2.x, 4.x, 5.x, 6.x and MSVC.NET 7.x. -Also builds with the MinGW port of GCC 3.x (tested with GCC 3.4.2). +This version of GNU make has been tested on Microsoft Windows 2000/XP/2003. +It has also been used on Windows 95/98/NT, and on OS/2. + +It builds natively with MSVC 2.x, 4.x, 5.x, 6.x, and 2003 as well as +.NET 7.x and .NET 2003. + +It builds with the MinGW port of GCC 3.x (tested with GCC 3.4.2). The Windows 32-bit port of GNU make is maintained jointly by various people. It was originally made by Rob Tulloh. @@ -234,23 +238,23 @@ SAMBA/NTFS/VFAT: 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 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. + 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. + 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: diff --git a/config.h-vms.template b/config.h-vms.template index c252b9c..e385b88 100644 --- a/config.h-vms.template +++ b/config.h-vms.template @@ -350,7 +350,7 @@ /* Define for case insensitve filenames */ #define HAVE_CASE_INSENSITIVE_FS 1 -/* VMS specific, define it if you want to use case sensitve targets */ +/* 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 */ diff --git a/config.h.W32.template b/config.h.W32.template index 956fc17..160f120 100644 --- a/config.h.W32.template +++ b/config.h.W32.template @@ -1,5 +1,13 @@ /* config.h.W32 -*-C-*- */ +/* 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:4127) /* conditional expression is constant */ +# pragma warning(disable:4702) /* unreachable code */ +#endif + /* Define to 1 if the `closedir' function returns void instead of `int'. */ /* #undef CLOSEDIR_VOID */ @@ -155,7 +155,11 @@ vms_hash (char *name) while (*name) { unsigned char uc = *name; +#ifdef HAVE_CASE_INSENSITIVE_FS h = (h << 4) + (isupper (uc) ? tolower (uc) : uc); +#else + h = (h << 4) + uc; +#endif name++; g = h & 0xf0000000; if (g) diff --git a/doc/make.texi b/doc/make.texi index ed864f9..b0de845 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -10,8 +10,8 @@ @set RCSID $Id$ @set EDITION 0.70 @set VERSION 3.81 -@set UPDATED 07 May 2005 -@set UPDATE-MONTH May 2005 +@set UPDATED 28 Dec 2005 +@set UPDATE-MONTH Dec 2005 @c ISBN provided by Lisa M. Opus Goldstein <opus@gnu.org>, 5 May 2004 @set ISBN 1-882114-83-5 @@ -1290,7 +1290,7 @@ Sets the default goal to be used if no targets were specified on the command line (@pxref{Goals, , Arguments to Specify the Goals}). The @code{.DEFAULT_GOAL} variable allows you to discover the current default goal, restart the default goal selection algorithm by clearing -its value, or to explicitly set the default goal. The following +its value, or to explicitly set the default goal. The following example illustrates these cases: @example @@ -1738,7 +1738,7 @@ when the target is an archive member, the target member name. The rule for this target. @code{$$^} and @code{$$+} evaluate to the list of all prerequisites of rules @emph{that have already appeared} for the same target (@code{$$+} with repetitions and @code{$$^} -without). The following example will help illustrate these behaviors: +without). The following example will help illustrate these behaviors: @example .SECONDEXPANSION: @@ -1750,12 +1750,12 @@ foo: foo.2 bar.2 $$< $$^ $$+ # line #2 foo: foo.3 bar.3 $$< $$^ $$+ # line #3 @end example -For the first line, all three variables (@code{$$<}, @code{$$^}, and -@code{$$+}) expand to the empty string. For the second line, they will -have values @code{foo.1}, @code{foo.1 bar.1}, and @code{foo.1 bar.1} -respectively. For the third they will have values @code{foo.1}, -@code{foo.1 bar.1 foo.2 bar.2}, and @code{foo.1 bar.1 foo.2 bar.2} -respectively. +In the first prerequisite list, all three variables (@code{$$<}, +@code{$$^}, and @code{$$+}) expand to the empty string. In the +second, they will have values @code{foo.1}, @code{foo.1 bar.1}, and +@code{foo.1 bar.1} respectively. In the third they will have values +@code{foo.1}, @code{foo.1 bar.1 foo.2 bar.2}, and @code{foo.1 bar.1 +foo.2 bar.2} respectively. Rules undergo secondary expansion in makefile order, except that the rule with the command script is always evaluated last. @@ -2680,8 +2680,8 @@ build the rest of the directories even when one fails. This can be overcome by adding shell commands to note the error and exit, but then it will do so even if @code{make} is invoked with the @code{-k} option, which is unfortunate. Second, and perhaps more importantly, you cannot -take advantage of the parallel build capabilities of make using this -method, since there is only one rule. +take advantage of @code{make}'s ability to build targets in parallel +(@pxref{Parallel, ,Parallel Execution}), since there is only one rule. By declaring the subdirectories as phony targets (you must do this as the subdirectory obviously always exists; otherwise it won't be built) @@ -2907,7 +2907,7 @@ intermediate). @findex .SECONDEXPANSION @item .SECONDEXPANSION -If @code{.SECONDEXPANSION} is mentioned as a target anwyeren in the +If @code{.SECONDEXPANSION} is mentioned as a target anywhere in the makefile, then all prerequisite lists defined @emph{after} it appears will be expanded a second time after all makefiles have been read in. @xref{Secondary Expansion, ,Secondary Expansion}. @@ -3424,7 +3424,7 @@ called @file{@var{name}.d} from a C source file called @file{@var{name}.c}: @smallexample @group %.d: %.c - @set -e; rm -f $@@; \ + @@set -e; rm -f $@@; \ $(CC) -M $(CPPFLAGS) $< > $@@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@@ : ,g' < $@@.$$$$ > $@@; \ rm -f $@@.$$$$ @@ -3585,21 +3585,28 @@ by making a new subshell for each line. (In practice, @code{make} may take shortcuts that do not affect the results.) @cindex @code{cd} (shell command) -@strong{Please note:} this implies that shell commands such as @code{cd} -that set variables local to each process will not affect the following -command lines. @footnote{On MS-DOS, the value of current working -directory is @strong{global}, so changing it @emph{will} affect the -following command lines on those systems.} If you want to use @code{cd} -to affect the next command, put the two on a single line with a -semicolon between them. Then @code{make} will consider them a single -command and pass them, together, to a shell which will execute them in -sequence. For example: +@strong{Please note:} this implies that shell commands such as +@code{cd} that set variables local to each process will not affect the +following command lines.@footnote{On MS-DOS, the value of current +working directory is @strong{global}, so changing it @emph{will} +affect the following command lines on those systems.} If you want to +use @code{cd} to affect the next command, put them on a single line. +Then @code{make} will consider them a single command and pass them +both to a single shell which will execute them in sequence. For +example: @example foo : bar/lose - cd bar; gobble lose > ../foo + cd $(@@D) && gobble $(@@F) > ../$@@ @end example +@noindent +Here we use the shell AND operator (@code{&&}) so that if the +@code{cd} command fails, the script will fail without trying to invoke +the @code{gobble} command in the wrong directory, which could very +easily cause problems (in this case it would certainly cause +@file{../foo} to be truncated, at least). + @cindex commands, backslash (@code{\}) in @cindex commands, quoting newlines in @cindex backslash (@code{\}), in commands @@ -3620,15 +3627,22 @@ all : space @@echo no\ space + @@echo one \ + space + @@echo one\ + space @end group @end example -consists of two separate shell commands where the output is: +@noindent +consists of four separate shell commands where the output is: @example @group nospace nospace +one space +one space @end group @end example @@ -3642,6 +3656,7 @@ all : ; @@echo 'hello \ @end group @end example +@noindent will run one shell with a command script of: @example @@ -3652,6 +3667,7 @@ world' ; echo "hello \ @end group @end example +@noindent which, according to shell quoting rules, will yield the following output: @example @@ -3662,6 +3678,13 @@ hello world @end group @end example +@noindent +Notice how the backslash/newline pair was removed inside the string quoted +with double quotes (@code{"..."}), but not from the string quoted with single +quotes (@code{'...'}). This is the way the default shell (@file{/bin/sh}) +handles backslash/newline pairs. If you specify a different shell in your +makefiles it may treat them differently. + @vindex SHELL The program used as the shell is taken from the variable @code{SHELL}. By default, the program @file{/bin/sh} is used. @@ -3719,7 +3742,7 @@ pathname of the shell, exactly as things are on Unix. The effect of the above DOS-specific processing is that a Makefile that says @samp{SHELL = /bin/sh} (as many Unix makefiles do), will work -on MS-DOS unaltered if you have e.g. @file{sh.exe} installed in some +on MS-DOS unaltered if you have e.g.@: @file{sh.exe} installed in some directory along your @code{PATH}. @cindex environment, @code{SHELL} in @@ -5287,7 +5310,7 @@ definition of the variable. If you defined it first with @samp{:=}, making it a simply-expanded variable, @samp{+=} adds to that simply-expanded definition, and expands the new text before appending it to the old value just as @samp{:=} does -(@pxref{Setting, ,Setting Variables} for a full explanation of @samp{:=}). +(see @ref{Setting, ,Setting Variables}, for a full explanation of @samp{:=}). In fact, @example @@ -5528,7 +5551,7 @@ and therefore are not affected by the value in the environment.) When @code{make} runs a command script, variables defined in the makefile are placed into the environment of that command. This allows -you to pass values to sub-@code{make} invocations. (@pxref{Recursion, +you to pass values to sub-@code{make} invocations (@pxref{Recursion, ,Recursive Use of @code{make}}). By default, only variables that came from the environment or the command line are passed to recursive invocations. You can use the @code{export} directive to pass other @@ -5605,7 +5628,7 @@ conditional (@samp{?=}). All variables that appear within the target: thus, any previously-defined target-specific variable values will be in effect. Note that this variable is actually distinct from any ``global'' value: the two variables do not have to have the same -flavor (recursive vs. static). +flavor (recursive vs.@: static). Target-specific variables have the same priority as any other makefile variable. Variables provided on the command-line (and in the @@ -5616,7 +5639,7 @@ variable value to be preferred. There is one more special feature of target-specific variables: when you define a target-specific variable that variable value is also in effect for all prerequisites of this target, and all their -prerequisites, etc. (unless those prerequisites override that variable +prerequisites, etc.@: (unless those prerequisites override that variable with their own target-specific variable value). So, for example, a statement like this: @@ -6596,8 +6619,8 @@ that match the pattern. @cindex file name, realpath of For each file name in @var{names} return the canonical absolute name. A canonical name does not contain any @code{.} or @code{..} components, -nor any repeated path separators (@code{/}) or symlinks. In case of a -failure the empty string is returned. Consult the @code{realpath(3)} +nor any repeated path separators (@code{/}) or symlinks. In case of a +failure the empty string is returned. Consult the @code{realpath(3)} documentation for a list of possible failure causes. @item $(abspath @var{names}@dots{}) @@ -6606,9 +6629,9 @@ documentation for a list of possible failure causes. @cindex file name, abspath of For each file name in @var{names} return an absolute name that does not contain any @code{.} or @code{..} components, nor any repeated path -separators (@code{/}). Note that in contrast to @code{realpath} +separators (@code{/}). Note that, in contrast to @code{realpath} function, @code{abspath} does not resolve symlinks and does not require -the file names to refer to an existing file or directory. Use the +the file names to refer to an existing file or directory. Use the @code{wildcard} function to test for existence. @end table @@ -6804,7 +6827,7 @@ LS := $(call pathsearch,ls) Now the variable LS contains @code{/bin/ls} or similar. The @code{call} function can be nested. Each recursive invocation gets -its own local values for @code{$(1)}, etc. that mask the values of +its own local values for @code{$(1)}, etc.@: that mask the values of higher-level @code{call}. For example, here is an implementation of a @dfn{map} function: @@ -7058,9 +7081,9 @@ Here the redefinition takes place if @samp{$(origin bletch)} returns either The @code{flavor} function is unlike most other functions (and like @code{origin} function) in that it does not operate on the values of -variables; it tells you something @emph{about} a variable. Specifically, -it tells you the flavor of a variable -(@pxref{Flavors, ,The Two Flavors of Variables}). +variables; it tells you something @emph{about} a variable. +Specifically, it tells you the flavor of a variable (@pxref{Flavors, +,The Two Flavors of Variables}). The syntax of the @code{flavor} function is: @@ -7117,7 +7140,7 @@ function calls are expanded (@pxref{Reading Makefiles, , How @code{make} Reads a Makefile}). Because this function involves spawning a new shell, you should carefully consider the performance implications of using the @code{shell} function within recursively -expanded variables vs. simply expanded variables (@pxref{Flavors, ,The +expanded variables vs.@: simply expanded variables (@pxref{Flavors, ,The Two Flavors of Variables}). Here are some examples of the use of the @code{shell} function: @@ -7217,6 +7240,7 @@ find out which files are out of date without changing them. By giving arguments when you run @code{make}, you can do any of these things and many others. +@cindex exit status of make The exit status of @code{make} is always one of three values: @table @code @item 0 @@ -8139,13 +8163,19 @@ available unless the makefile explicitly overrides or cancels them. canceling or overriding an implicit rule. The @samp{-r} or @samp{--no-builtin-rules} option cancels all predefined rules. +This manual only documents the default rules available on POSIX-based +operating systems. Other operating systems, such as VMS, Windows, +OS/2, etc. may have different sets of default rules. To see the full +list of default rules and variables available in your version of GNU +@code{make}, run @samp{make -p} in a directory with no makefile. + Not all of these rules will always be defined, even when the @samp{-r} option is not given. Many of the predefined implicit rules are implemented in @code{make} as suffix rules, so which ones will be defined depends on the @dfn{suffix list} (the list of prerequisites of the special target @code{.SUFFIXES}). The default suffix list is: @code{.out}, @code{.a}, @code{.ln}, @code{.o}, @code{.c}, @code{.cc}, -@code{.C}, @code{.p}, @code{.f}, @code{.F}, @code{.r}, @code{.y}, +@code{.C}, @code{.cpp}, @code{.p}, @code{.f}, @code{.F}, @code{.r}, @code{.y}, @code{.l}, @code{.s}, @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, @code{.h}, @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, @code{.texi}, @code{.txinfo}, @code{.w}, @code{.ch} @code{.web}, @@ -8170,12 +8200,13 @@ a command of the form @samp{$(CC) -c $(CPPFLAGS) $(CFLAGS)}.@refill @item Compiling C++ programs @cindex C++, rule to compile @pindex g++ -@pindex .C @pindex .cc -@file{@var{n}.o} is made automatically from @file{@var{n}.cc} or -@file{@var{n}.C} with a command of the form @samp{$(CXX) -c $(CPPFLAGS) -$(CXXFLAGS)}. We encourage you to use the suffix @samp{.cc} for C++ -source files instead of @samp{.C}.@refill +@pindex .cpp +@pindex .C +@file{@var{n}.o} is made automatically from @file{@var{n}.cc}, +@file{@var{n}.cpp}, or @file{@var{n}.C} with a command of the form +@samp{$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)}. We encourage you to use the +suffix @samp{.cc} for C++ source files instead of @samp{.C}.@refill @item Compiling Pascal programs @cindex Pascal, rule to compile @@ -8436,11 +8467,11 @@ the value @w{@samp{; mv $*.o $@@}}. @cindex flags for compilers The commands in built-in implicit rules make liberal use of certain -predefined variables. You can alter these variables in the makefile, -with arguments to @code{make}, or in the environment to alter how the -implicit rules work without redefining the rules themselves. You can -cancel all variables used by implicit rules with the @samp{-R} or -@samp{--no-builtin-variables} option. +predefined variables. You can alter the values of these variables in +the makefile, with arguments to @code{make}, or in the environment to +alter how the implicit rules work without redefining the rules +themselves. You can cancel all variables used by implicit rules with +the @samp{-R} or @samp{--no-builtin-variables} option. For example, the command used to compile a C source file actually says @samp{$(CC) -c $(CFLAGS) $(CPPFLAGS)}. The default values of the variables @@ -8459,7 +8490,15 @@ some command arguments, but it must start with an actual executable program name.) If a variable value contains more than one argument, separate them with spaces. -Here is a table of variables used as names of programs in built-in rules: +The following tables describe of some of the more commonly-used predefined +variables. This list is not exhaustive, and the default values shown here may +not be what is selected by @code{make} for your environment. To see the +complete list of predefined variables for your instance of GNU @code{make} you +can run @samp{make -p} in a directory with no makefiles. + +Here is a table of some of the more common variables used as names of +programs in built-in rules: +makefiles. @table @code @item AR @@ -8469,7 +8508,7 @@ Archive-maintaining program; default @samp{ar}. @item AS @vindex AS -Program for doing assembly; default @samp{as}. +Program for compiling assembly files; default @samp{as}. @pindex as @item CC @@ -8477,6 +8516,11 @@ Program for doing assembly; default @samp{as}. Program for compiling C programs; default @samp{cc}. @pindex cc +@item CO +@vindex CO +Program for checking out files from RCS; default @samp{co}. +@pindex cc + @item CXX @vindex CXX Program for compiling C++ programs; default @samp{g++}. @@ -8505,24 +8549,28 @@ Program for extracting a file from SCCS; default @samp{get}. @item LEX @vindex LEX -Program to use to turn Lex grammars into C programs or Ratfor programs; -default @samp{lex}. +Program to use to turn Lex grammars into source code; default @samp{lex}. @pindex lex -@item PC -@vindex PC -Program for compiling Pascal programs; default @samp{pc}. -@pindex pc - @item YACC @vindex YACC -Program to use to turn Yacc grammars into C programs; default @samp{yacc}. +Program to use to turn Yacc grammars into source code; default @samp{yacc}. @pindex yacc -@item YACCR -@vindex YACCR -Program to use to turn Yacc grammars into Ratfor -programs; default @samp{yacc -r}. +@item LINT +@vindex LINT +Program to use to run lint on source code; default @samp{lint}. +@pindex lint + +@item M2C +@vindex M2C +Program to use to compile Modula-2 source code; default @samp{m2c}. +@pindex m2c + +@item PC +@vindex PC +Program for compiling Pascal programs; default @samp{pc}. +@pindex pc @item MAKEINFO @vindex MAKEINFO @@ -8609,13 +8657,17 @@ Extra flags to give to the SCCS @code{get} program. @item LDFLAGS @vindex LDFLAGS -Extra flags to give to compilers when they are -supposed to invoke the linker, @samp{ld}. +Extra flags to give to compilers when they are supposed to invoke the linker, +@samp{ld}. @item LFLAGS @vindex LFLAGS Extra flags to give to Lex. +@item YFLAGS +@vindex YFLAGS +Extra flags to give to Yacc. + @item PFLAGS @vindex PFLAGS Extra flags to give to the Pascal compiler. @@ -8624,9 +8676,9 @@ Extra flags to give to the Pascal compiler. @vindex RFLAGS Extra flags to give to the Fortran compiler for Ratfor programs. -@item YFLAGS -@vindex YFLAGS -Extra flags to give to Yacc. +@item LINTFLAGS +@vindex LINTFLAGS +Extra flags to give to lint. @end table @node Chained Rules, Pattern Rules, Implicit Variables, Implicit Rules @@ -9119,7 +9171,7 @@ before it is compared with the target prefix and suffix. After the comparison of the file name to the target pattern, the directory names, along with the slash that ends them, are added on to the prerequisite file names generated from the pattern rule's prerequisite -patterns and the file name. The directories are ignored only for the +patterns and the file name. The directories are ignored only for the purpose of finding an implicit rule to use, not in the application of that rule. Thus, @samp{e%t} matches the file name @file{src/eat}, with @samp{src/a} as the stem. When prerequisites are turned into file @@ -10276,7 +10328,7 @@ and concatenate the results.@* @item $(call @var{var},@var{param},@dots{}) Evaluate the variable @var{var} replacing any references to @code{$(1)}, -@code{$(2)} with the first, second, etc. @var{param} values.@* +@code{$(2)} with the first, second, etc.@: @var{param} values.@* @xref{Call Function, ,The @code{call} Function}. @item $(eval @var{text}) @@ -10376,7 +10428,7 @@ environment. @xref{Environment, ,Using Variable from the Environment}. @item MAKESHELL On MS-DOS only, the name of the command interpreter that is to be used -by @code{make}. This value takes precedence over the value of +by @code{make}. This value takes precedence over the value of @code{SHELL}. @xref{Execution, ,MAKESHELL variable}. @item MAKE @@ -2027,8 +2027,8 @@ exec_command (char **argv, char **envp) break; else fprintf(stderr, - _("make reaped child pid %d, still waiting for pid %d\n"), - hWaitPID, hPID); + _("make reaped child pid %ld, still waiting for pid %ld\n"), + (DWORD)hWaitPID, (DWORD)hPID); } /* return child's exit code as our exit code */ @@ -668,7 +668,7 @@ handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo ) { sprintf(errmsg, _("%s: Interrupt/Exception caught (code = 0x%lx, addr = 0x%lx)\n"), - prg, exrec->ExceptionCode, exrec->ExceptionAddress); + prg, exrec->ExceptionCode, (DWORD)exrec->ExceptionAddress); fprintf(stderr, errmsg); exit(255); } @@ -676,7 +676,7 @@ handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo ) sprintf(errmsg, _("\nUnhandled exception filter called from program %s\nExceptionCode = %lx\nExceptionFlags = %lx\nExceptionAddress = %lx\n"), prg, exrec->ExceptionCode, exrec->ExceptionFlags, - exrec->ExceptionAddress); + (DWORD)exrec->ExceptionAddress); if (exrec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && exrec->NumberParameters >= 2) @@ -319,6 +319,17 @@ except that the modification time is changed only in the imagination of .TP 0.5i .B \-\-warn\-undefined\-variables Warn when an undefined variable is referenced. +.SH "EXIT STATUS" +GNU +.I 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 +.I make +determines that a target needs to be rebuilt. A status of two will be +returned if any errors were encountered. .SH "SEE ALSO" .I "The GNU Make Manual" .SH BUGS diff --git a/makefile.com b/makefile.com index dd94bc3..c04cae8 100644 --- a/makefile.com +++ b/makefile.com @@ -12,7 +12,7 @@ $! 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 +$! 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) @@ -33,7 +33,7 @@ $ then $ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library: $ ccopt = "" $ else -$ ccopt = "/decc/prefix=all" +$ ccopt = "/decc/prefix=(all,except=(globfree,glob))" $ if f$trnlnm("SYS").eqs."" $ then $ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes."" @@ -68,7 +68,7 @@ $ gosub check_cc_qual $ endif $ filelist = "alloca ar arscan commands default dir expand file function " + - "hash implicit job main misc read remake remote-stub rule " + - - "signame variable version vmsfunctions vmsify vpath " + - + "signame variable version vmsfunctions vmsify vpath " + - "[.glob]glob [.glob]fnmatch getopt1 getopt" $ copy config.h-vms config.h $ n=0 @@ -101,12 +101,12 @@ $! Check if this is a define relating to the properties of the C/C++ $! compiler $! $CHECK_CC_QUAL: -$ open/write tmpc 'tc +$ 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"");}}" +$ write tmpc "if (i < 0){printf(""Mission impossible\n"");}}" $ close tmpc $ gosub cc_qual_check $ return @@ -122,7 +122,7 @@ $ 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 +$ if cc_qual then ccopt = ccopt + ccqual $ return $!------------------------------------------------------------------------------ $! @@ -131,8 +131,8 @@ $ ploc = f$locate("]",p1) $ filnam = p1 $ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1) $ write optf "''filnam'" -$ cc'ccopt'/include=([],[.glob]) - - /define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") - +$ cc'ccopt'/include=([],[.glob]) - + /define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") - 'p1' $ exit $ endsubroutine : compileit @@ -1177,10 +1177,12 @@ eval (struct ebuffer *ebuf, int set_default) /* Put all the prerequisites here; they'll be parsed later. */ deps = (struct dep *) xmalloc (sizeof (struct dep)); deps->next = 0; - deps->name = xstrdup (beg); + deps->name = savestring (beg, end - beg + 1); + deps->file = 0; + deps->changed = 0; + deps->ignore_mtime = 0; deps->staticpattern = 0; deps->need_2nd_expansion = 0; - deps->file = 0; } else deps = 0; @@ -48,6 +48,68 @@ for this is to set this switch just prior to calling main: in an initialization routine. This adds more complexity and more VMS specific code. It is easier to tell the compiler NOT to map the routine names with a simple change in makefile.vms. + +Some notes on case sensitive names in rules and on the disk. In the VMS +template for CONFIG.H case sensitive rules can be enabled with defining +WANT_CASE_SENSITIVE_TARGETS. For recent version of VMS there is a case +sensitive file system: ODS5. To make use of that, additionally un-defining +the HAVE_CASE_INSENSITIVE_FS is required. As these are C macros, different +versions of make need to be built to have any case sensitivity for VMS +working. Unfortunately, for ODS5 disks that's not all. + +- Usually DCL upcases command line tokens (except strings) and usually the + file system is case blind (similar to how Windows systems work) + $ set proc/parse=extended/case=sensitive + preserves lower and UPPER on the command line and (for this process and all + sub-processes) enables case sensitivity in the file system + +- Usually the CRTL tries to reverse what DCL did with command line tokens, it + lowercases all tokens (except strings) + $ define DECC$ARGV_PARSE_STYLE enable + passes (the now preserved) lower and UPPER from the command line to main() + +- Usually the CRTL upcases the arguments to open() and friends + $ define DECC$EFS_CASE_PRESERVE enable + preserves the names as is. + +It is important to know that not all VMS tools are ready for case sensitivity. +With this setup some tools may not work as expected. The setup should not +blindly be applied for all users in default login procedures. + +Example? The poor coding gives a compiler message, showing that there are +different files: + +$ dir + +Directory ODS5DISK[HB] + +A.c;1 B.c;1 c.c;1 X.c;1 +x.c;1 + +Total of 5 files. +$ ods5make x.obj +cc /obj=x.obj x.c + +foo(){lowercase_x();} +......^ +%CC-I-IMPLICITFUNC, In this statement, the identifier "lowercase_x" is implicitly declared as a function. +at line number 1 in file ODS5DISK[HB]x.c;1 +$ mc SYS$SYSDEVICE:[HARTMUT.MAKE_3_80P]ods5make X.obj +cc /obj=X.obj X.c + +foo() {UPPERCASE_X();} +.......^ +%CC-I-IMPLICITFUNC, In this statement, the identifier "UPPERCASE_X" is implicitly declared as a function. +at line number 1 in file ODS5DISK[HB]X.c;1 +$ dir + +Directory ODS5DISK[HB] + +A.c;1 B.c;1 c.c;1 X.c;1 +x.c;1 X.obj;1 x.obj;1 + +Total of 7 files. +$ This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com. @@ -530,7 +530,10 @@ update_file_1 (struct file *file, unsigned int depth) break; if (!running) - d->changed = file_mtime (d->file) != mtime; + /* The prereq is considered changed if the timestamp has changed while + it was built, OR it doesn't exist. */ + d->changed = ((file_mtime (d->file) != mtime) + || (mtime == NONEXISTENT_MTIME)); lastd = d; d = d->next; diff --git a/tests/ChangeLog b/tests/ChangeLog index 480d2fc..80f4a0d 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2006-01-03 Paul D. Smith <psmith@gnu.org> + + * scripts/variables/automatic: Add a test for bug #8154. + + * README: Update to reflect the current state of the test suite. + 2005-12-12 Paul D. Smith <psmith@gnu.org> * scripts/features/parallelism, scripts/functions/wildcard, diff --git a/tests/README b/tests/README index 12fa698..e3ba5c9 100644 --- a/tests/README +++ b/tests/README @@ -1,33 +1,30 @@ -This is release 3.78 (September 6, 1999) of the GNU make test -suite. See the file NEWS for some of the changes since the last -release. - -This release is made by psmith@gnu.org to correspond to GNU make 3.78. -It won't work correctly for versions before that. In addition to some -infrastructure changes I've added a number of new tests. - -Rob Tulloh has contributed changes to get the suite running on NT. - -Eli Zaretskii and Esa A E Peuha <peuha@cc.helsinki.fi> have contributed -changes to get the suite running on DJGPP/DOS. - -This package has a number of problems which preclude me from -distributing it with make as a default "make check" test suite. The -most serious of these is that it's not parallelizable: it scribbles all -over its installation directory and so can only test one make at a -time. I simply don't have time to do more with this than I am so far; -I'm very actively interested in finding someone willing to overhaul the -test suite infrastructure. If you're interested, contact me (see below)! - -The test suite thus far has been written by Steve McGee, Chris Arthur, -and Paul D. Smith. It is covered by the GNU General Public License -(Version 2), described in the file COPYING. - -The test suite requires Perl and is known to work with Perl 4.036 and -Perl 5.004 (available from ftp.gnu.org, and portable to many machines). -Earlier or later versions may work; I don't know. It assumes that the -first "diff" it finds is GNU diff, but that only matters if a test -fails. +The test suite was originally written by Steve McGee and Chris Arthur. +It is covered by the GNU General Public License (Version 2), described +in the file COPYING. It has been maintained as part of GNU make proper +since GNU make 3.78. + +The test suite has a number of problems which should be addressed. One +VERY serious one is that there is no real documentation. You just have +to see the existing tests. Use the newer tests: many of the tests +haven't been updated to use the latest/greatest test methods. See the +ChangeLog in the tests directory for pointers. + +The second serious problem is that it's not parallelizable: it scribbles +all over its installation directory and so can only test one make at a +time. The third serious problem is that it's not relocatable: the only +way it works when you build out of the source tree is to create +symlinks, which doesn't work on every system and is bogus to boot. The +fourth serious problem is that it doesn't create its own sandbox when +running tests, so that if a test forgets to clean up after itself that +can impact future tests. + +The test suite requires Perl. These days, you should have at least Perl +5.004 (available from ftp.gnu.org, and portable to many machines). It +used to work with Perl 4.036 but official support for Perl 4.x was +abandoned a long time ago, due to lack of testbeds, as well as interest. + +The test suite assumes that the first "diff" it finds on your PATH is +GNU diff, but that only matters if a test fails. To run the test suite on a UNIX system, use "perl ./run_make_tests" (or just "./run_make_tests" if you have a perl on your PATH). @@ -43,18 +40,14 @@ relative paths and when make is called something other than "make" (like "gmake"). Tests cannot end with a "~" character, as the test suite will ignore any -that do (I was tired of having it run my Emacs backup files as test :) - -If you want to run the tests in parallel, you should use the mkshadow -script included here to create temporary "copies" (via symbolic links) -of the test suite, one for each parallel job. This is a pain and one -day maybe the test suite will be rewritten so it's no longer -necessary--volunteers welcome! +that do (I was tired of having it run my Emacs backup files as tests :)) Also, sometimes the tests may behave strangely on networked filesystems. You can use mkshadow to create a copy of the test suite in /tmp or similar, and try again. If the error disappears, it's an issue -with your network or file server, not GNU make (I believe). +with your network or file server, not GNU make (I believe). This +shouldn't happen very often anymore: I've done a lot of work on the +tests to reduce the impacts of this situation. The options/dash-l test will not really test anything if the copy of make you are using can't obtain the system load. Some systems require @@ -73,7 +66,9 @@ There is a -help option which will give you more information about the other possible options for the test suite. Any complaints/suggestions/bugs/etc. for the test suite itself (as -opposed to problems in make that the suite finds) should be sent to -psmith@gnu.org. Enjoy! +opposed to problems in make that the suite finds) should be handled the +same way as normal GNU make bugs/problems. + + Paul D. Smith Chris Arthur diff --git a/tests/scripts/variables/automatic b/tests/scripts/variables/automatic index dc08bd7..847c836 100644 --- a/tests/scripts/variables/automatic +++ b/tests/scripts/variables/automatic @@ -87,11 +87,22 @@ run_make_test(' mbr.b: mbr.src @echo $* -mbr.src: ; @: +mbr.src: ; @:', + '', + 'mbr'); -', -'', -'mbr -'); +# TEST #3 -- test for Savannah bug #8154 +# Make sure that nonexistent prerequisites are listed in $?, since they are +# considered reasons for the target to be rebuilt. +# +touch('foo'); + +run_make_test(' +foo: bar ; @echo "\$$? = $?" +bar: ;', + '', + '$? = bar'); + +unlink('foo'); 1; diff --git a/vmsfunctions.c b/vmsfunctions.c index 02e93d3..3acf54c 100644 --- a/vmsfunctions.c +++ b/vmsfunctions.c @@ -90,7 +90,10 @@ readdir (DIR *dir) dentry->d_namlen = dnam->nam$b_name + dnam->nam$b_type; strncpy (dentry->d_name, dnam->nam$l_name, dentry->d_namlen); dentry->d_name[dentry->d_namlen] = '\0'; + +#ifdef HAVE_CASE_INSENSITIVE_FS uppercasify (dentry->d_name); +#endif return (dentry); } @@ -79,9 +79,11 @@ copyto (char **to, char **from, char upto, int as_dir) } else { +#ifdef HAVE_CASE_INSENSITIVE_FS if (isupper ((unsigned char)**from)) **to = tolower ((unsigned char)**from); else +#endif **to = **from; } (*to)++; |