* Some final cleanups, and release 3.79.

This commit is contained in:
Paul Smith 2000-04-05 16:02:55 +00:00
parent f3a974bf32
commit f9c91ec34d
9 changed files with 173 additions and 113 deletions

View File

@ -1,3 +1,12 @@
2000-04-04 Paul D. Smith <psmith@gnu.org>
* Version 3.79 released.
* make.texinfo: Update documentation with new features for 3.79.
* function.c (func_wordlist): Don't re-order arguments to
wordlist.
2000-04-03 Paul D. Smith <psmith@gnu.org> 2000-04-03 Paul D. Smith <psmith@gnu.org>
* remake.c (f_mtime): Archive member timestamps are stored as * remake.c (f_mtime): Archive member timestamps are stored as

8
NEWS
View File

@ -39,8 +39,8 @@ Version 3.79
* The --debug option has changed: it now allows optional flags * The --debug option has changed: it now allows optional flags
controlling the amount and type of debugging output. By default only controlling the amount and type of debugging output. By default only
a minimal amount information is generated, displaying the names of a minimal amount information is generated, displaying the names of
"normal" targets (not makefiles) were deemed out of date and in need "normal" targets (not makefiles) that were deemed out of date and in
of being rebuilt. need of being rebuilt.
Note that the -d option behaves as before: it takes no arguments and Note that the -d option behaves as before: it takes no arguments and
all debugging information is generated. all debugging information is generated.
@ -48,6 +48,10 @@ Version 3.79
* The `-p' (print database) output now includes filename and linenumber * The `-p' (print database) output now includes filename and linenumber
information for variable definitions, to help debugging. information for variable definitions, to help debugging.
* The wordlist function no longer reverses its arguments if the "start"
value is greater than the "end" value. If that's true, nothing is
returned.
* Hartmut Becker provided many updates for the VMS port of GNU make. * Hartmut Becker provided many updates for the VMS port of GNU make.
See the readme.vms file for more details. See the readme.vms file for more details.

View File

@ -3,7 +3,7 @@ AC_REVISION([$Id$])
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required. AC_PREREQ(2.13)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.78.92) AM_INIT_AUTOMAKE(make, 3.79)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
dnl Regular configure stuff dnl Regular configure stuff

View File

