mirror of
https://github.com/mirror/make.git
synced 2024-12-28 05:40:10 +08:00
Changes for GNU make 3.76
This commit is contained in:
parent
161a026602
commit
41dcca8426
15
ChangeLog
15
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>
|
Fri Aug 29 02:01:27 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
* Version 3.75.93.
|
* Version 3.75.93.
|
||||||
|
5
NEWS
5
NEWS
@ -39,6 +39,9 @@ Version 3.76
|
|||||||
|
|
||||||
* The $(strip) function now removes newlines as well as TABs and spaces.
|
* 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).
|
* 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
|
* 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
|
and utilities. See README.DOS for details, and direct all questions
|
||||||
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
||||||
Delorie <dj@delorie.com>.
|
Delorie <dj@delorie.com>.
|
||||||
|
|
||||||
|
* John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||||
|
|
||||||
Version 3.75
|
Version 3.75
|
||||||
|
|
||||||
|
58
README.W32
58
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 are very few true ports of Bourne shell for NT right now.
|
||||||
There is a version of GNU bash available from Cygnus gnu-win32
|
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
|
of sh.exe or to build your own with a package like
|
||||||
NutCracker (DataFocus) or Portage (Consensys).
|
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
|
freely available. It may be available someday, but I am not in control
|
||||||
of this decision nor do I influence it. Sorry!
|
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:
|
GNU make test suite:
|
||||||
|
|
||||||
I verified all functionality with a slightly modified version
|
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
|
under VFAT. VFAT users may wish to be aware that this port
|
||||||
of make does respect case sensitivity.
|
of make does respect case sensitivity.
|
||||||
|
|
||||||
Version 3.76 contains some preliminary support for FAT.
|
Version 3.76 contains some preliminary support for FAT. Make
|
||||||
Make now tries to work around some difficulties with stat'ing of
|
now tries to work around some difficulties with stat'ing of
|
||||||
files and caching of filenames and directories internally.
|
files and caching of filenames and directories internally.
|
||||||
There is still a known problem with filenames sometimes being found
|
There is still a known problem with filenames sometimes being
|
||||||
to have modification dates in the future which cause make to
|
found to have modification dates in the future which cause make
|
||||||
complain about the file and exit (remake.c).
|
to complain about the file and exit (remake.c).
|
||||||
|
|
||||||
Bug reports:
|
Bug reports:
|
||||||
|
|
||||||
Please submit bugs via the normal bug reporting mechanism
|
Please submit bugs via the normal bug reporting mechanism
|
||||||
which is described in one of the texinfo files. If you don't
|
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
|
have Texinfo for Windows NT or Windows 95, these files are simple
|
||||||
text files and can be read with a text editor.
|
text files and can be read with a text editor.
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ AC_REVISION([$Id$])
|
|||||||
AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required.
|
AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required.
|
||||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
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)
|
AM_CONFIG_HEADER(config.h)
|
||||||
AC_CONFIG_SUBDIRS(glob)
|
AC_CONFIG_SUBDIRS(glob)
|
||||||
|
|
||||||
|
361
function.c
361
function.c
@ -160,14 +160,14 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
|||||||
if (len < pattern_prepercent_len + pattern_postpercent_len)
|
if (len < pattern_prepercent_len + pattern_postpercent_len)
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
/* Does the prefix match? */
|
/* Does the prefix match? */
|
||||||
if (!fail && pattern_prepercent_len > 0
|
if (!fail && pattern_prepercent_len > 0
|
||||||
&& (*t != *pattern
|
&& (*t != *pattern
|
||||||
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|
||||||
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
|
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
/* Does the suffix match? */
|
/* Does the suffix match? */
|
||||||
if (!fail && pattern_postpercent_len > 0
|
if (!fail && pattern_postpercent_len > 0
|
||||||
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|
||||||
|| t[len - pattern_postpercent_len] != pattern_percent[1]
|
|| 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. */
|
The output is written into VARIABLE_BUFFER starting at O. */
|
||||||
|
|
||||||
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
||||||
#define BADARGS(func) \
|
#define BADARGS(func) \
|
||||||
if (reading_filename != 0) \
|
if (reading_filename != 0) \
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
||||||
"insufficient arguments to function `%s'", \
|
"insufficient arguments to function `%s'", \
|
||||||
func); \
|
func); \
|
||||||
else \
|
else \
|
||||||
fatal ("insufficient arguments to function `%s'", func)
|
fatal ("insufficient arguments to function `%s'", func)
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@ -349,12 +349,12 @@ expand_function (o, function, text, end)
|
|||||||
case function_shell:
|
case function_shell:
|
||||||
{
|
{
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
SECURITY_ATTRIBUTES saAttr;
|
SECURITY_ATTRIBUTES saAttr;
|
||||||
HANDLE hIn;
|
HANDLE hIn;
|
||||||
HANDLE hErr;
|
HANDLE hErr;
|
||||||
HANDLE hChildOutRd;
|
HANDLE hChildOutRd;
|
||||||
HANDLE hChildOutWr;
|
HANDLE hChildOutWr;
|
||||||
HANDLE hProcess;
|
HANDLE hProcess;
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
FILE *fpipe;
|
FILE *fpipe;
|
||||||
@ -380,7 +380,7 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
/* Using a target environment for `shell' loses in cases like:
|
/* 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)
|
because target_environment hits a loop trying to expand $(var)
|
||||||
to put it in the environment. This is even more confusing when
|
to put it in the environment. This is even more confusing when
|
||||||
var was not explicitly exported, but just appeared in the
|
var was not explicitly exported, but just appeared in the
|
||||||
@ -391,7 +391,7 @@ expand_function (o, function, text, end)
|
|||||||
/* Construct the environment. */
|
/* Construct the environment. */
|
||||||
envp = target_environment ((struct file *) 0);
|
envp = target_environment ((struct file *) 0);
|
||||||
#endif
|
#endif
|
||||||
#endif /* Not Amiga. */
|
#endif /* Not Amiga. */
|
||||||
|
|
||||||
/* For error messages. */
|
/* For error messages. */
|
||||||
if (reading_filename != 0)
|
if (reading_filename != 0)
|
||||||
@ -405,111 +405,111 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
# ifdef WINDOWS32
|
# ifdef WINDOWS32
|
||||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
saAttr.bInheritHandle = TRUE;
|
saAttr.bInheritHandle = TRUE;
|
||||||
saAttr.lpSecurityDescriptor = NULL;
|
saAttr.lpSecurityDescriptor = NULL;
|
||||||
|
|
||||||
if (DuplicateHandle(GetCurrentProcess(),
|
if (DuplicateHandle(GetCurrentProcess(),
|
||||||
GetStdHandle(STD_INPUT_HANDLE),
|
GetStdHandle(STD_INPUT_HANDLE),
|
||||||
GetCurrentProcess(),
|
GetCurrentProcess(),
|
||||||
&hIn,
|
&hIn,
|
||||||
0,
|
0,
|
||||||
TRUE,
|
TRUE,
|
||||||
DUPLICATE_SAME_ACCESS) == FALSE) {
|
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||||
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
|
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
if (DuplicateHandle(GetCurrentProcess(),
|
if (DuplicateHandle(GetCurrentProcess(),
|
||||||
GetStdHandle(STD_ERROR_HANDLE),
|
GetStdHandle(STD_ERROR_HANDLE),
|
||||||
GetCurrentProcess(),
|
GetCurrentProcess(),
|
||||||
&hErr,
|
&hErr,
|
||||||
0,
|
0,
|
||||||
TRUE,
|
TRUE,
|
||||||
DUPLICATE_SAME_ACCESS) == FALSE) {
|
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||||
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
|
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
||||||
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
|
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
|
||||||
|
|
||||||
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
||||||
|
|
||||||
if (!hProcess)
|
if (!hProcess)
|
||||||
fatal("expand_function: process_init_fd() failed\n");
|
fatal("expand_function: process_init_fd() failed\n");
|
||||||
else
|
else
|
||||||
process_register(hProcess);
|
process_register(hProcess);
|
||||||
|
|
||||||
/* make sure that CreateProcess() has Path it needs */
|
/* make sure that CreateProcess() has Path it needs */
|
||||||
sync_Path_environment();
|
sync_Path_environment();
|
||||||
|
|
||||||
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
|
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
|
||||||
pid = (int) hProcess;
|
pid = (int) hProcess;
|
||||||
else
|
else
|
||||||
fatal("expand_function: unable to launch process (e=%d)\n",
|
fatal("expand_function: unable to launch process (e=%d)\n",
|
||||||
process_last_err(hProcess));
|
process_last_err(hProcess));
|
||||||
|
|
||||||
/* set up to read data from child */
|
/* set up to read data from child */
|
||||||
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
||||||
|
|
||||||
/* this will be closed almost right away */
|
/* this will be closed almost right away */
|
||||||
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
||||||
# else /* WINDOWS32 */
|
# else /* WINDOWS32 */
|
||||||
# ifdef __MSDOS__
|
# ifdef __MSDOS__
|
||||||
{
|
{
|
||||||
/* MSDOS can't fork, but it has `popen'.
|
/* MSDOS can't fork, but it has `popen'.
|
||||||
(Bwt, why isn't `popen' used in all the versions?) */
|
(Bwt, why isn't `popen' used in all the versions?) */
|
||||||
struct variable *sh = lookup_variable ("SHELL", 5);
|
struct variable *sh = lookup_variable ("SHELL", 5);
|
||||||
int e;
|
int e;
|
||||||
extern int dos_command_running, dos_status;
|
extern int dos_command_running, dos_status;
|
||||||
|
|
||||||
/* Make sure not to bother processing an empty line. */
|
/* Make sure not to bother processing an empty line. */
|
||||||
while (isblank (*text))
|
while (isblank (*text))
|
||||||
++text;
|
++text;
|
||||||
if (*text == '\0')
|
if (*text == '\0')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (sh)
|
if (sh)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX + 7];
|
char buf[PATH_MAX + 7];
|
||||||
/* This makes sure $SHELL value is used by $(shell), even
|
/* This makes sure $SHELL value is used by $(shell), even
|
||||||
though the target environment is not passed to it. */
|
though the target environment is not passed to it. */
|
||||||
sprintf (buf, "SHELL=%s", sh->value);
|
sprintf (buf, "SHELL=%s", sh->value);
|
||||||
putenv (buf);
|
putenv (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
e = errno;
|
e = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
dos_command_running = 1;
|
dos_command_running = 1;
|
||||||
dos_status = 0;
|
dos_status = 0;
|
||||||
fpipe = popen (text, "rt");
|
fpipe = popen (text, "rt");
|
||||||
dos_command_running = 0;
|
dos_command_running = 0;
|
||||||
if (!fpipe || dos_status)
|
if (!fpipe || dos_status)
|
||||||
{
|
{
|
||||||
pipedes[0] = -1;
|
pipedes[0] = -1;
|
||||||
pid = -1;
|
pid = -1;
|
||||||
if (dos_status)
|
if (dos_status)
|
||||||
errno = EINTR;
|
errno = EINTR;
|
||||||
else if (errno == 0)
|
else if (errno == 0)
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
shell_function_completed = -1;
|
shell_function_completed = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pipedes[0] = fileno (fpipe);
|
pipedes[0] = fileno (fpipe);
|
||||||
pid = 42;
|
pid = 42;
|
||||||
errno = e;
|
errno = e;
|
||||||
shell_function_completed = 1;
|
shell_function_completed = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pipedes[0] < 0)
|
if (pipedes[0] < 0)
|
||||||
# else /* ! __MSDOS__ */
|
# else /* ! __MSDOS__ */
|
||||||
if (pipe (pipedes) < 0)
|
if (pipe (pipedes) < 0)
|
||||||
# endif /* __MSDOS__ */
|
# endif /* __MSDOS__ */
|
||||||
{
|
{
|
||||||
perror_with_name (error_prefix, "pipe");
|
perror_with_name (error_prefix, "pipe");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifndef __MSDOS__
|
# ifndef __MSDOS__
|
||||||
pid = vfork ();
|
pid = vfork ();
|
||||||
@ -606,28 +606,41 @@ expand_function (o, function, text, end)
|
|||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
if (buffer[i - 1] == '\n')
|
if (buffer[i - 1] == '\n')
|
||||||
buffer[--i] = '\0';
|
{
|
||||||
|
if (i > 1 && buffer[i - 2] == '\r')
|
||||||
|
--i;
|
||||||
|
buffer[--i] = '\0';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
buffer[i] = '\0';
|
buffer[i] = '\0';
|
||||||
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
while ((p = index (p, '\n')) != 0)
|
for (p2=p; *p != '\0'; ++p)
|
||||||
*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);
|
o = variable_buffer_output (o, buffer, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#else /* Amiga */
|
#else /* Amiga */
|
||||||
{
|
{
|
||||||
/* Amiga can't fork nor spawn, but I can start a program with
|
/* 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,
|
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
|
we save our own stdout onto a new descriptor and dup a temp
|
||||||
file's descriptor onto our stdout temporarily. After we
|
file's descriptor onto our stdout temporarily. After we
|
||||||
spawn the shell program, we dup our own stdout back to the
|
spawn the shell program, we dup our own stdout back to the
|
||||||
stdout descriptor. The buffer reading is the same as above,
|
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 <dos/dos.h>
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
|
|
||||||
@ -699,7 +712,7 @@ expand_function (o, function, text, end)
|
|||||||
}
|
}
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#endif /* Not Amiga. */
|
#endif /* Not Amiga. */
|
||||||
|
|
||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
@ -1051,13 +1064,13 @@ expand_function (o, function, text, end)
|
|||||||
p2 = text;
|
p2 = text;
|
||||||
while (*p2 != '\0')
|
while (*p2 != '\0')
|
||||||
{
|
{
|
||||||
while (isspace(*p2))
|
while (isspace(*p2))
|
||||||
++p2;
|
++p2;
|
||||||
p = p2;
|
p = p2;
|
||||||
for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
|
for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
|
||||||
{}
|
{}
|
||||||
if (!i)
|
if (!i)
|
||||||
break;
|
break;
|
||||||
o = variable_buffer_output (o, p, i);
|
o = variable_buffer_output (o, p, i);
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
doneany = 1;
|
doneany = 1;
|
||||||
@ -1235,42 +1248,42 @@ index argument");
|
|||||||
|
|
||||||
/* Check the next argument */
|
/* Check the next argument */
|
||||||
for (p2 = p + 1; isblank(*p2); ++p2)
|
for (p2 = p + 1; isblank(*p2); ++p2)
|
||||||
{}
|
{}
|
||||||
count = 0;
|
count = 0;
|
||||||
for (p = p2; p < end; ++p)
|
for (p = p2; p < end; ++p)
|
||||||
{
|
{
|
||||||
if (*p == startparen)
|
if (*p == startparen)
|
||||||
++count;
|
++count;
|
||||||
else if (*p == endparen)
|
else if (*p == endparen)
|
||||||
--count;
|
--count;
|
||||||
else if (*p == ',' && count <= 0)
|
else if (*p == ',' && count <= 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (p == end)
|
if (p == end)
|
||||||
BADARGS ("wordlist");
|
BADARGS ("wordlist");
|
||||||
text = expand_argument (p2, p);
|
text = expand_argument (p2, p);
|
||||||
|
|
||||||
for (p2 = text; *p2 != '\0'; ++p2)
|
for (p2 = text; *p2 != '\0'; ++p2)
|
||||||
if (*p2 < '0' || *p2 > '9')
|
if (*p2 < '0' || *p2 > '9')
|
||||||
{
|
{
|
||||||
if (reading_filename != 0)
|
if (reading_filename != 0)
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
"non-numeric second argument to `wordlist' function");
|
"non-numeric second argument to `wordlist' function");
|
||||||
else
|
else
|
||||||
fatal ("non-numeric second argument to `wordlist' function");
|
fatal ("non-numeric second argument to `wordlist' function");
|
||||||
}
|
}
|
||||||
j = (unsigned int)atoi(text);
|
j = (unsigned int)atoi(text);
|
||||||
free (text);
|
free (text);
|
||||||
|
|
||||||
if (j > i)
|
if (j > i)
|
||||||
j -= i;
|
j -= i;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
k = j;
|
k = j;
|
||||||
j = i - j;
|
j = i - j;
|
||||||
i = k;
|
i = k;
|
||||||
}
|
}
|
||||||
++j;
|
++j;
|
||||||
|
|
||||||
/* Extract the requested words */
|
/* Extract the requested words */
|
||||||
@ -1278,13 +1291,13 @@ index argument");
|
|||||||
p2 = text;
|
p2 = text;
|
||||||
|
|
||||||
while (((p = find_next_token (&p2, &len)) != 0) && --i)
|
while (((p = find_next_token (&p2, &len)) != 0) && --i)
|
||||||
{}
|
{}
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
while (--j && (find_next_token (&p2, &len) != 0))
|
while (--j && (find_next_token (&p2, &len) != 0))
|
||||||
{}
|
{}
|
||||||
o = variable_buffer_output (o, p, p2 - p);
|
o = variable_buffer_output (o, p, p2 - p);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
@ -1366,34 +1379,34 @@ index argument");
|
|||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
while (p >= p2 && *p != ']'
|
while (p >= p2 && *p != ']'
|
||||||
&& (function != function_basename || *p != '.'))
|
&& (function != function_basename || *p != '.'))
|
||||||
#else
|
#else
|
||||||
# ifdef __MSDOS__
|
# ifdef __MSDOS__
|
||||||
while (p >= p2 && *p != '/' && *p != '\\'
|
while (p >= p2 && *p != '/' && *p != '\\'
|
||||||
&& (function != function_basename || *p != '.'))
|
&& (function != function_basename || *p != '.'))
|
||||||
# else
|
# else
|
||||||
while (p >= p2 && *p != '/'
|
while (p >= p2 && *p != '/'
|
||||||
&& (function != function_basename || *p != '.'))
|
&& (function != function_basename || *p != '.'))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2 && (function == function_dir))
|
if (p >= p2 && (function == function_dir))
|
||||||
o = variable_buffer_output (o, p2, ++p - p2);
|
o = variable_buffer_output (o, p2, ++p - p2);
|
||||||
else if (p >= p2 && (*p == '.'))
|
else if (p >= p2 && (*p == '.'))
|
||||||
o = variable_buffer_output (o, p2, p - p2);
|
o = variable_buffer_output (o, p2, p - p2);
|
||||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
/* Handle the "d:foobar" case */
|
/* Handle the "d:foobar" case */
|
||||||
else if (p2[0] && p2[1] == ':' && function == function_dir)
|
else if (p2[0] && p2[1] == ':' && function == function_dir)
|
||||||
o = variable_buffer_output (o, p2, 2);
|
o = variable_buffer_output (o, p2, 2);
|
||||||
#endif
|
#endif
|
||||||
else if (function == function_dir)
|
else if (function == function_dir)
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
o = variable_buffer_output (o, "[]", 2);
|
o = variable_buffer_output (o, "[]", 2);
|
||||||
#else
|
#else
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
o = variable_buffer_output (o, "./", 2);
|
o = variable_buffer_output (o, "./", 2);
|
||||||
#else
|
#else
|
||||||
/* o = o */; /* Just a nop... */
|
/* o = o */; /* Just a nop... */
|
||||||
#endif /* AMIGA */
|
#endif /* AMIGA */
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
else
|
else
|
||||||
@ -1421,32 +1434,32 @@ index argument");
|
|||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
while (p >= p2 && *p != ']'
|
while (p >= p2 && *p != ']'
|
||||||
&& (function != function_suffix || *p != '.'))
|
&& (function != function_suffix || *p != '.'))
|
||||||
#else
|
#else
|
||||||
# ifdef __MSDOS__
|
# ifdef __MSDOS__
|
||||||
while (p >= p2 && *p != '/' && *p != '\\'
|
while (p >= p2 && *p != '/' && *p != '\\'
|
||||||
&& (function != function_suffix || *p != '.'))
|
&& (function != function_suffix || *p != '.'))
|
||||||
# else
|
# else
|
||||||
while (p >= p2 && *p != '/'
|
while (p >= p2 && *p != '/'
|
||||||
&& (function != function_suffix || *p != '.'))
|
&& (function != function_suffix || *p != '.'))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2)
|
||||||
{
|
{
|
||||||
if (function == function_notdir)
|
if (function == function_notdir)
|
||||||
++p;
|
++p;
|
||||||
else if (*p != '.')
|
else if (*p != '.')
|
||||||
continue;
|
continue;
|
||||||
o = variable_buffer_output (o, p, len - (p - p2));
|
o = variable_buffer_output (o, p, len - (p - p2));
|
||||||
}
|
}
|
||||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
/* Handle the case of "d:foo/bar". */
|
/* Handle the case of "d:foo/bar". */
|
||||||
else if (function == function_notdir && p2[0] && p2[1] == ':')
|
else if (function == function_notdir && p2[0] && p2[1] == ':')
|
||||||
{
|
{
|
||||||
p = p2 + 2;
|
p = p2 + 2;
|
||||||
o = variable_buffer_output (o, p, len - (p - p2));
|
o = variable_buffer_output (o, p, len - (p - p2));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (function == function_notdir)
|
else if (function == function_notdir)
|
||||||
o = variable_buffer_output (o, p2, len);
|
o = variable_buffer_output (o, p2, len);
|
||||||
|
@ -40,6 +40,13 @@ build.sh.in: build.template Makefile.am
|
|||||||
$< > $@
|
$< > $@
|
||||||
chmod a-w+x $@
|
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.
|
# Put the alpha distribution files up for anonymous FTP.
|
||||||
#
|
#
|
||||||
ALPHA := ~ftp/gnu
|
ALPHA := ~ftp/gnu
|
||||||
|
40
make.texinfo
40
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
|
(@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
|
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,
|
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
|
before substituting it into the surrounding text, is to convert each
|
||||||
spaces.@refill
|
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
|
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
|
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,
|
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.
|
@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
|
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
|
starts with @samp{-} or contains an @samp{=}, in which case it will be
|
||||||
parsed as a switch or variable definition, respectively). Even
|
parsed as a switch or variable definition, respectively). Even
|
||||||
targets not in the makefile may be specified, if @code{make} can find
|
targets not in the makefile may be specified, if @code{make} can find
|
||||||
implicit rules that say how to make them.
|
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
|
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
|
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
|
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.@*
|
a makefile to set flags.@*
|
||||||
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
@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
|
@item SUFFIXES
|
||||||
|
|
||||||
The default list of suffixes before @code{make} reads any makefiles.
|
The default list of suffixes before @code{make} reads any makefiles.
|
||||||
|
@ -12,10 +12,6 @@ Make with this makefile to rebuild.
|
|||||||
|
|
||||||
Here are some notes about GNU Make for VMS:
|
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
|
The variable $^ separates files with commas instead of spaces (It's the
|
||||||
natural thing to do for VMS).
|
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 ('\').
|
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||||
E.g.- hobbes\:[bogas.files]
|
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-).
|
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
|
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||||
this in your makefile, or whatever).
|
this in your makefile, or whatever).
|
||||||
|
@ -38,11 +38,15 @@ convert_Path_to_windows32(char *Path, char to_delim)
|
|||||||
if ((etok - p) == 1) {
|
if ((etok - p) == 1) {
|
||||||
if (*(etok - 1) == ';' ||
|
if (*(etok - 1) == ';' ||
|
||||||
*(etok - 1) == ':') {
|
*(etok - 1) == ':') {
|
||||||
etok[-1] = to_delim;
|
etok[-1] = to_delim;
|
||||||
etok[0] = to_delim;
|
etok[0] = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
continue; /* ignore empty bucket */
|
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 */
|
/* found one to count, handle drive letter */
|
||||||
*etok = to_delim;
|
*etok = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
@ -55,11 +59,6 @@ convert_Path_to_windows32(char *Path, char to_delim)
|
|||||||
p = ++etok;
|
p = ++etok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* convert to backward slashes */
|
|
||||||
for (p = Path, p = strchr(p, '/'); p; p = strchr(p, '/'))
|
|
||||||
*p = '\\';
|
|
||||||
#endif
|
|
||||||
return Path;
|
return Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user