summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--NEWS5
-rw-r--r--README.W3258
-rw-r--r--configure.in2
-rw-r--r--function.c383
-rw-r--r--maintMakefile7
-rw-r--r--make.texinfo40
-rw-r--r--readme.vms6
-rw-r--r--w32/pathstuff.c15
9 files changed, 314 insertions, 217 deletions
diff --git a/ChangeLog b/ChangeLog
index eaf8c0b..c72000a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Tue Sep 2 10:07:39 1997 Paul D. Smith <psmith@baynetworks.com>
+
+ * function.c (expand_function): When processing $(shell...)
+ translate a CRLF (\r\n) sequence as well as a newline (\n) to a
+ space. Also remove an ending \r\n sequence.
+ * make.texinfo (Shell Function): Document it.
+
+Fri Aug 29 12:59:06 1997 Rob Tulloh <rob_tulloh@tivoli.com>
+
+ * w32/pathstuff.c (convert_Path_to_windows32): Fix problem where
+ paths which contain single character entries like `.' are not
+ handled correctly.
+
+ * README.W32: Document path handling issues on Windows systems.
+
Fri Aug 29 02:01:27 1997 Paul D. Smith <psmith@baynetworks.com>
* Version 3.75.93.
diff --git a/NEWS b/NEWS
index 60ebca0..2943b7b 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,9 @@ Version 3.76
* The $(strip) function now removes newlines as well as TABs and spaces.
+* The $(shell) function now changes CRLF (\r\n) pairs to a space as well
+ as newlines (\n).
+
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
@@ -46,6 +49,8 @@ Version 3.76
and utilities. See README.DOS for details, and direct all questions
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
Delorie <dj@delorie.com>.
+
+* John W. Eaton has updated the VMS port to support libraries and VPATH.
Version 3.75
diff --git a/README.W32 b/README.W32
index 0104d55..ac5001d 100644
--- a/README.W32
+++ b/README.W32
@@ -38,7 +38,7 @@ GNU make and 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 gnu-win32
- porting effort. Other possibilites are to get the MKS version
+ porting effort. Other possibilities are to get the MKS version
of sh.exe or to build your own with a package like
NutCracker (DataFocus) or Portage (Consensys).
@@ -46,6 +46,46 @@ GNU make and sh.exe:
freely available. It may be available someday, but I am not in control
of this decision nor do I influence it. Sorry!
+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
+
+ These caveats affect Windows systems only (Windows NT and
+ Windows 95) and can be ignored for other platforms.
+
+ 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.
+
+ 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.
+
GNU make test suite:
I verified all functionality with a slightly modified version
@@ -105,17 +145,17 @@ SAMBA/NTFS/VFAT:
under VFAT. VFAT users may wish to be aware that this port
of make does respect case sensitivity.
- Version 3.76 contains some preliminary support for FAT.
- Make now tries to work around some difficulties with stat'ing of
- files and caching of filenames and directories internally.
- There is still a known problem with filenames sometimes being found
- to have modification dates in the future which cause make to
- complain about the file and exit (remake.c).
+ Version 3.76 contains some preliminary support for FAT. Make
+ now tries to work around some difficulties with stat'ing of
+ files and caching of filenames and directories internally.
+ There is still a known problem with filenames sometimes being
+ found to have modification dates in the future which cause make
+ to complain about the file and exit (remake.c).
Bug reports:
Please submit bugs via the normal bug reporting mechanism
- which is described in one of the texinfo files. If you don't
- have texinfo for Windows NT or Windows 95, these files are simple
+ which is described in one of the Texinfo files. If you don't
+ have Texinfo for Windows NT or Windows 95, these files are simple
text files and can be read with a text editor.
diff --git a/configure.in b/configure.in
index 7b4e5ca..7dfe0bc 100644
--- a/configure.in
+++ b/configure.in
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required.
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
-AM_INIT_AUTOMAKE(make, 3.75.93)
+AM_INIT_AUTOMAKE(make, 3.76)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob)
diff --git a/function.c b/function.c
index e64afa0..e115522 100644
--- a/function.c
+++ b/function.c
@@ -160,14 +160,14 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
if (len < pattern_prepercent_len + pattern_postpercent_len)
fail = 1;
- /* Does the prefix match? */
+ /* Does the prefix match? */
if (!fail && pattern_prepercent_len > 0
&& (*t != *pattern
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
fail = 1;
- /* Does the suffix match? */
+ /* Does the suffix match? */
if (!fail && pattern_postpercent_len > 0
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|| t[len - pattern_postpercent_len] != pattern_percent[1]
@@ -318,12 +318,12 @@ int shell_function_pid = 0, shell_function_completed;
The output is written into VARIABLE_BUFFER starting at O. */
/* Note this absorbs a semicolon and is safe to use in conditionals. */
-#define BADARGS(func) \
- if (reading_filename != 0) \
- makefile_fatal (reading_filename, *reading_lineno_ptr, \
- "insufficient arguments to function `%s'", \
- func); \
- else \
+#define BADARGS(func) \
+ if (reading_filename != 0) \
+ makefile_fatal (reading_filename, *reading_lineno_ptr, \
+ "insufficient arguments to function `%s'", \
+ func); \
+ else \
fatal ("insufficient arguments to function `%s'", func)
static char *
@@ -349,12 +349,12 @@ expand_function (o, function, text, end)
case function_shell:
{
#ifdef WINDOWS32
- SECURITY_ATTRIBUTES saAttr;
- HANDLE hIn;
- HANDLE hErr;
- HANDLE hChildOutRd;
- HANDLE hChildOutWr;
- HANDLE hProcess;
+ SECURITY_ATTRIBUTES saAttr;
+ HANDLE hIn;
+ HANDLE hErr;
+ HANDLE hChildOutRd;
+ HANDLE hChildOutWr;
+ HANDLE hProcess;
#endif
#ifdef __MSDOS__
FILE *fpipe;
@@ -380,7 +380,7 @@ expand_function (o, function, text, end)
#ifndef _AMIGA
/* Using a target environment for `shell' loses in cases like:
- export var = $(shell echo foobie)
+ export var = $(shell echo foobie)
because target_environment hits a loop trying to expand $(var)
to put it in the environment. This is even more confusing when
var was not explicitly exported, but just appeared in the
@@ -391,7 +391,7 @@ expand_function (o, function, text, end)
/* Construct the environment. */
envp = target_environment ((struct file *) 0);
#endif
-#endif /* Not Amiga. */
+#endif /* Not Amiga. */
/* For error messages. */
if (reading_filename != 0)
@@ -405,111 +405,111 @@ expand_function (o, function, text, end)
#ifndef _AMIGA
# ifdef WINDOWS32
- saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
- saAttr.bInheritHandle = TRUE;
- saAttr.lpSecurityDescriptor = NULL;
-
- if (DuplicateHandle(GetCurrentProcess(),
- GetStdHandle(STD_INPUT_HANDLE),
- GetCurrentProcess(),
- &hIn,
- 0,
- TRUE,
- DUPLICATE_SAME_ACCESS) == FALSE) {
- fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
- GetLastError());
- }
- if (DuplicateHandle(GetCurrentProcess(),
- GetStdHandle(STD_ERROR_HANDLE),
- GetCurrentProcess(),
- &hErr,
- 0,
- TRUE,
- DUPLICATE_SAME_ACCESS) == FALSE) {
- fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
- GetLastError());
- }
-
- if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
- fatal("CreatePipe() failed (e=%d)\n", GetLastError());
-
- hProcess = process_init_fd(hIn, hChildOutWr, hErr);
-
- if (!hProcess)
- fatal("expand_function: process_init_fd() failed\n");
- else
- process_register(hProcess);
-
- /* make sure that CreateProcess() has Path it needs */
- sync_Path_environment();
-
- if (!process_begin(hProcess, argv, envp, argv[0], NULL))
- pid = (int) hProcess;
- else
- fatal("expand_function: unable to launch process (e=%d)\n",
- process_last_err(hProcess));
-
- /* set up to read data from child */
- pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
-
- /* this will be closed almost right away */
- pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
+ saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
+ saAttr.bInheritHandle = TRUE;
+ saAttr.lpSecurityDescriptor = NULL;
+
+ if (DuplicateHandle(GetCurrentProcess(),
+ GetStdHandle(STD_INPUT_HANDLE),
+ GetCurrentProcess(),
+ &hIn,
+ 0,
+ TRUE,
+ DUPLICATE_SAME_ACCESS) == FALSE) {
+ fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
+ GetLastError());
+ }
+ if (DuplicateHandle(GetCurrentProcess(),
+ GetStdHandle(STD_ERROR_HANDLE),
+ GetCurrentProcess(),
+ &hErr,
+ 0,
+ TRUE,
+ DUPLICATE_SAME_ACCESS) == FALSE) {
+ fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
+ GetLastError());
+ }
+
+ if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
+ fatal("CreatePipe() failed (e=%d)\n", GetLastError());
+
+ hProcess = process_init_fd(hIn, hChildOutWr, hErr);
+
+ if (!hProcess)
+ fatal("expand_function: process_init_fd() failed\n");
+ else
+ process_register(hProcess);
+
+ /* make sure that CreateProcess() has Path it needs */
+ sync_Path_environment();
+
+ if (!process_begin(hProcess, argv, envp, argv[0], NULL))
+ pid = (int) hProcess;
+ else
+ fatal("expand_function: unable to launch process (e=%d)\n",
+ process_last_err(hProcess));
+
+ /* set up to read data from child */
+ pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
+
+ /* this will be closed almost right away */
+ pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
# else /* WINDOWS32 */
# ifdef __MSDOS__
- {
- /* MSDOS can't fork, but it has `popen'.
- (Bwt, why isn't `popen' used in all the versions?) */
- struct variable *sh = lookup_variable ("SHELL", 5);
- int e;
- extern int dos_command_running, dos_status;
-
- /* Make sure not to bother processing an empty line. */
- while (isblank (*text))
- ++text;
- if (*text == '\0')
- break;
-
- if (sh)
- {
- char buf[PATH_MAX + 7];
- /* This makes sure $SHELL value is used by $(shell), even
- though the target environment is not passed to it. */
- sprintf (buf, "SHELL=%s", sh->value);
- putenv (buf);
- }
-
- e = errno;
- errno = 0;
- dos_command_running = 1;
- dos_status = 0;
- fpipe = popen (text, "rt");
- dos_command_running = 0;
- if (!fpipe || dos_status)
- {
- pipedes[0] = -1;
- pid = -1;
- if (dos_status)
- errno = EINTR;
- else if (errno == 0)
- errno = ENOMEM;
- shell_function_completed = -1;
- }
- else
- {
- pipedes[0] = fileno (fpipe);
- pid = 42;
- errno = e;
- shell_function_completed = 1;
- }
- }
- if (pipedes[0] < 0)
+ {
+ /* MSDOS can't fork, but it has `popen'.
+ (Bwt, why isn't `popen' used in all the versions?) */
+ struct variable *sh = lookup_variable ("SHELL", 5);
+ int e;
+ extern int dos_command_running, dos_status;
+
+ /* Make sure not to bother processing an empty line. */
+ while (isblank (*text))
+ ++text;
+ if (*text == '\0')
+ break;
+
+ if (sh)
+ {
+ char buf[PATH_MAX + 7];
+ /* This makes sure $SHELL value is used by $(shell), even
+ though the target environment is not passed to it. */
+ sprintf (buf, "SHELL=%s", sh->value);
+ putenv (buf);
+ }
+
+ e = errno;
+ errno = 0;
+ dos_command_running = 1;
+ dos_status = 0;
+ fpipe = popen (text, "rt");
+ dos_command_running = 0;
+ if (!fpipe || dos_status)
+ {
+ pipedes[0] = -1;
+ pid = -1;
+ if (dos_status)
+ errno = EINTR;
+ else if (errno == 0)
+ errno = ENOMEM;
+ shell_function_completed = -1;
+ }
+ else
+ {
+ pipedes[0] = fileno (fpipe);
+ pid = 42;
+ errno = e;
+ shell_function_completed = 1;
+ }
+ }
+ if (pipedes[0] < 0)
# else /* ! __MSDOS__ */
- if (pipe (pipedes) < 0)
+ if (pipe (pipedes) < 0)
# endif /* __MSDOS__ */
- {
- perror_with_name (error_prefix, "pipe");
- break;
- }
+ {
+ perror_with_name (error_prefix, "pipe");
+ break;
+ }
# ifndef __MSDOS__
pid = vfork ();
@@ -606,28 +606,41 @@ expand_function (o, function, text, end)
if (i > 0)
{
if (buffer[i - 1] == '\n')
- buffer[--i] = '\0';
+ {
+ if (i > 1 && buffer[i - 2] == '\r')
+ --i;
+ buffer[--i] = '\0';
+ }
else
buffer[i] = '\0';
+
p = buffer;
- while ((p = index (p, '\n')) != 0)
- *p++ = ' ';
+ for (p2=p; *p != '\0'; ++p)
+ {
+ if (p[0] == '\r' && p[1] == '\n')
+ continue;
+ if (*p == '\n')
+ *p2++ = ' ';
+ else
+ *p2++ = *p;
+ }
+ *p2 = '\0';
o = variable_buffer_output (o, buffer, i);
}
}
free (buffer);
}
-#else /* Amiga */
+#else /* Amiga */
{
/* Amiga can't fork nor spawn, but I can start a program with
- redirection of my choice. However, this means that we
+ redirection of my choice. However, this means that we
don't have an opportunity to reopen stdout to trap it. Thus,
we save our own stdout onto a new descriptor and dup a temp
file's descriptor onto our stdout temporarily. After we
spawn the shell program, we dup our own stdout back to the
stdout descriptor. The buffer reading is the same as above,
- except that we're now reading from a file. */
+ except that we're now reading from a file. */
#include <dos/dos.h>
#include <proto/dos.h>
@@ -699,7 +712,7 @@ expand_function (o, function, text, end)
}
free (buffer);
}
-#endif /* Not Amiga. */
+#endif /* Not Amiga. */
free (text);
break;
@@ -1051,13 +1064,13 @@ expand_function (o, function, text, end)
p2 = text;
while (*p2 != '\0')
{
- while (isspace(*p2))
- ++p2;
- p = p2;
- for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
- {}
- if (!i)
- break;
+ while (isspace(*p2))
+ ++p2;
+ p = p2;
+ for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
+ {}
+ if (!i)
+ break;
o = variable_buffer_output (o, p, i);
o = variable_buffer_output (o, " ", 1);
doneany = 1;
@@ -1235,42 +1248,42 @@ index argument");
/* Check the next argument */
for (p2 = p + 1; isblank(*p2); ++p2)
- {}
+ {}
count = 0;
for (p = p2; p < end; ++p)
- {
- if (*p == startparen)
- ++count;
- else if (*p == endparen)
- --count;
- else if (*p == ',' && count <= 0)
- break;
- }
+ {
+ if (*p == startparen)
+ ++count;
+ else if (*p == endparen)
+ --count;
+ else if (*p == ',' && count <= 0)
+ break;
+ }
if (p == end)
- BADARGS ("wordlist");
+ BADARGS ("wordlist");
text = expand_argument (p2, p);
for (p2 = text; *p2 != '\0'; ++p2)
- if (*p2 < '0' || *p2 > '9')
- {
- if (reading_filename != 0)
- makefile_fatal (reading_filename, *reading_lineno_ptr,
- "non-numeric second argument to `wordlist' function");
- else
- fatal ("non-numeric second argument to `wordlist' function");
- }
+ if (*p2 < '0' || *p2 > '9')
+ {
+ if (reading_filename != 0)
+ makefile_fatal (reading_filename, *reading_lineno_ptr,
+ "non-numeric second argument to `wordlist' function");
+ else
+ fatal ("non-numeric second argument to `wordlist' function");
+ }
j = (unsigned int)atoi(text);
free (text);
if (j > i)
- j -= i;
+ j -= i;
else
- {
- unsigned int k;
- k = j;
- j = i - j;
- i = k;
- }
+ {
+ unsigned int k;
+ k = j;
+ j = i - j;
+ i = k;
+ }
++j;
/* Extract the requested words */
@@ -1278,13 +1291,13 @@ index argument");
p2 = text;
while (((p = find_next_token (&p2, &len)) != 0) && --i)
- {}
+ {}
if (p)
- {
- while (--j && (find_next_token (&p2, &len) != 0))
- {}
- o = variable_buffer_output (o, p, p2 - p);
- }
+ {
+ while (--j && (find_next_token (&p2, &len) != 0))
+ {}
+ o = variable_buffer_output (o, p, p2 - p);
+ }
free (text);
break;
@@ -1366,34 +1379,34 @@ index argument");
p = p2 + len;
#ifdef VMS
while (p >= p2 && *p != ']'
- && (function != function_basename || *p != '.'))
+ && (function != function_basename || *p != '.'))
#else
# ifdef __MSDOS__
while (p >= p2 && *p != '/' && *p != '\\'
- && (function != function_basename || *p != '.'))
+ && (function != function_basename || *p != '.'))
# else
while (p >= p2 && *p != '/'
- && (function != function_basename || *p != '.'))
+ && (function != function_basename || *p != '.'))
# endif
#endif
--p;
if (p >= p2 && (function == function_dir))
o = variable_buffer_output (o, p2, ++p - p2);
- else if (p >= p2 && (*p == '.'))
- o = variable_buffer_output (o, p2, p - p2);
+ else if (p >= p2 && (*p == '.'))
+ o = variable_buffer_output (o, p2, p - p2);
#if defined(WINDOWS32) || defined(__MSDOS__)
- /* Handle the "d:foobar" case */
- else if (p2[0] && p2[1] == ':' && function == function_dir)
- o = variable_buffer_output (o, p2, 2);
+ /* Handle the "d:foobar" case */
+ else if (p2[0] && p2[1] == ':' && function == function_dir)
+ o = variable_buffer_output (o, p2, 2);
#endif
else if (function == function_dir)
#ifdef VMS
- o = variable_buffer_output (o, "[]", 2);
+ o = variable_buffer_output (o, "[]", 2);
#else
#ifndef _AMIGA
- o = variable_buffer_output (o, "./", 2);
+ o = variable_buffer_output (o, "./", 2);
#else
- /* o = o */; /* Just a nop... */
+ /* o = o */; /* Just a nop... */
#endif /* AMIGA */
#endif /* !VMS */
else
@@ -1421,32 +1434,32 @@ index argument");
p = p2 + len;
#ifdef VMS
while (p >= p2 && *p != ']'
- && (function != function_suffix || *p != '.'))
+ && (function != function_suffix || *p != '.'))
#else
# ifdef __MSDOS__
while (p >= p2 && *p != '/' && *p != '\\'
- && (function != function_suffix || *p != '.'))
+ && (function != function_suffix || *p != '.'))
# else
while (p >= p2 && *p != '/'
- && (function != function_suffix || *p != '.'))
+ && (function != function_suffix || *p != '.'))
# endif
#endif
--p;
if (p >= p2)
{
if (function == function_notdir)
- ++p;
- else if (*p != '.')
- continue;
+ ++p;
+ else if (*p != '.')
+ continue;
o = variable_buffer_output (o, p, len - (p - p2));
}
#if defined(WINDOWS32) || defined(__MSDOS__)
- /* Handle the case of "d:foo/bar". */
- else if (function == function_notdir && p2[0] && p2[1] == ':')
- {
- p = p2 + 2;
- o = variable_buffer_output (o, p, len - (p - p2));
- }
+ /* Handle the case of "d:foo/bar". */
+ else if (function == function_notdir && p2[0] && p2[1] == ':')
+ {
+ p = p2 + 2;
+ o = variable_buffer_output (o, p, len - (p - p2));
+ }
#endif
else if (function == function_notdir)
o = variable_buffer_output (o, p2, len);
diff --git a/maintMakefile b/maintMakefile
index 1fcd09e..05e73e8 100644
--- a/maintMakefile
+++ b/maintMakefile
@@ -40,6 +40,13 @@ build.sh.in: build.template Makefile.am
$< > $@
chmod a-w+x $@
+# We clean everything here. The GNU standards for makefile conventions say
+# you shouldn't remove configure, etc., but this makefile is only available
+# in a full development distribution, so they'll only be removed then.
+#
+MAINTAINERCLEANFILES = $(TEMPLATES) Makefile.DOS build.sh.in \
+ configure Makefile.in stamp-h.in
+
# Put the alpha distribution files up for anonymous FTP.
#
ALPHA := ~ftp/gnu
diff --git a/make.texinfo b/make.texinfo
index 1958134..3c7e4d3 100644
--- a/make.texinfo
+++ b/make.texinfo
@@ -5746,8 +5746,10 @@ The @code{shell} function performs the same function that backquotes
(@samp{`}) perform in most shells: it does @dfn{command expansion}. This
means that it takes an argument that is a shell command and returns the
output of the command. The only processing @code{make} does on the result,
-before substituting it into the surrounding text, is to convert newlines to
-spaces.@refill
+before substituting it into the surrounding text, is to convert each
+newline or carriage-return / newline pair to a single space. It also
+removes the trailing (carriage-return and) newline, if it's the last
+thing in the result.@refill
The commands run by calls to the @code{shell} function are run when the
function calls are expanded. In most cases, this is when the makefile is
@@ -5856,18 +5858,34 @@ You can specify a different goal or goals with arguments to @code{make}.
Use the name of the goal as an argument. If you specify several goals,
@code{make} processes each of them in turn, in the order you name them.
-@cindex @code{MAKECMDGOALS}
-@vindex MAKECMDGOALS
-@code{Make} will set the special variable @code{MAKECMDGOALS} to the
-list of goals you specified on the command line. If no goals were given
-on the command line, this variable is empty.
-
Any target in the makefile may be specified as a goal (unless it
starts with @samp{-} or contains an @samp{=}, in which case it will be
parsed as a switch or variable definition, respectively). Even
targets not in the makefile may be specified, if @code{make} can find
implicit rules that say how to make them.
+@cindex @code{MAKECMDGOALS}
+@vindex MAKECMDGOALS
+@code{Make} will set the special variable @code{MAKECMDGOALS} to the
+list of goals you specified on the command line. If no goals were given
+on the command line, this variable is empty. Note that this variable
+should be used only in special circumstances.
+
+An example of appropriate use is to avoid including @file{.d} files
+during @code{clean} rules (@pxref{Automatic Dependencies}), so
+@code{make} won't create them only to immediately remove them
+again:@refill
+
+@example
+@group
+sources = foo.c bar.c
+
+ifneq ($(MAKECMDGOALS),clean)
+include $(sources:.c=.d)
+endif
+@end group
+@end example
+
One use of specifying a goal is if you want to compile only a part of
the program, or only one of several programs. Specify as a goal each
file that you wish to remake. For example, consider a directory containing
@@ -8797,6 +8815,12 @@ The flags given to @code{make}. You can set this in the environment or
a makefile to set flags.@*
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
+@item MAKECMDGOALS
+
+The targets given to @code{make} on the command line. Setting this
+variable has no effect on the operation of @code{make}.@*
+@xref{Goals, ,Arguments to Specify the Goals}.
+
@item SUFFIXES
The default list of suffixes before @code{make} reads any makefiles.
diff --git a/readme.vms b/readme.vms
index 8284876..18010cf 100644
--- a/readme.vms
+++ b/readme.vms
@@ -12,10 +12,6 @@ Make with this makefile to rebuild.
Here are some notes about GNU Make for VMS:
-Libraries are not supported. They were in GNU Make 3.60 but somehow I didn't
-care porting the code. If there is enough interest, I'll do it at some
-later time.
-
The variable $^ separates files with commas instead of spaces (It's the
natural thing to do for VMS).
@@ -41,8 +37,6 @@ less than what vms provides. This might be a problem on the faster Alphas.
You can use a : in a filename only if you preceed it with a backslash ('\').
E.g.- hobbes\:[bogas.files]
-None of the stuff in vpath.c has been implemented yet.
-
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).
diff --git a/w32/pathstuff.c b/w32/pathstuff.c
index 01ed52f..52f24a2 100644
--- a/w32/pathstuff.c
+++ b/w32/pathstuff.c
@@ -38,11 +38,15 @@ convert_Path_to_windows32(char *Path, char to_delim)
if ((etok - p) == 1) {
if (*(etok - 1) == ';' ||
*(etok - 1) == ':') {
- etok[-1] = to_delim;
- etok[0] = to_delim;
+ etok[-1] = to_delim;
+ etok[0] = to_delim;
p = ++etok;
continue; /* ignore empty bucket */
- } else if (etok = strpbrk(etok+1, ":;")) {
+ } else if (!isalpha(*p)) {
+ /* found one to count, handle things like '.' */
+ *etok = to_delim;
+ p = ++etok;
+ } else if ((*etok == ':') && (etok = strpbrk(etok+1, ":;"))) {
/* found one to count, handle drive letter */
*etok = to_delim;
p = ++etok;
@@ -55,11 +59,6 @@ convert_Path_to_windows32(char *Path, char to_delim)
p = ++etok;
}
-#if 0
- /* convert to backward slashes */
- for (p = Path, p = strchr(p, '/'); p; p = strchr(p, '/'))
- *p = '\\';
-#endif
return Path;
}