@ -37,7 +37,7 @@ struct function_table_entry
unsigned char minimum_args; unsigned char minimum_args;
unsigned char maximum_args; unsigned char maximum_args;
char expand_args; char expand_args;
char *(*func_ptr) PARAMS((char *output, char **argv, const char*funcname)); char *(*func_ptr) PARAMS ((char *output, char **argv, const char *fname));
}; };
@ -231,7 +231,7 @@ lookup_function (table, s)
const struct function_table_entry *table; const struct function_table_entry *table;
const char *s; const char *s;
{ {
int len = strlen(s); int len = strlen (s);
for (; table->name != NULL; ++table) for (; table->name != NULL; ++table)
if (table->len <= len if (table->len <= len
@ -386,7 +386,7 @@ func_patsubst (o, argv, funcname)
static char * static char *
func_join(o, argv, funcname) func_join (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -429,7 +429,7 @@ func_join(o, argv, funcname)
static char * static char *
func_origin(o, argv, funcname) func_origin (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -483,7 +483,7 @@ func_origin(o, argv, funcname)
static char * static char *
func_notdir_suffix(o, argv, funcname) func_notdir_suffix (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -518,7 +518,7 @@ func_notdir_suffix(o, argv, funcname)
} }
#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 (streq(funcname, "notdir") && p2[0] && p2[1] == ':') else if (streq (funcname, "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));
@ -544,7 +544,7 @@ func_notdir_suffix(o, argv, funcname)
static char * static char *
func_basename_dir(o, argv, funcname) func_basename_dir (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -603,7 +603,7 @@ func_basename_dir(o, argv, funcname)
} }
static char * static char *
func_addsuffix_addprefix(o, argv, funcname) func_addsuffix_addprefix (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -636,7 +636,7 @@ func_addsuffix_addprefix(o, argv, funcname)
} }
static char * static char *
func_subst(o, argv, funcname) func_subst (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -649,7 +649,7 @@ func_subst(o, argv, funcname)
static char * static char *
func_firstword(o, argv, funcname) func_firstword (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -666,7 +666,7 @@ func_firstword(o, argv, funcname)
static char * static char *
func_words(o, argv, funcname) func_words (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -724,7 +724,7 @@ check_numeric (s, message)
static char * static char *
func_word(o, argv, funcname) func_word (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -758,45 +758,42 @@ func_wordlist (o, argv, funcname)
char **argv; char **argv;
const char *funcname; const char *funcname;
{ {
int i=0; int start, count;
int j=0;
/* Check the first argument. */ /* Check the arguments. */
check_numeric (argv[0], check_numeric (argv[0],
_("non-numeric first argument to `wordlist' function")); _("non-numeric first argument to `wordlist' function"));
i =atoi(argv[0]);
check_numeric (argv[1], check_numeric (argv[1],
_("non-numeric second argument to `wordlist' function")); _("non-numeric second argument to `wordlist' function"));
j = atoi(argv[1]); start = atoi (argv[0]);
count = atoi (argv[1]) - start + 1;
if (count > 0)
{
char *p;
char *end_p = argv[2];
{ /* Find the beginning of the "start"th word. */
char *p; while (((p = find_next_token (&end_p, 0)) != 0) && --start)
char *end_p = argv[2]; ;
int start = (i < j) ? i : j; if (p)
int count = j -i ; {
if (count < 0) /* Find the end of the "count"th word from start. */
count = - count; while (--count && (find_next_token (&end_p, 0) != 0))
count ++; ;
/* Return the stuff in the middle. */
o = variable_buffer_output (o, p, end_p - p);
}
}
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
{}
if (p)
{
while (--count && (find_next_token (&end_p, 0) != 0))
{}
o = variable_buffer_output (o, p, end_p - p);
}
}
return o; return o;
} }
static char* static char*
func_findstring(o, argv, funcname) func_findstring (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -888,7 +885,7 @@ func_filter_filterout (o, argv, funcname)
/* Chop ARGV[1] up into words and then run each pattern through. */ /* Chop ARGV[1] up into words and then run each pattern through. */
while ((p = find_next_token (&word_iterator, &len)) != 0) while ((p = find_next_token (&word_iterator, &len)) != 0)
{ {
struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word)); struct a_word *w = (struct a_word *)alloca (sizeof (struct a_word));
if (wordhead == 0) if (wordhead == 0)
wordhead = w; wordhead = w;
else else
@ -944,7 +941,7 @@ func_filter_filterout (o, argv, funcname)
static char * static char *
func_strip(o, argv, funcname) func_strip (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -992,18 +989,18 @@ func_error (o, argv, funcname)
another special case where function arguments aren't broken up, another special case where function arguments aren't broken up,
just create a format string that puts them back together. */ just create a format string that puts them back together. */
for (len=0, argvp=argv; *argvp != 0; ++argvp) for (len=0, argvp=argv; *argvp != 0; ++argvp)
len += strlen(*argvp) + 2; len += strlen (*argvp) + 2;
p = msg = alloca (len + 1); p = msg = alloca (len + 1);
for (argvp=argv; argvp[1] != 0; ++argvp) for (argvp=argv; argvp[1] != 0; ++argvp)
{ {
strcpy(p, *argvp); strcpy (p, *argvp);
p += strlen(*argvp); p += strlen (*argvp);
*(p++) = ','; *(p++) = ',';
*(p++) = ' '; *(p++) = ' ';
} }
strcpy(p, *argvp); strcpy (p, *argvp);
if (*funcname == 'e') if (*funcname == 'e')
fatal (reading_file, "%s", msg); fatal (reading_file, "%s", msg);
@ -1128,7 +1125,7 @@ func_if (o, argv, funcname)
} }
static char * static char *
func_wildcard(o, argv, funcname) func_wildcard (o, argv, funcname)
char *o; char *o;
char **argv; char **argv;
const char *funcname; const char *funcname;
@ -1197,11 +1194,11 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
HANDLE hProcess; HANDLE hProcess;
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,
@ -1371,7 +1368,7 @@ func_shell (o, argv, funcname)
/* For error messages. */ /* For error messages. */
if (reading_file != 0) if (reading_file != 0)
{ {
error_prefix = (char *) alloca (strlen(reading_file->filenm)+11+4); error_prefix = (char *) alloca (strlen (reading_file->filenm)+11+4);
sprintf (error_prefix, sprintf (error_prefix,
"%s:%lu: ", reading_file->filenm, reading_file->lineno); "%s:%lu: ", reading_file->filenm, reading_file->lineno);
} }
@ -1470,8 +1467,8 @@ func_shell (o, argv, funcname)
if (batch_filename) { if (batch_filename) {
DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"), DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
batch_filename)); batch_filename));
remove(batch_filename); remove (batch_filename);
free(batch_filename); free (batch_filename);
} }
shell_function_pid = 0; shell_function_pid = 0;
@ -1623,7 +1620,7 @@ func_not (char* o, char **argv, char *funcname)
#endif #endif
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof(_s)-1) #define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1)
/* Lookup table for builtin functions. /* Lookup table for builtin functions.
@ -1637,7 +1634,7 @@ func_not (char* o, char **argv, char *funcname)
EXPAND_ARGS means that all arguments should be expanded before invocation. EXPAND_ARGS means that all arguments should be expanded before invocation.
Functions that do namespace tricks (foreach) don't automatically expand. */ Functions that do namespace tricks (foreach) don't automatically expand. */
static char *func_call PARAMS((char *o, char **argv, const char *funcname)); static char *func_call PARAMS ((char *o, char **argv, const char *funcname));
static struct function_table_entry function_table[] = static struct function_table_entry function_table[] =
@ -1751,7 +1748,7 @@ handle_function (op, stringp)
*stringp = end; *stringp = end;
/* Get some memory to store the arg pointers. */ /* Get some memory to store the arg pointers. */
argvp = argv = (char **) alloca (sizeof(char *) * (nargs + 2)); argvp = argv = (char **) alloca (sizeof (char *) * (nargs + 2));
/* Chop the string into arguments, then a nul. As soon as we hit /* Chop the string into arguments, then a nul. As soon as we hit
MAXIMUM_ARGS (if it's >0) assume the rest of the string is part of the MAXIMUM_ARGS (if it's >0) assume the rest of the string is part of the
@ -1833,7 +1830,7 @@ func_call (o, argv, funcname)
while (*fname != '\0' && isspace ((unsigned char)*fname)) while (*fname != '\0' && isspace ((unsigned char)*fname))
++fname; ++fname;
cp = fname + strlen(fname) - 1; cp = fname + strlen (fname) - 1;
while (cp > fname && isspace ((unsigned char)*cp)) while (cp > fname && isspace ((unsigned char)*cp))
--cp; --cp;
cp[1] = '\0'; cp[1] = '\0';
@ -1886,5 +1883,5 @@ func_call (o, argv, funcname)
pop_variable_scope (); pop_variable_scope ();
return o + strlen(o); return o + strlen (o);
} }

View File

@ -8,10 +8,10 @@
@c FSF publishers: format makebook.texi instead of using this file directly. @c FSF publishers: format makebook.texi instead of using this file directly.
@set RCSID $Id$ @set RCSID $Id$
@set EDITION 0.54 @set EDITION 0.55
@set VERSION 3.78.1 @set VERSION 3.79
@set UPDATED 09 September 1999 @set UPDATED 04 April 2000
@set UPDATE-MONTH September 1999 @set UPDATE-MONTH April 2000
@comment The ISBN number might need to change on next publication. @comment The ISBN number might need to change on next publication.
@set ISBN 1-882114-80-9 @c CHANGE THIS BEFORE PRINTING AGAIN! --psmith 16jul98 @set ISBN 1-882114-80-9 @c CHANGE THIS BEFORE PRINTING AGAIN! --psmith 16jul98
@ -37,7 +37,7 @@ and issues the commands to recompile them.
This is Edition @value{EDITION}, last updated @value{UPDATED}, This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}. of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99 Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99, 2000
Free Software Foundation, Inc. Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of Permission is granted to make and distribute verbatim copies of
@ -73,7 +73,7 @@ by the Free Software Foundation.
@author Richard M. Stallman and Roland McGrath @author Richard M. Stallman and Roland McGrath
@page @page
@vskip 0pt plus 1filll @vskip 0pt plus 1filll
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98 Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99, 2000
Free Software Foundation, Inc. Free Software Foundation, Inc.
@sp 2 @sp 2
Published by the Free Software Foundation @* Published by the Free Software Foundation @*
@ -134,7 +134,7 @@ This manual describes @code{make} and contains the following chapters:@refill
* Missing:: What GNU @code{make} lacks from other @code{make}s. * Missing:: What GNU @code{make} lacks from other @code{make}s.
* Makefile Conventions:: Conventions for makefiles in GNU programs. * Makefile Conventions:: Conventions for makefiles in GNU programs.
* Quick Reference:: A quick reference for experienced users. * Quick Reference:: A quick reference for experienced users.
* Make Errors:: A list of common errors generated by @code{make}. * Error Messages:: A list of common errors generated by @code{make}.
* Complex Makefile:: A real example of a straightforward, * Complex Makefile:: A real example of a straightforward,
but nontrivial, makefile. but nontrivial, makefile.
* Concept Index:: Index of Concepts * Concept Index:: Index of Concepts
@ -2479,7 +2479,7 @@ Sub-@code{make}}.
If @code{.NOTPARALLEL} is mentioned as a target, then this invocation of If @code{.NOTPARALLEL} is mentioned as a target, then this invocation of
@code{make} will be run serially, even if the @samp{-j} option is @code{make} will be run serially, even if the @samp{-j} option is
given. Any recursively invoked @code{make} command will still be run in given. Any recursively invoked @code{make} command will still be run in
parallel if its makefile doesn't contain this target. Any prerequisites parallel (unless its makefile contains this target). Any prerequisites
on this target are ignored. on this target are ignored.
@end table @end table
@ -5854,8 +5854,7 @@ ending with word @var{e} (inclusive). The legitimate values of @var{s}
and @var{e} start from 1. If @var{s} is bigger than the number of words and @var{e} start from 1. If @var{s} is bigger than the number of words
in @var{text}, the value is empty. If @var{e} is bigger than the number in @var{text}, the value is empty. If @var{e} is bigger than the number
of words in @var{text}, words up to the end of @var{text} are returned. of words in @var{text}, words up to the end of @var{text} are returned.
If @var{s} is greater than @var{e}, @code{make} swaps them for you. For If @var{s} is greater than @var{e}, nothing is returned. For example,
example,
@example @example
$(wordlist 2, 3, foo bar baz) $(wordlist 2, 3, foo bar baz)
@ -6060,6 +6059,12 @@ If @var{variable} is the name of a builtin function, the builtin function
is always invoked (even if a @code{make} variable by that name also is always invoked (even if a @code{make} variable by that name also
exists). exists).
The @code{call} function expands the @var{param} arguments before
assigning them to temporary variables. This means that @var{variable}
values containing references to builtin functions that have special
expansion rules, like @code{foreach} or @code{if}, may not work as you
expect.
Some examples may make this clearer. Some examples may make this clearer.
This macro simply reverses its arguments: This macro simply reverses its arguments:
@ -6067,12 +6072,11 @@ This macro simply reverses its arguments:
@smallexample @smallexample
reverse = $(2) $(1) reverse = $(2) $(1)
foo = a b foo = $(call reverse,a,b)
bar = $(call reverse,$(foo))
@end smallexample @end smallexample
@noindent @noindent
Here @var{bar} will contain @samp{b a}. Here @var{foo} will contain @samp{b a}.
This one is slightly more interesting: it defines a macro to search for This one is slightly more interesting: it defines a macro to search for
the first instance of a program in @code{PATH}: the first instance of a program in @code{PATH}:
@ -6803,8 +6807,6 @@ This is typically used with recursive invocations of @code{make}
@item -d @item -d
@cindex @code{-d} @cindex @code{-d}
@itemx --debug
@cindex @code{--debug}
@c Extra blank line here makes the table look better. @c Extra blank line here makes the table look better.
Print debugging information in addition to normal processing. The Print debugging information in addition to normal processing. The
@ -6812,7 +6814,46 @@ debugging information says which files are being considered for
remaking, which file-times are being compared and with what results, remaking, which file-times are being compared and with what results,
which files actually need to be remade, which implicit rules are which files actually need to be remade, which implicit rules are
considered and which are applied---everything interesting about how considered and which are applied---everything interesting about how
@code{make} decides what to do. @code{make} decides what to do. The @code{-d} option is equivalent to
@samp{--debug=a} (see below).
@item --debug[=@var{options}]
@cindex @code{--debug}
@c Extra blank line here makes the table look better.
Print debugging information in addition to normal processing. Various
levels and types of output can be chosen. With no arguments, print the
``basic'' level of debugging. Possible arguments are below; only the
first character is considered, and values must be comma- or
space-separated.
@table @code
@item a@var{ll}
All types of debugging output is enabled. This is equivalent to using
@samp{-d}.
@item b@var{asic}
Basic debugging prints each target that was found to be out-of-date, and
whether the build was successful or not.
@item v@var{erbose}
A level above @samp{basic}; includes messages about which makefiles were
parsed, prerequisites that did not need to be rebuilt, etc. This option
also enables @samp{basic} messages.
@item i@var{mplicit}
Prints messages describing the implicit rule searches for each target.
This option also enables @samp{basic} messages.
@item j@var{obs}
Prints messages giving details on the invocation of specific subcommands.
@item m@var{akefile}
By default, the above messages are not enabled while trying to remake
the makefiles. This option enables messages while rebuilding makefiles,
too. Note that the @samp{all} option does enable this option. This
option also enables @samp{basic} messages.
@end table
@item -e @item -e
@cindex @code{-e} @cindex @code{-e}
@ -6857,7 +6898,7 @@ searched in the order specified.
@item -j [@var{jobs}] @item -j [@var{jobs}]
@cindex @code{-j} @cindex @code{-j}
@itemx --jobs=[@var{jobs}] @itemx --jobs[=@var{jobs}]
@cindex @code{--jobs} @cindex @code{--jobs}
Specifies the number of jobs (commands) to run simultaneously. With no Specifies the number of jobs (commands) to run simultaneously. With no
argument, @code{make} runs as many jobs simultaneously as possible. If argument, @code{make} runs as many jobs simultaneously as possible. If
@ -6920,7 +6961,9 @@ reading the makefiles; then execute as usual or as otherwise specified.
This also prints the version information given by the @samp{-v} switch This also prints the version information given by the @samp{-v} switch
(see below). To print the data base without trying to remake any files, (see below). To print the data base without trying to remake any files,
use @w{@samp{make -qp}}. To print the data base of predefined rules and use @w{@samp{make -qp}}. To print the data base of predefined rules and
variables, use @w{@samp{make -p -f /dev/null}}. variables, use @w{@samp{make -p -f /dev/null}}. The data base output
contains filename and linenumber information for command and variable
definitions, so it can be a useful debugging tool in complex environments.
@item -q @item -q
@cindex @code{-q} @cindex @code{-q}
@ -9107,7 +9150,7 @@ special treatment.
@comment included by standards.texi. @comment included by standards.texi.
@include make-stds.texi @include make-stds.texi
@node Quick Reference, Make Errors, Makefile Conventions, Top @node Quick Reference, Error Messages, Makefile Conventions, Top
@appendix Quick Reference @appendix Quick Reference
This appendix summarizes the directives, text manipulation functions, This appendix summarizes the directives, text manipulation functions,
@ -9402,6 +9445,11 @@ 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}}.
It is @emph{never} appropriate to use @code{MAKEFLAGS} directly on a
command line: its contents may not be quoted correctly for use in the
shell. Always allow recursive @code{make}'s to obtain these values
through the environment from its parent.
@item MAKECMDGOALS @item MAKECMDGOALS
The targets given to @code{make} on the command line. Setting this The targets given to @code{make} on the command line. Setting this
@ -9425,11 +9473,11 @@ order.@*
@xref{Libraries/Search, ,Directory Search for Link Libraries}. @xref{Libraries/Search, ,Directory Search for Link Libraries}.
@end table @end table
@node Make Errors, Complex Makefile, Quick Reference, Top @node Error Messages, Complex Makefile, Quick Reference, Top
@comment node-name, next, previous, up @comment node-name, next, previous, up
@appendix Errors Generated by Make @appendix Errors Generated by Make
Here is a list of the most common errors you might see generated by Here is a list of the more common errors you might see generated by
@code{make}, and some information about what they mean and how to fix @code{make}, and some information about what they mean and how to fix
them. them.
@ -9575,7 +9623,7 @@ sequential manner.
@end table @end table
@node Complex Makefile, Concept Index, Make Errors, Top @node Complex Makefile, Concept Index, Error Messages, Top
@appendix Complex Makefile Example @appendix Complex Makefile Example
Here is the makefile for the GNU @code{tar} program. This is a Here is the makefile for the GNU @code{tar} program. This is a

3
read.c
View File

@ -313,7 +313,6 @@ read_makefile (filename, flags)
{ \ { \
if (filenames != 0) \ if (filenames != 0) \
{ \ { \
int lineno = fileinfo.lineno; \
struct floc fi; \ struct floc fi; \
fi.filenm = fileinfo.filenm; \ fi.filenm = fileinfo.filenm; \
fi.lineno = tgts_started; \ fi.lineno = tgts_started; \
@ -331,7 +330,7 @@ read_makefile (filename, flags)
fileinfo.lineno = 1; fileinfo.lineno = 1;
pattern_percent = 0; pattern_percent = 0;
/* cmds_started = fileinfo.lineno; */ cmds_started = tgts_started = fileinfo.lineno;
if (ISDB (DB_VERBOSE)) if (ISDB (DB_VERBOSE))
{ {

View File

@ -1,3 +1,7 @@
2000-04-04 Paul D. Smith <psmith@gnu.org>
* scripts/functions/word: wordlist doesn't swap arguments anymore.
2000-03-27 Paul D. Smith <psmith@gnu.org> 2000-03-27 Paul D. Smith <psmith@gnu.org>
* scripts/features/statipattrules: Test that static pattern rules * scripts/features/statipattrules: Test that static pattern rules

View File

@ -1,33 +1,33 @@
$description = "The following test creates a makefile to test the word, words,\n" # -*-perl-*-
."and wordlist functions.\n"; $description = "Test the word, words, and wordlist functions.\n";
$details = "The word function will return the number of words in a variable or\n" $details = "\
."the word specified. The test will produce a variable with a large\n" Produce a variable with a large number of words in it,
."number of words in it, determine the number of word and then read\n" determine the number of words, and then read each one back.\n";
."each one back.\n";
open(MAKEFILE,"> $makefile"); open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ... # The Contents of the MAKEFILE ...
print MAKEFILE "string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl \n" print MAKEFILE <<'EOF';
."string2 := \$(string) \$(string) \$(string) \$(string) \$(string) \$(string) \$(string)\n" string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl
."string3 := \$(string2) \$(string2) \$(string2) \$(string2) \$(string2) \$(string2) \$(string2)\n" string2 := $(string) $(string) $(string) $(string) $(string) $(string) $(string)
."string4 := \$(string3) \$(string3) \$(string3) \$(string3) \$(string3) \$(string3) \$(string3)\n" string3 := $(string2) $(string2) $(string2) $(string2) $(string2) $(string2) $(string2)
."all: \n" string4 := $(string3) $(string3) $(string3) $(string3) $(string3) $(string3) $(string3)
."\t\@echo \$(words \$(string)) \n" all:
."\t\@echo \$(words \$(string4)) \n" @echo $(words $(string))
."\t\@echo \$(word 1, \$(string)) \n" @echo $(words $(string4))
."\t\@echo \$(word 100, \$(string)) \n" @echo $(word 1, $(string))
."\t\@echo \$(word 1, \$(string)) \n" @echo $(word 100, $(string))
."\t\@echo \$(word 1000, \$(string3)) \n" @echo $(word 1, $(string))
."\t\@echo \$(wordlist 3, 4, \$(string)) \n" @echo $(word 1000, $(string3))
."\t\@echo \$(wordlist 4, 3, \$(string)) \n" @echo $(wordlist 3, 4, $(string))
."\t\@echo \$(wordlist 1, 6, \$(string)) \n" @echo $(wordlist 4, 3, $(string))
."\t\@echo \$(wordlist 7, 5, \$(string)) \n" @echo $(wordlist 1, 6, $(string))
."\t\@echo \$(wordlist 100, 110, \$(string)) \n" @echo $(wordlist 5, 7, $(string))
."\t\@echo \$(wordlist 7, 10, \$(string2)) \n" @echo $(wordlist 100, 110, $(string))
; @echo $(wordlist 7, 10, $(string2))
EOF
@ -35,7 +35,7 @@ print MAKEFILE "string := word.pl general_test2.pl FORCE.pl word.pl generic_t
close(MAKEFILE); close(MAKEFILE);
&run_make_with_options($makefile,"",&get_logfile,0); &run_make_with_options($makefile, "", &get_logfile);
# Create the answer to what should be produced by this Makefile # Create the answer to what should be produced by this Makefile
@ -47,7 +47,7 @@ $answer = "6\n"
."word.pl\n" ."word.pl\n"
."\n" ."\n"
."FORCE.pl word.pl\n" ."FORCE.pl word.pl\n"
."FORCE.pl word.pl\n" ."\n"
."word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl\n" ."word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl\n"
."generic_test.perl MAKEFILES_variable.pl\n" ."generic_test.perl MAKEFILES_variable.pl\n"
."\n" ."\n"
@ -58,13 +58,7 @@ $answer = "6\n"
# to send the name of the last logfile created. You may also use # to send the name of the last logfile created. You may also use
# the special call &get_logfile(1) which returns the same as &get_logfile(1). # the special call &get_logfile(1) which returns the same as &get_logfile(1).
&compare_output($answer,&get_logfile(1)); &compare_output($answer, &get_logfile(1));
# This tells the test driver that the perl test script executed properly. # This tells the test driver that the perl test script executed properly.
1; 1;

View File

@ -50,6 +50,11 @@ EOF
close(MAKEFILE); close(MAKEFILE);
&touch('b'); &touch('b');
# Sometimes, on my Solaris 2.5.1 box with a NetApp filesystem NFS-mounted,
# just touching b first then a isn't good enough: the nsec field in the
# stat result shows b is _newer_ than a once every 5 or 6 tries!!! I've
# no idea what this is about, but that's why there's a sleep(1) here...
sleep(1);
&touch('a'); &touch('a');
sleep(1); sleep(1);
&touch('c'); &touch('c');