mirror of
https://github.com/mirror/make.git
synced 2025-02-10 20:00:21 +08:00
Various cleanups reported by people using the alpha release.
Incorporate "order-only" prerequisites patch. Wrote a test for it. The test shows what might be a bug in the code; I need to look at it more closely (anyway it doesn't behave as I expected). Also I haven't done the docs yet.
This commit is contained in:
parent
2f20fc1cc7
commit
724925be2b
36
ChangeLog
36
ChangeLog
@ -1,5 +1,17 @@
|
|||||||
|
2002-07-08 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* maintMakefile: Add "update" targets for wget'ing the latest
|
||||||
|
versions of various external files. Taken from Makefile.maint in
|
||||||
|
autoconf, etc.
|
||||||
|
|
||||||
|
* dosbuild.bat: Somehow we got _extra_ ^M's. Remove them.
|
||||||
|
Reported by Eli Zaretskii <eliz@is.elta.co.il>.
|
||||||
|
|
||||||
2002-07-07 Paul D. Smith <psmith@gnu.org>
|
2002-07-07 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* po/*.po: Remove. We'll use wget to retrieve them at release
|
||||||
|
time.
|
||||||
|
|
||||||
* variable.c (do_variable_definition) [W32]: On W32 using cmd
|
* variable.c (do_variable_definition) [W32]: On W32 using cmd
|
||||||
rather than a shell you get an exception. Make sure we look up
|
rather than a shell you get an exception. Make sure we look up
|
||||||
the variable. Patch provided by Eli Zaretskii <eliz@is.elta.co.il>.
|
the variable. Patch provided by Eli Zaretskii <eliz@is.elta.co.il>.
|
||||||
@ -53,6 +65,23 @@
|
|||||||
want to define our variables from evaluated makefile code in the
|
want to define our variables from evaluated makefile code in the
|
||||||
global scope.
|
global scope.
|
||||||
|
|
||||||
|
2002-07-03 Greg McGary <greg@mcgary.org>
|
||||||
|
|
||||||
|
* dep.h (struct dep) [ignore_mtime]: New member.
|
||||||
|
[changed]: convert to a bitfield.
|
||||||
|
* implicit.c (pattern_search): Zero ignore_mtime.
|
||||||
|
* main.c (main, handle_non_switch_argument): Likewise.
|
||||||
|
* rule.c (convert_suffix_rule): Likewise.
|
||||||
|
* read.c (read_all_makefiles, read_makefile, multi_glob): Likewise.
|
||||||
|
(read_makefile): Parse '|' in prerequisite list.
|
||||||
|
(uniquize_deps): Consider ignore_mtime when comparing deps.
|
||||||
|
* remake.c (update_file_1, check_dep): Don't force remake for
|
||||||
|
dependencies that have d->ignore_mtime.
|
||||||
|
* commands.c (FILE_LIST_SEPARATOR): New constant.
|
||||||
|
(set_file_variables): Don't include a
|
||||||
|
prerequisite in $+, $^ or $? if d->ignore_mtime.
|
||||||
|
Define $|.
|
||||||
|
|
||||||
2002-06-18 Paul D. Smith <psmith@gnu.org>
|
2002-06-18 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* make.texinfo: Updates for next revision. New date/rev/etc.
|
* make.texinfo: Updates for next revision. New date/rev/etc.
|
||||||
@ -83,6 +112,13 @@
|
|||||||
MAKEFILE_LIST.
|
MAKEFILE_LIST.
|
||||||
(read_makefile): Add each makefile read in to this variable value.
|
(read_makefile): Add each makefile read in to this variable value.
|
||||||
|
|
||||||
|
2002-05-18 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* Makefile.DOS.template: Tweak according to changes in the
|
||||||
|
distribution. Add back the dependencies of *.o files.
|
||||||
|
|
||||||
|
* configh.dos.template: Synchronize with config.h.in.
|
||||||
|
|
||||||
2002-05-09 Paul D. Smith <psmith@gnu.org>
|
2002-05-09 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* file.c (file_timestamp_now): Use K&R function declaration.
|
* file.c (file_timestamp_now): Use K&R function declaration.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*-Makefile-*- template for DJGPP
|
# -*-Makefile-*- template for DJGPP
|
||||||
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995-1998, 1999 Free Software Foundation, Inc.
|
# Copyright (C) 1994, 1995-1998, 1999, 2002 Free Software Foundation, Inc.
|
||||||
# This Makefile.DOS is free software; the Free Software Foundation
|
# This Makefile.DOS is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy, distribute and modify it.
|
# gives unlimited permission to copy, distribute and modify it.
|
||||||
|
|
||||||
@ -47,7 +47,11 @@ POST_INSTALL = :
|
|||||||
NORMAL_UNINSTALL = :
|
NORMAL_UNINSTALL = :
|
||||||
PRE_UNINSTALL = :
|
PRE_UNINSTALL = :
|
||||||
POST_UNINSTALL = :
|
POST_UNINSTALL = :
|
||||||
|
EXEEXT = .exe
|
||||||
|
OBJEXT = o
|
||||||
|
|
||||||
AR = ar
|
AR = ar
|
||||||
|
AWK = gawk
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CPP = gcc -E
|
CPP = gcc -E
|
||||||
LIBOBJS =
|
LIBOBJS =
|
||||||
@ -60,7 +64,7 @@ VERSION = %VERSION%
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = 1.2
|
AUTOMAKE_OPTIONS = 1.2
|
||||||
|
|
||||||
bin_PROGRAMS = %PROGRAMS%
|
bin_PROGRAMS = %PROGRAMS%$(EXEEXT)
|
||||||
|
|
||||||
make_SOURCES = %SOURCES%
|
make_SOURCES = %SOURCES%
|
||||||
# This should include the glob/ prefix
|
# This should include the glob/ prefix
|
||||||
@ -99,7 +103,7 @@ CFLAGS = -O2 -g
|
|||||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||||
TEXI2DVI = texi2dvi
|
TEXI2DVI = texi2dvi
|
||||||
TEXINFO_TEX = $(srcdir)/texinfo.tex
|
TEXINFO_TEX = $(srcdir)/config/texinfo.tex
|
||||||
INFO_DEPS = make.info
|
INFO_DEPS = make.info
|
||||||
DVIS = make.dvi
|
DVIS = make.dvi
|
||||||
TEXINFOS = make.texinfo
|
TEXINFOS = make.texinfo
|
||||||
@ -107,8 +111,7 @@ man1dir = $(mandir)/man1
|
|||||||
MANS = $(man_MANS)
|
MANS = $(man_MANS)
|
||||||
|
|
||||||
NROFF = nroff
|
NROFF = nroff
|
||||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in configure configure.in getloadavg.c gettext.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex
|
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.in getloadavg.c
|
||||||
|
|
||||||
|
|
||||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
@ -121,7 +124,7 @@ HEADERS = $(wildcard $(srcdir)/*.h)
|
|||||||
default: all
|
default: all
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
|
.SUFFIXES: .c .dvi .info .o .obj .ps .texinfo .tex
|
||||||
|
|
||||||
mostlyclean-hdr:
|
mostlyclean-hdr:
|
||||||
|
|
||||||
@ -153,17 +156,11 @@ uninstall-binPROGRAMS:
|
|||||||
.c.o:
|
.c.o:
|
||||||
$(COMPILE) -c $<
|
$(COMPILE) -c $<
|
||||||
|
|
||||||
.s.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
.S.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
clean-noinstLIBRARIES:
|
clean-noinstLIBRARIES:
|
||||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||||
|
|
||||||
mostlyclean-compile:
|
mostlyclean-compile:
|
||||||
-rm -f *.o *.exe make.new core
|
-rm -f *.$(OBJEXT) *$(EXEEXT) make.new core
|
||||||
|
|
||||||
clean-compile:
|
clean-compile:
|
||||||
|
|
||||||
@ -172,7 +169,7 @@ distclean-compile:
|
|||||||
|
|
||||||
maintainer-clean-compile:
|
maintainer-clean-compile:
|
||||||
|
|
||||||
make: $(make_OBJECTS) $(make_DEPENDENCIES)
|
make$(EXEEXT): $(make_OBJECTS) $(make_DEPENDENCIES)
|
||||||
@command.com /c if exist make del make
|
@command.com /c if exist make del make
|
||||||
@command.com /c if exist make.exe del make.exe
|
@command.com /c if exist make.exe del make.exe
|
||||||
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
||||||
@ -183,29 +180,19 @@ make.dvi: make.texinfo
|
|||||||
|
|
||||||
DVIPS = dvips
|
DVIPS = dvips
|
||||||
|
|
||||||
.texi.info:
|
|
||||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
|
||||||
|
|
||||||
.texi.dvi:
|
|
||||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
|
||||||
|
|
||||||
.texi:
|
|
||||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
|
||||||
|
|
||||||
.texinfo.info:
|
.texinfo.info:
|
||||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
@command.com /c if exist make.info* del make.info*
|
||||||
|
@command.com /c if exist make.i* del make.i*
|
||||||
|
$(MAKEINFO) -I$(srcdir) $< -o ./$@
|
||||||
|
|
||||||
.texinfo:
|
.texinfo:
|
||||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
@command.com /c if exist make.info* del make.info*
|
||||||
|
@command.com /c if exist make.i* del make.i*
|
||||||
|
$(MAKEINFO) -I$(srcdir) $< -o ./$@
|
||||||
|
|
||||||
.texinfo.dvi:
|
.texinfo.dvi:
|
||||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
.txi.info:
|
|
||||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
|
||||||
|
|
||||||
.txi.dvi:
|
|
||||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
|
||||||
|
|
||||||
.dvi.ps:
|
.dvi.ps:
|
||||||
$(DVIPS) $< -o $@
|
$(DVIPS) $< -o $@
|
||||||
@ -542,3 +529,40 @@ check-regression:
|
|||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
|
|
||||||
|
# --------------- DEPENDENCIES
|
||||||
|
ar.o: ar.c make.h config.h gettext.h filedef.h dep.h glob/fnmatch.h
|
||||||
|
arscan.o: arscan.c make.h config.h gettext.h
|
||||||
|
commands.o: commands.c make.h config.h gettext.h dep.h filedef.h \
|
||||||
|
variable.h job.h commands.h
|
||||||
|
default.o: default.c make.h config.h gettext.h rule.h dep.h filedef.h \
|
||||||
|
job.h commands.h variable.h
|
||||||
|
dir.o: dir.c make.h config.h gettext.h glob/glob.h
|
||||||
|
expand.o: expand.c make.h config.h gettext.h filedef.h job.h commands.h \
|
||||||
|
variable.h rule.h
|
||||||
|
file.o: file.c make.h config.h gettext.h dep.h filedef.h job.h \
|
||||||
|
commands.h variable.h debug.h
|
||||||
|
function.o: function.c make.h config.h gettext.h filedef.h variable.h \
|
||||||
|
dep.h job.h commands.h debug.h
|
||||||
|
getopt.o: getopt.c config.h gettext.h getopt.h
|
||||||
|
getopt1.o: getopt1.c config.h getopt.h
|
||||||
|
implicit.o: implicit.c make.h config.h gettext.h rule.h dep.h filedef.h \
|
||||||
|
debug.h
|
||||||
|
job.o: job.c make.h config.h gettext.h job.h debug.h filedef.h \
|
||||||
|
commands.h variable.h
|
||||||
|
main.o: main.c make.h config.h gettext.h dep.h filedef.h variable.h \
|
||||||
|
job.h commands.h rule.h debug.h getopt.h
|
||||||
|
misc.o: misc.c make.h config.h gettext.h dep.h debug.h
|
||||||
|
read.o: read.c make.h config.h gettext.h glob/glob.h dep.h filedef.h \
|
||||||
|
job.h commands.h variable.h rule.h debug.h
|
||||||
|
remake.o: remake.c make.h config.h gettext.h filedef.h job.h commands.h \
|
||||||
|
dep.h variable.h debug.h
|
||||||
|
remote-stub.o: remote-stub.c make.h config.h gettext.h filedef.h job.h \
|
||||||
|
commands.h
|
||||||
|
rule.o: rule.c make.h config.h gettext.h dep.h filedef.h job.h \
|
||||||
|
commands.h variable.h rule.h
|
||||||
|
signame.o: signame.c make.h config.h gettext.h
|
||||||
|
variable.o: variable.c make.h config.h gettext.h dep.h filedef.h job.h \
|
||||||
|
commands.h variable.h rule.h
|
||||||
|
version.o: version.c config.h
|
||||||
|
vpath.o: vpath.c make.h config.h gettext.h filedef.h variable.h
|
||||||
|
22
README.cvs
22
README.cvs
@ -25,13 +25,11 @@ Building From CVS
|
|||||||
|
|
||||||
To build GNU make from CVS, you will need Autoconf 2.53 (or better),
|
To build GNU make from CVS, you will need Autoconf 2.53 (or better),
|
||||||
Automake 1.6.1 (or better), and Gettext 0.11.3-pre2 (or better), and any
|
Automake 1.6.1 (or better), and Gettext 0.11.3-pre2 (or better), and any
|
||||||
tools that those utilities require (GNU m4, Perl, etc.).
|
tools that those utilities require (GNU m4, Perl, etc.). You will also
|
||||||
|
need a copy of wget.
|
||||||
|
|
||||||
After checking out the code, you will need to perform these steps to get
|
After checking out the code, you will need to perform these steps to get
|
||||||
to the point where you can run "configure" then "make".
|
to the point where you can run "make".
|
||||||
|
|
||||||
Hopefully at some point in the (near) future this will all be obsolete
|
|
||||||
and you can just run "autoreconf" and have it DTRT.
|
|
||||||
|
|
||||||
|
|
||||||
1) $ autopoint
|
1) $ autopoint
|
||||||
@ -70,12 +68,23 @@ and you can just run "autoreconf" and have it DTRT.
|
|||||||
Generate a "configure" script from configure.in and acinclude.m4.
|
Generate a "configure" script from configure.in and acinclude.m4.
|
||||||
|
|
||||||
|
|
||||||
|
6) $ ./configure
|
||||||
|
|
||||||
|
Generate a Makefile
|
||||||
|
|
||||||
|
|
||||||
|
7) $ make update
|
||||||
|
|
||||||
|
Use wget to retrieve various other files that GNU make relies on,
|
||||||
|
but does not keep in its own source tree.
|
||||||
|
|
||||||
|
|
||||||
At this point you have successfully brought your CVS copy of the GNU
|
At this point you have successfully brought your CVS copy of the GNU
|
||||||
make source directory up to the point where it can be treated
|
make source directory up to the point where it can be treated
|
||||||
more-or-less like the official package you would get from ftp.gnu.org.
|
more-or-less like the official package you would get from ftp.gnu.org.
|
||||||
That is, you can just run:
|
That is, you can just run:
|
||||||
|
|
||||||
$ ./configure && make && make check && make install
|
$ make && make check && make install
|
||||||
|
|
||||||
to build and install GNU make.
|
to build and install GNU make.
|
||||||
|
|
||||||
@ -127,6 +136,7 @@ autoheader
|
|||||||
automake --add-missing
|
automake --add-missing
|
||||||
autoconf
|
autoconf
|
||||||
./configure
|
./configure
|
||||||
|
make update
|
||||||
make
|
make
|
||||||
make check
|
make check
|
||||||
make distcheck
|
make distcheck
|
||||||
|
111
commands.c
111
commands.c
@ -24,6 +24,12 @@ Boston, MA 02111-1307, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
|
#if VMS
|
||||||
|
# define FILE_LIST_SEPARATOR ','
|
||||||
|
#else
|
||||||
|
# define FILE_LIST_SEPARATOR ' '
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int remote_kill PARAMS ((int id, int sig));
|
extern int remote_kill PARAMS ((int id, int sig));
|
||||||
|
|
||||||
#ifndef HAVE_UNISTD_H
|
#ifndef HAVE_UNISTD_H
|
||||||
@ -36,7 +42,6 @@ static void
|
|||||||
set_file_variables (file)
|
set_file_variables (file)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
{
|
{
|
||||||
register char *p;
|
|
||||||
char *at, *percent, *star, *less;
|
char *at, *percent, *star, *less;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
@ -46,6 +51,8 @@ set_file_variables (file)
|
|||||||
if (ar_name (file->name))
|
if (ar_name (file->name))
|
||||||
{
|
{
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
char *p;
|
||||||
|
|
||||||
p = strchr (file->name, '(');
|
p = strchr (file->name, '(');
|
||||||
at = (char *) alloca (p - file->name + 1);
|
at = (char *) alloca (p - file->name + 1);
|
||||||
bcopy (file->name, at, p - file->name);
|
bcopy (file->name, at, p - file->name);
|
||||||
@ -120,12 +127,14 @@ set_file_variables (file)
|
|||||||
/* Compute the values for $^, $+, and $?. */
|
/* Compute the values for $^, $+, and $?. */
|
||||||
|
|
||||||
{
|
{
|
||||||
register unsigned int qmark_len, plus_len;
|
unsigned int qmark_len, plus_len, bar_len;
|
||||||
char *caret_value, *plus_value;
|
char *caret_value, *plus_value;
|
||||||
register char *cp;
|
char *cp;
|
||||||
char *qmark_value;
|
char *qmark_value;
|
||||||
register char *qp;
|
char *bar_value;
|
||||||
register struct dep *d;
|
char *qp;
|
||||||
|
char *bp;
|
||||||
|
struct dep *d;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
/* Compute first the value for $+, which is supposed to contain
|
/* Compute first the value for $+, which is supposed to contain
|
||||||
@ -133,36 +142,35 @@ set_file_variables (file)
|
|||||||
|
|
||||||
plus_len = 0;
|
plus_len = 0;
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
plus_len += strlen (dep_name (d)) + 1;
|
if (! d->ignore_mtime)
|
||||||
|
plus_len += strlen (dep_name (d)) + 1;
|
||||||
|
if (plus_len == 0)
|
||||||
|
plus_len++;
|
||||||
|
|
||||||
len = plus_len == 0 ? 1 : plus_len;
|
cp = plus_value = (char *) alloca (plus_len);
|
||||||
cp = plus_value = (char *) alloca (len);
|
|
||||||
|
|
||||||
qmark_len = plus_len; /* Will be this or less. */
|
qmark_len = plus_len; /* Will be this or less. */
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
{
|
if (! d->ignore_mtime)
|
||||||
char *c = dep_name (d);
|
{
|
||||||
|
char *c = dep_name (d);
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (ar_name (c))
|
if (ar_name (c))
|
||||||
{
|
{
|
||||||
c = strchr (c, '(') + 1;
|
c = strchr (c, '(') + 1;
|
||||||
len = strlen (c) - 1;
|
len = strlen (c) - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
len = strlen (c);
|
len = strlen (c);
|
||||||
|
|
||||||
bcopy (c, cp, len);
|
bcopy (c, cp, len);
|
||||||
cp += len;
|
cp += len;
|
||||||
#if VMS
|
*cp++ = FILE_LIST_SEPARATOR;
|
||||||
*cp++ = ',';
|
if (! d->changed)
|
||||||
#else
|
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||||
*cp++ = ' ';
|
}
|
||||||
#endif
|
|
||||||
if (! d->changed)
|
|
||||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Kill the last space and define the variable. */
|
/* Kill the last space and define the variable. */
|
||||||
|
|
||||||
@ -175,11 +183,18 @@ set_file_variables (file)
|
|||||||
|
|
||||||
uniquize_deps (file->deps);
|
uniquize_deps (file->deps);
|
||||||
|
|
||||||
/* Compute the values for $^ and $?. */
|
bar_len = 0;
|
||||||
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
|
if (d->ignore_mtime)
|
||||||
|
bar_len += strlen (dep_name (d)) + 1;
|
||||||
|
if (bar_len == 0)
|
||||||
|
bar_len++;
|
||||||
|
|
||||||
|
/* Compute the values for $^, $?, and $|. */
|
||||||
|
|
||||||
cp = caret_value = plus_value; /* Reuse the buffer; it's big enough. */
|
cp = caret_value = plus_value; /* Reuse the buffer; it's big enough. */
|
||||||
len = qmark_len == 0 ? 1 : qmark_len;
|
qp = qmark_value = (char *) alloca (qmark_len);
|
||||||
qp = qmark_value = (char *) alloca (len);
|
bp = bar_value = (char *) alloca (bar_len);
|
||||||
|
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
{
|
{
|
||||||
@ -195,23 +210,24 @@ set_file_variables (file)
|
|||||||
#endif
|
#endif
|
||||||
len = strlen (c);
|
len = strlen (c);
|
||||||
|
|
||||||
bcopy (c, cp, len);
|
if (d->ignore_mtime)
|
||||||
cp += len;
|
{
|
||||||
#if VMS
|
bcopy (c, bp, len);
|
||||||
*cp++ = ',';
|
bp += len;
|
||||||
#else
|
*bp++ = FILE_LIST_SEPARATOR;
|
||||||
*cp++ = ' ';
|
|
||||||
#endif
|
|
||||||
if (d->changed)
|
|
||||||
{
|
|
||||||
bcopy (c, qp, len);
|
|
||||||
qp += len;
|
|
||||||
#if VMS
|
|
||||||
*qp++ = ',';
|
|
||||||
#else
|
|
||||||
*qp++ = ' ';
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bcopy (c, cp, len);
|
||||||
|
cp += len;
|
||||||
|
*cp++ = FILE_LIST_SEPARATOR;
|
||||||
|
if (d->changed)
|
||||||
|
{
|
||||||
|
bcopy (c, qp, len);
|
||||||
|
qp += len;
|
||||||
|
*qp++ = FILE_LIST_SEPARATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Kill the last spaces and define the variables. */
|
/* Kill the last spaces and define the variables. */
|
||||||
@ -221,6 +237,9 @@ set_file_variables (file)
|
|||||||
|
|
||||||
qp[qp > qmark_value ? -1 : 0] = '\0';
|
qp[qp > qmark_value ? -1 : 0] = '\0';
|
||||||
DEFINE_VARIABLE ("?", 1, qmark_value);
|
DEFINE_VARIABLE ("?", 1, qmark_value);
|
||||||
|
|
||||||
|
bp[bp > bar_value ? -1 : 0] = '\0';
|
||||||
|
DEFINE_VARIABLE ("|", 1, bar_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef DEFINE_VARIABLE
|
#undef DEFINE_VARIABLE
|
||||||
|
@ -351,6 +351,9 @@
|
|||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
/* #undef HAVE_LIBSUN */
|
/* #undef HAVE_LIBSUN */
|
||||||
|
|
||||||
|
/* Use high resolution file timestamps if nonzero. */
|
||||||
|
#define FILE_TIMESTAMP_HI_RES 0
|
||||||
|
|
||||||
/* Build host information. */
|
/* Build host information. */
|
||||||
#define MAKE_HOST "Windows32"
|
#define MAKE_HOST "Windows32"
|
||||||
|
|
||||||
|
@ -2,12 +2,6 @@
|
|||||||
/* Many things are defined already by a system header. */
|
/* Many things are defined already by a system header. */
|
||||||
#include <sys/config.h>
|
#include <sys/config.h>
|
||||||
|
|
||||||
/* Name of this package (needed by automake) */
|
|
||||||
#define PACKAGE "%PACKAGE%"
|
|
||||||
|
|
||||||
/* Version of this package (needed by automake) */
|
|
||||||
#define VERSION "%VERSION%"
|
|
||||||
|
|
||||||
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
|
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
@ -23,21 +17,33 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Use high resolution file timestamps if nonzero. */
|
||||||
|
#define FILE_TIMESTAMP_HI_RES 0
|
||||||
|
|
||||||
|
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||||
|
#define HAVE_ALLOCA 1
|
||||||
|
|
||||||
/* Define if you have the fdopen function. */
|
/* Define if you have the fdopen function. */
|
||||||
#define HAVE_FDOPEN 1
|
#define HAVE_FDOPEN 1
|
||||||
|
|
||||||
/* Define if you have sigsetmask. */
|
/* Define to 1 if you have the `getgroups' function. */
|
||||||
#define HAVE_SIGSETMASK 1
|
#define HAVE_GETGROUPS 1
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H 1
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
/* Define if you have the memmove function. */
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
|
|
||||||
/* Define if you have the mkstemp function. */
|
/* Define if you have the mkstemp function. */
|
||||||
#define HAVE_MKSTEMP 1
|
#define HAVE_MKSTEMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `mktemp' function. */
|
||||||
|
#define HAVE_MKTEMP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setlinebuf' function. */
|
||||||
|
#define HAVE_SETLINEBUF 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `setvbuf' function. */
|
||||||
|
#define HAVE_SETVBUF 1
|
||||||
|
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|
||||||
/* Define to `unsigned long' or `unsigned long long'
|
/* Define to `unsigned long' or `unsigned long long'
|
||||||
@ -54,5 +60,32 @@
|
|||||||
#undef HAVE_VPRINTF
|
#undef HAVE_VPRINTF
|
||||||
#define HAVE_VPRINTF 1
|
#define HAVE_VPRINTF 1
|
||||||
|
|
||||||
|
/* Name of the package */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#define PACKAGE_BUGREPORT "bug-%PACKAGE%@gnu.org"
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#define PACKAGE_NAME "GNU %PACKAGE%"
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#define PACKAGE_STRING "GNU %PACKAGE% %VERSION%"
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#define PACKAGE_TARNAME "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#define PACKAGE_VERSION "%VERSION%"
|
||||||
|
|
||||||
|
/* Define to 1 if the C compiler supports function prototypes. */
|
||||||
|
#define PROTOTYPES 1
|
||||||
|
|
||||||
|
/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
|
||||||
|
#define SYS_SIGLIST_DECLARED 1
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Build host information. */
|
/* Build host information. */
|
||||||
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
||||||
|
3
dep.h
3
dep.h
@ -38,7 +38,8 @@ struct dep
|
|||||||
struct dep *next;
|
struct dep *next;
|
||||||
char *name;
|
char *name;
|
||||||
struct file *file;
|
struct file *file;
|
||||||
int changed;
|
unsigned int changed : 8;
|
||||||
|
unsigned int ignore_mtime : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -546,6 +546,7 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dep = (struct dep *) xmalloc (sizeof (struct dep));
|
dep = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
|
dep->ignore_mtime = 0;
|
||||||
s = found_files[deps_found];
|
s = found_files[deps_found];
|
||||||
if (recursions == 0)
|
if (recursions == 0)
|
||||||
{
|
{
|
||||||
@ -611,6 +612,8 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
if (i != matches[foundrule])
|
if (i != matches[foundrule])
|
||||||
{
|
{
|
||||||
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep));
|
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
|
/* GKM FIMXE: handle '|' here too */
|
||||||
|
new->ignore_mtime = 0;
|
||||||
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1);
|
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1);
|
||||||
bcopy (rule->targets[i], p,
|
bcopy (rule->targets[i], p,
|
||||||
rule->suffixes[i] - rule->targets[i] - 1);
|
rule->suffixes[i] - rule->targets[i] - 1);
|
||||||
|
61
main.c
61
main.c
@ -904,20 +904,6 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
/* Make sure stdout is line-buffered. */
|
/* Make sure stdout is line-buffered. */
|
||||||
|
|
||||||
#ifdef HAVE_SETVBUF
|
|
||||||
# ifndef SETVBUF_REVERSED
|
|
||||||
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
|
|
||||||
_WAIT_NOHANG
|
|
||||||
# if defined SIGCHLD
|
|
||||||
(void) bsd_signal (SIGCHLD, SIG_DFL);
|
|
||||||
# endif
|
|
||||||
# if defined SIGCLD && SIGCLD != SIGCHLD
|
|
||||||
(void) bsd_signal (SIGCLD, SIG_DFL);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make sure stdout is line-buffered. */
|
|
||||||
|
|
||||||
#ifdef HAVE_SETVBUF
|
#ifdef HAVE_SETVBUF
|
||||||
# ifdef SETVBUF_REVERSED
|
# ifdef SETVBUF_REVERSED
|
||||||
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
|
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
|
||||||
@ -1899,6 +1885,7 @@ _WAIT_NOHANG
|
|||||||
goals = (struct dep *) xmalloc (sizeof (struct dep));
|
goals = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
goals->next = 0;
|
goals->next = 0;
|
||||||
goals->name = 0;
|
goals->name = 0;
|
||||||
|
goals->ignore_mtime = 0;
|
||||||
goals->file = default_goal_file;
|
goals->file = default_goal_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2056,6 +2043,7 @@ handle_non_switch_argument (arg, env)
|
|||||||
}
|
}
|
||||||
lastgoal->name = 0;
|
lastgoal->name = 0;
|
||||||
lastgoal->file = f;
|
lastgoal->file = f;
|
||||||
|
lastgoal->ignore_mtime = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Add this target name to the MAKECMDGOALS variable. */
|
/* Add this target name to the MAKECMDGOALS variable. */
|
||||||
@ -2180,9 +2168,11 @@ print_usage (bad)
|
|||||||
buf, gettext (cs->description));
|
buf, gettext (cs->description));
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (usageto, _("\nBuilt for %s"), make_host);
|
if (!remote_description || *remote_description == '\0')
|
||||||
if (remote_description != 0 && *remote_description != '\0')
|
fprintf (usageto, _("\nBuilt for %s"), make_host);
|
||||||
fprintf (usageto, " (%s)", remote_description);
|
else
|
||||||
|
fprintf (usageto, "\nBuilt for %s (%s)", make_host, remote_description);
|
||||||
|
|
||||||
fprintf (usageto, _("\nReport bugs to <bug-make@gnu.org>\n"));
|
fprintf (usageto, _("\nReport bugs to <bug-make@gnu.org>\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2828,21 +2818,34 @@ log_working_directory (entering)
|
|||||||
if (print_data_base_flag)
|
if (print_data_base_flag)
|
||||||
fputs ("# ", stdout);
|
fputs ("# ", stdout);
|
||||||
|
|
||||||
if (makelevel == 0)
|
|
||||||
printf ("%s: ", program);
|
|
||||||
else
|
|
||||||
printf ("%s[%u]: ", program, makelevel);
|
|
||||||
|
|
||||||
/* Use entire sentences to give the translators a fighting chance. */
|
/* Use entire sentences to give the translators a fighting chance. */
|
||||||
|
|
||||||
if (starting_directory == 0)
|
if (makelevel == 0)
|
||||||
if (entering)
|
if (starting_directory == 0)
|
||||||
puts (_("Entering an unknown directory"));
|
if (entering)
|
||||||
|
printf (_("%s: Entering an unknown directory"), program);
|
||||||
|
else
|
||||||
|
printf (_("%s: Leaving an unknown directory"), program);
|
||||||
else
|
else
|
||||||
puts (_("Leaving an unknown directory"));
|
if (entering)
|
||||||
|
printf (_("%s: Entering directory `%s'\n"),
|
||||||
|
program, starting_directory);
|
||||||
|
else
|
||||||
|
printf (_("%s: Leaving directory `%s'\n"),
|
||||||
|
program, starting_directory);
|
||||||
else
|
else
|
||||||
if (entering)
|
if (starting_directory == 0)
|
||||||
printf (_("Entering directory `%s'\n"), starting_directory);
|
if (entering)
|
||||||
|
printf (_("%s[%u]: Entering an unknown directory"),
|
||||||
|
program, makelevel);
|
||||||
|
else
|
||||||
|
printf (_("%s[%u]: Leaving an unknown directory"),
|
||||||
|
program, makelevel);
|
||||||
else
|
else
|
||||||
printf (_("Leaving directory `%s'\n"), starting_directory);
|
if (entering)
|
||||||
|
printf (_("%s[%u]: Entering directory `%s'\n"),
|
||||||
|
program, makelevel, starting_directory);
|
||||||
|
else
|
||||||
|
printf (_("%s[%u]: Leaving directory `%s'\n"),
|
||||||
|
program, makelevel, starting_directory);
|
||||||
}
|
}
|
||||||
|
@ -189,4 +189,34 @@ cvs-update: $(cvs-targets)
|
|||||||
# --------------------- #
|
# --------------------- #
|
||||||
|
|
||||||
.PHONY: update
|
.PHONY: update
|
||||||
update: wget-update cvs-update po-update
|
update: wget-update po-update
|
||||||
|
|
||||||
|
# cvs-update
|
||||||
|
|
||||||
|
|
||||||
|
## --------------- ##
|
||||||
|
## Sanity checks. ##
|
||||||
|
## --------------- ##
|
||||||
|
|
||||||
|
# Checks that don't require cvs. Run `changelog-check' last as
|
||||||
|
# previous test may reveal problems requiring new ChangeLog entries.
|
||||||
|
local-check: po-check changelog-check
|
||||||
|
|
||||||
|
# copyright-check writable-files
|
||||||
|
|
||||||
|
changelog-check:
|
||||||
|
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
||||||
|
:; \
|
||||||
|
else \
|
||||||
|
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||||
|
po-check:
|
||||||
|
if test -f po/POTFILES.in; then \
|
||||||
|
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
|
||||||
|
grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2; \
|
||||||
|
diff -u $@-1 $@-2 || exit 1; \
|
||||||
|
rm -f $@-1 $@-2; \
|
||||||
|
fi
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Set of available languages.
|
# Set of available languages: 14 languages
|
||||||
|
|
||||||
da de es fr gl he hr ja ko nl pl pt_BR ru tr
|
da de es fr gl he hr ja ko nl pl pt_BR ru tr
|
||||||
|
|
||||||
|
33
read.c
33
read.c
@ -251,6 +251,7 @@ read_all_makefiles (makefiles)
|
|||||||
d->name = 0;
|
d->name = 0;
|
||||||
d->file = enter_file (*p);
|
d->file = enter_file (*p);
|
||||||
d->file->dontcare = 1;
|
d->file->dontcare = 1;
|
||||||
|
d->ignore_mtime = 0;
|
||||||
/* Tell update_goal_chain to bail out as soon as this file is
|
/* Tell update_goal_chain to bail out as soon as this file is
|
||||||
made, and main not to die if we can't make this file. */
|
made, and main not to die if we can't make this file. */
|
||||||
d->changed = RM_DONTCARE;
|
d->changed = RM_DONTCARE;
|
||||||
@ -347,6 +348,7 @@ eval_makefile (filename, flags)
|
|||||||
free (filename);
|
free (filename);
|
||||||
filename = deps->file->name;
|
filename = deps->file->name;
|
||||||
deps->changed = flags;
|
deps->changed = flags;
|
||||||
|
deps->ignore_mtime = 0;
|
||||||
|
|
||||||
/* If the makefile can't be found at all, give up entirely. */
|
/* If the makefile can't be found at all, give up entirely. */
|
||||||
|
|
||||||
@ -1117,8 +1119,24 @@ eval (ebuf, set_default)
|
|||||||
|
|
||||||
/* Parse the dependencies. */
|
/* Parse the dependencies. */
|
||||||
deps = (struct dep *)
|
deps = (struct dep *)
|
||||||
multi_glob (parse_file_seq (&p2, '\0', sizeof (struct dep), 1),
|
multi_glob (parse_file_seq (&p2, '|', sizeof (struct dep), 1),
|
||||||
sizeof (struct dep));
|
sizeof (struct dep));
|
||||||
|
if (*p2)
|
||||||
|
{
|
||||||
|
/* Files that follow '|' are special prerequisites that
|
||||||
|
need only exist in order to satisfy the dependency.
|
||||||
|
Their modification times are irrelevant. */
|
||||||
|
struct dep **deps_ptr = &deps;
|
||||||
|
struct dep *d;
|
||||||
|
for (deps_ptr = &deps; *deps_ptr; deps_ptr = &(*deps_ptr)->next)
|
||||||
|
;
|
||||||
|
++p2;
|
||||||
|
*deps_ptr = (struct dep *)
|
||||||
|
multi_glob (parse_file_seq (&p2, '\0', sizeof (struct dep), 1),
|
||||||
|
sizeof (struct dep));
|
||||||
|
for (d = *deps_ptr; d != 0; d = d->next)
|
||||||
|
d->ignore_mtime = 1;
|
||||||
|
}
|
||||||
|
|
||||||
commands_idx = 0;
|
commands_idx = 0;
|
||||||
if (cmdleft != 0)
|
if (cmdleft != 0)
|
||||||
@ -1506,7 +1524,8 @@ uniquize_deps (chain)
|
|||||||
last = d;
|
last = d;
|
||||||
next = d->next;
|
next = d->next;
|
||||||
while (next != 0)
|
while (next != 0)
|
||||||
if (streq (dep_name (d), dep_name (next)))
|
if (streq (dep_name (d), dep_name (next))
|
||||||
|
&& d->ignore_mtime == next->ignore_mtime)
|
||||||
{
|
{
|
||||||
struct dep *n = next->next;
|
struct dep *n = next->next;
|
||||||
last->next = n;
|
last->next = n;
|
||||||
@ -2825,10 +2844,13 @@ multi_glob (chain, size)
|
|||||||
if (found == 0)
|
if (found == 0)
|
||||||
{
|
{
|
||||||
/* No matches. Use MEMNAME as-is. */
|
/* No matches. Use MEMNAME as-is. */
|
||||||
struct nameseq *elt
|
|
||||||
= (struct nameseq *) xmalloc (size);
|
|
||||||
unsigned int alen = strlen (gl.gl_pathv[i]);
|
unsigned int alen = strlen (gl.gl_pathv[i]);
|
||||||
unsigned int mlen = strlen (memname);
|
unsigned int mlen = strlen (memname);
|
||||||
|
struct nameseq *elt
|
||||||
|
= (struct nameseq *) xmalloc (size);
|
||||||
|
if (size > sizeof (struct nameseq))
|
||||||
|
bzero (((char *) elt) + sizeof (struct nameseq),
|
||||||
|
size - sizeof (struct nameseq));
|
||||||
elt->name = (char *) xmalloc (alen + 1 + mlen + 2);
|
elt->name = (char *) xmalloc (alen + 1 + mlen + 2);
|
||||||
bcopy (gl.gl_pathv[i], elt->name, alen);
|
bcopy (gl.gl_pathv[i], elt->name, alen);
|
||||||
elt->name[alen] = '(';
|
elt->name[alen] = '(';
|
||||||
@ -2857,6 +2879,9 @@ multi_glob (chain, size)
|
|||||||
#endif /* !NO_ARCHIVES */
|
#endif /* !NO_ARCHIVES */
|
||||||
{
|
{
|
||||||
struct nameseq *elt = (struct nameseq *) xmalloc (size);
|
struct nameseq *elt = (struct nameseq *) xmalloc (size);
|
||||||
|
if (size > sizeof (struct nameseq))
|
||||||
|
bzero (((char *) elt) + sizeof (struct nameseq),
|
||||||
|
size - sizeof (struct nameseq));
|
||||||
elt->name = xstrdup (gl.gl_pathv[i]);
|
elt->name = xstrdup (gl.gl_pathv[i]);
|
||||||
elt->next = new;
|
elt->next = new;
|
||||||
new = elt;
|
new = elt;
|
||||||
|
40
remake.c
40
remake.c
@ -349,6 +349,7 @@ update_file_1 (file, depth)
|
|||||||
int dep_status = 0;
|
int dep_status = 0;
|
||||||
register struct dep *d, *lastd;
|
register struct dep *d, *lastd;
|
||||||
int running = 0;
|
int running = 0;
|
||||||
|
int maybe_make;
|
||||||
|
|
||||||
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
|
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
|
||||||
|
|
||||||
@ -457,7 +458,11 @@ update_file_1 (file, depth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->file->parent = file;
|
d->file->parent = file;
|
||||||
dep_status |= check_dep (d->file, depth, this_mtime, &must_make);
|
maybe_make = must_make;
|
||||||
|
dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
|
||||||
|
if (! d->ignore_mtime)
|
||||||
|
must_make = maybe_make;
|
||||||
|
|
||||||
check_renamed (d->file);
|
check_renamed (d->file);
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -570,17 +575,21 @@ update_file_1 (file, depth)
|
|||||||
FILE_TIMESTAMP d_mtime = file_mtime (d->file);
|
FILE_TIMESTAMP d_mtime = file_mtime (d->file);
|
||||||
check_renamed (d->file);
|
check_renamed (d->file);
|
||||||
|
|
||||||
#if 1 /* %%% In version 4, remove this code completely to
|
if (! d->ignore_mtime)
|
||||||
|
{
|
||||||
|
#if 1
|
||||||
|
/* %%% In version 4, remove this code completely to
|
||||||
implement not remaking deps if their deps are newer
|
implement not remaking deps if their deps are newer
|
||||||
than their parents. */
|
than their parents. */
|
||||||
if (d_mtime == NONEXISTENT_MTIME && !d->file->intermediate)
|
if (d_mtime == NONEXISTENT_MTIME && !d->file->intermediate)
|
||||||
/* We must remake if this dep does not
|
/* We must remake if this dep does not
|
||||||
exist and is not intermediate. */
|
exist and is not intermediate. */
|
||||||
must_make = 1;
|
must_make = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set DEPS_CHANGED if this dep actually changed. */
|
/* Set DEPS_CHANGED if this dep actually changed. */
|
||||||
deps_changed |= d->changed;
|
deps_changed |= d->changed;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set D->changed if either this dep actually changed,
|
/* Set D->changed if either this dep actually changed,
|
||||||
or its dependent, FILE, is older or does not exist. */
|
or its dependent, FILE, is older or does not exist. */
|
||||||
@ -590,7 +599,12 @@ update_file_1 (file, depth)
|
|||||||
{
|
{
|
||||||
const char *fmt = 0;
|
const char *fmt = 0;
|
||||||
|
|
||||||
if (d_mtime == NONEXISTENT_MTIME)
|
if (d->ignore_mtime)
|
||||||
|
{
|
||||||
|
if (ISDB (DB_VERBOSE))
|
||||||
|
fmt = _("Prerequisite `%s' is order-only for target `%s'.\n");
|
||||||
|
}
|
||||||
|
else if (d_mtime == NONEXISTENT_MTIME)
|
||||||
{
|
{
|
||||||
if (ISDB (DB_BASIC))
|
if (ISDB (DB_BASIC))
|
||||||
fmt = _("Prerequisite `%s' of target `%s' does not exist.\n");
|
fmt = _("Prerequisite `%s' of target `%s' does not exist.\n");
|
||||||
@ -822,8 +836,9 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
|||||||
FILE_TIMESTAMP this_mtime;
|
FILE_TIMESTAMP this_mtime;
|
||||||
int *must_make_ptr;
|
int *must_make_ptr;
|
||||||
{
|
{
|
||||||
register struct dep *d;
|
struct dep *d;
|
||||||
int dep_status = 0;
|
int dep_status = 0;
|
||||||
|
int maybe_make;
|
||||||
|
|
||||||
++depth;
|
++depth;
|
||||||
start_updating (file);
|
start_updating (file);
|
||||||
@ -898,8 +913,11 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->file->parent = file;
|
d->file->parent = file;
|
||||||
|
maybe_make = *must_make_ptr;
|
||||||
dep_status |= check_dep (d->file, depth, this_mtime,
|
dep_status |= check_dep (d->file, depth, this_mtime,
|
||||||
must_make_ptr);
|
&maybe_make);
|
||||||
|
if (! d->ignore_mtime)
|
||||||
|
*must_make_ptr = maybe_make;
|
||||||
check_renamed (d->file);
|
check_renamed (d->file);
|
||||||
if (dep_status != 0 && !keep_going_flag)
|
if (dep_status != 0 && !keep_going_flag)
|
||||||
break;
|
break;
|
||||||
|
1
rule.c
1
rule.c
@ -230,6 +230,7 @@ convert_suffix_rule (target, source, cmds)
|
|||||||
deps = (struct dep *) xmalloc (sizeof (struct dep));
|
deps = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
deps->next = 0;
|
deps->next = 0;
|
||||||
deps->name = depname;
|
deps->name = depname;
|
||||||
|
deps->ignore_mtime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
create_pattern_rule (names, percents, 0, deps, cmds, 0);
|
create_pattern_rule (names, percents, 0, deps, cmds, 0);
|
||||||
|
79
tests/scripts/features/order_only
Normal file
79
tests/scripts/features/order_only
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# -*-perl-*-
|
||||||
|
$description = "Test order-only prerequisites.";
|
||||||
|
|
||||||
|
$details = "\
|
||||||
|
Create makefiles with various combinations of normal and order-only
|
||||||
|
prerequisites and ensure they behave properly. Test the \$| variable.";
|
||||||
|
|
||||||
|
open(MAKEFILE,"> $makefile");
|
||||||
|
|
||||||
|
print MAKEFILE <<'EOF';
|
||||||
|
foo: bar | baz
|
||||||
|
@echo '$$^ = $^'
|
||||||
|
@echo '$$? = $?'
|
||||||
|
@echo '$$| = $|'
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.PHONY: baz
|
||||||
|
|
||||||
|
bar baz:
|
||||||
|
touch $@
|
||||||
|
EOF
|
||||||
|
|
||||||
|
close(MAKEFILE);
|
||||||
|
|
||||||
|
|
||||||
|
# TEST #1 -- just the syntax
|
||||||
|
|
||||||
|
&run_make_with_options($makefile, "", &get_logfile);
|
||||||
|
$answer = "touch bar\ntouch baz\n\$^ = bar\n\$? = bar\n\$| = baz\ntouch foo\n";
|
||||||
|
&compare_output($answer,&get_logfile(1));
|
||||||
|
|
||||||
|
|
||||||
|
# TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
|
||||||
|
|
||||||
|
&run_make_with_options($makefile, "", &get_logfile);
|
||||||
|
$answer = "touch baz\n";
|
||||||
|
&compare_output($answer,&get_logfile(1));
|
||||||
|
|
||||||
|
unlink(qw(foo bar baz));
|
||||||
|
|
||||||
|
# Test prereqs that are both order and non-order
|
||||||
|
|
||||||
|
$makefile2 = &get_tmpfile;
|
||||||
|
|
||||||
|
open(MAKEFILE,"> $makefile2");
|
||||||
|
|
||||||
|
print MAKEFILE <<'EOF';
|
||||||
|
foo: bar | baz
|
||||||
|
@echo '$$^ = $^'
|
||||||
|
@echo '$$? = $?'
|
||||||
|
@echo '$$| = $|'
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
foo: baz
|
||||||
|
|
||||||
|
.PHONY: baz
|
||||||
|
|
||||||
|
bar baz:
|
||||||
|
touch $@
|
||||||
|
EOF
|
||||||
|
|
||||||
|
close(MAKEFILE);
|
||||||
|
|
||||||
|
# TEST #3 -- just the syntax
|
||||||
|
|
||||||
|
&run_make_with_options($makefile2, "", &get_logfile);
|
||||||
|
$answer = "touch bar\ntouch baz\n\$^ = bar baz\n\$? = bar baz\n\$| = baz\ntouch foo\n";
|
||||||
|
&compare_output($answer,&get_logfile(1));
|
||||||
|
|
||||||
|
|
||||||
|
# TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
|
||||||
|
|
||||||
|
&run_make_with_options($makefile2, "", &get_logfile);
|
||||||
|
$answer = "touch baz\$^ = bar baz\n\$? = baz\n\$| = baz\ntouch foo\n";
|
||||||
|
&compare_output($answer,&get_logfile(1));
|
||||||
|
|
||||||
|
unlink(qw(foo bar baz));
|
||||||
|
|
||||||
|
1;
|
Loading…
Reference in New Issue
Block a user