Compare commits

..

77 Commits

Author SHA1 Message Date
Paul Smith
e34540f79b * Release 3.77.92.
* Complete implementation of new jobserver algorithm.
* A few minor fixups.
1999-08-01 08:12:06 +00:00
Paul Smith
09f1e4cf83 * Applied some DOS updates.
* Started reworking the jobserver algorithm; not complete yet.
1999-08-01 06:05:17 +00:00
Paul Smith
28ef4c4dac * Add gettext macros to start i18n support. 1999-07-28 06:23:37 +00:00
Paul Smith
3a945a665e * Update the manual. 1999-07-26 05:06:58 +00:00
Paul Smith
6dbd348522 * Forgot ChangeLog. 1999-07-24 04:56:06 +00:00
Paul Smith
a9166bb7bc * Some configure fixes. 1999-07-24 04:55:08 +00:00
Paul Smith
4e7ee4fc01 * Bugfix for NT archive support.
* Rework how the jobserver stuff works.
1999-07-23 22:46:47 +00:00
Paul Smith
b05cb1d99e * Make some portability fixes. 1999-07-22 06:29:02 +00:00
Paul Smith
c8a60e7431 * Update the AUTHORS file. 1999-07-22 04:41:51 +00:00
Paul Smith
6d2984e0b2 * Fix backward incompatibility in new function implementation.
* Add support for ARFZMAG archive formats.
1999-07-22 04:31:11 +00:00
Paul Smith
ec50fe2a2b * Installed new versions of GLIBC glob library.
* Installed Tim Magill's "graph pruning" performance enhancement.
* Update version to 3.77.90 for the release.
* Require automake 1.4.
1999-07-22 04:20:14 +00:00
Paul Smith
c69d4c95bf * Installed VMS fixes. 1999-07-21 16:06:18 +00:00
Paul Smith
588da9812e * Add configure option to enable dmalloc library.
* Various code cleanups.
1999-07-21 05:53:23 +00:00
Paul Smith
73846549f6 * Fix memory leaks, fd leaks, and some long-standing bugs recognizing when
targets need to have their modtimes rechecked (-n, etc.)
1999-07-20 22:34:41 +00:00
Karl Berry
169e6b8c3d pdfimage takes braces 1999-07-18 18:19:53 +00:00
Paul Smith
826ab14b26 * Fix some memory and file descriptor leaks. 1999-07-16 22:28:46 +00:00
Paul Smith
a3cf773e29 * Various bug fixes. 1999-07-16 02:25:03 +00:00
Paul Smith
9d89ad56bf * Fix up and document $(apply ...) function. 1999-07-15 07:36:44 +00:00
Paul Eggert
adb1632033 Sync to ftp.gnu.org version of 1999-07-06. 1999-07-13 04:50:09 +00:00
Paul Smith
8df9d54020 * Fixed error rebuilding makefiles with -j>1
* Fixed problem with job pipe and -j>1 when waiting on -l loads.
1999-07-09 22:55:44 +00:00
Paul Smith
9035aa27b7 * Minor code cleanup. 1999-07-08 22:32:38 +00:00
Paul Smith
e1d72ad3f1 * Added -R / --no-builtin-variables flag. 1999-07-08 06:49:52 +00:00
Paul Smith
012254e81e * Various bugfixes/updates. See ChangeLog. 1999-07-06 21:09:32 +00:00
Paul Smith
2858f7a8f1 * Various bug fixes. 1999-06-14 06:50:28 +00:00
Paul Smith
187787286d * Various bug fixes. 1999-06-14 05:26:28 +00:00
Paul Smith
fc0fe4103a * Add new jobserver feature.
* Small updates to the manual
* E.Zaretskii fix for new DJGPP version.
1999-04-25 04:30:55 +00:00
Paul Smith
7f3ffd4019 Clean up some logic. 1999-04-13 02:28:27 +00:00
Paul Smith
a2ea1bd27f If a file declared .INTERMEDIATE already exists before make starts, we
won't delete it--this is how normal intermediate files behave, too.
1999-04-09 05:57:35 +00:00
Paul Smith
3d1cdf4106 * Fix possible memory stomp.
* A few admin file cleanups.
1999-04-02 06:19:33 +00:00
Paul Smith
7052a57152 * Ignore CR in CRLF line terminators for compatibility with DOSsy
makefiles.
1999-03-31 23:25:13 +00:00
Karl Berry
47922a5a65 * texinfo.tex (\defopheader): missing word space before `on'.
Report from: Chris Hanson <cph@martigny.ai.mit.edu>.
1999-03-31 18:30:14 +00:00
Paul Smith
e005a48b9f * More build fixes. I think a vanilla CVS checkout should build OK now. 1999-03-30 06:19:17 +00:00
Karl Berry
0798a61169 * texinfo.tex (\imagexxx): Equalize space above and below if in
vmode.  From rms.
.,
1999-03-27 10:32:23 +00:00
Paul Smith
ecb3bca9f5 * Manual updates: added xrefs, some typos sent by users.
* Change the build env. to not link libglob.a unless we need it.
1999-03-26 07:08:57 +00:00
Paul Smith
c4353af3f9 * Reworked function.c to use separate functions instead of a huge case stmt.
* Added new functions $(error ...) and $(warning ...) and documented same.
* In windows/dos shells, only treat \ as an escape for special chars.
1999-03-26 04:04:42 +00:00
Karl Berry
8363e0496d * texinfo.tex (&): be sure active & is defined for @deftypefn
operator&.
	Report from: Nathan Sidwell <nathan@acm.org>.
1999-03-24 16:04:27 +00:00
Karl Berry
4025030d96 * texinfo.tex: Changes from Andreas to use \sl\$ inside italics
and to avoid extra spaces around @anchor.
	* texinfo.tex (\image, \imagexx): move pdf test to imagexxx for
 		correct filename parsing.
1999-03-20 21:49:38 +00:00
Paul Smith
1e0513335f * Add strneq() (streq only n chars) macro
* fix return type of xstrdup.
1999-03-19 04:27:56 +00:00
Karl Berry
e3d0d562da * texinfo.tex (\imagexxx): reset catcode ^^M in case we're inside
in an example.  Report from kama.
1999-03-16 12:49:21 +00:00
Karl Berry
db865774df * texinfo.tex (\putwordin): new macro for word `in'.
(\xrefX): use it.
1999-03-15 22:34:20 +00:00
Paul Smith
a6a9ebb54f * Define and use xstrdup() instead of strdup(). 1999-03-05 07:13:12 +00:00
Paul Smith
9e6ba6a148 * Update FSF address info in copyright notices.
* Update maintainers build process; remove GNUmakefile.  Require builders to
  run automake && autoreconf by hand.
* Use AC_SUBST_FILE to get the maintMakefile included, rather than GNU
  make's include directive, which conflicts with automake 1.4's include
  directive.
1999-03-05 05:55:11 +00:00
Paul Smith
ede263043c Fix a bug where conditional variables weren't being expanded correctly. 1999-03-04 17:03:56 +00:00
Karl Berry
a8f7173799 * texinfo.tex: Expand tabs. 1999-02-22 12:59:43 +00:00
Paul Smith
a66668aabc * New feature: .LIBPATTERNS controls the way -lfoo dependencies are expanded.
* A few tweaks to the system glob test, after trying it on a system where
  it's true.
* Installed patches to archive handling for AIX 4.3 big archives.
* Fix a memory stomp in target-specific variables.
* Fix a memory leak in foreach functions.
1999-02-22 07:23:30 +00:00
Paul Smith
84f38c9c6f * Updates for automake 1.4 and autoconf 2.13
* Check for a libc version of GNU glob and, if found, don't use the local
  glob headers.
* Fix a bug in OpenVMS archive handling.
* Fix a bug in VMS siglist processing.
1999-02-19 18:07:49 +00:00
Karl Berry
5808507144 * texinfo.tex (\paragraphindent): implement.
Suggestion from: Paul DuBois <dubois@primate.wisc.edu>.
	* texinfo.tex (\alias): use def rather than \let.
	Change timestamp format to include hours.
1999-02-15 13:15:05 +00:00
Karl Berry
e3ef8e974c * texinfo.tex: New commands @alias and @definfoenclose.
From: "Eric S. Raymond" <esr@snark.thyrsus.com>.
1999-02-09 15:10:17 +00:00
Karl Berry
281cdd5d74 * texinfo.tex (\scanmacro): Use \endinput to avoid spurious space,
and various other space fixes.  From: Andreas Schwab
 		<schwab@ls5.informatik.uni-dortmund.de>.
1999-02-08 19:55:39 +00:00
Karl Berry
3634e15fe3 * texinfo.tex (\uref): implement optional third arg.
* texinfo.tex (\dosubind): Include index entry in third arg to
		\entry instead of writing as bogus fourth arg.
	Report from: kama@hippo.fido.de (Karl Heinz Marbaise).
	* texinfo.tex (\setemergencystretch): Increase somewhat.
	* texinfo.tex (\putwordof): rename from \putwordOf.
	* texinfo.tex (defivarhead, \defcvarheader): Use \putwordof.
1999-02-05 10:33:07 +00:00
Karl Berry
9c95acec4b * texinfo.tex (\documentlanguage, \documentencoding): new
commands.  \documentlanguage based on an implementation by kama.
1999-02-03 11:35:04 +00:00
Karl Berry
8b55cda094 * texinfo.tex: Fix @macro expansion inside @section. Patch from
Andreas:
	From: Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>
	The general idea is to construct a list a all defined macros in
 		the form \do\macro1\do\macro2..., then temporarily define
 		\do to something appropriate and execute the list to do
 		whatever is needed.  Here is a patch, and i have also
 		fixed a few other bugs that i found while browsing through
 		the @macro implementation.  Additionally i have added a
 		check to prevent the user from doing silly things like
 		@macro shipout.
1999-01-30 13:16:18 +00:00
Karl Berry
9d9111c450 * texinfo.tex (\obstexwarn): Don't use *** in message, it
interferes with make output parsing.
1999-01-24 16:04:24 +00:00
Karl Berry
0f686c1e6b * texinfo.tex: Internationalization improvements from kama. 1999-01-22 10:24:18 +00:00
Karl Berry
6eeae809a8 * texinfo.tex (\contents, \shortcontents): Run \contentspagealignmacro.
From: Trond Endrestol <trond@agamemnon.gtf.ol.no>
1999-01-21 10:37:08 +00:00
Karl Berry
5b16b3c015 * texinfo.tex (\begindoublecolumns): Ship out \partialpage
immediately if it is nonvoid, instead of saving it.  This avoids a
	bug where the index could end up printing one line per page (see
	the indexspread.tex test).
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>

	* texinfo.tex (\image): If running pdftex, do \pdfimage{imagefile.pdf}.
 	From: Samuel Tardieu <sam@inf.enst.fr>

 	Also, update copyright year.
1999-01-15 09:29:00 +00:00
Karl Berry
c0ec561e37 * texinfo.tex (\enddoublecolumns): Move \pagegoal reset to after
the \endgroup so we get the restored single-column \vsize
 		as intended.
1999-01-06 11:11:58 +00:00
Karl Berry
71aacd9fe0 * texinfo.tex (\indexdummies): Set \{ and \} to \mylbrace and
\mybrace to avoid braces in the index file, which
	texindex can't handle.
1998-12-21 15:36:12 +00:00
Karl Berry
dc7cf1c4b2 * texinfo.tex (\pickupwholefraction): Ignore whole-number part.
(\setuptable): Always pass whole-number part and decimal point.  This
	allows leading zeroes.
	Suggestion from: Ben Bullock <ben@hayamasa.demon.co.uk>.
	Date: Fri, 21 Aug 1998 14:06:50 +0100 (BST)
1998-12-20 12:55:40 +00:00
Karl Berry
7f83bfe911 * texinfo.tex (\indexdummies): set \{ and \} to \lbracecmd and
\rbracecmd to avoid lossage if @tex is active during \shipout.
	Report from: "Peter Kabal" <Kabal@ece.mcgill.ca>.
1998-12-15 21:48:39 +00:00
Karl Berry
45406fc744 doc fix 1998-12-12 20:44:40 +00:00
Karl Berry
76468fbaa1 update date 1998-11-13 23:00:02 +00:00
Karl Berry
2116c80dc7 1998-11-11 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* doc/texinfo.tex (\onepageout): Put the cropmarks in vboxes of
	zero height so that they don't contribute space themselves.
	Compensate for \topandbottommargin.
	(\internalpagesizes): Advance \outervsize by 2\topandbottommargin,
	not only 0.6in.
1998-11-13 22:49:41 +00:00
Karl Berry
28eecbb94f * texinfo.tex: Use standard time-stamp.el package instead of
update-date.el.
.,
1998-11-08 18:39:08 +00:00
Karl Berry
9ad3cb03b7 * texinfo.tex (\indexnofonts,\indexdummies): add \url and \uref to
list.
1998-11-01 12:43:32 +00:00
Karl Berry
0be25c6986 * texinfo.tex (@env, @command, @option): Must disable for index
and xref commands.  Also, \input plain if necessary before
 		using {} in the version number.
1998-10-27 16:59:40 +00:00
Richard M. Stallman
4dfe38353e Mention Automake.
Mention DESTDIR.
Comment on changing prefix or exec_prefix.
1998-10-15 15:29:00 +00:00
Paul Smith
3948640154 Ignore non-empty lines which become empty after variable expansion.
Don't choke on invalid pattern rules if we fail during makefile parsing.
Don't dump core if a non-empty command becomes empty after expansion.
1998-10-13 20:59:08 +00:00
Paul Smith
2c64fb221a Checkpoint changes. Bug fixes, mostly. 1998-10-03 05:39:55 +00:00
Paul Smith
e90887e68a Don't use a separate configure.in for the glob directory. It now uses
the configure script for make proper.
1998-10-03 05:23:25 +00:00
Karl Berry
321b447568 * texinfo.tex: Use date as version number instead of RCS, and
update-date to update it.
1998-09-30 15:43:32 +00:00
Richard M. Stallman
b5722838c2 Treat __GNU__ line NeXT: undefine BSD and FSCALE. 1998-09-27 07:29:59 +00:00
Karl Berry
7a43e6cd30 * texinfo.tex: Fix @macro expansion of @code with _ in the
argument.
 	From: Zack Weinberg <zack@rabi.columbia.edu>.
1998-09-17 17:25:42 +00:00
Karl Berry
84d159bb64 * texinfo.tex (\itemzzz): take \itemmargin into account when
unhboxing.  Reported by Bob.
1998-08-28 14:29:37 +00:00
Karl Berry
050f9d9f5d * texinfo.tex: Change @defun environments so that right margin is
not changed, and instead the defun type label is outdented
 		into the margin.
1998-08-14 20:54:46 +00:00
Karl Berry
50b5c15b54 * texinfo.tex (\smartslanted): define this separately from
\smartitalic.
	(\emph, \i): use \smartitalic for true italics.
1998-08-13 17:33:06 +00:00
Karl Berry
fc6cca1c7c * texinfo.tex (\value): handle active _ or - in argument (happens
if called from @code).
 	Report from: Dave Love <d.love@dl.ac.uk>.
1998-08-10 19:17:34 +00:00
70 changed files with 9077 additions and 5665 deletions

View File

@@ -11,6 +11,13 @@ makebook*
*.dep *.dvi *.toc *.aux *.log *.dep *.dvi *.toc *.aux *.log
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs *.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
README aclocal.m4 config.h.in config.h configure Makefile.in
build.sh.in build.sh SMakefile config.ami README.DOS Makefile.DOS configh.dos
NMakefile config.h.W32 config.h-vms
.deps .dep_segment
_*
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
hp700 hp834 mips sol2 i486-linux hp700 hp834 mips sol2 i486-linux

12
.purify Normal file
View File

@@ -0,0 +1,12 @@
# Solaris (2.5.1) has a couple if issues.
#
suppress plk malloc; setvbuf "libc*"; main "main.c"
suppress umr kstat_read; kstat_chain_update; kstat_open; getloadavg
suppress umr kstat_chain_update; kstat_open; getloadavg
# The command line options stuff leaks a little bit. No big deal.
#
suppress mlk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
suppress plk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
suppress mlk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
suppress plk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"

15
AUTHORS
View File

@@ -8,10 +8,11 @@ Development starting with GNU make 3.76 by:
Paul D. Smith <psmith@gnu.org> Paul D. Smith <psmith@gnu.org>
GNU Make User's Manual written by: GNU Make User's Manual
Written by:
Richard M. Stallman <rms@gnu.org> Richard M. Stallman <rms@gnu.org>
User's Manual edited by: Edited by:
Roland McGrath <roland@gnu.org> Roland McGrath <roland@gnu.org>
Bob Chassell <bob@gnu.org> Bob Chassell <bob@gnu.org>
Melissa Weisshaus <melissa@gnu.org> Melissa Weisshaus <melissa@gnu.org>
@@ -22,8 +23,9 @@ GNU make porting efforts:
Port to VMS by: Port to VMS by:
Klaus Kaempf <kkaempf@progis.de> Klaus Kaempf <kkaempf@progis.de>
Archive support/Bug fixes by John W. Eaton <jwe@bevo.che.wisc.edu> Archive support/Bug fixes by:
John W. Eaton <jwe@bevo.che.wisc.edu>
Martin Zinser <zinser@decus.decus.de>
Port to Amiga by: Port to Amiga by:
Aaron Digulla <digulla@fh-konstanz.de> Aaron Digulla <digulla@fh-konstanz.de>
@@ -38,11 +40,14 @@ GNU make porting efforts:
Other contributors: Other contributors:
Janet Carson <janet_carson@tivoli.com> Janet Carson <janet_carson@tivoli.com>
Paul Eggert <eggert@twinsun.com> Howard Chu <hyc@highlandsun.com>
Paul Eggert <eggert@twinsun.com>
Klaus Heinz <kamar@ease.rhein-main.de> Klaus Heinz <kamar@ease.rhein-main.de>
Michael Joosten Michael Joosten
Jim Kelton <jim_kelton@tivoli.com> Jim Kelton <jim_kelton@tivoli.com>
David Lubbren <uhay@rz.uni-karlsruhe.de> David Lubbren <uhay@rz.uni-karlsruhe.de>
Tim Magill <tim.magill@telops.gte.com>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Carl Staelin (Princeton University) Carl Staelin (Princeton University)
Ian Stewartson (Data Logic Limited) Ian Stewartson (Data Logic Limited)

924
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,54 +0,0 @@
# This is a maintainer's-only makefile
#
# It bootstraps a GNU make maintainer's directory
#
.SUFFIXES:
NORECURSE = true
# If the user asked for a specific target, invoke the Makefile instead.
#
.DEFAULT:
@[ -f Makefile.in -a -f configure -a -f aclocal.m4 -a -f config.h.in ] \
|| $(MAKE) __cfg NORECURSE=
@[ -f Makefile ] \
|| ./configure
$(MAKE) -f Makefile $@
.PHONY: __cfg __cfg_basic
# This is variable since the glob subdirectory doesn't use it.
#
ACCONFIG = acconfig.h
__cfg: __cfg_basic config.h.in TAGS
cd glob && $(MAKE) -f ../GNUmakefile __cfg_basic ACCONFIG=
ifdef NORECURSE
@echo ""; echo "Now you should run one of:"; echo ""; \
echo " make all"; \
echo " make dist"; \
echo " make distdir"; \
echo " make distcheck"; echo ""; \
echo "Or similar to proceed.";\
echo ""
endif
__cfg_basic: aclocal.m4 stamp-h.in configure Makefile.in
aclocal.m4: configure.in $(wildcard acinclude.m4)
aclocal
config.h.in: stamp-h.in
stamp-h.in: configure.in aclocal.m4 $(ACCONFIG)
autoheader
echo timestamp > $@
configure: configure.in aclocal.m4
autoconf
Makefile.in: configure.in config.h.in Makefile.am aclocal.m4
automake --add-missing
TAGS:
find . -name '*.[ch]' -print | etags -

View File

@@ -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, 1996, 1997 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-1998, 1999 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.
@@ -118,7 +118,11 @@ HEADERS = $(wildcard $(srcdir)/*.h)
default: all default: all
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .dvi .info .o .ps .texi .texinfo .SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
mostlyclean-hdr:
clean-hdr:
distclean-hdr: distclean-hdr:
-rm -f config.h -rm -f config.h
@@ -141,11 +145,17 @@ install-binPROGRAMS: $(bin_PROGRAMS)
uninstall-binPROGRAMS: uninstall-binPROGRAMS:
$(NORMAL_UNINSTALL) $(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`; done list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`.exe; done
.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)
@@ -155,7 +165,7 @@ mostlyclean-compile:
clean-compile: clean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c *_tab.c
maintainer-clean-compile: maintainer-clean-compile:
@@ -188,6 +198,12 @@ DVIPS = dvips
.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 $@
@@ -208,7 +224,7 @@ dist-info: $(INFO_DEPS)
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
mostlyclean-aminfo: mostlyclean-aminfo:
rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.kys make.ps make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv make.cn cd $(srcdir) && for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
clean-aminfo: clean-aminfo:

View File

@@ -1,6 +1,6 @@
# -*-Makefile-*-, or close enough # This is a -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.3 AUTOMAKE_OPTIONS = 1.4
bin_PROGRAMS = make bin_PROGRAMS = make
@@ -10,16 +10,14 @@ make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
commands.h dep.h filedef.h job.h make.h rule.h variable.h \ commands.h dep.h filedef.h job.h make.h rule.h variable.h \
signame.c signame.h \ signame.c signame.h \
getopt.c getopt1.c getopt.h getopt.c getopt1.c getopt.h
make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a make_LDADD = @LIBOBJS@ @ALLOCA@ @GLOBLIB@
info_TEXINFOS = make.texinfo info_TEXINFOS = make.texinfo
man_MANS = make.1 man_MANS = make.1
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" INCLUDES = -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
BUILT_SOURCES = README build.sh.in EXTRA_DIST = README build.sh.in $(man_MANS) README.customs remote-cstms.c\
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c\
make-stds.texi texinfo.tex SCOPTIONS SMakefile\ make-stds.texi texinfo.tex SCOPTIONS SMakefile\
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\ README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\ README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
@@ -125,10 +123,12 @@ check-regression: all
cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS) cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)
# --------------- Local CLEAN section
maintainer-clean-local:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
# --------------- Maintainer's Section # --------------- Maintainer's Section
if MAINT_MAKEFILE @MAINT_MAKEFILE@
# Note this requires GNU make. Not to worry, since it will only be included
# in the Makefile if we're in the maintainer's environment.
include $(srcdir)/maintMakefile
endif

View File

@@ -16,7 +16,8 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Make; see the file COPYING. If not, write to # along with GNU Make; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# #
# Makefile for GNU Make # Makefile for GNU Make

57
NEWS
View File

@@ -1,12 +1,48 @@
GNU make NEWS -*-indented-text-*- GNU make NEWS -*-indented-text-*-
History of user-visible changes. History of user-visible changes.
19 May 1998 21 Jul 1999
Copyright (C) 1992,1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc. Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
See the end for copying conditions. See the end for copying conditions.
All changes mentioned here are more fully described in the GNU make
manual, which is contained in this distribution as the file make.texinfo.
Please send GNU make bug reports to bug-make@gnu.org. Please send GNU make bug reports to bug-make@gnu.org.
Version 3.78
* Two new functions, $(error ...) and $(warning ...) are provided. The
former will cause make to fail and exit immediately upon expansion of
the function, with the text provided as the error message. The latter
causes the text provided to be printed as a warning message, but make
proceeds normally.
* A new function, $(call ...) is provided. This allows users to create
their own parameterized macros and invoke them later. Original
implementation of this feature was provided by Han-Wen Nienhuys
<hanwen@cs.uu.nl>.
* Make defines a new variable, .LIBPATTERNS. This variable controls how
library dependency expansion (dependencies like ``-lfoo'') is performed.
* Make accepts CRLF sequences as well as traditional LF, for
compatibility with makefiles created on other operating systems.
* Make accepts a new option: -R, or --no-builtin-variables. This option
disables the definition of the rule-specific builtin variables (CC,
LD, AR, etc.). Specifying this option forces -r (--no-builtin-rules)
as well.
* A "job server" feature, suggested by Howard Chu <hyc@highlandsun.com>.
On systems that support POSIX pipe(2) semantics, GNU make can now pass
-jN options to submakes rather than forcing them all to use -j1. The
top make and all its sub-make processes use a pipe to communicate with
each other to ensure that no more than N jobs are started across all
makes. To get the old behavior of -j back, you can configure make
with the --disable-job-server option.
Version 3.77 Version 3.77
* Implement BSD make's "?=" variable assignment operator. The variable * Implement BSD make's "?=" variable assignment operator. The variable
@@ -659,18 +695,11 @@ Version 3.05
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright information: Copyright information:
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved, copyright notice and this permission notice are preserved, thus
thus giving the recipient permission to redistribute in turn. giving the recipient permission to redistribute in turn.
Permission is granted to distribute modified versions Permission is granted to distribute modified versions of this
of this document, or of portions of it, document, or of portions of it, under the above conditions, provided
under the above conditions, provided also that they also that they carry prominent notices stating who last changed them.
carry prominent notices stating who last changed them.
Local variables:
version-control: never
end:

View File

@@ -16,7 +16,8 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Make; see the file COPYING. If not, write to # along with GNU Make; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# #
# NMakefile for GNU Make # NMakefile for GNU Make
@@ -29,7 +30,7 @@ OUTDIR=.
MAKEFILE=NMakefile MAKEFILE=NMakefile
SUBPROC_MAKEFILE=NMakefile SUBPROC_MAKEFILE=NMakefile
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/ CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/

View File

@@ -5,7 +5,7 @@ Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
New (since 3.74) DOS-specific features: New (since 3.74) DOS-specific features:
1. Supports long filenames when run from DOS box on Windows 95. 1. Supports long filenames when run from DOS box on Windows 9x.
2. Supports both stock DOS COMMAND.COM and Unix-style shells 2. Supports both stock DOS COMMAND.COM and Unix-style shells
(details in ``Notes'' below). (details in ``Notes'' below).
@@ -48,9 +48,10 @@ To build:
[Enter]. Otherwise, you need to supply the path to the source [Enter]. Otherwise, you need to supply the path to the source
directory as an argument to the batch file, like this: directory as an argument to the batch file, like this:
configure.bat c:/djgpp/gnu/make-%VERSION% c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
Note the forward slashes: you MUST use them here. Note the forward slashes in the source path argument: you MUST
use them here.
3. If configure.bat doesn't find a working Make, it will suggest to 3. If configure.bat doesn't find a working Make, it will suggest to
use the `dosbuild.bat' batch file to build Make. Either do as it use the `dosbuild.bat' batch file to build Make. Either do as it
@@ -228,9 +229,9 @@ Notes:
4. Letter-case in filenames. 4. Letter-case in filenames.
If you run Make on Windows 95, you should be aware of the If you run Make on Windows 9x, you should be aware of the
letter-case issue. Make is internally case-sensitive, but all letter-case issue. Make is internally case-sensitive, but all
file operations are case-insensitive on Windows 95, so file operations are case-insensitive on Windows 9x, so
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
far as Windows is concerned. The underlying DJGPP C library far as Windows is concerned. The underlying DJGPP C library
functions honor the letter-case of the filenames they get from functions honor the letter-case of the filenames they get from
@@ -240,8 +241,8 @@ Notes:
converted to lower case are explained in the DJGPP libc docs, converted to lower case are explained in the DJGPP libc docs,
under the `_preserve_fncase' and `_lfn_gen_short_fname' under the `_preserve_fncase' and `_lfn_gen_short_fname'
functions, but as a thumb rule, any filename that is stored in functions, but as a thumb rule, any filename that is stored in
upper case in the directory, is a legal DOS 8+3 filename and upper case in the directory, is a valid DOS 8+3 filename and
doesn't include characters illegal on MSDOS FAT filesystems, doesn't include characters invalid on MSDOS FAT filesystems,
will be automatically down-cased.) User reports that I have will be automatically down-cased.) User reports that I have
indicate that this default behavior is generally what you'd indicate that this default behavior is generally what you'd
expect; however, your input is most welcome. expect; however, your input is most welcome.

View File

@@ -3,17 +3,40 @@ All bugs reported for previous releases have been fixed.
Some bugs surely remain. Some bugs surely remain.
For general building and installation instructions, see the file INSTALL. For general building and installation instructions, see the file INSTALL.
If you need to build GNU Make and have no other `make' program to use, If you need to build GNU Make and have no other `make' program to use,
you can use the shell script `build.sh' instead. To do this, first run you can use the shell script `build.sh' instead. To do this, first run
`configure' as described in INSTALL. Then, instead of typing `make' to `configure' as described in INSTALL. Then, instead of typing `make' to
build the program, type `sh build.sh'. This should compile the program build the program, type `sh build.sh'. This should compile the program
in the current directory. Then you will have a Make program that you can in the current directory. Then you will have a Make program that you can
use for `make install', or whatever else. use for `./make install', or whatever else.
Some systems' Make programs are broken and cannot process the Makefile for Some systems' Make programs are broken and cannot process the Makefile for
GNU Make. If you get errors from your system's Make when building GNU GNU Make. If you get errors from your system's Make when building GNU
Make, try using `build.sh' instead. Make, try using `build.sh' instead.
GNU make is fully documented in the GNU Make manual, which is contained
in this distribution as the file make.texinfo. You can also find
on-line and preformatted (PostScript and DVI) versions at the FSF's web
site. There is information there about ordering hardcopy documentation.
http://www.gnu.org/
http://www.gnu.org/doc/doc.html
http://www.gnu.org/manual/manual.html
Please send GNU make bug reports to bug-make@gnu.org. Please see the
section of the manual entitles `Problems and Bugs' for information on
submitting bug reports.
If you need help using GNU make, try these forums:
help-make@gnu.org
help-utils@gnu.org
news:gnu.utils.help
news:gnu.utils.bug
Also:
- See README.customs for details on integrating GNU make with the - See README.customs for details on integrating GNU make with the
Customs distributed build environment from the Pmake distribution. Customs distributed build environment from the Pmake distribution.

View File

@@ -16,16 +16,17 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Make; see the file COPYING. If not, write to # along with GNU Make; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# #
# Makefile for GNU Make # Makefile for GNU Make
# #
# Ultrix 2.2 make doesn't expand the value of VPATH. # Ultrix 2.2 make doesn't expand the value of VPATH.
VPATH = /make-3.74/ VPATH = /make-%VERSION%/
# This must repeat the value, because configure will remove `VPATH = .'. # This must repeat the value, because configure will remove `VPATH = .'.
srcdir = /make-3.74/ srcdir = /make-%VERSION%/
CC = sc CC = sc
RM = delete RM = delete

View File

@@ -10,6 +10,13 @@
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G #undef SCCS_GET_MINUS_G
/* Define this to enable job server support in GNU make. */
#undef MAKE_JOBSERVER
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
#undef ST_MTIM_NSEC
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
#undef HAVE_SYS_SIGLIST #undef HAVE_SYS_SIGLIST
@@ -18,3 +25,18 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT #undef HAVE_UNION_WAIT
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#undef uintmax_t
/* These are for AC_FUNC_SELECT */
/* Define if the system doesn't provide fd_set. */
#undef fd_set
/* Define the type of the first arg to select(). */
#undef fd_set_size_t
/* Define this if select() args need to be cast away from fd_set (HP-UX). */
#undef SELECT_FD_SET_CAST

View File

@@ -86,7 +86,7 @@ changequote([,])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Got this from the GNU fileutils 3.16r distribution dnl Got this from the GNU fileutils 3.16r distribution
dnl by Paul Eggert <egger@twinsun.com> dnl by Paul Eggert <eggert@twinsun.com>
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl The problem is that the default compilation flags in Solaris 2.6 won't dnl The problem is that the default compilation flags in Solaris 2.6 won't
@@ -129,3 +129,171 @@ AC_DEFUN(AC_LFS,
done ;; done ;;
esac esac
]) ])
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
dnl Define HAVE_INTTYPES_H if <inttypes.h> exists,
dnl doesn't clash with <sys/types.h>, and declares uintmax_t.
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for `HAVE_INTTYPES_H' in config.h.in.
AC_CHECK_FUNCS(INTTYPES_H)
fi
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <inttypes.h>],
[uintmax_t i = (uintmax_t) -1;],
jm_ac_cv_header_inttypes_h=yes,
jm_ac_cv_header_inttypes_h=no)])
if test $jm_ac_cv_header_inttypes_h = yes; then
ac_kludge=HAVE_INTTYPES_H
AC_DEFINE_UNQUOTED($ac_kludge)
fi
])
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
[AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
ac_cv_struct_st_mtim_nsec,
[ac_save_CPPFLAGS="$CPPFLAGS"
ac_cv_struct_st_mtim_nsec=no
# tv_nsec -- the usual case
# _tv_nsec -- Solaris 2.6, if
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
# && !defined __EXTENSIONS__)
# st__tim.tv_nsec -- UnixWare 2.1.2
for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
done
CPPFLAGS="$ac_save_CPPFLAGS"])
if test $ac_cv_struct_st_mtim_nsec != no; then
AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec)
fi
]
)
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
dnl Define uintmax_t to `unsigned long' or `unsigned long long'
dnl if <inttypes.h> does not exist.
AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
[
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
if test $jm_ac_cv_header_inttypes_h = no; then
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
[AC_TRY_COMPILE([],
[unsigned long long i = (unsigned long long) -1;],
ac_cv_type_unsigned_long_long=yes,
ac_cv_type_unsigned_long_long=no)])
if test $ac_cv_type_unsigned_long_long = yes; then
AC_DEFINE(uintmax_t, unsigned long long)
else
AC_DEFINE(uintmax_t, unsigned long)
fi
fi
])
dnl ---------------------------------------------------------------------------
dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
dnl From a proposed change made on the autoconf list on 2 Feb 1999
dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html
dnl Patch for AIX 3.2 by Lars Hecking <lhecking@nmrc.ucc.ie> on 17 May 1999
AC_DEFUN(AC_FUNC_SELECT,
[AC_CHECK_FUNCS(select)
if test "$ac_cv_func_select" = yes; then
AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h)
AC_MSG_CHECKING([argument types of select()])
AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
[AC_CACHE_VAL(ac_cv_type_fd_set,dnl
[for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
AC_TRY_COMPILE(dnl
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif],
[#ifdef __STDC__
extern select ($ac_cv_type_fd_set_size_t,
$ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
$ac_type_timeval *);
#else
extern select ();
$ac_cv_type_fd_set_size_t s;
$ac_cv_type_fd_set *p;
$ac_type_timeval *t;
#endif],
[ac_found=yes ; break 3],ac_found=no)
done
done
done
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
if test "$ac_found" = no; then
AC_MSG_ERROR([can't determine argument types])
fi
AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
ac_cast=
if test "$ac_cv_type_fd_set" != fd_set; then
# Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for
# FD_SET macros, but insist that you cast the argument to select. I don't
# understand why that might be, but it means we cannot define fd_set.
AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
changequote([,]),dnl
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif],dnl
# We found fd_set type in a header, need special cast
ac_cast="($ac_cv_type_fd_set *)",dnl
# No fd_set type; it is safe to define it
AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
fi
AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
fi
])

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "variable.h" #include "variable.h"
@@ -45,7 +46,7 @@ char ** argv;
buffer = AllocMem (len, MEMF_ANY); buffer = AllocMem (len, MEMF_ANY);
if (!buffer) if (!buffer)
fatal ("MyExecute: Cannot allocate space for calling a command"); fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
ptr = buffer; ptr = buffer;

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
extern int MyExecute PARAMS ((char ** argv)); extern int MyExecute PARAMS ((char ** argv));
extern char * wildcard_expansion PARAMS ((char * wc, char * o)); extern char * wildcard_expansion PARAMS ((char * wc, char * o));

28
ar.c
View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
@@ -46,7 +47,7 @@ ar_name (name)
return 0; return 0;
if (p[1] == '(' && end[-1] == ')') if (p[1] == '(' && end[-1] == ')')
fatal ("attempt to use unsupported feature: `%s'", name); fatal (NILF, _("attempt to use unsupported feature: `%s'"), name);
return 1; return 1;
} }
@@ -137,7 +138,7 @@ int
ar_touch (name) ar_touch (name)
char *name; char *name;
{ {
error ("touch archive member is not available on VMS"); error (NILF, _("touch archive member is not available on VMS"));
return -1; return -1;
} }
#else #else
@@ -169,22 +170,24 @@ ar_touch (name)
switch (ar_member_touch (arname, memname)) switch (ar_member_touch (arname, memname))
{ {
case -1: case -1:
error ("touch: Archive `%s' does not exist", arname); error (NILF, _("touch: Archive `%s' does not exist"), arname);
break; break;
case -2: case -2:
error ("touch: `%s' is not a valid archive", arname); error (NILF, _("touch: `%s' is not a valid archive"), arname);
break; break;
case -3: case -3:
perror_with_name ("touch: ", arname); perror_with_name ("touch: ", arname);
break; break;
case 1: case 1:
error ("touch: Member `%s' does not exist in `%s'", memname, arname); error (NILF,
_("touch: Member `%s' does not exist in `%s'"), memname, arname);
break; break;
case 0: case 0:
val = 0; val = 0;
break; break;
default: default:
error ("touch: Bad return code from ar_member_touch on `%s'", name); error (NILF,
_("touch: Bad return code from ar_member_touch on `%s'"), name);
} }
if (!arname_used) if (!arname_used)
@@ -233,15 +236,6 @@ ar_glob_match (desc, mem, truncated,
return 0L; return 0L;
} }
/* Alphabetic sorting function for `qsort'. */
static int
ar_glob_alphacompare (a, b)
char **a, **b;
{
return strcmp (*a, *b);
}
/* Return nonzero if PATTERN contains any metacharacters. /* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int static int
@@ -316,7 +310,7 @@ ar_glob (arname, member_pattern, size)
names[i++] = n->name; names[i++] = n->name;
/* Sort them alphabetically. */ /* Sort them alphabetically. */
qsort ((char *) names, i, sizeof (*names), ar_glob_alphacompare); qsort ((char *) names, i, sizeof (*names), alpha_compare);
/* Put them back into the chain in the sorted order. */ /* Put them back into the chain in the sorted order. */
i = 0; i = 0;

265
arscan.c
View File

@@ -13,7 +13,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#include "make.h" #include "make.h"
@@ -69,7 +70,7 @@ VMS_get_member_info (module, rfa)
&bufdesc.dsc$w_length, 0); &bufdesc.dsc$w_length, 0);
if (! status) if (! status)
{ {
error ("lbr$set_module failed to extract module info, status = %d", error (NILF, _("lbr$set_module failed to extract module info, status = %d"),
status); status);
lbr$close (&VMS_lib_idx); lbr$close (&VMS_lib_idx);
@@ -151,7 +152,7 @@ ar_scan (archive, function, arg)
if (! status) if (! status)
{ {
error ("lbr$ini_control failed with status = %d",status); error (NILF, _("lbr$ini_control failed with status = %d"),status);
return -2; return -2;
} }
@@ -162,7 +163,7 @@ ar_scan (archive, function, arg)
if (! status) if (! status)
{ {
error ("unable to open library `%s' to lookup member `%s'", error (NILF, _("unable to open library `%s' to lookup member `%s'"),
archive, (char *)arg); archive, (char *)arg);
return -1; return -1;
} }
@@ -177,6 +178,7 @@ ar_scan (archive, function, arg)
VMS_function = function; VMS_function = function;
VMS_member_date = (time_t) -1;
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0); lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
/* Undo the damage. */ /* Undo the damage. */
@@ -212,11 +214,46 @@ ar_scan (archive, function, arg)
#endif #endif
#endif #endif
#include <ar.h> /* On AIX, define these symbols to be sure to get both archive formats.
AIX 4.3 introduced the "big" archive format to support 64-bit object
files, so on AIX 4.3 systems we need to support both the "normal" and
"big" archive formats. An archive's format is indicated in the
"fl_magic" field of the "FL_HDR" structure. For a normal archive,
this field will be the string defined by the AIAMAG symbol. For a
"big" archive, it will be the string defined by the AIAMAGBIG symbol
(at least on AIX it works this way).
Note: we'll define these symbols regardless of which AIX version
we're compiling on, but this is okay since we'll use the new symbols
only if they're present. */
#ifdef _AIX
# define __AR_SMALL__
# define __AR_BIG__
#endif
#ifndef WINDOWS32
# include <ar.h>
#else
/* These should allow us to read Windows (VC++) libraries (according to Frank
* Libbrecht <frankl@abzx.belgium.hp.com>)
*/
# include <windows.h>
# include <windef.h>
# include <io.h>
# define ARMAG IMAGE_ARCHIVE_START
# define SARMAG IMAGE_ARCHIVE_START_SIZE
# define ar_hdr _IMAGE_ARCHIVE_MEMBER_HEADER
# define ar_name Name
# define ar_mode Mode
# define ar_size Size
# define ar_date Date
# define ar_uid UserID
# define ar_gid GroupID
#endif
/* Cray's <ar.h> apparently defines this. */ /* Cray's <ar.h> apparently defines this. */
#ifndef AR_HDR_SIZE #ifndef AR_HDR_SIZE
#define AR_HDR_SIZE (sizeof (struct ar_hdr)) # define AR_HDR_SIZE (sizeof (struct ar_hdr))
#endif #endif
/* Takes three arguments ARCHIVE, FUNCTION and ARG. /* Takes three arguments ARCHIVE, FUNCTION and ARG.
@@ -254,6 +291,10 @@ ar_scan (archive, function, arg)
{ {
#ifdef AIAMAG #ifdef AIAMAG
FL_HDR fl_header; FL_HDR fl_header;
#ifdef AIAMAGBIG
int big_archive = 0;
FL_HDR_BIG fl_header_big;
#endif
#else #else
int long_name = 0; int long_name = 0;
#endif #endif
@@ -275,11 +316,42 @@ ar_scan (archive, function, arg)
#ifdef AIAMAG #ifdef AIAMAG
{ {
register int nread = read (desc, (char *) &fl_header, FL_HSZ); register int nread = read (desc, (char *) &fl_header, FL_HSZ);
if (nread != FL_HSZ || bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
if (nread != FL_HSZ)
{ {
(void) close (desc); (void) close (desc);
return -2; return -2;
} }
#ifdef AIAMAGBIG
/* If this is a "big" archive, then set the flag and
re-read the header into the "big" structure. */
if (!bcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
{
big_archive = 1;
/* seek back to beginning of archive */
if (lseek (desc, 0, 0) < 0)
{
(void) close (desc);
return -2;
}
/* re-read the header into the "big" structure */
nread = read (desc, (char *) &fl_header_big, FL_HSZ_BIG);
if (nread != FL_HSZ_BIG)
{
(void) close (desc);
return -2;
}
}
else
#endif
/* Check to make sure this is a "normal" archive. */
if (bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
{
(void) close (desc);
return -2;
}
} }
#else #else
{ {
@@ -307,8 +379,18 @@ ar_scan (archive, function, arg)
long int member_offset; long int member_offset;
long int last_member_offset; long int last_member_offset;
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset); #ifdef AIAMAGBIG
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset); if ( big_archive )
{
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
}
else
#endif
{
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
}
if (member_offset == 0) if (member_offset == 0)
{ {
@@ -329,6 +411,9 @@ ar_scan (archive, function, arg)
{ {
register int nread; register int nread;
struct ar_hdr member_header; struct ar_hdr member_header;
#ifdef AIAMAGBIG
struct ar_hdr_big member_header_big;
#endif
#ifdef AIAMAG #ifdef AIAMAG
char name[256]; char name[256];
int name_len; int name_len;
@@ -351,34 +436,73 @@ ar_scan (archive, function, arg)
} }
#ifdef AIAMAG #ifdef AIAMAG
#define AR_MEMHDR (AR_HDR_SIZE - sizeof (member_header._ar_name)) #define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
nread = read (desc, (char *) &member_header, AR_MEMHDR);
if (nread != AR_MEMHDR) #ifdef AIAMAGBIG
if (big_archive)
{ {
(void) close (desc); nread = read (desc, (char *) &member_header_big,
return -2; AR_MEMHDR_SZ(member_header_big) );
if (nread != AR_MEMHDR_SZ(member_header_big))
{
(void) close (desc);
return -2;
}
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
{
(void) close (desc);
return -2;
}
name[name_len] = 0;
sscanf (member_header_big.ar_date, "%12ld", &dateval);
sscanf (member_header_big.ar_uid, "%12d", &uidval);
sscanf (member_header_big.ar_gid, "%12d", &gidval);
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
+ name_len + 2);
} }
else
sscanf (member_header.ar_namlen, "%4d", &name_len); #endif
nread = read (desc, name, name_len);
if (nread != name_len)
{ {
(void) close (desc); nread = read (desc, (char *) &member_header,
return -2; AR_MEMHDR_SZ(member_header) );
if (nread != AR_MEMHDR_SZ(member_header))
{
(void) close (desc);
return -2;
}
sscanf (member_header.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
{
(void) close (desc);
return -2;
}
name[name_len] = 0;
sscanf (member_header.ar_date, "%12ld", &dateval);
sscanf (member_header.ar_uid, "%12d", &uidval);
sscanf (member_header.ar_gid, "%12d", &gidval);
sscanf (member_header.ar_mode, "%12o", &eltmode);
sscanf (member_header.ar_size, "%12ld", &eltsize);
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
+ name_len + 2);
} }
data_offset += data_offset % 2;
name[name_len] = 0;
sscanf (member_header.ar_date, "%12ld", &dateval);
sscanf (member_header.ar_uid, "%12d", &uidval);
sscanf (member_header.ar_gid, "%12d", &gidval);
sscanf (member_header.ar_mode, "%12o", &eltmode);
sscanf (member_header.ar_size, "%12ld", &eltsize);
if ((data_offset = member_offset + AR_MEMHDR + name_len + 2) % 2)
++data_offset;
fnval = fnval =
(*function) (desc, name, 0, (*function) (desc, name, 0,
@@ -393,8 +517,20 @@ ar_scan (archive, function, arg)
break; break;
if (nread != AR_HDR_SIZE if (nread != AR_HDR_SIZE
#ifdef ARFMAG #if defined(ARFMAG) || defined(ARFZMAG)
|| bcmp (member_header.ar_fmag, ARFMAG, 2) || (
# ifdef ARFMAG
bcmp (member_header.ar_fmag, ARFMAG, 2)
# else
1
# endif
&&
# ifdef ARFZMAG
bcmp (member_header.ar_fmag, ARFZMAG, 2)
# else
1
# endif
)
#endif #endif
) )
{ {
@@ -492,7 +628,12 @@ ar_scan (archive, function, arg)
/* End of the chain. */ /* End of the chain. */
break; break;
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset); #ifdef AIAMAGBIG
if (big_archive)
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
else
#endif
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
if (lseek (desc, member_offset, 0) != member_offset) if (lseek (desc, member_offset, 0) != member_offset)
{ {
@@ -561,37 +702,6 @@ ar_name_equal (name, mem, truncated)
if (p != 0) if (p != 0)
name = p + 1; name = p + 1;
/* We no longer use this kludge, since we
now support long archive member names. */
#if 0 && !defined (AIAMAG) && !defined (APOLLO)
{
/* `reallylongname.o' matches `reallylongnam.o'.
If member names have a trailing slash, that's `reallylongna.o'. */
struct ar_hdr h;
unsigned int max = sizeof (h.ar_name);
unsigned int namelen, memlen;
if (strncmp (name, mem, max - 3))
return 0;
namelen = strlen (name);
memlen = strlen (mem);
if (namelen > memlen && memlen >= max - 1
&& name[namelen - 2] == '.' && name[namelen - 1] == 'o'
&& mem[memlen - 2] == '.' && mem[memlen - 1] == 'o')
return 1;
if (namelen != memlen)
return 0;
return (namelen < max - 3 || !strcmp (name + max - 3, mem + max - 3));
}
#else /* AIX or APOLLO. */
#ifndef VMS #ifndef VMS
if (truncated) if (truncated)
{ {
@@ -601,17 +711,15 @@ ar_name_equal (name, mem, truncated)
#else #else
struct ar_hdr hdr; struct ar_hdr hdr;
#if !defined (__hpux) && !defined (cray) #if !defined (__hpux) && !defined (cray)
return !strncmp (name, mem, sizeof(hdr.ar_name) - 1); return strneq (name, mem, sizeof(hdr.ar_name) - 1);
#else #else
return !strncmp (name, mem, sizeof(hdr.ar_name) - 2); return strneq (name, mem, sizeof(hdr.ar_name) - 2);
#endif /* !__hpux && !cray */ #endif /* !__hpux && !cray */
#endif /* !AIAMAG */ #endif /* !AIAMAG */
} }
#endif /* !VMS */ #endif /* !VMS */
return !strcmp (name, mem); return !strcmp (name, mem);
#endif
} }
#ifndef VMS #ifndef VMS
@@ -667,12 +775,9 @@ ar_member_touch (arname, memname)
if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE)) if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE))
goto lose; goto lose;
/* The file's mtime is the time we we want. */ /* The file's mtime is the time we we want. */
#ifdef EINTR while (fstat (fd, &statbuf) < 0 && EINTR_SET)
while (fstat (fd, &statbuf) < 0 && errno == EINTR); ;
#else #if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
fstat (fd, &statbuf);
#endif
#if defined(ARFMAG) || defined(AIAMAG)
/* Advance member's time to that time */ /* Advance member's time to that time */
for (i = 0; i < sizeof ar_hdr.ar_date; i++) for (i = 0; i < sizeof ar_hdr.ar_date; i++)
ar_hdr.ar_date[i] = ' '; ar_hdr.ar_date[i] = ' ';
@@ -712,11 +817,11 @@ describe_member (desc, name, truncated,
{ {
extern char *ctime (); extern char *ctime ();
printf ("Member `%s'%s: %ld bytes at %ld (%ld).\n", printf (_("Member `%s'%s: %ld bytes at %ld (%ld).\n"),
name, truncated ? " (name might be truncated)" : "", name, truncated ? _(" (name might be truncated)") : "",
size, hdrpos, datapos); size, hdrpos, datapos);
printf (" Date %s", ctime (&date)); printf (_(" Date %s"), ctime (&date));
printf (" uid = %d, gid = %d, mode = 0%o.\n", uid, gid, mode); printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
return 0; return 0;
} }

View File

@@ -17,7 +17,8 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Make; see the file COPYING. If not, write to # along with GNU Make; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# See Makefile.in for comments describing these variables. # See Makefile.in for comments describing these variables.
@@ -31,6 +32,7 @@ ALLOCA='@ALLOCA@'
LOADLIBES='@LIBS@' LOADLIBES='@LIBS@'
extras='@LIBOBJS@' extras='@LIBOBJS@'
REMOTE='@REMOTE@' REMOTE='@REMOTE@'
GLOBLIB='@GLOBLIB@'
# Common prefix for machine-independent installed files. # Common prefix for machine-independent installed files.
prefix='@prefix@' prefix='@prefix@'
@@ -47,11 +49,15 @@ set -e
# These are all the objects we need to link together. # These are all the objects we need to link together.
objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}" objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
if [ x"$GLOBLIB" != x ]; then
objs="$objs %globobjs%"
fi
# Compile the source files into those objects. # Compile the source files into those objects.
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
echo compiling ${file}... echo compiling ${file}...
$CC $defines $CPPFLAGS $CFLAGS \ $CC $defines $CPPFLAGS $CFLAGS \
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file -c -I. -I${srcdir} ${srcdir}/$file
done done
# The object files were actually all put in the current directory. # The object files were actually all put in the current directory.

View File

@@ -10,59 +10,59 @@ echo off
echo "Creating GNU make for Windows 95/NT" echo "Creating GNU make for Windows 95/NT"
echo on echo on
if not exist .\WinDebug\nul mkdir .\WinDebug if not exist .\WinDebug\nul mkdir .\WinDebug
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
echo WinDebug\variable.obj >>link.dbg echo WinDebug\variable.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
echo WinDebug\rule.obj >>link.dbg echo WinDebug\rule.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
echo WinDebug\remote-stub.obj >>link.dbg echo WinDebug\remote-stub.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
echo WinDebug\commands.obj >>link.dbg echo WinDebug\commands.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
echo WinDebug\file.obj >>link.dbg echo WinDebug\file.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
echo WinDebug\getloadavg.obj >>link.dbg echo WinDebug\getloadavg.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
echo WinDebug\default.obj >>link.dbg echo WinDebug\default.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
echo WinDebug\signame.obj >>link.dbg echo WinDebug\signame.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
echo WinDebug\expand.obj >>link.dbg echo WinDebug\expand.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
echo WinDebug\dir.obj >>link.dbg echo WinDebug\dir.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
echo WinDebug\main.obj >>link.dbg echo WinDebug\main.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
echo WinDebug\getopt1.obj >>link.dbg echo WinDebug\getopt1.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
echo WinDebug\job.obj >>link.dbg echo WinDebug\job.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
echo WinDebug\read.obj >>link.dbg echo WinDebug\read.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
echo WinDebug\version.obj >>link.dbg echo WinDebug\version.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
echo WinDebug\getopt.obj >>link.dbg echo WinDebug\getopt.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
echo WinDebug\arscan.obj >>link.dbg echo WinDebug\arscan.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
echo WinDebug\remake.obj >>link.dbg echo WinDebug\remake.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
echo WinDebug\misc.obj >>link.dbg echo WinDebug\misc.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
echo WinDebug\ar.obj >>link.dbg echo WinDebug\ar.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
echo WinDebug\function.obj >>link.dbg echo WinDebug\function.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
echo WinDebug\vpath.obj >>link.dbg echo WinDebug\vpath.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
echo WinDebug\implicit.obj >>link.dbg echo WinDebug\implicit.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
echo WinDebug\dirent.obj >>link.dbg echo WinDebug\dirent.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
echo WinDebug\glob.obj >>link.dbg echo WinDebug\glob.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
echo WinDebug\fnmatch.obj >>link.dbg echo WinDebug\fnmatch.obj >>link.dbg
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
echo WinDebug\pathstuff.obj >>link.dbg echo WinDebug\pathstuff.obj >>link.dbg
echo off echo off
echo "Linking WinDebug/%make%.exe" echo "Linking WinDebug/%make%.exe"
@@ -73,59 +73,59 @@ if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!" if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
if not exist .\WinRel\nul mkdir .\WinRel if not exist .\WinRel\nul mkdir .\WinRel
echo on echo on
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
echo WinRel\variable.obj >>link.rel echo WinRel\variable.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
echo WinRel\rule.obj >>link.rel echo WinRel\rule.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
echo WinRel\remote-stub.obj >>link.rel echo WinRel\remote-stub.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
echo WinRel\commands.obj >>link.rel echo WinRel\commands.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
echo WinRel\file.obj >>link.rel echo WinRel\file.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
echo WinRel\getloadavg.obj >>link.rel echo WinRel\getloadavg.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
echo WinRel\default.obj >>link.rel echo WinRel\default.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
echo WinRel\signame.obj >>link.rel echo WinRel\signame.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
echo WinRel\expand.obj >>link.rel echo WinRel\expand.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
echo WinRel\dir.obj >>link.rel echo WinRel\dir.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
echo WinRel\main.obj >>link.rel echo WinRel\main.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
echo WinRel\getopt1.obj >>link.rel echo WinRel\getopt1.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
echo WinRel\job.obj >>link.rel echo WinRel\job.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
echo WinRel\read.obj >>link.rel echo WinRel\read.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
echo WinRel\version.obj >>link.rel echo WinRel\version.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
echo WinRel\getopt.obj >>link.rel echo WinRel\getopt.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
echo WinRel\arscan.obj >>link.rel echo WinRel\arscan.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
echo WinRel\remake.obj >>link.rel echo WinRel\remake.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
echo WinRel\misc.obj >>link.rel echo WinRel\misc.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
echo WinRel\ar.obj >>link.rel echo WinRel\ar.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
echo WinRel\function.obj >>link.rel echo WinRel\function.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
echo WinRel\vpath.obj >>link.rel echo WinRel\vpath.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
echo WinRel\implicit.obj >>link.rel echo WinRel\implicit.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
echo WinRel\dirent.obj >>link.rel echo WinRel\dirent.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
echo WinRel\glob.obj >>link.rel echo WinRel\glob.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
echo WinRel\fnmatch.obj >>link.rel echo WinRel\fnmatch.obj >>link.rel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
echo WinRel\pathstuff.obj >>link.rel echo WinRel\pathstuff.obj >>link.rel
echo off echo off
echo "Linking WinRel/%make%.exe" echo "Linking WinRel/%make%.exe"

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -87,7 +88,7 @@ set_file_variables (file)
for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next) for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next)
{ {
unsigned int slen = strlen (dep_name (d)); unsigned int slen = strlen (dep_name (d));
if (len > slen && !strncmp (dep_name (d), name + (len - slen), slen)) if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
{ {
file->stem = savestring (name, len - slen); file->stem = savestring (name, len - slen);
break; break;
@@ -343,6 +344,7 @@ execute_file_commands (file)
/* We are all out of commands. /* We are all out of commands.
If we have gotten this far, all the previous commands If we have gotten this far, all the previous commands
have run successfully, so we have winning update status. */ have run successfully, so we have winning update status. */
set_command_state (file, cs_running);
file->update_status = 0; file->update_status = 0;
notice_finished_file (file); notice_finished_file (file);
return; return;
@@ -379,12 +381,12 @@ fatal_error_signal (sig)
return; return;
} }
remove_intermediates (1); remove_intermediates (1);
exit (1); exit (EXIT_FAILURE);
#else /* not __MSDOS__ */ #else /* not __MSDOS__ */
#ifdef _AMIGA #ifdef _AMIGA
remove_intermediates (1); remove_intermediates (1);
if (sig == SIGINT) if (sig == SIGINT)
fputs ("*** Break.\n", stderr); fputs (_("*** Break.\n"), stderr);
exit (10); exit (10);
#else /* not Amiga */ #else /* not Amiga */
@@ -473,13 +475,13 @@ delete_target (file, on_behalf_of)
#ifndef NO_ARCHIVES #ifndef NO_ARCHIVES
if (ar_name (file->name)) if (ar_name (file->name))
{ {
if (ar_member_date (file->name) != file->last_mtime) if (ar_member_date (file->name) != FILE_TIMESTAMP_S (file->last_mtime))
{ {
if (on_behalf_of) if (on_behalf_of)
error ("*** [%s] Archive member `%s' may be bogus; not deleted", error (NILF, _("*** [%s] Archive member `%s' may be bogus; not deleted"),
on_behalf_of, file->name); on_behalf_of, file->name);
else else
error ("*** Archive member `%s' may be bogus; not deleted", error (NILF, _("*** Archive member `%s' may be bogus; not deleted"),
file->name); file->name);
} }
return; return;
@@ -488,12 +490,12 @@ delete_target (file, on_behalf_of)
if (stat (file->name, &st) == 0 if (stat (file->name, &st) == 0
&& S_ISREG (st.st_mode) && S_ISREG (st.st_mode)
&& (time_t) st.st_mtime != file->last_mtime) && FILE_TIMESTAMP_STAT_MODTIME (st) != file->last_mtime)
{ {
if (on_behalf_of) if (on_behalf_of)
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name); error (NILF, _("*** [%s] Deleting file `%s'"), on_behalf_of, file->name);
else else
error ("*** Deleting file `%s'", file->name); error (NILF, _("*** Deleting file `%s'"), file->name);
if (unlink (file->name) < 0 if (unlink (file->name) < 0
&& errno != ENOENT) /* It disappeared; so what. */ && errno != ENOENT) /* It disappeared; so what. */
perror_with_name ("unlink: ", file->name); perror_with_name ("unlink: ", file->name);
@@ -531,12 +533,13 @@ print_commands (cmds)
{ {
register char *s; register char *s;
fputs ("# commands to execute", stdout); fputs (_("# commands to execute"), stdout);
if (cmds->filename == 0) if (cmds->fileinfo.filenm == 0)
puts (" (built-in):"); puts (_(" (built-in):"));
else else
printf (" (from `%s', line %u):\n", cmds->filename, cmds->lineno); printf (_(" (from `%s', line %lu):\n"),
cmds->fileinfo.filenm, cmds->fileinfo.lineno);
s = cmds->commands; s = cmds->commands;
while (*s != '\0') while (*s != '\0')

View File

@@ -14,15 +14,15 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Structure that gives the commands to make a file /* Structure that gives the commands to make a file
and information about where these commands came from. */ and information about where these commands came from. */
struct commands struct commands
{ {
char *filename; /* File that contains commands. */ struct floc fileinfo; /* Where commands were defined. */
unsigned int lineno; /* Line number in file. */
char *commands; /* Commands text. */ char *commands; /* Commands text. */
unsigned int ncommand_lines;/* Number of command lines. */ unsigned int ncommand_lines;/* Number of command lines. */
char **command_lines; /* Commands chopped up into lines. */ char **command_lines; /* Commands chopped up into lines. */

View File

@@ -4,121 +4,123 @@
System headers sometimes define this. System headers sometimes define this.
We just want to avoid a redefinition error message. */ We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE #ifndef _ALL_SOURCE
#undef _ALL_SOURCE /* #undef _ALL_SOURCE */
#endif #endif
/* Define if using alloca.c. */ /* Define if using alloca.c. */
#define C_ALLOCA #define C_ALLOCA
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */ /* Define to empty if the keyword does not work. */
#undef const /* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */ This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END /* #undef CRAY_STACKSEG_END */
/* Define for DGUX with <sys/dg_sys_info.h>. */ /* Define for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX /* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
#undef GETLOADAVG_PRIVILEGED /* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int #define gid_t int
/* Define if you have alloca, as a function or macro. */ /* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA /* #undef HAVE_ALLOCA */
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H /* #undef HAVE_ALLOCA_H */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you don't have vprintf but do have _doprnt. */ /* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT /* #undef HAVE_DOPRNT */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */ /* Define if your system has its own `getloadavg' function. */
#undef HAVE_GETLOADAVG /* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */ /* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT /* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */ /* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE /* #undef HAVE_LONG_DOUBLE */
/* Define if you support file names longer than 14 characters. */ /* Define if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES #define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */ /* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP /* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption /* Define if system calls automatically restart after interruption
by a signal. */ by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS /* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */ /* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE /* #undef HAVE_ST_BLKSIZE */
/* Define if your struct stat has st_blocks. */ /* Define if your struct stat has st_blocks. */
#undef HAVE_ST_BLOCKS /* #undef HAVE_ST_BLOCKS */
/* Define if you have the strcoll function and it is properly defined. */ /* Define if you have the strcoll function and it is properly defined. */
#define HAVE_STRCOLL #define HAVE_STRCOLL 1
/* Define if your struct stat has st_rdev. */ /* Define if your struct stat has st_rdev. */
#define HAVE_ST_RDEV #define HAVE_ST_RDEV 1
/* Define if you have the strftime function. */ /* Define if you have the strftime function. */
#define HAVE_STRFTIME #define HAVE_STRFTIME 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H /* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */ /* Define if your struct tm has tm_zone. */
#undef HAVE_TM_ZONE /* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array /* Define if you don't have tm_zone but do have the external array
tzname. */ tzname. */
#define HAVE_TZNAME #define HAVE_TZNAME 1
/* #define tzname __tzname */
/* Define if you have <unistd.h>. */ /* Define if you have <unistd.h>. */
#define HAVE_UNISTD_H #define HAVE_UNISTD_H 1
/* Define if utime(file, NULL) sets file's timestamp to the present. */ /* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL /* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */ /* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H /* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#define HAVE_VPRINTF #define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */ /* Define if you have the wait3 system call. */
#undef HAVE_WAIT3 /* #undef HAVE_WAIT3 */
/* Define if on MINIX. */ /* Define if on MINIX. */
#undef _MINIX /* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */ /* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION /* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */ /* Define if you have <nlist.h>. */
#undef NLIST_STRUCT /* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */ /* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O /* #undef NO_MINUS_C_MINUS_O */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#define pid_t int #define pid_t int
/* Define if the system does not provide POSIX.1 features except /* Define if the system does not provide POSIX.1 features except
with this defined. */ with this defined. */
#undef _POSIX_1_SOURCE /* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */ /* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE /* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */ /* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void #define RETSIGTYPE void
@@ -126,7 +128,7 @@
/* Define if the setvbuf function takes the buffering type as its second /* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V argument and the buffer pointer as the third, as on System V
before release 3. */ before release 3. */
#undef SETVBUF_REVERSED /* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@@ -138,29 +140,29 @@
#define STACK_DIRECTION -1 #define STACK_DIRECTION -1
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN /* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#define STDC_HEADERS #define STDC_HEADERS
/* Define on System V Release 4. */ /* Define on System V Release 4. */
#undef SVR4 /* #undef SVR4 */
/* Define if `sys_siglist' is declared by <signal.h>. */ /* Define if `sys_siglist' is declared by <signal.h>. */
#undef SYS_SIGLIST_DECLARED /* #undef SYS_SIGLIST_DECLARED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#define uid_t int #define uid_t int
/* Define for Encore UMAX. */ /* Define for Encore UMAX. */
#undef UMAX /* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h> /* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */ instead of <sys/cpustats.h>. */
#undef UMAX4_3 /* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */ /* Define vfork as fork if vfork does not work. */
#undef vfork /* #undef vfork */
/* Name of this package (needed by automake) */ /* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%" #define PACKAGE "%PACKAGE%"
@@ -172,112 +174,137 @@
#define SCCS_GET "get" #define SCCS_GET "get"
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G /* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
#undef HAVE_SYS_SIGLIST /* #undef HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */ /* Define this if the C library defines the variable `_sys_siglist'. */
#undef HAVE__SYS_SIGLIST /* #undef HAVE__SYS_SIGLIST */
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT /* #undef HAVE_UNION_WAIT */
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
#undef HAVE_SYSCONF_OPEN_MAX
/* Define if you have the dup2 function. */ /* Define if you have the dup2 function. */
#undef HAVE_DUP2 /* #undef HAVE_DUP2 */
/* Define if you have the getcwd function. */ /* Define if you have the getcwd function. */
#define HAVE_GETCWD #define HAVE_GETCWD 1
/* Define if you have the getdtablesize function. */
#undef HAVE_GETDTABLESIZE
/* Define if you have the getgroups function. */ /* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS /* #undef HAVE_GETGROUPS */
/* Define if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */ /* Define if you have the mktemp function. */
#define HAVE_MKTEMP #define HAVE_MKTEMP 1
/* Define if you have the psignal function. */ /* Define if you have the psignal function. */
#undef HAVE_PSIGNAL /* #undef HAVE_PSIGNAL */
/* Define if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */ /* Define if you have the setegid function. */
#undef HAVE_SETEGID /* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */ /* Define if you have the seteuid function. */
#undef HAVE_SETEUID /* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */ /* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF /* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */ /* Define if you have the setregid function. */
#undef HAVE_SETREGID /* #undef HAVE_SETREGID */
/* Define if you have the setreuid function. */ /* Define if you have the setreuid function. */
#undef HAVE_SETREUID /* #undef HAVE_SETREUID */
/* Define if you have the sigsetmask function. */ /* Define if you have the sigsetmask function. */
#undef HAVE_SIGSETMASK /* #undef HAVE_SIGSETMASK */
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#define HAVE_STRERROR #define HAVE_STRERROR 1
/* Define if you have the strsignal function. */ /* Define if you have the strsignal function. */
#undef HAVE_STRSIGNAL /* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */ /* Define if you have the wait3 function. */
#undef HAVE_WAIT3 /* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
#undef HAVE_WAITPID /* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H #define HAVE_DIRENT_H 1
/* Define if you have the <fcntl.h> header file. */ /* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H #define HAVE_FCNTL_H 1
/* Define if you have the <limits.h> header file. */ /* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H #define HAVE_LIMITS_H 1
/* Define if you have the <mach/mach.h> header file. */ /* Define if you have the <mach/mach.h> header file. */
#undef HAVE_MACH_MACH_H /* #undef HAVE_MACH_MACH_H */
/* Define if you have the <memory.h> header file. */ /* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H /* #undef HAVE_MEMORY_H */
/* Define if you have the <ndir.h> header file. */ /* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H /* #undef HAVE_NDIR_H */
/* Define if you have the <stdlib.h> header file. */
/* #undef HAVE_STDLIB_H */
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#define HAVE_STRING_H #define HAVE_STRING_H 1
/* Define if you have the <sys/dir.h> header file. */ /* Define if you have the <sys/dir.h> header file. */
#define HAVE_SYS_DIR_H #define HAVE_SYS_DIR_H 1
/* Define if you have the <sys/ndir.h> header file. */ /* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H /* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H /* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/timeb.h> header file. */ /* Define if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H /* #undef HAVE_SYS_TIMEB_H */
/* Define if you have the <sys/wait.h> header file. */ /* Define if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H /* #undef HAVE_SYS_WAIT_H */
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H #define HAVE_UNISTD_H 1
/* Define if you have the dgc library (-ldgc). */ /* Define if you have the dgc library (-ldgc). */
#undef HAVE_LIBDGC /* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define if you have the sun library (-lsun). */ /* Define if you have the sun library (-lsun). */
#undef HAVE_LIBSUN /* #undef HAVE_LIBSUN */
/* Define for Case Insensitve behavior */ /* Define for Case Insensitve behavior */
#define HAVE_CASE_INSENSITIVE_FS #define HAVE_CASE_INSENSITIVE_FS

View File

@@ -12,6 +12,9 @@
/* Define if using alloca.c. */ /* Define if using alloca.c. */
/* #undef C_ALLOCA */ /* #undef C_ALLOCA */
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */ /* Define to empty if the keyword does not work. */
/* #undef const */ /* #undef const */
@@ -23,7 +26,7 @@
/* #undef DGUX */ /* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED 1 */ /* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */ /* #undef gid_t */
@@ -32,14 +35,14 @@
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H 1 */ /* #undef HAVE_ALLOCA_H */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you don't have vprintf but do have _doprnt. */ /* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */ /* #undef HAVE_DOPRNT */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */ /* Define if your system has its own `getloadavg' function. */
/* #undef HAVE_GETLOADAVG */ /* #undef HAVE_GETLOADAVG */
@@ -66,16 +69,16 @@
/* #undef HAVE_ST_BLOCKS */ /* #undef HAVE_ST_BLOCKS */
/* Define if you have the strcoll function and it is properly defined. */ /* Define if you have the strcoll function and it is properly defined. */
/* #undef HAVE_STRCOLL 1 */ /* #undef HAVE_STRCOLL */
/* Define if your struct stat has st_rdev. */ /* Define if your struct stat has st_rdev. */
/* #undef HAVE_ST_RDEV */ /* #undef HAVE_ST_RDEV */
/* Define if you have the strftime function. */ /* Define if you have the strftime function. */
/* #undef HAVE_STRFTIME */ /* #undef HAVE_STRFTIME */
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H 1 */ /* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */ /* Define if your struct tm has tm_zone. */
/* #undef HAVE_TM_ZONE */ /* #undef HAVE_TM_ZONE */
@@ -93,13 +96,13 @@
/* #undef HAVE_UTIME_NULL */ /* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */ /* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H 1 */ /* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1 #define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */ /* Define if you have the wait3 system call. */
/* #undef HAVE_WAIT3 1 */ /* #undef HAVE_WAIT3 */
/* Define if on MINIX. */ /* Define if on MINIX. */
/* #undef _MINIX */ /* #undef _MINIX */
@@ -108,7 +111,7 @@
/* #undef NLIST_NAME_UNION */ /* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */ /* Define if you have <nlist.h>. */
/* #undef NLIST_STRUCT 1 */ /* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */ /* Define if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */ /* #undef NO_MINUS_C_MINUS_O */
@@ -120,8 +123,12 @@
with this defined. */ with this defined. */
/* #undef _POSIX_1_SOURCE */ /* #undef _POSIX_1_SOURCE */
#include <sys/types.h>
#include <ctype.h>
#include <signal.h>
/* Define if you need to in order for stat and other things to work. */ /* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */ #define _POSIX_C_SOURCE 1
/* Define as the return type of signal handlers (int or void). */ /* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void #define RETSIGTYPE void
@@ -129,7 +136,7 @@
/* Define if the setvbuf function takes the buffering type as its second /* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V argument and the buffer pointer as the third, as on System V
before release 3. */ before release 3. */
/* #undef SETVBUF_REVERSED 1 */ /* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@@ -162,23 +169,30 @@
instead of <sys/cpustats.h>. */ instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */ /* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Name of this package (needed by automake) */ /* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%" #define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */ /* Version of this package (needed by automake) */
#define VERSION "%VERSION%" #define VERSION "%VERSION%"
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Define to the name of the SCCS `get' command. */ /* Define to the name of the SCCS `get' command. */
/* #undef SCCS_GET "/usr/sccs/get" */ /* #undef SCCS_GET */
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
/* #undef SCCS_GET_MINUS_G 1 */ /* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
/* #undefine HAVE_SYS_SIGLIST 1 */ /* #undefine HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */ /* Define this if the C library defines the variable `_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */ /* #undef HAVE__SYS_SIGLIST */
@@ -186,45 +200,60 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */ /* #undef HAVE_UNION_WAIT */
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
/* #undef HAVE_SYSCONF_OPEN_MAX */
/* Define if you have the dup2 function. */ /* Define if you have the dup2 function. */
#define HAVE_DUP2 1 #define HAVE_DUP2 1
/* Define if you have the getcwd function. */ /* Define if you have the getcwd function. */
#define HAVE_GETCWD 1 #define HAVE_GETCWD 1
/* Define if you have the getdtablesize function. */
/* #undef HAVE_GETDTABLESIZE 1 */
/* Define if you have the getgroups function. */ /* Define if you have the getgroups function. */
/* #undef HAVE_GETGROUPS 1 */ /* #undef HAVE_GETGROUPS */
/* Define if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */ /* Define if you have the mktemp function. */
#define HAVE_MKTEMP 1 #define HAVE_MKTEMP 1
/* Define if you have the psignal function. */ /* Define if you have the psignal function. */
/* #undef HAVE_PSIGNAL 1 */ /* #undef HAVE_PSIGNAL */
/* Define if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */ /* Define if you have the setegid function. */
/* #undef HAVE_SETEGID 1 */ /* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */ /* Define if you have the seteuid function. */
/* #undef HAVE_SETEUID 1 */ /* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */ /* Define if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF 1 */ /* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */ /* Define if you have the setregid function. */
/* #undefine HAVE_SETREGID 1 */ /* #undefine HAVE_SETREGID */
/* Define if you have the setreuid function. */ /* Define if you have the setreuid function. */
/* #define HAVE_SETREUID 1 */ /* #define HAVE_SETREUID */
/* Define if you have the sigsetmask function. */ /* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1 #define HAVE_SIGSETMASK 1
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#define HAVE_STRERROR 1 #define HAVE_STRERROR 1
@@ -232,13 +261,13 @@
/* #undef HAVE_STRSIGNAL */ /* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */ /* Define if you have the wait3 function. */
/* #define HAVE_WAIT3 1 */ /* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
/* #undef HAVE_WAITPID 1 */ /* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
/* #unddef HAVE_DIRENT_H 1 */ /* #undef HAVE_DIRENT_H */
/* Define if you have the <fcntl.h> header file. */ /* Define if you have the <fcntl.h> header file. */
#ifdef __DECC #ifdef __DECC
@@ -252,17 +281,17 @@
/* #undef HAVE_MACH_MACH_H */ /* #undef HAVE_MACH_MACH_H */
/* Define if you have the <memory.h> header file. */ /* Define if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H 1 */ /* #undef HAVE_MEMORY_H */
/* Define if you have the <ndir.h> header file. */ /* Define if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */ /* #undef HAVE_NDIR_H */
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
/* Define if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
/* Define if you have the <sys/dir.h> header file. */ /* Define if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */ /* #undef HAVE_SYS_DIR_H */
@@ -270,27 +299,40 @@
/* #undef HAVE_SYS_NDIR_H */ /* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H 1 */ /* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/timeb.h> header file. */ /* Define if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1 #define HAVE_SYS_TIMEB_H 1
/* Define if you have the <sys/wait.h> header file. */ /* Define if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H 1 */ /* #undef HAVE_SYS_WAIT_H */
/* Define if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
/* Define if you have the dgc library (-ldgc). */ /* Define if you have the dgc library (-ldgc). */
/* #undef HAVE_LIBDGC */ /* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define if you have the sun library (-lsun). */ /* Define if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */ /* #undef HAVE_LIBSUN */
/* VMS specific */ /* VMS specific */
#define HAVE_VMSDIR_H 1 #define HAVE_VMSDIR_H 1
#define HAVE_STDLIB_H 1
#define INCLUDEDIR "sys$sysroot:[syslib]" #define INCLUDEDIR "sys$sysroot:[syslib]"
#define LIBDIR "sys$sysroot:[syslib]" #define LIBDIR "sys$sysroot:[syslib]"
/* Avoid broken RTL functions on OpenVMS */
#include <unixlib.h>
#define getopt gnu_getopt
#define optarg gnu_optarg
#define optopt gnu_optopt
#define optind gnu_optind
#define opterr gnu_opterr
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef PARAMS #undef PARAMS
#define PARAMS(protos) protos #define PARAMS(protos) protos

View File

@@ -4,24 +4,27 @@
System headers sometimes define this. System headers sometimes define this.
We just want to avoid a redefinition error message. */ We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE #ifndef _ALL_SOURCE
#undef _ALL_SOURCE /* #undef _ALL_SOURCE */
#endif #endif
/* Define if using alloca.c. */ /* Define if using alloca.c. */
#undef C_ALLOCA /* #undef C_ALLOCA */
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */ /* Define to empty if the keyword does not work. */
#undef const /* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */ This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END /* #undef CRAY_STACKSEG_END */
/* Define for DGUX with <sys/dg_sys_info.h>. */ /* Define for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX /* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
#undef GETLOADAVG_PRIVILEGED /* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t #undef gid_t
@@ -32,40 +35,39 @@
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H /* #undef HAVE_ALLOCA_H */
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
#define HAVE_MEMMOVE 1
/* Define if you don't have vprintf but do have _doprnt. */ /* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT /* #undef HAVE_DOPRNT */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */ /* Define if your system has its own `getloadavg' function. */
#undef HAVE_GETLOADAVG /* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */ /* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT /* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */ /* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE /* #undef HAVE_LONG_DOUBLE */
/* Define if you support file names longer than 14 characters. */ /* Define if you support file names longer than 14 characters. */
#undef HAVE_LONG_FILE_NAMES #undef HAVE_LONG_FILE_NAMES
#define HAVE_LONG_FILE_NAMES 1 #define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */ /* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP /* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption /* Define if system calls automatically restart after interruption
by a signal. */ by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS /* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */ /* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE /* #undef HAVE_ST_BLKSIZE */
/* Define if your struct stat has st_blocks. */ /* Define if your struct stat has st_blocks. */
#undef HAVE_ST_BLOCKS /* #undef HAVE_ST_BLOCKS */
/* Define if you have the strcoll function and it is properly defined. */ /* Define if you have the strcoll function and it is properly defined. */
#undef HAVE_STRCOLL #undef HAVE_STRCOLL
@@ -80,10 +82,10 @@
#define HAVE_STRFTIME 1 #define HAVE_STRFTIME 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H /* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */ /* Define if your struct tm has tm_zone. */
#undef HAVE_TM_ZONE /* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array /* Define if you don't have tm_zone but do have the external array
tzname. */ tzname. */
@@ -91,33 +93,33 @@
#define HAVE_TZNAME 1 #define HAVE_TZNAME 1
/* Define if you have <unistd.h>. */ /* Define if you have <unistd.h>. */
#undef HAVE_UNISTD_H /* #undef HAVE_UNISTD_H */
/* Define if utime(file, NULL) sets file's timestamp to the present. */ /* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL #undef HAVE_UTIME_NULL
#define HAVE_UTIME_NULL 1 #define HAVE_UTIME_NULL 1
/* Define if you have <vfork.h>. */ /* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H /* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#undef HAVE_VPRINTF #undef HAVE_VPRINTF
#define HAVE_VPRINTF 1 #define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */ /* Define if you have the wait3 system call. */
#undef HAVE_WAIT3 /* #undef HAVE_WAIT3 */
/* Define if on MINIX. */ /* Define if on MINIX. */
#undef _MINIX /* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */ /* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION /* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */ /* Define if you have <nlist.h>. */
#undef NLIST_STRUCT /* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */ /* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O /* #undef NO_MINUS_C_MINUS_O */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t #undef pid_t
@@ -125,7 +127,7 @@
/* Define if the system does not provide POSIX.1 features except /* Define if the system does not provide POSIX.1 features except
with this defined. */ with this defined. */
#undef _POSIX_1_SOURCE /* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */ /* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE #undef _POSIX_SOURCE
@@ -138,7 +140,7 @@
/* Define if the setvbuf function takes the buffering type as its second /* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V argument and the buffer pointer as the third, as on System V
before release 3. */ before release 3. */
#undef SETVBUF_REVERSED /* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@@ -147,34 +149,34 @@
STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown STACK_DIRECTION = 0 => direction of growth unknown
*/ */
#undef STACK_DIRECTION /* #undef STACK_DIRECTION */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN /* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Define on System V Release 4. */ /* Define on System V Release 4. */
#undef SVR4 /* #undef SVR4 */
/* Define if `sys_siglist' is declared by <signal.h>. */ /* Define if `sys_siglist' is declared by <signal.h>. */
#undef SYS_SIGLIST_DECLARED /* #undef SYS_SIGLIST_DECLARED */
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t #undef uid_t
#define uid_t int #define uid_t int
/* Define for Encore UMAX. */ /* Define for Encore UMAX. */
#undef UMAX /* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h> /* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */ instead of <sys/cpustats.h>. */
#undef UMAX4_3 /* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */ /* Define vfork as fork if vfork does not work. */
#undef vfork /* #undef vfork */
/* Name of this package (needed by automake) */ /* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%" #define PACKAGE "%PACKAGE%"
@@ -187,16 +189,23 @@
#define SCCS_GET "echo no sccs get" #define SCCS_GET "echo no sccs get"
/* Define this if the SCCS `get' command understands the `-G<file>' option. */ /* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G /* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */ /* Define this if the C library defines the variable `sys_siglist'. */
#undef HAVE_SYS_SIGLIST /* #undef HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */ /* Define this if the C library defines the variable `_sys_siglist'. */
#undef HAVE__SYS_SIGLIST /* #undef HAVE__SYS_SIGLIST */
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT /* #undef HAVE_UNION_WAIT */
/* Define if you have the dup2 function. */ /* Define if you have the dup2 function. */
#undef HAVE_DUP2 #undef HAVE_DUP2
@@ -207,45 +216,67 @@
#define HAVE_GETCWD 1 #define HAVE_GETCWD 1
/* Define if you have the getgroups function. */ /* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS /* #undef HAVE_GETGROUPS */
/* Define if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */ /* Define if you have the mktemp function. */
#undef HAVE_MKTEMP #undef HAVE_MKTEMP
#define HAVE_MKTEMP 1 #define HAVE_MKTEMP 1
/* Define if you have the psignal function. */ /* Define if you have the psignal function. */
#undef HAVE_PSIGNAL /* #undef HAVE_PSIGNAL */
/* Define if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */ /* Define if you have the setegid function. */
#undef HAVE_SETEGID /* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */ /* Define if you have the seteuid function. */
#undef HAVE_SETEUID /* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */ /* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF /* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */ /* Define if you have the setregid function. */
#undef HAVE_SETREGID /* #undef HAVE_SETREGID */
/* Define if you have the setreuid function. */ /* Define if you have the setreuid function. */
#undef HAVE_SETREUID /* #undef HAVE_SETREUID */
/* Define if you have the sigsetmask function. */ /* Define if you have the sigsetmask function. */
#undef HAVE_SIGSETMASK /* #undef HAVE_SIGSETMASK */
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#undef HAVE_STRERROR #undef HAVE_STRERROR
#define HAVE_STRERROR 1 #define HAVE_STRERROR 1
/* Define if you have the strsignal function. */ /* Define if you have the strsignal function. */
#undef HAVE_STRSIGNAL /* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */ /* Define if you have the wait3 function. */
#undef HAVE_WAIT3 /* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
#undef HAVE_WAITPID /* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H
@@ -260,43 +291,46 @@
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
/* Define if you have the <mach/mach.h> header file. */ /* Define if you have the <mach/mach.h> header file. */
#undef HAVE_MACH_MACH_H /* #undef HAVE_MACH_MACH_H */
/* Define if you have the <memory.h> header file. */ /* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
#define HAVE_MEMORY_H 1 #define HAVE_MEMORY_H 1
/* Define if you have the <ndir.h> header file. */ /* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H /* #undef HAVE_NDIR_H */
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H #undef HAVE_STRING_H
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
/* Define if you have the <sys/dir.h> header file. */ /* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H /* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/ndir.h> header file. */ /* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H /* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H /* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/timeb.h> header file. */ /* Define if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H #undef HAVE_SYS_TIMEB_H
#define HAVE_SYS_TIMEB_H 1 #define HAVE_SYS_TIMEB_H 1
/* Define if you have the <sys/wait.h> header file. */ /* Define if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H /* #undef HAVE_SYS_WAIT_H */
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H /* #undef HAVE_UNISTD_H */
/* Define if you have the dgc library (-ldgc). */ /* Define if you have the dgc library (-ldgc). */
#undef HAVE_LIBDGC /* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define if you have the sun library (-lsun). */ /* Define if you have the sun library (-lsun). */
#undef HAVE_LIBSUN /* #undef HAVE_LIBSUN */
/* /*
* Refer to README.W32 for info on the following settings * Refer to README.W32 for info on the following settings

View File

@@ -1,4 +1,3 @@
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
/* 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>
@@ -9,8 +8,20 @@
/* Version of this package (needed by automake) */ /* Version of this package (needed by automake) */
#define VERSION "%VERSION%" #define VERSION "%VERSION%"
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
/* Define if `sys_siglist' is declared by <signal.h>. */
# define SYS_SIGLIST_DECLARED 1
/* Define this if the C library defines the variable `_sys_siglist'. */
# define HAVE_SYS_SIGLIST 1
#else
/* Define NSIG. */ /* Define NSIG. */
#define NSIG SIGMAX # define NSIG SIGMAX
#endif
/* Define if you have sigsetmask. */ /* Define if you have sigsetmask. */
#define HAVE_SIGSETMASK 1 #define HAVE_SIGSETMASK 1
@@ -22,3 +33,17 @@
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define SCCS_GET "get" #define SCCS_GET "get"
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long long
/* Define the type of the first arg to select(). */
#define fd_set_size_t int
/* Define if you have the select function. */
#define HAVE_SELECT 1
/* Define if you have the vprintf library function. */
#undef HAVE_VPRINTF
#define HAVE_VPRINTF 1

View File

@@ -1,21 +1,19 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$Id$]) AC_REVISION([$Id$])
AC_PREREQ(2.12)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.77) AM_INIT_AUTOMAKE(make, 3.77.92)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob)
AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
dnl Regular configure stuff dnl Regular configure stuff
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
AC_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_RANLIB
AC_PROG_CPP dnl Later checks need this. AC_PROG_CPP dnl Later checks need this.
dnl AC_ARG_PROGRAM -- implied by AM_INIT_AUTOMAKE; gives errors if run twice.
AC_AIX AC_AIX
AC_ISC_POSIX AC_ISC_POSIX
AC_MINIX AC_MINIX
@@ -30,12 +28,15 @@ AC_HEADER_DIRENT
AC_TYPE_UID_T dnl Also does gid_t. AC_TYPE_UID_T dnl Also does gid_t.
AC_TYPE_PID_T AC_TYPE_PID_T
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \ AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
sys/timeb.h) memory.h sys/timeb.h)
AC_PROG_CC_C_O AC_PROG_CC_C_O
AC_C_CONST dnl getopt needs this. AC_C_CONST dnl getopt needs this.
AC_HEADER_STAT AC_HEADER_STAT
AC_STRUCT_ST_MTIM_NSEC
jm_AC_TYPE_UINTMAX_T
AC_SUBST(LIBOBJS) AC_SUBST(LIBOBJS)
AC_DEFUN(AC_CHECK_SYMBOL, [dnl AC_DEFUN(AC_CHECK_SYMBOL, [dnl
@@ -51,19 +52,27 @@ changequote([,])dnl
fi fi
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \ # clock_gettime is in -lposix4 in Solaris 2.6.
dup2 getcwd sigsetmask getgroups setlinebuf \ AC_CHECK_LIB(posix4, clock_gettime)
seteuid setegid setreuid setregid strerror strsignal)
AC_CHECK_FUNCS(memmove strdup psignal mktemp pstat_getdynamic \
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
setlinebuf seteuid setegid setreuid setregid pipe \
strerror strsignal)
AC_CHECK_SYMBOL(sys_siglist) AC_CHECK_SYMBOL(sys_siglist)
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_FUNC_VFORK AC_FUNC_VFORK
AC_FUNC_VPRINTF
AC_FUNC_STRCOLL
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_SETVBUF_REVERSED AC_FUNC_SETVBUF_REVERSED
AC_FUNC_GETLOADAVG AC_FUNC_GETLOADAVG
AC_FUNC_SELECT
AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_LIB(kstat, kstat_open)
AC_FUNC_STRCOLL
# Check out the wait reality. # Check out the wait reality.
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3) AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_FUNCS(waitpid wait3)
AC_MSG_CHECKING(for union wait) AC_MSG_CHECKING(for union wait)
AC_CACHE_VAL(make_cv_union_wait, [dnl AC_CACHE_VAL(make_cv_union_wait, [dnl
AC_TRY_LINK([#include <sys/types.h> AC_TRY_LINK([#include <sys/types.h>
@@ -117,27 +126,99 @@ AC_ARG_WITH(customs,
;; ;;
esac]) esac])
echo checking for location of SCCS get command dnl See if we can handle the job server feature, and if the user wants it.
AC_ARG_ENABLE(job-server,
[ --disable-job-server Disallow recursive make communication during -jN],
[make_cv_job_server="$enableval" user_job_server="$enableval"],
[make_cv_job_server="yes"])
has_wait_nohang=yes
case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
no/no) has_wait_nohang=no ;;
esac
case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$has_wait_nohang/$make_cv_job_server" in
yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER) ;;
esac
dnl Allow building with dmalloc
AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc Enable support for the dmalloc debugging library],
[make_cv_dmalloc="$enableval"],
[make_cv_dmalloc="no"])
case "$make_cv_dmalloc" in
yes) AC_CHECK_HEADERS(dmalloc.h)
AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
esac
AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
if test -f /usr/sccs/get; then if test -f /usr/sccs/get; then
SCCS_GET=/usr/sccs/get make_cv_path_sccs_get=/usr/sccs/get
AC_DEFINE(SCCS_GET, "/usr/sccs/get")
else else
SCCS_GET=get make_cv_path_sccs_get=get
AC_DEFINE(SCCS_GET, "get") fi])
fi AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
test -f s.conftest; then test -f s.conftest; then
# We successfully created an SCCS file. # We successfully created an SCCS file.
echo checking if SCCS get command understands -G AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 && if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast; then test -f conftoast; then
AC_DEFINE(SCCS_GET_MINUS_G) make_cv_sys_get_minus_G=yes
fi else
make_cv_sys_get_minus_G=no
fi])
case "$make_cv_sys_get_minus_G" in
yes) AC_DEFINE(SCCS_GET_MINUS_G);;
esac
fi fi
rm -f s.conftest conftoast rm -f s.conftest conftoast
AC_OUTPUT(Makefile build.sh) AC_MSG_CHECKING(if system libc has GNU glob)
AC_CACHE_VAL(make_cv_sys_gnu_glob, [
AC_TRY_CPP([
#include <features.h>
#include <glob.h>
#include <fnmatch.h>
#define GLOB_INTERFACE_VERSION 1
#if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1
# error no gnu glob
#else
# include <gnu-versions.h>
# if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION
# error no gnu glob
# endif
#endif
], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)])
case "$make_cv_sys_gnu_glob" in
yes) AC_MSG_RESULT(yes) ;;
no) AC_MSG_RESULT([no; using local copy])
CPPFLAGS="$CPPFLAGS -I$srcdir/glob"
AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
;;
esac
MAINT_MAKEFILE=/dev/null
if test -r $srcdir/maintMakefile; then
MAINT_MAKEFILE="$srcdir/maintMakefile"
fi
AC_SUBST_FILE(MAINT_MAKEFILE)
AC_OUTPUT(build.sh Makefile glob/Makefile)
dnl If we don't yet have build.sh.in, build.sh is a bogus 0-length file
dnl so remove it.
test -f build.sh.in || rm -f build.sh
case "$make_badcust" in case "$make_badcust" in
yes) echo yes) echo
@@ -159,6 +240,25 @@ case "$with_customs" in
fi ;; fi ;;
esac esac
case "$has_wait_nohang" in
no) echo
echo "WARNING: Your system has neither waitpid() nor wait3()."
echo " Without one of these, signal handling is unreliable."
echo " You should be aware that running GNU make with -j"
echo " could result in erratic behavior."
echo ;;
esac
case "$make_cv_job_server/$user_job_server" in
no/yes) echo
echo "WARNING: Make job server requires a POSIX-ish system that"
echo " supports the pipe(), sigaction(), and either"
echo " waitpid() or wait3() functions. Your system doesn't"
echo " appear to provide one or more of those."
echo " Disabling job server support."
echo ;;
esac
dnl Local Variables: dnl Local Variables:
dnl comment-start: "dnl " dnl comment-start: "dnl "
dnl comment-end: "" dnl comment-end: ""

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "rule.h" #include "rule.h"
@@ -182,21 +183,21 @@ static char *default_suffix_rules[] =
".S.o", ".S.o",
"$(COMPILE.S) -o $@ $<", "$(COMPILE.S) -o $@ $<",
".c.o", ".c.o",
"$(COMPILE.c) $< $(OUTPUT_OPTION)", "$(COMPILE.c) $(OUTPUT_OPTION) $<",
".cc.o", ".cc.o",
"$(COMPILE.cc) $< $(OUTPUT_OPTION)", "$(COMPILE.cc) $(OUTPUT_OPTION) $<",
".C.o", ".C.o",
"$(COMPILE.C) $< $(OUTPUT_OPTION)", "$(COMPILE.C) $(OUTPUT_OPTION) $<",
".cpp.o", ".cpp.o",
"$(COMPILE.cpp) $< $(OUTPUT_OPTION)", "$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o", ".f.o",
"$(COMPILE.f) $< $(OUTPUT_OPTION)", "$(COMPILE.f) $(OUTPUT_OPTION) $<",
".p.o", ".p.o",
"$(COMPILE.p) $< $(OUTPUT_OPTION)", "$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o", ".F.o",
"$(COMPILE.F) $< $(OUTPUT_OPTION)", "$(COMPILE.F) $(OUTPUT_OPTION) $<",
".r.o", ".r.o",
"$(COMPILE.r) $< $(OUTPUT_OPTION)", "$(COMPILE.r) $(OUTPUT_OPTION) $<",
".mod.o", ".mod.o",
"$(COMPILE.mod) -o $@ $<", "$(COMPILE.mod) -o $@ $<",
@@ -221,9 +222,9 @@ static char *default_suffix_rules[] =
"@$(RM) $@ \n $(LEX.l) $< > $@", "@$(RM) $@ \n $(LEX.l) $< > $@",
".F.f", ".F.f",
"$(PREPROCESS.F) $< $(OUTPUT_OPTION)", "$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f", ".r.f",
"$(PREPROCESS.r) $< $(OUTPUT_OPTION)", "$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
/* This might actually make lex.yy.c if there's no %R% /* This might actually make lex.yy.c if there's no %R%
directive in $*.l, but in that case why were you directive in $*.l, but in that case why were you
@@ -425,6 +426,16 @@ static char *default_variables[] =
"SCCS_OUTPUT_OPTION", "-G$@", "SCCS_OUTPUT_OPTION", "-G$@",
#endif #endif
#ifdef _AMIGA
".LIBPATTERNS", "%.lib",
#else
#ifdef __MSDOS__
".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
#else
".LIBPATTERNS", "lib%.so lib%.a",
#endif
#endif
#endif /* !VMS */ #endif /* !VMS */
0, 0 0, 0
}; };
@@ -468,7 +479,7 @@ install_default_suffix_rules ()
if (f->cmds == 0) if (f->cmds == 0)
{ {
f->cmds = (struct commands *) xmalloc (sizeof (struct commands)); f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
f->cmds->filename = 0; f->cmds->fileinfo.filenm = 0;
f->cmds->commands = s[1]; f->cmds->commands = s[1];
f->cmds->command_lines = 0; f->cmds->command_lines = 0;
} }
@@ -498,6 +509,9 @@ define_default_variables ()
{ {
register char **s; register char **s;
if (no_builtin_variables_flag)
return;
for (s = default_variables; *s != 0; s += 2) for (s = default_variables; *s != 0; s += 2)
(void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1); (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
} }

25
dep.h
View File

@@ -14,7 +14,18 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Flag bits for the second argument to `read_makefile'.
These flags are saved in the `changed' field of each
`struct dep' in the chain returned by `read_all_makefiles'. */
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
#define RM_NOFLAG 0
/* Structure representing one dependency of a file. /* Structure representing one dependency of a file.
Each struct file's `deps' points to a chain of these, Each struct file's `deps' points to a chain of these,
@@ -59,13 +70,7 @@ extern struct nameseq *ar_glob PARAMS ((char *arname, char *member_pattern, unsi
extern char *dep_name (); extern char *dep_name ();
#endif #endif
extern struct dep *copy_dep_chain PARAMS ((struct dep *d));
extern struct dep *read_all_makefiles PARAMS ((char **makefiles)); extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
extern int update_goal_chain PARAMS ((struct dep *goals, int makefiles));
/* Flag bits for the second argument to `read_makefile'. extern void uniquize_deps PARAMS ((struct dep *));
These flags are saved in the `changed' field of each
`struct dep' in the chain returned by `read_all_makefiles'. */
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
#define RM_NOFLAG 0

50
dir.c
View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
@@ -331,6 +332,13 @@ find_directory (name)
#ifdef VMS #ifdef VMS
if (vmsstat_dir (name, &st) < 0) if (vmsstat_dir (name, &st) < 0)
#else #else
#ifdef WINDOWS32
/* Remove any trailing '\'. Windows32 stat fails even on valid
directories if they end in '\'. */
if (p[-1] == '\\')
p[-1] = '\0';
#endif
if (stat (name, &st) < 0) if (stat (name, &st) < 0)
#endif #endif
{ {
@@ -384,7 +392,7 @@ find_directory (name)
/* Enter it in the contents hash table. */ /* Enter it in the contents hash table. */
dc->dev = st.st_dev; dc->dev = st.st_dev;
#ifdef WINDOWS32 #ifdef WINDOWS32
dc->path_key = strdup(w32_path); dc->path_key = xstrdup(w32_path);
dc->mtime = st.st_mtime; dc->mtime = st.st_mtime;
/* /*
@@ -771,7 +779,7 @@ file_impossible (filename)
new = (struct dirfile *) xmalloc (sizeof (struct dirfile)); new = (struct dirfile *) xmalloc (sizeof (struct dirfile));
new->next = dir->contents->files[hash]; new->next = dir->contents->files[hash];
dir->contents->files[hash] = new; dir->contents->files[hash] = new;
new->name = savestring (filename, strlen (filename)); new->name = xstrdup (filename);
new->impossible = 1; new->impossible = 1;
} }
@@ -876,7 +884,7 @@ print_dir_data_base ()
register unsigned int i, dirs, files, impossible; register unsigned int i, dirs, files, impossible;
register struct directory *dir; register struct directory *dir;
puts ("\n# Directories\n"); puts (_("\n# Directories\n"));
dirs = files = impossible = 0; dirs = files = impossible = 0;
for (i = 0; i < DIRECTORY_BUCKETS; ++i) for (i = 0; i < DIRECTORY_BUCKETS; ++i)
@@ -884,19 +892,19 @@ print_dir_data_base ()
{ {
++dirs; ++dirs;
if (dir->contents == 0) if (dir->contents == 0)
printf ("# %s: could not be stat'd.\n", dir->name); printf (_("# %s: could not be stat'd.\n"), dir->name);
else if (dir->contents->files == 0) else if (dir->contents->files == 0)
#ifdef WINDOWS32 #ifdef WINDOWS32
printf ("# %s (key %s, mtime %d): could not be opened.\n", printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
dir->name, dir->contents->path_key,dir->contents->mtime); dir->name, dir->contents->path_key,dir->contents->mtime);
#else /* WINDOWS32 */ #else /* WINDOWS32 */
#ifdef VMS #ifdef VMS
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n", printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
dir->name, dir->contents->dev, dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1], dir->contents->ino[0], dir->contents->ino[1],
dir->contents->ino[2]); dir->contents->ino[2]);
#else #else
printf ("# %s (device %ld, inode %ld): could not be opened.\n", printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
dir->name, (long int) dir->contents->dev, dir->name, (long int) dir->contents->dev,
(long int) dir->contents->ino); (long int) dir->contents->ino);
#endif #endif
@@ -913,34 +921,34 @@ print_dir_data_base ()
else else
++f; ++f;
#ifdef WINDOWS32 #ifdef WINDOWS32
printf ("# %s (key %s, mtime %d): ", printf (_("# %s (key %s, mtime %d): "),
dir->name, dir->contents->path_key, dir->contents->mtime); dir->name, dir->contents->path_key, dir->contents->mtime);
#else /* WINDOWS32 */ #else /* WINDOWS32 */
#ifdef VMS #ifdef VMS
printf ("# %s (device %d, inode [%d,%d,%d]): ", printf (_("# %s (device %d, inode [%d,%d,%d]): "),
dir->name, dir->contents->dev, dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1], dir->contents->ino[0], dir->contents->ino[1],
dir->contents->ino[2]); dir->contents->ino[2]);
#else #else
printf ("# %s (device %ld, inode %ld): ", printf (_("# %s (device %ld, inode %ld): "),
dir->name, dir->name,
(long)dir->contents->dev, (long)dir->contents->ino); (long)dir->contents->dev, (long)dir->contents->ino);
#endif #endif
#endif /* WINDOWS32 */ #endif /* WINDOWS32 */
if (f == 0) if (f == 0)
fputs ("No", stdout); fputs (_("No"), stdout);
else else
printf ("%u", f); printf ("%u", f);
fputs (" files, ", stdout); fputs (_(" files, "), stdout);
if (im == 0) if (im == 0)
fputs ("no", stdout); fputs (_("no"), stdout);
else else
printf ("%u", im); printf ("%u", im);
fputs (" impossibilities", stdout); fputs (_(" impossibilities"), stdout);
if (dir->contents->dirstream == 0) if (dir->contents->dirstream == 0)
puts ("."); puts (".");
else else
puts (" so far."); puts (_(" so far."));
files += f; files += f;
impossible += im; impossible += im;
} }
@@ -948,15 +956,15 @@ print_dir_data_base ()
fputs ("\n# ", stdout); fputs ("\n# ", stdout);
if (files == 0) if (files == 0)
fputs ("No", stdout); fputs (_("No"), stdout);
else else
printf ("%u", files); printf ("%u", files);
fputs (" files, ", stdout); fputs (_(" files, "), stdout);
if (impossible == 0) if (impossible == 0)
fputs ("no", stdout); fputs (_("no"), stdout);
else else
printf ("%u", impossible); printf ("%u", impossible);
printf (" impossibilities in %u directories.\n", dirs); printf (_(" impossibilities in %u directories.\n"), dirs);
} }
/* Hooks for globbing. */ /* Hooks for globbing. */
@@ -1060,7 +1068,9 @@ void
dir_setup_glob (gl) dir_setup_glob (gl)
glob_t *gl; glob_t *gl;
{ {
#ifndef VMS
extern int stat (); extern int stat ();
#endif
/* Bogus sunos4 compiler complains (!) about & before functions. */ /* Bogus sunos4 compiler complains (!) about & before functions. */
gl->gl_opendir = open_dirstream; gl->gl_opendir = open_dirstream;

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
@@ -95,17 +96,10 @@ recursively_expand (v)
char *value; char *value;
if (v->expanding) if (v->expanding)
{ /* Expanding V causes infinite recursion. Lose. */
/* Expanding V causes infinite recursion. Lose. */ fatal (reading_file,
if (reading_filename == 0) _("Recursive variable `%s' references itself (eventually)"),
fatal ("Recursive variable `%s' references itself (eventually)", v->name);
v->name);
else
makefile_fatal
(reading_filename, *reading_lineno_ptr,
"Recursive variable `%s' references itself (eventually)",
v->name);
}
v->expanding = 1; v->expanding = 1;
value = allocated_variable_expand (v->value); value = allocated_variable_expand (v->value);
@@ -125,14 +119,8 @@ warn_undefined (name, length)
unsigned int length; unsigned int length;
{ {
if (warn_undefined_variables_flag) if (warn_undefined_variables_flag)
{ error (reading_file,
static const char warnmsg[] = "warning: undefined variable `%.*s'"; _("warning: undefined variable `%.*s'"), (int)length, name);
if (reading_filename != 0)
makefile_error (reading_filename, *reading_lineno_ptr,
warnmsg, length, name);
else
error (warnmsg, length, name);
}
} }
/* Expand a simple reference to variable NAME, which is LENGTH chars long. */ /* Expand a simple reference to variable NAME, which is LENGTH chars long. */
@@ -243,14 +231,8 @@ variable_expand_string (line, string, length)
end = index (beg, closeparen); end = index (beg, closeparen);
if (end == 0) if (end == 0)
{ /* Unterminated variable reference. */
/* Unterminated variable reference. */ fatal (reading_file, _("unterminated variable reference"));
if (reading_filename != 0)
makefile_fatal (reading_filename, *reading_lineno_ptr,
"unterminated variable reference");
else
fatal ("unterminated variable reference");
}
p1 = lindex (beg, end, '$'); p1 = lindex (beg, end, '$');
if (p1 != 0) if (p1 != 0)
{ {
@@ -417,7 +399,7 @@ char *
variable_expand (line) variable_expand (line)
char *line; char *line;
{ {
return variable_expand_string(NULL, line, -1); return variable_expand_string(NULL, line, (long)-1);
} }
/* Expand an argument for an expansion function. /* Expand an argument for an expansion function.
@@ -460,8 +442,7 @@ variable_expand_for_file (line, file)
save = current_variable_set_list; save = current_variable_set_list;
current_variable_set_list = file->variables; current_variable_set_list = file->variables;
reading_filename = file->cmds->filename; reading_file = &file->cmds->fileinfo;
reading_lineno_ptr = &file->cmds->lineno;
fnext = file->variables->next; fnext = file->variables->next;
/* See if there's a pattern-specific variable struct for this target. */ /* See if there's a pattern-specific variable struct for this target. */
if (!file->pat_searched) if (!file->pat_searched)
@@ -476,8 +457,7 @@ variable_expand_for_file (line, file)
} }
result = variable_expand (line); result = variable_expand (line);
current_variable_set_list = save; current_variable_set_list = save;
reading_filename = 0; reading_file = 0;
reading_lineno_ptr = 0;
file->variables->next = fnext; file->variables->next = fnext;
return result; return result;

156
file.c
View File

@@ -14,7 +14,10 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <assert.h>
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -22,7 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "job.h" #include "job.h"
#include "commands.h" #include "commands.h"
#include "variable.h" #include "variable.h"
#include <assert.h>
/* Hash table of files the makefile knows how to make. */ /* Hash table of files the makefile knows how to make. */
@@ -36,6 +38,9 @@ static struct file *files[FILE_BUCKETS];
unsigned int num_intermediates = 0; unsigned int num_intermediates = 0;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
unsigned int considered = 0;
/* Access the hash table of all file records. /* Access the hash table of all file records.
lookup_file given a name, return the struct file * for that name, lookup_file given a name, return the struct file * for that name,
@@ -294,24 +299,24 @@ file_hash_enter (file, name, oldhash, oldname)
/* We have two sets of commands. We will go with the /* We have two sets of commands. We will go with the
one given in the rule explicitly mentioning this name, one given in the rule explicitly mentioning this name,
but give a message to let the user know what's going on. */ but give a message to let the user know what's going on. */
if (oldfile->cmds->filename != 0) if (oldfile->cmds->fileinfo.filenm != 0)
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"Commands were specified for \ _("Commands were specified for \
file `%s' at %s:%u,", file `%s' at %s:%lu,"),
oldname, oldfile->cmds->filename, oldname, oldfile->cmds->fileinfo.filenm,
oldfile->cmds->lineno); oldfile->cmds->fileinfo.lineno);
else else
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"Commands for file `%s' were found by \ _("Commands for file `%s' were found by \
implicit rule search,", implicit rule search,"),
oldname); oldname);
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"but `%s' is now considered the same file \ _("but `%s' is now considered the same file \
as `%s'.", as `%s'."),
oldname, name); oldname, name);
makefile_error (file->cmds->filename, file->cmds->lineno, error (&file->cmds->fileinfo,
"Commands for `%s' will be ignored \ _("Commands for `%s' will be ignored \
in favor of those for `%s'.", in favor of those for `%s'."),
name, oldname); name, oldname);
} }
} }
@@ -331,12 +336,12 @@ in favor of those for `%s'.",
merge_variable_set_lists (&oldfile->variables, file->variables); merge_variable_set_lists (&oldfile->variables, file->variables);
if (oldfile->double_colon && file->is_target && !file->double_colon) if (oldfile->double_colon && file->is_target && !file->double_colon)
fatal ("can't rename single-colon `%s' to double-colon `%s'", fatal (NILF, _("can't rename single-colon `%s' to double-colon `%s'"),
oldname, name); oldname, name);
if (!oldfile->double_colon && file->double_colon) if (!oldfile->double_colon && file->double_colon)
{ {
if (oldfile->is_target) if (oldfile->is_target)
fatal ("can't rename double-colon `%s' to single-colon `%s'", fatal (NILF, _("can't rename double-colon `%s' to single-colon `%s'"),
oldname, name); oldname, name);
else else
oldfile->double_colon = file->double_colon; oldfile->double_colon = file->double_colon;
@@ -346,6 +351,8 @@ in favor of those for `%s'.",
/* %%% Kludge so -W wins on a file that gets vpathized. */ /* %%% Kludge so -W wins on a file that gets vpathized. */
oldfile->last_mtime = file->last_mtime; oldfile->last_mtime = file->last_mtime;
oldfile->mtime_before_update = file->mtime_before_update;
#define MERGE(field) oldfile->field |= file->field #define MERGE(field) oldfile->field |= file->field
MERGE (precious); MERGE (precious);
MERGE (tried_implicit); MERGE (tried_implicit);
@@ -401,7 +408,7 @@ remove_intermediates (sig)
if (!f->dontcare) if (!f->dontcare)
{ {
if (sig) if (sig)
error ("*** Deleting intermediate file `%s'", f->name); error (NILF, _("*** Deleting intermediate file `%s'"), f->name);
else if (!silent_flag) else if (!silent_flag)
{ {
if (! doneany) if (! doneany)
@@ -465,7 +472,8 @@ snap_deps ()
{ {
/* Mark this file as phony and nonexistent. */ /* Mark this file as phony and nonexistent. */
f2->phony = 1; f2->phony = 1;
f2->last_mtime = (time_t) -1; f2->last_mtime = (FILE_TIMESTAMP) -1;
f2->mtime_before_update = (FILE_TIMESTAMP) -1;
} }
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev) for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
@@ -549,6 +557,51 @@ set_command_state (file, state)
d->file->command_state = state; d->file->command_state = state;
} }
/* Get and print file timestamps. */
FILE_TIMESTAMP
file_timestamp_now ()
{
#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
struct timespec timespec;
if (clock_gettime (CLOCK_REALTIME, &timespec) == 0)
return FILE_TIMESTAMP_FROM_S_AND_NS (timespec.tv_sec, timespec.tv_nsec);
#endif
return FILE_TIMESTAMP_FROM_S_AND_NS (time ((time_t *) 0), 0);
}
void
file_timestamp_sprintf (p, ts)
char *p;
FILE_TIMESTAMP ts;
{
time_t t = FILE_TIMESTAMP_S (ts);
struct tm *tm = localtime (&t);
if (tm)
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
else if (t < 0)
sprintf (p, "%ld", (long) t);
else
sprintf (p, "%lu", (unsigned long) t);
p += strlen (p);
/* Append nanoseconds as a fraction, but remove trailing zeros.
We don't know the actual timestamp resolution, since clock_getres
applies only to local times, whereas this timestamp might come
from a remote filesystem. So removing trailing zeros is the
best guess that we can do. */
sprintf (p, ".%09ld", (long) FILE_TIMESTAMP_NS (ts));
p += strlen (p) - 1;
while (*p == '0')
p--;
p += *p != '.';
*p = '\0';
}
/* Print the data base of files. */ /* Print the data base of files. */
static void static void
@@ -559,7 +612,7 @@ print_file (f)
putchar ('\n'); putchar ('\n');
if (!f->is_target) if (!f->is_target)
puts ("# Not a target:"); puts (_("# Not a target:"));
printf ("%s:%s", f->name, f->double_colon ? ":" : ""); printf ("%s:%s", f->name, f->double_colon ? ":" : "");
for (d = f->deps; d != 0; d = d->next) for (d = f->deps; d != 0; d = d->next)
@@ -567,42 +620,45 @@ print_file (f)
putchar ('\n'); putchar ('\n');
if (f->precious) if (f->precious)
puts ("# Precious file (dependency of .PRECIOUS)."); puts (_("# Precious file (dependency of .PRECIOUS)."));
if (f->phony) if (f->phony)
puts ("# Phony target (dependency of .PHONY)."); puts (_("# Phony target (dependency of .PHONY)."));
if (f->cmd_target) if (f->cmd_target)
puts ("# Command-line target."); puts (_("# Command-line target."));
if (f->dontcare) if (f->dontcare)
puts ("# A default or MAKEFILES makefile."); puts (_("# A default or MAKEFILES makefile."));
printf ("# Implicit rule search has%s been done.\n", printf (_("# Implicit rule search has%s been done.\n"),
f->tried_implicit ? "" : " not"); f->tried_implicit ? "" : _(" not"));
if (f->stem != 0) if (f->stem != 0)
printf ("# Implicit/static pattern stem: `%s'\n", f->stem); printf (_("# Implicit/static pattern stem: `%s'\n"), f->stem);
if (f->intermediate) if (f->intermediate)
puts ("# File is an intermediate dependency."); puts (_("# File is an intermediate dependency."));
if (f->also_make != 0) if (f->also_make != 0)
{ {
fputs ("# Also makes:", stdout); fputs (_("# Also makes:"), stdout);
for (d = f->also_make; d != 0; d = d->next) for (d = f->also_make; d != 0; d = d->next)
printf (" %s", dep_name (d)); printf (" %s", dep_name (d));
putchar ('\n'); putchar ('\n');
} }
if (f->last_mtime == (time_t) 0) if (f->last_mtime == 0)
puts ("# Modification time never checked."); puts (_("# Modification time never checked."));
else if (f->last_mtime == (time_t) -1) else if (f->last_mtime == (FILE_TIMESTAMP) -1)
puts ("# File does not exist."); puts (_("# File does not exist."));
else else
printf ("# Last modified %.24s (%ld)\n", {
ctime (&f->last_mtime), (long int) f->last_mtime); char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
printf ("# File has%s been updated.\n", file_timestamp_sprintf (buf, f->last_mtime);
f->updated ? "" : " not"); printf (_("# Last modified %s\n"), buf);
}
printf (_("# File has%s been updated.\n"),
f->updated ? "" : _(" not"));
switch (f->command_state) switch (f->command_state)
{ {
case cs_running: case cs_running:
puts ("# Commands currently running (THIS IS A BUG)."); puts (_("# Commands currently running (THIS IS A BUG)."));
break; break;
case cs_deps_running: case cs_deps_running:
puts ("# Dependencies commands running (THIS IS A BUG)."); puts (_("# Dependencies commands running (THIS IS A BUG)."));
break; break;
case cs_not_started: case cs_not_started:
case cs_finished: case cs_finished:
@@ -611,24 +667,24 @@ print_file (f)
case -1: case -1:
break; break;
case 0: case 0:
puts ("# Successfully updated."); puts (_("# Successfully updated."));
break; break;
case 1: case 1:
assert (question_flag); assert (question_flag);
puts ("# Needs to be updated (-q is set)."); puts (_("# Needs to be updated (-q is set)."));
break; break;
case 2: case 2:
puts ("# Failed to be updated."); puts (_("# Failed to be updated."));
break; break;
default: default:
puts ("# Invalid value in `update_status' member!"); puts (_("# Invalid value in `update_status' member!"));
fflush (stdout); fflush (stdout);
fflush (stderr); fflush (stderr);
abort (); abort ();
} }
break; break;
default: default:
puts ("# Invalid value in `command_state' member!"); puts (_("# Invalid value in `command_state' member!"));
fflush (stdout); fflush (stdout);
fflush (stderr); fflush (stderr);
abort (); abort ();
@@ -647,7 +703,7 @@ print_file_data_base ()
register unsigned int i, nfiles, per_bucket; register unsigned int i, nfiles, per_bucket;
register struct file *file; register struct file *file;
puts ("\n# Files"); puts (_("\n# Files"));
per_bucket = nfiles = 0; per_bucket = nfiles = 0;
for (i = 0; i < FILE_BUCKETS; ++i) for (i = 0; i < FILE_BUCKETS; ++i)
@@ -670,12 +726,12 @@ print_file_data_base ()
} }
if (nfiles == 0) if (nfiles == 0)
puts ("\n# No files."); puts (_("\n# No files."));
else else
{ {
printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS); printf (_("\n# %u files in %u hash buckets.\n"), nfiles, FILE_BUCKETS);
#ifndef NO_FLOAT #ifndef NO_FLOAT
printf ("# average %.3f files per bucket, max %u files in one bucket.\n", printf (_("# average %.3f files per bucket, max %u files in one bucket.\n"),
((double) nfiles) / ((double) FILE_BUCKETS), per_bucket); ((double) nfiles) / ((double) FILE_BUCKETS), per_bucket);
#endif #endif
} }

View File

@@ -14,7 +14,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Structure that represents the info on one file /* Structure that represents the info on one file
that the makefile says how to make. that the makefile says how to make.
@@ -32,7 +34,9 @@ struct file
char *stem; /* Implicit stem, if an implicit char *stem; /* Implicit stem, if an implicit
rule has been used */ rule has been used */
struct dep *also_make; /* Targets that are made by making this. */ struct dep *also_make; /* Targets that are made by making this. */
time_t last_mtime; /* File's modtime, if already known. */ FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
struct file *prev; /* Previous entry for same file name; struct file *prev; /* Previous entry for same file name;
used when there are multiple double-colon used when there are multiple double-colon
entries for the same file. */ entries for the same file. */
@@ -83,25 +87,83 @@ struct file
unsigned int secondary:1; unsigned int secondary:1;
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
this target cannot be remade. */ this target cannot be remade. */
unsigned int shownerror:1; /* Nonzero if we printed an error */ unsigned int mfile_status:1;/* Nonzero if update_status was obtained
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */ while remaking a makefile. */
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
unsigned int pat_searched:1;/* Nonzero if we already searched for unsigned int pat_searched:1;/* Nonzero if we already searched for
pattern-specific variables */ pattern-specific variables. */
unsigned int considered:1; /* equal to `considered' if file has been
considered on current scan of goal chain */
}; };
/* Number of intermediate files entered. */ /* Number of intermediate files entered. */
extern unsigned int num_intermediates; extern unsigned int num_intermediates;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
extern unsigned int considered;
extern struct file *default_goal_file, *suffix_file, *default_file; extern struct file *default_goal_file, *suffix_file, *default_file;
extern struct file *lookup_file (), *enter_file (); extern struct file *lookup_file PARAMS ((char *name));
extern void remove_intermediates (), snap_deps (); extern struct file *enter_file PARAMS ((char *name));
extern void rename_file (), rehash_file (), file_hash_enter (); extern void remove_intermediates PARAMS ((int sig));
extern void set_command_state (); extern void snap_deps PARAMS ((void));
extern void rename_file PARAMS ((struct file *file, char *name));
extern void rehash_file PARAMS ((struct file *file, char *name));
extern void file_hash_enter PARAMS ((struct file *file, char *name,
unsigned int oldhash, char *oldname));
extern void set_command_state PARAMS ((struct file *file, int state));
extern void notice_finished_file PARAMS ((struct file *file));
#if ST_MTIM_NSEC
# define FILE_TIMESTAMP_STAT_MODTIME(st) \
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \
(st).st_mtim.ST_MTIM_NSEC)
# define FILE_TIMESTAMPS_PER_S \
MIN ((FILE_TIMESTAMP) 1000000000, \
(INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
/ INTEGER_TYPE_MAXIMUM (time_t)))
#else
# define FILE_TIMESTAMP_STAT_MODTIME(st) ((st).st_mtime)
# define FILE_TIMESTAMPS_PER_S 1
#endif
#define FILE_TIMESTAMP_FROM_S_AND_NS(s, ns) \
((s) * FILE_TIMESTAMPS_PER_S \
+ (ns) * FILE_TIMESTAMPS_PER_S / 1000000000)
#define FILE_TIMESTAMP_DIV(a, b) ((a)/(b) - ((a)%(b) < 0))
#define FILE_TIMESTAMP_MOD(a, b) ((a)%(b) + ((a)%(b) < 0) * (b))
#define FILE_TIMESTAMP_S(ts) FILE_TIMESTAMP_DIV ((ts), FILE_TIMESTAMPS_PER_S)
#define FILE_TIMESTAMP_NS(ts) \
(((FILE_TIMESTAMP_MOD ((ts), FILE_TIMESTAMPS_PER_S) * 1000000000) \
+ (FILE_TIMESTAMPS_PER_S - 1)) \
/ FILE_TIMESTAMPS_PER_S)
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
representing a file timestamp. The upper bound is not necessarily 19,
since the year might be less than -999 or greater than 9999.
Subtract one for the sign bit if in case file timestamps can be negative;
subtract FLOOR_LOG2_SECONDS_PER_YEAR to yield an upper bound on how many
file timestamp bits might affect the year;
302 / 1000 is log10 (2) rounded up;
add one for integer division truncation;
add one more for a minus sign if file timestamps can be negative;
add 4 to allow for any 4-digit epoch year (e.g. 1970);
add 25 to allow for "-MM-DD HH:MM:SS.NNNNNNNNN". */
#define FLOOR_LOG2_SECONDS_PER_YEAR 24
#define FILE_TIMESTAMP_PRINT_LEN_BOUND \
(((sizeof (FILE_TIMESTAMP) * CHAR_BIT - 1 - FLOOR_LOG2_SECONDS_PER_YEAR) \
* 302 / 1000) \
+ 1 + 1 + 4 + 25)
extern FILE_TIMESTAMP file_timestamp_now PARAMS ((void));
extern void file_timestamp_sprintf PARAMS ((char *p, FILE_TIMESTAMP ts));
/* Return the mtime of file F (a struct file *), caching it. /* Return the mtime of file F (a struct file *), caching it.
The value is -1 if the file does not exist. */ The value is -1 if the file does not exist. */
#define file_mtime(f) file_mtime_1 ((f), 1) #define file_mtime(f) file_mtime_1 ((f), 1)
@@ -110,9 +172,9 @@ extern void set_command_state ();
we don't find it. we don't find it.
The value is -1 if the file does not exist. */ The value is -1 if the file does not exist. */
#define file_mtime_no_search(f) file_mtime_1 ((f), 0) #define file_mtime_no_search(f) file_mtime_1 ((f), 0)
extern time_t f_mtime (); extern FILE_TIMESTAMP f_mtime PARAMS ((struct file *file, int search));
#define file_mtime_1(f, v) \ #define file_mtime_1(f, v) \
((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v)) ((f)->last_mtime ? (f)->last_mtime : f_mtime ((f), v))
/* Modtime value to use for `infinitely new'. We used to get the current time /* Modtime value to use for `infinitely new'. We used to get the current time
from the system and use that whenever we wanted `new'. But that causes from the system and use that whenever we wanted `new'. But that causes
@@ -121,12 +183,13 @@ extern time_t f_mtime ();
targets, which need to be considered newer than anything that depends on targets, which need to be considered newer than anything that depends on
them, even if said dependents' modtimes are in the future. them, even if said dependents' modtimes are in the future.
If time_t is unsigned, its maximum value is the same as "(time_t) -1", If FILE_TIMESTAMP is unsigned, its maximum value is the same as
so use one less than that, because -1 is used for non-existing files. */ ((FILE_TIMESTAMP) -1), so use one less than that, because -1 is
used for non-existing files. */
#define NEW_MTIME \ #define NEW_MTIME \
(INTEGER_TYPE_SIGNED (time_t) \ (INTEGER_TYPE_SIGNED (FILE_TIMESTAMP) \
? INTEGER_TYPE_MAXIMUM (time_t) \ ? INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
: (INTEGER_TYPE_MAXIMUM (time_t) - 1)) : (INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) - 1))
#define check_renamed(file) \ #define check_renamed(file) \
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */ while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */

2864
function.c

File diff suppressed because it is too large Load Diff

View File

@@ -132,6 +132,12 @@ extern int errno;
# undef FSCALE # undef FSCALE
# endif # endif
/* Same issues as for NeXT apply to the HURD-based GNU system. */
# ifdef __GNU__
# undef BSD
# undef FSCALE
# endif /* __GNU__ */
/* Set values that are different from the defaults, which are /* Set values that are different from the defaults, which are
set a little farther down with #ifndef. */ set a little farther down with #ifndef. */
@@ -528,13 +534,13 @@ static long offset;
#if !defined(VMS) && !defined(sgi) && !defined(__linux__) #if !defined(VMS) && !defined(sgi) && !defined(__linux__)
static struct nlist nl[2]; static struct nlist nl[2];
#endif #endif /* Not VMS or sgi */
#ifdef SUNOS_5 #ifdef SUNOS_5
static kvm_t *kd; static kvm_t *kd;
#endif /* SUNOS_5 */ #endif /* SUNOS_5 */
# endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */ #endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */
/* Put the 1 minute, 5 minute and 15 minute load averages /* Put the 1 minute, 5 minute and 15 minute load averages
into the first NELEM elements of LOADAVG. into the first NELEM elements of LOADAVG.
@@ -960,7 +966,7 @@ getloadavg (loadavg, nelem)
{ {
/* Set the channel to close on exec, so it does not /* Set the channel to close on exec, so it does not
litter any child's descriptor table. */ litter any child's descriptor table. */
# ifdef FD_SETFD # ifdef F_SETFD
# ifndef FD_CLOEXEC # ifndef FD_CLOEXEC
# define FD_CLOEXEC 1 # define FD_CLOEXEC 1
# endif # endif
@@ -1032,7 +1038,7 @@ getloadavg (loadavg, nelem)
#endif /* ! HAVE_GETLOADAVG */ #endif /* ! HAVE_GETLOADAVG */
#ifdef TEST #ifdef TEST
void int
main (argc, argv) main (argc, argv)
int argc; int argc;
char **argv; char **argv;

1
glob/.cvsignore Normal file
View File

@@ -0,0 +1 @@
.deps Makefile.in

View File

@@ -1,3 +1,19 @@
1999-07-21 Paul D. Smith <psmith@gnu.org>
* glob.c, glob.h, fnmatch.c, fnmatch.h: Update to latest version
from GLIBC.
* fnmatch.c (internal_fnmatch): Use K&R definition syntax, not ANSI.
(__strchrnul): This won't exist outside GLIBC, so create one.
* glob.c: Move getlogin{,_r} prototypes below glob.h to get __P()
macro.
1998-08-05 Paul D. Smith <psmith@gnu.org>
* configure.in: Remove; configuration for glob is handled by the
make configure.in.
1998-07-29 Paul D. Smith <psmith@gnu.org> 1998-07-29 Paul D. Smith <psmith@gnu.org>
* glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich * glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich

View File

@@ -1,6 +1,6 @@
# -*-Makefile-*-, or close enough # -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.3 foreign AUTOMAKE_OPTIONS = 1.4 foreign
noinst_LIBRARIES = libglob.a noinst_LIBRARIES = libglob.a

View File

@@ -1,23 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
AM_INIT_AUTOMAKE(glob, 0.0, nodefs)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_RANLIB
AC_PROG_CPP dnl Later checks need this.
dnl These two want to come early.
AC_AIX
AC_MINIX
AC_ISC_POSIX
AC_CONST
AC_HEADER_STDC
AC_CHECK_HEADERS(memory.h unistd.h string.h)
AC_HEADER_DIRENT
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ALLOCA
AC_FUNC_STRCOLL
AC_OUTPUT(Makefile)

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc. /* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@
#include <fnmatch.h> #include <fnmatch.h>
#include <ctype.h> #include <ctype.h>
#if HAVE_STRING_H #if HAVE_STRING_H || defined _LIBC
# include <string.h> # include <string.h>
#else #else
# include <strings.h> # include <strings.h>
@@ -127,16 +127,35 @@ extern char *getenv ();
extern int errno; extern int errno;
# endif # endif
/* This function doesn't exist on most systems. */
# if !defined HAVE___STRCHRNUL && !defined _LIBC
static char *
__strchrnul (s, c)
register const char *s;
int c;
{
c = (unsigned char)c;
while (*s && *s != c)
++s;
return (char *)s;
}
# endif
/* Match STRING against the filename pattern PATTERN, returning zero if /* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */ it matches, nonzero if not. */
int static int
fnmatch (pattern, string, flags) #ifdef _LIBC
internal_function
#endif
internal_fnmatch (pattern, string, no_leading_period, flags)
const char *pattern; const char *pattern;
const char *string; const char *string;
int no_leading_period;
int flags; int flags;
{ {
register const char *p = pattern, *n = string; register const char *p = pattern, *n = string;
register char c; register unsigned char c;
/* Note that this evaluates C many times. */ /* Note that this evaluates C many times. */
# ifdef _LIBC # ifdef _LIBC
@@ -154,10 +173,11 @@ fnmatch (pattern, string, flags)
case '?': case '?':
if (*n == '\0') if (*n == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/') else if (*n == '/' && (flags & FNM_FILE_NAME))
return FNM_NOMATCH; return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' && else if (*n == '.' && no_leading_period
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) && (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
@@ -170,18 +190,19 @@ fnmatch (pattern, string, flags)
return FNM_NOMATCH; return FNM_NOMATCH;
c = FOLD (c); c = FOLD (c);
} }
if (FOLD (*n) != c) if (FOLD ((unsigned char) *n) != c)
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
case '*': case '*':
if ((flags & FNM_PERIOD) && *n == '.' && if (*n == '.' && no_leading_period
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) && (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH; return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++) for (c = *p++; c == '?' || c == '*'; c = *p++)
{ {
if ((flags & FNM_FILE_NAME) && *n == '/') if (*n == '/' && (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under FNM_FILE_NAME. */ /* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH; return FNM_NOMATCH;
else if (c == '?') else if (c == '?')
@@ -199,17 +220,65 @@ fnmatch (pattern, string, flags)
} }
if (c == '\0') if (c == '\0')
return 0; /* The wildcard(s) is/are the last element of the pattern.
If the name is a file name and contains another slash
this does mean it cannot match. */
return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
? FNM_NOMATCH : 0);
else
{
const char *endp;
{ endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1); if (c == '[')
for (--p; *n != '\0'; ++n) {
if ((c == '[' || FOLD (*n) == c1) && int flags2 = ((flags & FNM_FILE_NAME)
fnmatch (p, n, flags & ~FNM_PERIOD) == 0) ? flags : (flags & ~FNM_PERIOD));
return 0;
return FNM_NOMATCH; for (--p; n < endp; ++n)
} if (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2)
== 0)
return 0;
}
else if (c == '/' && (flags & FNM_FILE_NAME))
{
while (*n != '\0' && *n != '/')
++n;
if (*n == '/'
&& (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
flags) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
if (c == '\\' && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
for (--p; n < endp; ++n)
if (FOLD ((unsigned char) *n) == c
&& (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2) == 0))
return 0;
}
}
/* If we come here no match is possible with the wildcard. */
return FNM_NOMATCH;
case '[': case '[':
{ {
@@ -224,8 +293,10 @@ fnmatch (pattern, string, flags)
if (*n == '\0') if (*n == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
if (*n == '.' && (flags & FNM_PERIOD) && if (*n == '.' && no_leading_period && (n == string
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) || (n[-1] == '/'
&& (flags
& FNM_FILE_NAME))))
return FNM_NOMATCH; return FNM_NOMATCH;
if (*n == '/' && (flags & FNM_FILE_NAME)) if (*n == '/' && (flags & FNM_FILE_NAME))
@@ -239,13 +310,14 @@ fnmatch (pattern, string, flags)
c = *p++; c = *p++;
for (;;) for (;;)
{ {
int fn = FOLD (*n); unsigned char fn = FOLD ((unsigned char) *n);
if (!(flags & FNM_NOESCAPE) && c == '\\') if (!(flags & FNM_NOESCAPE) && c == '\\')
{ {
if (*p == '\0') if (*p == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
c = FOLD (*p++); c = FOLD ((unsigned char) *p);
++p;
if (c == fn) if (c == fn)
goto matched; goto matched;
@@ -258,6 +330,7 @@ fnmatch (pattern, string, flags)
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) # if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt; wctype_t wt;
# endif # endif
const char *startp = p;
for (;;) for (;;)
{ {
@@ -272,7 +345,15 @@ fnmatch (pattern, string, flags)
p += 2; p += 2;
break; break;
} }
str[c1++] = 'c'; if (c < 'a' || c >= 'z')
{
/* This cannot possibly be a character class name.
Match it as a normal range. */
p = startp;
c = '[';
goto normal_bracket;
}
str[c1++] = c;
} }
str[c1] = '\0'; str[c1] = '\0';
@@ -282,47 +363,52 @@ fnmatch (pattern, string, flags)
/* Invalid character class name. */ /* Invalid character class name. */
return FNM_NOMATCH; return FNM_NOMATCH;
if (__iswctype (__btowc (*n), wt)) if (__iswctype (__btowc ((unsigned char) *n), wt))
goto matched; goto matched;
# else # else
if ((STREQ (str, "alnum") && ISALNUM (*n)) if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|| (STREQ (str, "alpha") && ISALPHA (*n)) || (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|| (STREQ (str, "blank") && ISBLANK (*n)) || (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|| (STREQ (str, "cntrl") && ISCNTRL (*n)) || (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|| (STREQ (str, "digit") && ISDIGIT (*n)) || (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|| (STREQ (str, "graph") && ISGRAPH (*n)) || (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|| (STREQ (str, "lower") && ISLOWER (*n)) || (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|| (STREQ (str, "print") && ISPRINT (*n)) || (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|| (STREQ (str, "punct") && ISPUNCT (*n)) || (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|| (STREQ (str, "space") && ISSPACE (*n)) || (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|| (STREQ (str, "upper") && ISUPPER (*n)) || (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|| (STREQ (str, "xdigit") && ISXDIGIT (*n))) || (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
goto matched; goto matched;
# endif # endif
} }
else if (c == '\0') else if (c == '\0')
/* [ (unterminated) loses. */ /* [ (unterminated) loses. */
return FNM_NOMATCH; return FNM_NOMATCH;
else if (FOLD (c) == fn) else
goto matched;
cold = c;
c = *p++;
if (c == '-' && *p != ']')
{ {
/* It is a range. */ normal_bracket:
char cend = *p++; if (FOLD (c) == fn)
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend))
goto matched; goto matched;
cold = c;
c = *p++; c = *p++;
if (c == '-' && *p != ']')
{
/* It is a range. */
unsigned char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend))
goto matched;
c = *p++;
}
} }
if (c == ']') if (c == ']')
break; break;
} }
@@ -363,7 +449,7 @@ fnmatch (pattern, string, flags)
break; break;
default: default:
if (c != FOLD (*n)) if (c != FOLD ((unsigned char) *n))
return FNM_NOMATCH; return FNM_NOMATCH;
} }
@@ -382,4 +468,14 @@ fnmatch (pattern, string, flags)
# undef FOLD # undef FOLD
} }
int
fnmatch (pattern, string, flags)
const char *pattern;
const char *string;
int flags;
{
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */ #endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. /* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@@ -24,8 +24,10 @@ extern "C" {
#endif #endif
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# undef __P # if !defined __GLIBC__ || !defined __P
# define __P(protos) protos # undef __P
# define __P(protos) protos
# endif
#else /* Not C++ or ANSI C. */ #else /* Not C++ or ANSI C. */
# undef __P # undef __P
# define __P(protos) () # define __P(protos) ()
@@ -66,13 +68,13 @@ extern "C" {
`fnmatch'. Since this is not the case here it will never be `fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol returned but the conformance test suites still require the symbol
to be defined. */ to be defined. */
#if (_XOPEN_SOURCE - 0) == 500 #ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1) # define FNM_NOSYS (-1)
#endif #endif
/* Match STRING against the filename pattern PATTERN, /* Match NAME against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */ returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((__const char *__pattern, __const char *__string, extern int fnmatch __P ((__const char *__pattern, __const char *__name,
int __flags)); int __flags));
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc. /* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as modify it under the terms of the GNU Library General Public License as
@@ -177,10 +177,10 @@ extern void bcopy ();
#if !defined HAVE_MEMPCPY && __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1 #if !defined HAVE_MEMPCPY && __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1
# define HAVE_MEMPCPY 1 # define HAVE_MEMPCPY 1
# undef mempcpy
# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len) # define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
#endif #endif
#ifndef __GNU_LIBRARY__ #ifndef __GNU_LIBRARY__
# ifdef __GNUC__ # ifdef __GNUC__
__inline __inline
@@ -240,11 +240,17 @@ extern char *alloca ();
#endif #endif
#ifdef _LIBC #ifdef _LIBC
# undef strdup
# define strdup(str) __strdup (str) # define strdup(str) __strdup (str)
# define sysconf(id) __sysconf (id) # define sysconf(id) __sysconf (id)
# define closedir(dir) __closedir (dir) # define closedir(dir) __closedir (dir)
# define opendir(name) __opendir (name) # define opendir(name) __opendir (name)
# define readdir(str) __readdir (str) # define readdir(str) __readdir (str)
# define getpwnam_r(name, bufp, buf, len, res) \
__getpwnam_r (name, bufp, buf, len, res)
# ifndef __stat
# define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
# endif
#endif #endif
#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__) #if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
@@ -274,6 +280,12 @@ extern char *alloca ();
# undef GLOB_PERIOD # undef GLOB_PERIOD
#endif #endif
#include <glob.h> #include <glob.h>
#ifdef HAVE_GETLOGIN_R
extern int getlogin_r __P ((char *, size_t));
#else
extern char *getlogin __P ((void));
#endif
static static
#if __GNUC__ - 0 >= 2 #if __GNUC__ - 0 >= 2
@@ -282,7 +294,7 @@ inline
const char *next_brace_sub __P ((const char *begin)); const char *next_brace_sub __P ((const char *begin));
static int glob_in_dir __P ((const char *pattern, const char *directory, static int glob_in_dir __P ((const char *pattern, const char *directory,
int flags, int flags,
int (*errfunc) __P ((const char *, int)), int (*errfunc) (const char *, int),
glob_t *pglob)); glob_t *pglob));
static int prefix_array __P ((const char *prefix, char **array, size_t n)); static int prefix_array __P ((const char *prefix, char **array, size_t n));
static int collated_compare __P ((const __ptr_t, const __ptr_t)); static int collated_compare __P ((const __ptr_t, const __ptr_t));
@@ -349,7 +361,7 @@ glob (pattern, flags, errfunc, pglob)
glob_t *pglob; glob_t *pglob;
{ {
const char *filename; const char *filename;
char *dirname; const char *dirname;
size_t dirlen; size_t dirlen;
int status; int status;
int oldcount; int oldcount;
@@ -501,39 +513,40 @@ glob (pattern, flags, errfunc, pglob)
{ {
/* This can mean two things: a simple name or "~name". The later /* This can mean two things: a simple name or "~name". The later
case is nothing but a notation for a directory. */ case is nothing but a notation for a directory. */
if ((flags & GLOB_TILDE) && pattern[0] == '~') if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern[0] == '~')
{ {
dirname = (char *) pattern; dirname = pattern;
dirlen = strlen (pattern); dirlen = strlen (pattern);
/* Set FILENAME to NULL as a special flag. This is ugly but /* Set FILENAME to NULL as a special flag. This is ugly but
other solutions would require much more code. We test for other solutions would require much more code. We test for
this special case below. */ this special case below. */
filename = NULL; filename = NULL;
} }
else else
{ {
filename = pattern; filename = pattern;
#ifdef _AMIGA #ifdef _AMIGA
dirname = (char *) ""; dirname = "";
#else #else
dirname = (char *) "."; dirname = ".";
#endif #endif
dirlen = 0; dirlen = 0;
} }
} }
else if (filename == pattern) else if (filename == pattern)
{ {
/* "/pattern". */ /* "/pattern". */
dirname = (char *) "/"; dirname = "/";
dirlen = 1; dirlen = 1;
++filename; ++filename;
} }
else else
{ {
char *newp;
dirlen = filename - pattern; dirlen = filename - pattern;
#if defined __MSDOS__ || defined WINDOWS32 #if defined __MSDOS__ || defined WINDOWS32
if ((*filename == ':') if (*filename == ':'
|| (filename > pattern + 1 && filename[-1] == ':')) || (filename > pattern + 1 && filename[-1] == ':'))
{ {
char *drive_spec; char *drive_spec;
@@ -555,30 +568,31 @@ glob (pattern, flags, errfunc, pglob)
from "d:/", since "d:" and "d:/" are not the same.*/ from "d:/", since "d:" and "d:/" are not the same.*/
} }
#endif #endif
dirname = (char *) __alloca (dirlen + 1); newp = (char *) __alloca (dirlen + 1);
#ifdef HAVE_MEMPCPY #ifdef HAVE_MEMPCPY
*((char *) mempcpy (dirname, pattern, dirlen)) = '\0'; *((char *) mempcpy (newp, pattern, dirlen)) = '\0';
#else #else
memcpy (dirname, pattern, dirlen); memcpy (newp, pattern, dirlen);
dirname[dirlen] = '\0'; newp[dirlen] = '\0';
#endif #endif
dirname = newp;
++filename; ++filename;
if (filename[0] == '\0' if (filename[0] == '\0'
#if defined __MSDOS__ || defined WINDOWS32 #if defined __MSDOS__ || defined WINDOWS32
&& dirname[dirlen-1] != ':' && dirname[dirlen - 1] != ':'
&& (dirlen < 3 || dirname[dirlen-2] != ':' && (dirlen < 3 || dirname[dirlen - 2] != ':'
|| dirname[dirlen-1] != '/') || dirname[dirlen - 1] != '/')
#endif #endif
&& dirlen > 1) && dirlen > 1)
/* "pattern/". Expand "pattern", appending slashes. */ /* "pattern/". Expand "pattern", appending slashes. */
{ {
int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob); int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
if (val == 0) if (val == 0)
pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK) pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
| (flags & GLOB_MARK)); | (flags & GLOB_MARK));
return val; return val;
} }
} }
if (!(flags & GLOB_APPEND)) if (!(flags & GLOB_APPEND))
@@ -590,12 +604,12 @@ glob (pattern, flags, errfunc, pglob)
oldcount = pglob->gl_pathc; oldcount = pglob->gl_pathc;
#ifndef VMS #ifndef VMS
if ((flags & GLOB_TILDE) && dirname[0] == '~') if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{ {
if (dirname[1] == '\0' || dirname[1] == '/') if (dirname[1] == '\0' || dirname[1] == '/')
{ {
/* Look up home directory. */ /* Look up home directory. */
char *home_dir = getenv ("HOME"); const char *home_dir = getenv ("HOME");
# ifdef _AMIGA # ifdef _AMIGA
if (home_dir == NULL || home_dir[0] == '\0') if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS:"; home_dir = "SYS:";
@@ -607,45 +621,61 @@ glob (pattern, flags, errfunc, pglob)
if (home_dir == NULL || home_dir[0] == '\0') if (home_dir == NULL || home_dir[0] == '\0')
{ {
int success; int success;
# if defined HAVE_GETLOGIN_R || defined _LIBC
extern int getlogin_r __P ((char *, size_t));
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
char *name; char *name;
# if defined HAVE_GETLOGIN_R || defined _LIBC
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
if (buflen == 0) if (buflen == 0)
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try /* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
a moderate value. */ a moderate value. */
buflen = 16; buflen = 20;
name = (char *) __alloca (buflen); name = (char *) __alloca (buflen);
success = getlogin_r (name, buflen) >= 0; success = getlogin_r (name, buflen) >= 0;
# else # else
extern char *getlogin __P ((void));
char *name;
success = (name = getlogin ()) != NULL; success = (name = getlogin ()) != NULL;
# endif # endif
if (success) if (success)
{ {
struct passwd *p;
# if defined HAVE_GETPWNAM_R || defined _LIBC # if defined HAVE_GETPWNAM_R || defined _LIBC
size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX); size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf; char *pwtmpbuf;
struct passwd pwbuf, *p; struct passwd pwbuf;
int save = errno;
if (pwbuflen == -1)
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
Try a moderate value. */
pwbuflen = 1024;
pwtmpbuf = (char *) __alloca (pwbuflen); pwtmpbuf = (char *) __alloca (pwbuflen);
success = (__getpwnam_r (name, &pwbuf, pwtmpbuf, while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
pwbuflen, &p) >= 0); != 0)
{
if (errno != ERANGE)
{
p = NULL;
break;
}
pwbuflen *= 2;
pwtmpbuf = (char *) __alloca (pwbuflen);
__set_errno (save);
}
# else # else
struct passwd *p = getpwnam (name); p = getpwnam (name);
success = p != NULL;
# endif # endif
if (success) if (p != NULL)
home_dir = p->pw_dir; home_dir = p->pw_dir;
} }
} }
if (home_dir == NULL || home_dir[0] == '\0') if (home_dir == NULL || home_dir[0] == '\0')
home_dir = (char *) "~"; /* No luck. */ {
if (flags & GLOB_TILDE_CHECK)
return GLOB_NOMATCH;
else
home_dir = "~"; /* No luck. */
}
# endif /* WINDOWS32 */ # endif /* WINDOWS32 */
# endif # endif
/* Now construct the full directory. */ /* Now construct the full directory. */
@@ -670,40 +700,58 @@ glob (pattern, flags, errfunc, pglob)
else else
{ {
char *end_name = strchr (dirname, '/'); char *end_name = strchr (dirname, '/');
char *user_name; const char *user_name;
char *home_dir; const char *home_dir;
if (end_name == NULL) if (end_name == NULL)
user_name = dirname + 1; user_name = dirname + 1;
else else
{ {
user_name = (char *) __alloca (end_name - dirname); char *newp;
newp = (char *) __alloca (end_name - dirname);
# ifdef HAVE_MEMPCPY # ifdef HAVE_MEMPCPY
*((char *) mempcpy (user_name, dirname + 1, end_name - dirname)) *((char *) mempcpy (newp, dirname + 1, end_name - dirname))
= '\0'; = '\0';
# else # else
memcpy (user_name, dirname + 1, end_name - dirname); memcpy (newp, dirname + 1, end_name - dirname);
user_name[end_name - dirname - 1] = '\0'; newp[end_name - dirname - 1] = '\0';
# endif # endif
user_name = newp;
} }
/* Look up specific user's home directory. */ /* Look up specific user's home directory. */
{ {
struct passwd *p;
# if defined HAVE_GETPWNAM_R || defined _LIBC # if defined HAVE_GETPWNAM_R || defined _LIBC
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX); size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf = (char *) __alloca (buflen); char *pwtmpbuf;
struct passwd pwbuf, *p; struct passwd pwbuf;
if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0) int save = errno;
home_dir = p->pw_dir;
else if (buflen == -1)
home_dir = NULL; /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a
moderate value. */
buflen = 1024;
pwtmpbuf = (char *) __alloca (buflen);
while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0)
{
if (errno != ERANGE)
{
p = NULL;
break;
}
buflen *= 2;
pwtmpbuf = __alloca (buflen);
__set_errno (save);
}
# else # else
struct passwd *p = getpwnam (user_name); p = getpwnam (user_name);
# endif
if (p != NULL) if (p != NULL)
home_dir = p->pw_dir; home_dir = p->pw_dir;
else else
home_dir = NULL; home_dir = NULL;
# endif
} }
/* If we found a home directory use this. */ /* If we found a home directory use this. */
if (home_dir != NULL) if (home_dir != NULL)
@@ -722,6 +770,11 @@ glob (pattern, flags, errfunc, pglob)
# endif # endif
dirname = newp; dirname = newp;
} }
else
if (flags & GLOB_TILDE_CHECK)
/* We have to regard it as an error if we cannot find the
home directory. */
return GLOB_NOMATCH;
} }
# endif /* Not Amiga && not WINDOWS32. */ # endif /* Not Amiga && not WINDOWS32. */
} }
@@ -850,78 +903,80 @@ glob (pattern, flags, errfunc, pglob)
flag was set we must return the list consisting of the disrectory flag was set we must return the list consisting of the disrectory
names followed by the filename. */ names followed by the filename. */
if (pglob->gl_pathc == oldcount) if (pglob->gl_pathc == oldcount)
/* No matches. */ {
if (flags & GLOB_NOCHECK) /* No matches. */
{ if (flags & GLOB_NOCHECK)
size_t filename_len = strlen (filename) + 1; {
char **new_pathv; size_t filename_len = strlen (filename) + 1;
struct stat st; char **new_pathv;
struct stat st;
/* This is an pessimistic guess about the size. */ /* This is an pessimistic guess about the size. */
pglob->gl_pathv pglob->gl_pathv
= (char **) realloc (pglob->gl_pathv, = (char **) realloc (pglob->gl_pathv,
(pglob->gl_pathc + (pglob->gl_pathc +
((flags & GLOB_DOOFFS) ? ((flags & GLOB_DOOFFS) ?
pglob->gl_offs : 0) + pglob->gl_offs : 0) +
dirs.gl_pathc + 1) * dirs.gl_pathc + 1) *
sizeof (char *)); sizeof (char *));
if (pglob->gl_pathv == NULL) if (pglob->gl_pathv == NULL)
{ {
globfree (&dirs); globfree (&dirs);
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
if (flags & GLOB_DOOFFS) if (flags & GLOB_DOOFFS)
while (pglob->gl_pathc < pglob->gl_offs) while (pglob->gl_pathc < pglob->gl_offs)
pglob->gl_pathv[pglob->gl_pathc++] = NULL; pglob->gl_pathv[pglob->gl_pathc++] = NULL;
for (i = 0; i < dirs.gl_pathc; ++i) for (i = 0; i < dirs.gl_pathc; ++i)
{ {
const char *dir = dirs.gl_pathv[i]; const char *dir = dirs.gl_pathv[i];
size_t dir_len = strlen (dir); size_t dir_len = strlen (dir);
/* First check whether this really is a directory. */ /* First check whether this really is a directory. */
if (((flags & GLOB_ALTDIRFUNC) if (((flags & GLOB_ALTDIRFUNC)
? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0 ? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0
|| !S_ISDIR (st.st_mode)) || !S_ISDIR (st.st_mode))
/* No directory, ignore this entry. */ /* No directory, ignore this entry. */
continue; continue;
pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1 pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1
+ filename_len); + filename_len);
if (pglob->gl_pathv[pglob->gl_pathc] == NULL) if (pglob->gl_pathv[pglob->gl_pathc] == NULL)
{ {
globfree (&dirs); globfree (&dirs);
globfree (pglob); globfree (pglob);
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
#ifdef HAVE_MEMPCPY #ifdef HAVE_MEMPCPY
mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc], mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc],
dir, dir_len), dir, dir_len),
"/", 1), "/", 1),
filename, filename_len); filename, filename_len);
#else #else
memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len); memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len);
pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/'; pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/';
memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1], memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1],
filename, filename_len); filename, filename_len);
#endif #endif
++pglob->gl_pathc; ++pglob->gl_pathc;
} }
pglob->gl_pathv[pglob->gl_pathc] = NULL; pglob->gl_pathv[pglob->gl_pathc] = NULL;
pglob->gl_flags = flags; pglob->gl_flags = flags;
/* Now we know how large the gl_pathv vector must be. */ /* Now we know how large the gl_pathv vector must be. */
new_pathv = (char **) realloc (pglob->gl_pathv, new_pathv = (char **) realloc (pglob->gl_pathv,
((pglob->gl_pathc + 1) ((pglob->gl_pathc + 1)
* sizeof (char *))); * sizeof (char *)));
if (new_pathv != NULL) if (new_pathv != NULL)
pglob->gl_pathv = new_pathv; pglob->gl_pathv = new_pathv;
} }
else else
return GLOB_NOMATCH; return GLOB_NOMATCH;
}
globfree (&dirs); globfree (&dirs);
} }
@@ -1092,6 +1147,8 @@ prefix_array (dirname, array, n)
} }
/* We must not compile this function twice. */
#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
/* Return nonzero if PATTERN contains any metacharacters. /* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
int int
@@ -1126,8 +1183,9 @@ __glob_pattern_p (pattern, quote)
return 0; return 0;
} }
#ifdef _LIBC # ifdef _LIBC
weak_alias (__glob_pattern_p, glob_pattern_p) weak_alias (__glob_pattern_p, glob_pattern_p)
# endif
#endif #endif
@@ -1213,8 +1271,9 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
: (__ptr_t) opendir (directory)); : (__ptr_t) opendir (directory));
if (stream == NULL) if (stream == NULL)
{ {
if ((errfunc != NULL && (*errfunc) (directory, errno)) if (errno != ENOTDIR
|| (flags & GLOB_ERR)) && ((errfunc != NULL && (*errfunc) (directory, errno))
|| (flags & GLOB_ERR)))
return GLOB_ABORTED; return GLOB_ABORTED;
nfound = 0; nfound = 0;
meta = 0; meta = 0;
@@ -1317,10 +1376,12 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
save = errno; save = errno;
if (stream != NULL) if (stream != NULL)
if (flags & GLOB_ALTDIRFUNC) {
(*pglob->gl_closedir) (stream); if (flags & GLOB_ALTDIRFUNC)
else (*pglob->gl_closedir) (stream);
closedir ((DIR *) stream); else
closedir ((DIR *) stream);
}
__set_errno (save); __set_errno (save);
return nfound == 0 ? GLOB_NOMATCH : 0; return nfound == 0 ? GLOB_NOMATCH : 0;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc. /* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as modify it under the terms of the GNU Library General Public License as
@@ -24,21 +24,42 @@ extern "C" {
#undef __ptr_t #undef __ptr_t
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# undef __P # if !defined __GLIBC__ || !defined __P
# define __P(protos) protos # undef __P
# define __ptr_t void * # undef __PMT
# if !defined __GNUC__ || __GNUC__ < 2 # define __P(protos) protos
# undef __const # define __PMT(protos) protos
# define __const const # if !defined __GNUC__ || __GNUC__ < 2
# undef __const
# define __const const
# endif
# endif # endif
# define __ptr_t void *
#else /* Not C++ or ANSI C. */ #else /* Not C++ or ANSI C. */
# undef __P # undef __P
# undef __PMT
# define __P(protos) () # define __P(protos) ()
# define __PMT(protos) ()
# undef __const # undef __const
# define __const # define __const
# define __ptr_t char * # define __ptr_t char *
#endif /* C++ or ANSI C. */ #endif /* C++ or ANSI C. */
/* We need `size_t' for the following definitions. */
#ifndef __size_t
# if defined __GNUC__ && __GNUC__ >= 2
typedef __SIZE_TYPE__ __size_t;
# else
/* This is a guess. */
typedef unsigned long int __size_t;
# endif
#else
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
definition. */
# undef __size_t
# define __size_t size_t
#endif
/* Bits set in the FLAGS argument to `glob'. */ /* Bits set in the FLAGS argument to `glob'. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */ #define GLOB_ERR (1 << 0)/* Return on read errors. */
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */ #define GLOB_MARK (1 << 1)/* Append a slash to each name. */
@@ -57,10 +78,12 @@ extern "C" {
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */ # define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */ # define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */ # define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR) GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else #else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
@@ -71,41 +94,52 @@ extern "C" {
#define GLOB_NOSPACE 1 /* Ran out of memory. */ #define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */ #define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */ #define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of /* Previous versions of this file defined GLOB_ABEND instead of
GLOB_ABORTED. Provide a compatibility definition here. */ GLOB_ABORTED. Provide a compatibility definition here. */
# define GLOB_ABEND GLOB_ABORTED # define GLOB_ABEND GLOB_ABORTED
#endif #endif
/* This value is returned if the implementation does not support
`glob'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#if (_XOPEN_SOURCE - 0) == 500
# define GLOB_NOSYS (-1)
#endif
/* Structure describing a globbing run. */ /* Structure describing a globbing run. */
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */ #if !defined _AMIGA && !defined VMS /* Buggy compiler. */
struct stat; struct stat;
#endif #endif
typedef struct typedef struct
{ {
int gl_pathc; /* Count of paths matched by the pattern. */ __size_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */ char **gl_pathv; /* List of matched pathnames. */
int gl_offs; /* Slots to reserve in `gl_pathv'. */ __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions /* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */ are used instead of the normal file access functions. */
void (*gl_closedir) __P ((void *)); void (*gl_closedir) __PMT ((void *));
struct dirent *(*gl_readdir) __P ((void *)); struct dirent *(*gl_readdir) __PMT ((void *));
__ptr_t (*gl_opendir) __P ((__const char *)); __ptr_t (*gl_opendir) __PMT ((__const char *));
int (*gl_lstat) __P ((__const char *, struct stat *)); int (*gl_lstat) __PMT ((__const char *, struct stat *));
int (*gl_stat) __P ((__const char *, struct stat *)); int (*gl_stat) __PMT ((__const char *, struct stat *));
} glob_t; } glob_t;
#ifdef _LARGEFILE64_SOURCE
struct stat64;
typedef struct
{
__size_t gl_pathc;
char **gl_pathv;
__size_t gl_offs;
int gl_flags;
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */
void (*gl_closedir) __PMT ((void *));
struct dirent64 *(*gl_readdir) __PMT ((void *));
__ptr_t (*gl_opendir) __PMT ((__const char *));
int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
int (*gl_stat) __PMT ((__const char *, struct stat64 *));
} glob64_t;
#endif
/* Do glob searching for PATTERN, placing results in PGLOB. /* Do glob searching for PATTERN, placing results in PGLOB.
The bits defined above may be set in FLAGS. The bits defined above may be set in FLAGS.
If a directory cannot be opened or read and ERRFUNC is not nil, If a directory cannot be opened or read and ERRFUNC is not nil,
@@ -114,12 +148,33 @@ typedef struct
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored. `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */ Otherwise, `glob' returns zero. */
#if _FILE_OFFSET_BITS != 64
extern int glob __P ((__const char *__pattern, int __flags, extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) __P ((__const char *, int)), int (*__errfunc) (__const char *, int),
glob_t *__pglob)); glob_t *__pglob));
/* Free storage allocated in PGLOB by a previous `glob' call. */ /* Free storage allocated in PGLOB by a previous `glob' call. */
extern void globfree __P ((glob_t *__pglob)); extern void globfree __P ((glob_t *__pglob));
#else
# if __GNUC__ >= 2
extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob_t *__pglob)) __asm__ ("glob64");
extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
# else
# define glob glob64
# define globfree globfree64
# endif
#endif
#ifdef _LARGEFILE64_SOURCE
extern int glob64 __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob64_t *__pglob));
extern void globfree64 __P ((glob64_t *__pglob));
#endif
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE
@@ -128,7 +183,6 @@ extern void globfree __P ((glob_t *__pglob));
This function is not part of the interface specified by POSIX.2 This function is not part of the interface specified by POSIX.2
but several programs want to use it. */ but several programs want to use it. */
extern int __glob_pattern_p __P ((__const char *__pattern, int __quote));
extern int glob_pattern_p __P ((__const char *__pattern, int __quote)); extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
#endif #endif

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "rule.h" #include "rule.h"
@@ -35,7 +36,7 @@ try_implicit_rule (file, depth)
struct file *file; struct file *file;
unsigned int depth; unsigned int depth;
{ {
DEBUGPR ("Looking for an implicit rule for `%s'.\n"); DEBUGPR (_("Looking for an implicit rule for `%s'.\n"));
/* The order of these searches was previously reversed. My logic now is /* The order of these searches was previously reversed. My logic now is
that since the non-archive search uses more information in the target that since the non-archive search uses more information in the target
@@ -50,7 +51,7 @@ try_implicit_rule (file, depth)
archive member name to search for implicit rules. */ archive member name to search for implicit rules. */
if (ar_name (file->name)) if (ar_name (file->name))
{ {
DEBUGPR ("Looking for archive-member implicit rule for `%s'.\n"); DEBUGPR (_("Looking for archive-member implicit rule for `%s'.\n"));
if (pattern_search (file, 1, depth, 0)) if (pattern_search (file, 1, depth, 0))
return 1; return 1;
} }
@@ -148,7 +149,7 @@ pattern_search (file, archive, depth, recursions)
that is not just `%'. */ that is not just `%'. */
int specific_rule_matched = 0; int specific_rule_matched = 0;
register unsigned int i; register unsigned int i = 0; /* uninit checks OK */
register struct rule *rule; register struct rule *rule;
register struct dep *dep; register struct dep *dep;
@@ -198,7 +199,7 @@ pattern_search (file, archive, depth, recursions)
don't use it here. */ don't use it here. */
if (rule->in_use) if (rule->in_use)
{ {
DEBUGP2 ("Avoiding implicit rule recursion.%s%s\n", "", ""); DEBUGP2 (_("Avoiding implicit rule recursion.%s%s\n"), "", "");
continue; continue;
} }
@@ -246,11 +247,11 @@ pattern_search (file, archive, depth, recursions)
if (check_lastslash) if (check_lastslash)
{ {
if (stem > (lastslash + 1) if (stem > (lastslash + 1)
&& strncmp (target, lastslash + 1, stem - lastslash - 1)) && !strneq (target, lastslash + 1, stem - lastslash - 1))
continue; continue;
} }
else if (stem > filename else if (stem > filename
&& strncmp (target, filename, stem - filename)) && !strneq (target, filename, stem - filename))
continue; continue;
/* Check that the rule pattern matches the text after the stem. /* Check that the rule pattern matches the text after the stem.
@@ -334,7 +335,7 @@ pattern_search (file, archive, depth, recursions)
stemlen -= (lastslash - filename) + 1; stemlen -= (lastslash - filename) + 1;
} }
DEBUGP2 ("Trying pattern rule with stem `%.*s'.\n", DEBUGP2 (_("Trying pattern rule with stem `%.*s'.\n"),
(int) stemlen, stem); (int) stemlen, stem);
/* Try each dependency; see if it "exists". */ /* Try each dependency; see if it "exists". */
@@ -342,6 +343,8 @@ pattern_search (file, archive, depth, recursions)
deps_found = 0; deps_found = 0;
for (dep = rule->deps; dep != 0; dep = dep->next) for (dep = rule->deps; dep != 0; dep = dep->next)
{ {
struct file *fp;
/* If the dependency name has a %, substitute the stem. */ /* If the dependency name has a %, substitute the stem. */
p = index (dep_name (dep), '%'); p = index (dep_name (dep), '%');
if (p != 0) if (p != 0)
@@ -373,16 +376,16 @@ pattern_search (file, archive, depth, recursions)
"impossible", then the rule fails and don't "impossible", then the rule fails and don't
bother trying it on the second pass either bother trying it on the second pass either
since we know that will fail too. */ since we know that will fail too. */
DEBUGP2 ("Rejecting impossible %s dependency `%s'.\n", DEBUGP2 (_("Rejecting impossible %s dependency `%s'.\n"),
p == depname ? "implicit" : "rule", p); p == depname ? _("implicit") : _("rule"), p);
tryrules[i] = 0; tryrules[i] = 0;
break; break;
} }
intermediate_files[deps_found] = 0; intermediate_files[deps_found] = 0;
DEBUGP2 ("Trying %s dependency `%s'.\n", DEBUGP2 (_("Trying %s dependency `%s'.\n"),
p == depname ? "implicit" : "rule", p); p == depname ? _("implicit") : _("rule"), p);
/* The DEP->changed flag says that this dependency resides in a /* The DEP->changed flag says that this dependency resides in a
nonexistent directory. So we normally can skip looking for nonexistent directory. So we normally can skip looking for
@@ -390,19 +393,22 @@ pattern_search (file, archive, depth, recursions)
dependency file we are actually looking for is in a different dependency file we are actually looking for is in a different
directory (the one gotten by prepending FILENAME's directory), directory (the one gotten by prepending FILENAME's directory),
so it might actually exist. */ so it might actually exist. */
/* If we find a file but the intermediate flag is set, then it
was put here by a .INTERMEDIATE: rule so ignore it. */
if ((!dep->changed || check_lastslash) if ((!dep->changed || check_lastslash)
&& (lookup_file (p) != 0 || file_exists_p (p))) && (((fp = lookup_file (p)) != 0 && !fp->intermediate)
|| file_exists_p (p)))
{ {
found_files[deps_found++] = savestring (p, strlen (p)); found_files[deps_found++] = xstrdup (p);
continue; continue;
} }
/* This code, given FILENAME = "lib/foo.o", dependency name /* This code, given FILENAME = "lib/foo.o", dependency name
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */ "lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
vp = p; vp = p;
if (vpath_search (&vp, (time_t *) 0)) if (vpath_search (&vp, (FILE_TIMESTAMP *) 0))
{ {
DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp); DEBUGP2 (_("Found dependency `%s' as VPATH `%s'\n"), p, vp);
strcpy(vp, p); strcpy(vp, p);
found_files[deps_found++] = vp; found_files[deps_found++] = vp;
continue; continue;
@@ -418,15 +424,15 @@ pattern_search (file, archive, depth, recursions)
intermediate_file intermediate_file
= (struct file *) alloca (sizeof (struct file)); = (struct file *) alloca (sizeof (struct file));
DEBUGP2 ("Looking for a rule with %s file `%s'.\n", DEBUGP2 (_("Looking for a rule with %s file `%s'.\n"),
"intermediate", p); _("intermediate"), p);
bzero ((char *) intermediate_file, sizeof (struct file)); bzero ((char *) intermediate_file, sizeof (struct file));
intermediate_file->name = p; intermediate_file->name = p;
if (pattern_search (intermediate_file, 0, depth + 1, if (pattern_search (intermediate_file, 0, depth + 1,
recursions + 1)) recursions + 1))
{ {
p = savestring (p, strlen (p)); p = xstrdup (p);
intermediate_patterns[deps_found] intermediate_patterns[deps_found]
= intermediate_file->name; = intermediate_file->name;
intermediate_file->name = p; intermediate_file->name = p;
@@ -435,7 +441,7 @@ pattern_search (file, archive, depth, recursions)
/* Allocate an extra copy to go in FOUND_FILES, /* Allocate an extra copy to go in FOUND_FILES,
because every elt of FOUND_FILES is consumed because every elt of FOUND_FILES is consumed
or freed later. */ or freed later. */
found_files[deps_found] = savestring (p, strlen (p)); found_files[deps_found] = xstrdup (p);
++deps_found; ++deps_found;
continue; continue;
} }
@@ -518,6 +524,7 @@ pattern_search (file, archive, depth, recursions)
f->deps = imf->deps; f->deps = imf->deps;
f->cmds = imf->cmds; f->cmds = imf->cmds;
f->stem = imf->stem; f->stem = imf->stem;
f->also_make = imf->also_make;
imf = lookup_file (intermediate_patterns[deps_found]); imf = lookup_file (intermediate_patterns[deps_found]);
if (imf != 0 && imf->precious) if (imf != 0 && imf->precious)
f->precious = 1; f->precious = 1;
@@ -526,6 +533,9 @@ pattern_search (file, archive, depth, recursions)
for (dep = f->deps; dep != 0; dep = dep->next) for (dep = f->deps; dep != 0; dep = dep->next)
{ {
dep->file = enter_file (dep->name); dep->file = enter_file (dep->name);
/* enter_file uses dep->name _if_ we created a new file. */
if (dep->name != dep->file->name)
free (dep->name);
dep->name = 0; dep->name = 0;
dep->file->tried_implicit |= dep->changed; dep->file->tried_implicit |= dep->changed;
} }
@@ -585,10 +595,9 @@ pattern_search (file, archive, depth, recursions)
file->cmds = rule->cmds; file->cmds = rule->cmds;
/* Put the targets other than the one that /* If this rule builds other targets, too, put the others into FILE's
matched into FILE's `also_make' member. */ `also_make' member. */
/* If there was only one target, there is nothing to do. */
if (rule->targets[1] != 0) if (rule->targets[1] != 0)
for (i = 0; rule->targets[i] != 0; ++i) for (i = 0; rule->targets[i] != 0; ++i)
if (i != matches[foundrule]) if (i != matches[foundrule])

831
job.c

File diff suppressed because it is too large Load Diff

8
job.h
View File

@@ -1,5 +1,5 @@
/* Definitions for managing subprocesses in GNU Make. /* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc. Copyright (C) 1992, 1993, 1996, 1999 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef SEEN_JOB_H #ifndef SEEN_JOB_H
#define SEEN_JOB_H #define SEEN_JOB_H
@@ -38,13 +39,14 @@ struct child
int efn; /* Completion event flag number */ int efn; /* Completion event flag number */
int cstatus; /* Completion status */ int cstatus; /* Completion status */
#endif #endif
char *sh_batch_file; /* Script file for shell commands */
unsigned int remote:1; /* Nonzero if executing remotely. */ unsigned int remote:1; /* Nonzero if executing remotely. */
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */ unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */ unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
unsigned int deleted:1; /* Nonzero if targets have been deleted. */ unsigned int deleted:1; /* Nonzero if targets have been deleted. */
char* sh_batch_file; /* used to execute shell commands via scripts */ char job_token; /* The token read from the job pipe. */
}; };
extern struct child *children; extern struct child *children;

720
main.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
# Maintainer-only makefile segment. This contains things that are relevant # Maintainer-only makefile segment. This contains things that are relevant
# only if you have the full copy of the GNU make sources, not a dist copy. # only if you have the full copy of the GNU make sources from the CVS
# tree, not a dist copy.
# #
# Find the glob source files... this might be dangerous, but we're maintainers! # Find the glob source files... this might be dangerous, but we're maintainers!
@@ -10,6 +11,11 @@ globhdr := $(wildcard glob/*.h)
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
MTEMPLATES = Makefile.DOS SMakefile MTEMPLATES = Makefile.DOS SMakefile
# We need this to ensure that README and build.sh.in are created on time to
# avoid errors by automake.
#
#Makefile.in: README build.sh.in
# General rule for turning a .template into a regular file. # General rule for turning a .template into a regular file.
# #
$(TEMPLATES) : % : %.template configure.in $(TEMPLATES) : % : %.template configure.in
@@ -45,9 +51,9 @@ NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
# #
build.sh.in: build.template Makefile.am maintMakefile build.sh.in: build.template Makefile.am maintMakefile
rm -f $@ rm -f $@
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\ sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@' \
$(patsubst %.c,%.o,$(globsrc)))@' \ -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@' \
$< > $@ $< > $@
chmod a-w+x $@ chmod a-w+x $@
# Use automake to build a dependency list file, for "foreign" makefiles like # Use automake to build a dependency list file, for "foreign" makefiles like
@@ -62,9 +68,7 @@ build.sh.in: build.template Makefile.am maintMakefile
# #
# And _I_ want them to be removed ;) # And _I_ want them to be removed ;)
# #
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in \ maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
glob/configure glob/aclocal.m4 glob/config.h.in glob/Makefile.in \
glob/stamp-h.in
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \ MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
missing build.sh.in .dep_segment missing build.sh.in .dep_segment

View File

@@ -21,6 +21,8 @@ chapter
@end ifclear @end ifclear
@end iftex @end iftex
describes conventions for writing the Makefiles for GNU programs. describes conventions for writing the Makefiles for GNU programs.
Using Automake will help you write a Makefile that follows these
conventions.
@menu @menu
* Makefile Basics:: General Conventions for Makefiles * Makefile Basics:: General Conventions for Makefiles
@@ -257,6 +259,18 @@ $(INSTALL_PROGRAM) foo $(bindir)/foo
$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
@end example @end example
Optionally, you may prepend the value of @code{DESTDIR} to the target
filename. Doing this allows the installer to create a snapshot of the
installation to be copied onto the real target filesystem later. Do not
set the value of @code{DESTDIR} in your Makefile, and do not include it
in any installed files. With support for @code{DESTDIR}, the above
examples become:
@example
$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
@end example
@noindent @noindent
Always use a file name, not a directory name, as the second argument of Always use a file name, not a directory name, as the second argument of
the installation commands. Use a separate command for each file to be the installation commands. Use a separate command for each file to be
@@ -283,6 +297,10 @@ When building the complete GNU system, the prefix will be empty and
@file{/usr} will be a symbolic link to @file{/}. @file{/usr} will be a symbolic link to @file{/}.
(If you are using Autoconf, write it as @samp{@@prefix@@}.) (If you are using Autoconf, write it as @samp{@@prefix@@}.)
Running @samp{make install} with a different value of @code{prefix}
from the one used to build the program should @var{not} recompile
the program.
@item exec_prefix @item exec_prefix
A prefix used in constructing the default values of some of the A prefix used in constructing the default values of some of the
variables listed below. The default value of @code{exec_prefix} should variables listed below. The default value of @code{exec_prefix} should
@@ -292,6 +310,10 @@ be @code{$(prefix)}.
Generally, @code{$(exec_prefix)} is used for directories that contain Generally, @code{$(exec_prefix)} is used for directories that contain
machine-specific files (such as executables and subroutine libraries), machine-specific files (such as executables and subroutine libraries),
while @code{$(prefix)} is used directly for other directories. while @code{$(prefix)} is used directly for other directories.
Running @samp{make install} with a different value of @code{exec_prefix}
from the one used to build the program should @var{not} recompile the
program.
@end table @end table
Executable programs are installed in one of the following directories. Executable programs are installed in one of the following directories.
@@ -568,12 +590,12 @@ Here is a sample rule to install an Info file:
@comment This example has been carefully formatted for the Make manual. @comment This example has been carefully formatted for the Make manual.
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu. @comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
@smallexample @smallexample
$(infodir)/foo.info: foo.info $(DESTDIR)$(infodir)/foo.info: foo.info
$(POST_INSTALL) $(POST_INSTALL)
# There may be a newer info file in . than in srcdir. # There may be a newer info file in . than in srcdir.
-if test -f foo.info; then d=.; \ -if test -f foo.info; then d=.; \
else d=$(srcdir); fi; \ else d=$(srcdir); fi; \
$(INSTALL_DATA) $$d/foo.info $@@; \ $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \
# Run install-info only if it exists. # Run install-info only if it exists.
# Use `if' instead of just prepending `-' to the # Use `if' instead of just prepending `-' to the
# line so we notice real errors from install-info. # line so we notice real errors from install-info.
@@ -581,8 +603,8 @@ $(infodir)/foo.info: foo.info
# fail gracefully when there is an unknown command. # fail gracefully when there is an unknown command.
if $(SHELL) -c 'install-info --version' \ if $(SHELL) -c 'install-info --version' \
>/dev/null 2>&1; then \ >/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir \ install-info --dir-file=$(DESTDIR)$(infodir)/dir \
$(infodir)/foo.info; \ $(DESTDIR)$(infodir)/foo.info; \
else true; fi else true; fi
@end smallexample @end smallexample

5
make.1
View File

@@ -257,11 +257,6 @@ Print the version of the
.I make .I make
program plus a copyright, a list of authors and a notice that there program plus a copyright, a list of authors and a notice that there
is no warranty. is no warranty.
After this information is printed, processing continues normally.
To get this information without doing anything else, use
.B make
.B \-v
.BI \-f /dev/null.
.TP 0.5i .TP 0.5i
.B \-w .B \-w
Print a message containing the working directory Print a message containing the working directory

532
make.h
View File

@@ -1,5 +1,5 @@
/* Miscellaneous global declarations and portability cruft for GNU Make. /* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc. Copyright (C) 1988,89,90,91,92,93,94,95,96,97,99 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* AIX requires this to be the first thing in the file. */ /* AIX requires this to be the first thing in the file. */
#if defined (_AIX) && !defined (__GNUC__) #if defined (_AIX) && !defined (__GNUC__)
@@ -25,27 +26,39 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because make.h was found in $srcdir). */ (which it would do because make.h was found in $srcdir). */
#include <config.h> #include <config.h>
#undef HAVE_CONFIG_H #undef HAVE_CONFIG_H
#define HAVE_CONFIG_H #define HAVE_CONFIG_H 1
/* Use prototypes if available. */ /* Use prototypes if available. */
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef PARAMS # undef PARAMS
#define PARAMS(protos) protos # define PARAMS(protos) protos
#else /* Not C++ or ANSI C. */ #else /* Not C++ or ANSI C. */
#undef PARAMS # undef PARAMS
#define PARAMS(protos) () # define PARAMS(protos) ()
#endif /* C++ or ANSI C. */ #endif /* C++ or ANSI C. */
#ifdef CRAY /* For now, set gettext macro to a no-op. */
#undef _
#undef N_
#define _(s) s
#define N_(s) s
#ifdef CRAY
/* This must happen before #include <signal.h> so /* This must happen before #include <signal.h> so
that the declaration therein is changed. */ that the declaration therein is changed. */
#define signal bsdsignal # define signal bsdsignal
#endif #endif
#define _GNU_SOURCE /* If we're compiling for the dmalloc debugger, turn off string inlining. */
#if defined(HAVE_DMALLOC_H) && defined(__GNUC__)
# define __NO_STRING_INLINES
#endif
#define _GNU_SOURCE 1
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <signal.h> #include <signal.h>
@@ -55,35 +68,43 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs /* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs
unless <sys/timeb.h> has been included first. Does every system have a unless <sys/timeb.h> has been included first. Does every system have a
<sys/timeb.h>? If any does not, configure should check for it. */ <sys/timeb.h>? If any does not, configure should check for it. */
#include <sys/timeb.h> # include <sys/timeb.h>
#endif #endif
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#ifndef errno #ifndef errno
extern int errno; extern int errno;
#endif #endif
#ifndef isblank /* A shortcut for EINTR checking. Note you should never negate this! That
#define isblank(c) ((c) == ' ' || (c) == '\t') very likely doesn't mean what you want if EINTR is not available. */
#ifdef EINTR
# define EINTR_SET (errno == EINTR)
#else
# define EINTR_SET (0)
#endif #endif
#ifdef HAVE_UNISTD_H #ifndef isblank
#include <unistd.h> # define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get /* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */ POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
#if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS) # if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
#define POSIX # define POSIX 1
#endif # endif
#endif #endif
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */ /* Some systems define _POSIX_VERSION but are not really POSIX.1. */
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386))) #if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
#undef POSIX # undef POSIX
#endif #endif
#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) #if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE)
#define POSIX # define POSIX 1
#endif #endif
#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED) #if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED)
@@ -91,54 +112,54 @@ extern char *sys_siglist[];
#endif #endif
#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL) #if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
#include "signame.h" # include "signame.h"
#endif #endif
/* Some systems do not define NSIG in <signal.h>. */ /* Some systems do not define NSIG in <signal.h>. */
#ifndef NSIG #ifndef NSIG
#ifdef _NSIG # ifdef _NSIG
#define NSIG _NSIG # define NSIG _NSIG
#else # else
#define NSIG 32 # define NSIG 32
#endif # endif
#endif #endif
#ifndef RETSIGTYPE #ifndef RETSIGTYPE
#define RETSIGTYPE void # define RETSIGTYPE void
#endif #endif
#ifndef sigmask #ifndef sigmask
#define sigmask(sig) (1 << ((sig) - 1)) # define sigmask(sig) (1 << ((sig) - 1))
#endif #endif
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> # include <limits.h>
#endif #endif
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifndef PATH_MAX #ifndef PATH_MAX
#ifndef POSIX # ifndef POSIX
#define PATH_MAX MAXPATHLEN # define PATH_MAX MAXPATHLEN
#endif /* Not POSIX. */ # endif
#endif /* No PATH_MAX. */ #endif
#ifndef MAXPATHLEN #ifndef MAXPATHLEN
#define MAXPATHLEN 1024 # define MAXPATHLEN 1024
#endif /* No MAXPATHLEN. */ #endif
#ifdef PATH_MAX #ifdef PATH_MAX
#define GET_PATH_MAX PATH_MAX # define GET_PATH_MAX PATH_MAX
#define PATH_VAR(var) char var[PATH_MAX] # define PATH_VAR(var) char var[PATH_MAX]
#else #else
#define NEED_GET_PATH_MAX # define NEED_GET_PATH_MAX 1
# define GET_PATH_MAX (get_path_max ())
# define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
extern unsigned int get_path_max PARAMS ((void)); extern unsigned int get_path_max PARAMS ((void));
#define GET_PATH_MAX (get_path_max ())
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
#endif #endif
#ifndef CHAR_BIT #ifndef CHAR_BIT
#define CHAR_BIT 8 # define CHAR_BIT 8
#endif #endif
/* Nonzero if the integer type T is signed. */ /* Nonzero if the integer type T is signed. */
@@ -150,171 +171,189 @@ extern unsigned int get_path_max PARAMS ((void));
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) #define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
#ifdef STAT_MACROS_BROKEN #ifdef STAT_MACROS_BROKEN
#ifdef S_ISREG # ifdef S_ISREG
#undef S_ISREG # undef S_ISREG
#endif # endif
#ifdef S_ISDIR # ifdef S_ISDIR
#undef S_ISDIR # undef S_ISDIR
#endif # endif
#endif /* STAT_MACROS_BROKEN. */ #endif /* STAT_MACROS_BROKEN. */
#ifndef S_ISREG #ifndef S_ISREG
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif #endif
#ifndef S_ISDIR #ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif #endif
#ifdef VMS #ifdef VMS
#include <stdio.h> # include <stdio.h>
#include <types.h> # include <types.h>
#include <unixlib.h> # include <unixlib.h>
#include <unixio.h> # include <unixio.h>
#include <errno.h> # include <errno.h>
#include <perror.h> # include <perror.h>
#endif #endif
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) || defined(VMS)) #ifndef __attribute__
#include <stdlib.h> /* This feature is available in gcc versions 2.5 and later. */
#include <string.h> # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
#define ANSI_STRING # define __attribute__(x)
#else /* No standard headers. */ # endif
/* The __-protected variants of `format' and `printf' attributes
#ifdef HAVE_STRING_H are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
#include <string.h> # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
#define ANSI_STRING # define __format__ format
#else # define __printf__ printf
#include <strings.h> # endif
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif #endif
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
# include <stdlib.h>
# include <string.h>
# define ANSI_STRING 1
#else /* No standard headers. */
# ifdef HAVE_STRING_H
# include <string.h>
# define ANSI_STRING 1
# else
# include <strings.h>
# endif
# ifdef HAVE_MEMORY_H
# include <memory.h>
# endif
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# else
extern char *malloc PARAMS ((int)); extern char *malloc PARAMS ((int));
extern char *realloc PARAMS ((char *, int)); extern char *realloc PARAMS ((char *, int));
extern void free PARAMS ((char *)); extern void free PARAMS ((char *));
extern void abort PARAMS ((void)); extern void abort PARAMS ((void)) __attribute__ ((noreturn));
extern void exit PARAMS ((int)); extern void exit PARAMS ((int)) __attribute__ ((noreturn));
# endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */ #endif /* Standard headers. */
#ifdef ANSI_STRING #if ST_MTIM_NSEC
# if HAVE_INTTYPES_H
#ifndef index # include <inttypes.h>
#define index(s, c) strchr((s), (c)) # endif
#endif # define FILE_TIMESTAMP uintmax_t
#ifndef rindex #else
#define rindex(s, c) strrchr((s), (c)) # define FILE_TIMESTAMP time_t
#endif #endif
#ifndef bcmp #ifdef ANSI_STRING
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#endif
#ifndef bzero
#define bzero(s, n) memset ((s), 0, (n))
#endif
#if defined(HAVE_MEMMOVE) && !defined(bcopy)
#define bcopy(s, d, n) memmove ((d), (s), (n))
#endif
#else /* Not ANSI_STRING. */ # ifndef index
# define index(s, c) strchr((s), (c))
# endif
# ifndef rindex
# define rindex(s, c) strrchr((s), (c))
# endif
#ifndef bcmp # ifndef bcmp
extern int bcmp (); # define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#endif # endif
#ifndef bzero # ifndef bzero
extern void bzero (); # define bzero(s, n) memset ((s), 0, (n))
#endif # endif
#ifndef bcopy # if defined(HAVE_MEMMOVE) && !defined(bcopy)
extern void bcopy (); # define bcopy(s, d, n) memmove ((d), (s), (n))
#endif # endif
#endif /* ANSI_STRING. */ #else /* Not ANSI_STRING. */
#undef ANSI_STRING
# ifndef bcmp
extern int bcmp PARAMS ((const char *, const char *, int));
# endif
# ifndef bzero
extern void bzero PARAMS ((char *, int));
#endif
# ifndef bcopy
extern void bcopy PARAMS ((const char *b1, char *b2, int));
# endif
#endif /* ANSI_STRING. */
#undef ANSI_STRING
/* SCO Xenix has a buggy macro definition in <string.h>. */ /* SCO Xenix has a buggy macro definition in <string.h>. */
#undef strerror #undef strerror
#if !defined(ANSI_STRING) && !defined(__DECC) #if !defined(ANSI_STRING) && !defined(__DECC)
extern char *strerror PARAMS ((int errnum)); extern char *strerror PARAMS ((int errnum));
#endif #endif
#ifndef __attribute__ #ifdef __GNUC__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # undef alloca
# define __attribute__(x) # define alloca(n) __builtin_alloca (n)
# endif #else /* Not GCC. */
#endif # ifdef HAVE_ALLOCA_H
# include <alloca.h>
#ifdef __GNUC__ # else /* Not HAVE_ALLOCA_H. */
#undef alloca # ifndef _AIX
#define alloca(n) __builtin_alloca (n)
#else /* Not GCC. */
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else /* Not HAVE_ALLOCA_H. */
#ifndef _AIX
extern char *alloca (); extern char *alloca ();
#endif /* Not AIX. */ # endif /* Not AIX. */
#endif /* HAVE_ALLOCA_H. */ # endif /* HAVE_ALLOCA_H. */
#endif /* GCC. */ #endif /* GCC. */
#ifndef iAPX286 #ifndef iAPX286
#define streq(a, b) \ # define streq(a, b) \
((a) == (b) || \ ((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
#ifdef HAVE_CASE_INSENSITIVE_FS # ifdef HAVE_CASE_INSENSITIVE_FS
#define strieq(a, b) \ /* This is only used on Windows/DOS platforms, so we assume strcmpi(). */
((a) == (b) || \ # define strieq(a, b) \
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) ((a) == (b) || \
#else (tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
#define strieq(a, b) \ # else
((a) == (b) || \ # define strieq(a, b) streq(a, b)
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) # endif
#endif
#else #else
/* Buggy compiler can't handle this. */ /* Buggy compiler can't handle this. */
#define streq(a, b) (strcmp ((a), (b)) == 0) # define streq(a, b) (strcmp ((a), (b)) == 0)
#define strieq(a, b) (strcmp ((a), (b)) == 0) # define strieq(a, b) (strcmp ((a), (b)) == 0)
#endif #endif
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
/* Add to VAR the hashing value of C, one character in a name. */ /* Add to VAR the hashing value of C, one character in a name. */
#define HASH(var, c) \ #define HASH(var, c) \
((var += (c)), (var = ((var) << 7) + ((var) >> 20))) ((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */ #ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */
#define HASHI(var, c) \ # define HASHI(var, c) \
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20))) ((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
#else #else
#define HASHI(var, c) HASH(var,c) # define HASHI(var, c) HASH(var,c)
#endif #endif
#if defined(__GNUC__) || defined(ENUM_BITFIELDS) #if defined(__GNUC__) || defined(ENUM_BITFIELDS)
#define ENUM_BITFIELD(bits) :bits # define ENUM_BITFIELD(bits) :bits
#else #else
#define ENUM_BITFIELD(bits) # define ENUM_BITFIELD(bits)
#endif #endif
#if defined(__MSDOS__) || defined(WINDOWS32) #if defined(__MSDOS__) || defined(WINDOWS32)
#define PATH_SEPARATOR_CHAR ';' # define PATH_SEPARATOR_CHAR ';'
#else #else
#if defined(VMS) # if defined(VMS)
#define PATH_SEPARATOR_CHAR ',' # define PATH_SEPARATOR_CHAR ','
#else # else
#define PATH_SEPARATOR_CHAR ':' # define PATH_SEPARATOR_CHAR ':'
#endif # endif
#endif #endif
#ifdef WINDOWS32 #ifdef WINDOWS32
#include <fcntl.h> # include <fcntl.h>
#include <malloc.h> # include <malloc.h>
#define pipe(p) _pipe(p, 512, O_BINARY) # define pipe(p) _pipe(p, 512, O_BINARY)
#define kill(pid,sig) w32_kill(pid,sig) # define kill(pid,sig) w32_kill(pid,sig)
extern void sync_Path_environment(void); extern void sync_Path_environment(void);
extern int kill(int pid, int sig); extern int kill(int pid, int sig);
extern int safe_stat(char *file, struct stat *sb); extern int safe_stat(char *file, struct stat *sb);
extern char *end_of_token_w32(); extern char *end_of_token_w32(char *s, char stopchar);
extern int find_and_set_default_shell(char *token); extern int find_and_set_default_shell(char *token);
/* indicates whether or not we have Bourne shell */ /* indicates whether or not we have Bourne shell */
@@ -323,72 +362,83 @@ extern int no_default_sh_exe;
/* is default_shell unixy? */ /* is default_shell unixy? */
extern int unixy_shell; extern int unixy_shell;
#endif /* WINDOWS32 */ #endif /* WINDOWS32 */
extern void die () __attribute__ ((noreturn));
extern void message ();
extern void fatal () __attribute__ ((noreturn));
extern void error ();
extern void log_working_directory ();
extern void makefile_error ();
extern void makefile_fatal () __attribute__ ((noreturn));
extern void pfatal_with_name () __attribute__ ((noreturn));
extern void perror_with_name ();
extern char *savestring ();
extern char *concat ();
extern char *xmalloc ();
extern char *xrealloc ();
extern char *find_next_token ();
extern char *next_token ();
extern char *end_of_token ();
extern void collapse_continuations ();
extern void remove_comments ();
extern char *sindex ();
extern char *lindex ();
extern int alpha_compare ();
extern void print_spaces ();
extern struct dep *copy_dep_chain ();
extern char *find_char_unquote ();
extern char *find_percent ();
#ifndef NO_ARCHIVES struct floc
extern int ar_name (); {
extern void ar_parse_name (); char *filenm;
extern int ar_touch (); unsigned long lineno;
extern time_t ar_member_date (); };
#define NILF ((struct floc *)0)
/* Fancy processing for variadic functions in both ANSI and pre-ANSI
compilers. */
#if defined __STDC__ && __STDC__
extern void message (int prefix, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void error (const struct floc *flocp, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void fatal (const struct floc *flocp, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
#else
extern void message ();
extern void error ();
extern void fatal ();
#endif #endif
extern void dir_load (); extern void die PARAMS ((int)) __attribute__ ((noreturn));
extern int dir_file_exists_p (); extern void log_working_directory PARAMS ((int));
extern int file_exists_p (); extern void pfatal_with_name PARAMS ((char *)) __attribute__ ((noreturn));
extern int file_impossible_p (); extern void perror_with_name PARAMS ((char *, char *));
extern void file_impossible (); extern char *savestring PARAMS ((const char *, unsigned int));
extern char *dir_name (); extern char *concat PARAMS ((char *, char *, char *));
extern char *xmalloc PARAMS ((unsigned int));
extern char *xrealloc PARAMS ((char *, unsigned int));
extern char *xstrdup PARAMS ((const char *));
extern char *find_next_token PARAMS ((char **, unsigned int *));
extern char *next_token PARAMS ((char *));
extern char *end_of_token PARAMS ((char *));
extern void collapse_continuations PARAMS ((char *));
extern void remove_comments PARAMS((char *));
extern char *sindex PARAMS ((const char *, unsigned int, \
const char *, unsigned int));
extern char *lindex PARAMS ((const char *, const char *, int));
extern int alpha_compare PARAMS ((const void *, const void *));
extern void print_spaces PARAMS ((unsigned int));
extern char *find_char_unquote PARAMS ((char *, char *, int));
extern char *find_percent PARAMS ((char *));
extern void define_default_variables (); #ifndef NO_ARCHIVES
extern void set_default_suffixes (); extern int ar_name PARAMS ((char *));
extern void install_default_suffix_rules (); extern void ar_parse_name PARAMS ((char *, char **, char **));
extern void install_default_implicit_rules (); extern int ar_touch PARAMS ((char *));
extern void count_implicit_rule_limits (); extern time_t ar_member_date PARAMS ((char *));
extern void convert_to_pattern (); #endif
extern void create_pattern_rule ();
extern void build_vpath_lists (); extern int dir_file_exists_p PARAMS ((char *, char *));
extern void construct_vpath_list (); extern int file_exists_p PARAMS ((char *));
extern int vpath_search (); extern int file_impossible_p PARAMS ((char *));
extern int gpath_search (); extern void file_impossible PARAMS ((char *));
extern char *dir_name PARAMS ((char *));
extern void construct_include_path (); extern void define_default_variables PARAMS ((void));
extern void uniquize_deps (); extern void set_default_suffixes PARAMS ((void));
extern void install_default_suffix_rules PARAMS ((void));
extern void install_default_implicit_rules PARAMS ((void));
extern int update_goal_chain (); extern void build_vpath_lists PARAMS ((void));
extern void notice_finished_file (); extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath));
extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr));
extern int gpath_search PARAMS ((char *file, int len));
extern void user_access (); extern void construct_include_path PARAMS ((char **arg_dirs));
extern void make_access ();
extern void child_access ();
#ifdef HAVE_VFORK_H extern void user_access PARAMS ((void));
#include <vfork.h> extern void make_access PARAMS ((void));
extern void child_access PARAMS ((void));
#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif #endif
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, /* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
@@ -397,38 +447,38 @@ extern void child_access ();
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) #if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
extern long int atol (); extern long int atol ();
#ifndef VMS # ifndef VMS
extern long int lseek (); extern long int lseek ();
#endif # endif
#endif /* Not GNU C library or POSIX. */ #endif /* Not GNU C library or POSIX. */
#ifdef HAVE_GETCWD #ifdef HAVE_GETCWD
extern char *getcwd (); extern char *getcwd ();
#ifdef VMS # ifdef VMS
extern char *getwd PARAMS ((char *)); extern char *getwd PARAMS ((char *));
#endif # endif
#else #else
extern char *getwd (); extern char *getwd ();
#define getcwd(buf, len) getwd (buf) # define getcwd(buf, len) getwd (buf)
#endif #endif
extern const struct floc *reading_file;
extern char **environ; extern char **environ;
extern char *reading_filename;
extern unsigned int *reading_lineno_ptr;
extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
extern int debug_flag, print_data_base_flag, question_flag, touch_flag; extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
extern int env_overrides, no_builtin_rules_flag, print_version_flag; extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
extern int print_directory_flag, warn_undefined_variables_flag; extern int print_version_flag, print_directory_flag;
extern int posix_pedantic; extern int warn_undefined_variables_flag, posix_pedantic;
extern int clock_skew_detected; extern int clock_skew_detected;
/* can we run commands via 'sh -c xxx' or must we use batch files? */ /* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell; extern int batch_mode_shell;
extern unsigned int job_slots; extern unsigned int job_slots;
extern int job_fds[2];
#ifndef NO_FLOAT #ifndef NO_FLOAT
extern double max_load_average; extern double max_load_average;
#else #else
@@ -445,9 +495,16 @@ extern unsigned int commands_started;
extern int handling_fatal_signal; extern int handling_fatal_signal;
#ifndef MIN
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#endif
#ifndef MAX
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
#endif
#define DEBUGPR(msg) \ #define DEBUGPR(msg) \
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \ do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
fflush (stdout); } while (0) fflush (stdout); } while (0)
#ifdef VMS #ifdef VMS
# ifndef EXIT_FAILURE # ifndef EXIT_FAILURE
@@ -471,3 +528,8 @@ extern int handling_fatal_signal;
# endif # endif
#endif #endif
/* Set up heap debugging library dmalloc. */
#ifdef HAVE_DMALLOC_H
#include <dmalloc.h>
#endif

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.52 @set EDITION 0.53
@set VERSION 3.77 @set VERSION 3.78
@set UPDATED 20 May 1998 @set UPDATED 14 April 1999
@set UPDATE-MONTH May 1998 @set UPDATE-MONTH April 1999
@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
@@ -24,12 +24,12 @@
@c Combine the program and concept indices: @c Combine the program and concept indices:
@syncodeindex pg cp @syncodeindex pg cp
@ifinfo @dircategory GNU Packages
@dircategory The GNU make utility
@direntry @direntry
* Make: (make.info). The GNU make utility. * Make: (make). Remake files automatically.
@end direntry @end direntry
@ifinfo
This file documents the GNU Make utility, which determines This file documents the GNU Make utility, which determines
automatically which pieces of a large program need to be recompiled, automatically which pieces of a large program need to be recompiled,
and issues the commands to recompile them. and issues the commands to recompile them.
@@ -37,8 +37,8 @@ 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 Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99
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
this manual provided the copyright notice and this permission notice this manual provided the copyright notice and this permission notice
@@ -68,19 +68,21 @@ by the Free Software Foundation.
@titlepage @titlepage
@title GNU Make @title GNU Make
@subtitle A Program for Directing Recompilation @subtitle A Program for Directing Recompilation
@subtitle GNU @code{make} Version @value{VERSION}. @subtitle GNU @code{make} Version @value{VERSION}
@subtitle @value{UPDATE-MONTH} @subtitle @value{UPDATE-MONTH}
@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 Free Software Foundation, Inc. Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98
Free Software Foundation, Inc.
@sp 2 @sp 2
Published by the Free Software Foundation @* Published by the Free Software Foundation @*
59 Temple Place -- Suite 330, @* 59 Temple Place -- Suite 330, @*
Boston, MA 02111-1307 USA @* Boston, MA 02111-1307 USA @*
Printed copies are available for $20 each. @*
ISBN @value{ISBN} @* ISBN @value{ISBN} @*
Maintenance and updates since Version 3.76 by Paul D. Smith.
Permission is granted to make and distribute verbatim copies of Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice this manual provided the copyright notice and this permission notice
are preserved on all copies. are preserved on all copies.
@@ -124,7 +126,7 @@ This manual describes @code{make} and contains the following chapters:@refill
* Conditionals:: Use or ignore parts of the makefile based * Conditionals:: Use or ignore parts of the makefile based
on the values of variables. on the values of variables.
* Functions:: Many powerful ways to manipulate text. * Functions:: Many powerful ways to manipulate text.
* make Invocation: Running. How to invoke @code{make} on the command line. * Invoking make: Running. How to invoke @code{make} on the command line.
* Implicit Rules:: Use implicit rules to treat many files alike, * Implicit Rules:: Use implicit rules to treat many files alike,
based on their file names. based on their file names.
* Archives:: How @code{make} can update library archives. * Archives:: How @code{make} can update library archives.
@@ -267,6 +269,7 @@ Functions for Transforming Text
* Text Functions:: General-purpose text manipulation functions. * Text Functions:: General-purpose text manipulation functions.
* File Name Functions:: Functions for manipulating file names. * File Name Functions:: Functions for manipulating file names.
* Foreach Function:: Repeat some text with controlled variation. * Foreach Function:: Repeat some text with controlled variation.
* Call Function:: Expand a user-defined function.
* Origin Function:: Find where a variable got its value. * Origin Function:: Find where a variable got its value.
* Shell Function:: Substitute the output of a shell command. * Shell Function:: Substitute the output of a shell command.
@@ -332,8 +335,11 @@ Implicit Rule for Archive Member Targets
The @code{make} utility automatically determines which pieces of a large The @code{make} utility automatically determines which pieces of a large
program need to be recompiled, and issues commands to recompile them. program need to be recompiled, and issues commands to recompile them.
This manual describes GNU @code{make}, which was implemented by Richard This manual describes GNU @code{make}, which was implemented by Richard
Stallman and Roland McGrath. GNU @code{make} conforms to section 6.2 of Stallman and Roland McGrath. Development since Version 3.76 has been
@cite{IEEE Standard 1003.2-1992} (POSIX.2). handled by Paul D. Smith.
GNU @code{make} conforms to section 6.2 of @cite{IEEE Standard
1003.2-1992} (POSIX.2).
@cindex POSIX @cindex POSIX
@cindex IEEE Standard 1003.2 @cindex IEEE Standard 1003.2
@cindex standards conformance @cindex standards conformance
@@ -1188,6 +1194,13 @@ again. (It will also attempt to update each of them over again, but
normally this will not change them again, since they are already up to normally this will not change them again, since they are already up to
date.)@refill date.)@refill
If you know that one or more of your makefiles cannot be remade and you
want to keep @code{make} from performing an implicit rule search on
them, perhaps for efficiency reasons, you can use any normal method of
preventing implicit rule lookup to do so. For example, you can write an
explicit rule with the makefile as the target, and an empty command
string (@pxref{Empty Commands, ,Using Empty Commands}).
If the makefiles specify a double-colon rule to remake a file with If the makefiles specify a double-colon rule to remake a file with
commands but no dependencies, that file will always be remade commands but no dependencies, that file will always be remade
(@pxref{Double-Colon}). In the case of makefiles, a makefile that has a (@pxref{Double-Colon}). In the case of makefiles, a makefile that has a
@@ -1196,8 +1209,8 @@ time @code{make} is run, and then again after @code{make} starts over
and reads the makefiles in again. This would cause an infinite loop: and reads the makefiles in again. This would cause an infinite loop:
@code{make} would constantly remake the makefile, and never do anything @code{make} would constantly remake the makefile, and never do anything
else. So, to avoid this, @code{make} will @strong{not} attempt to else. So, to avoid this, @code{make} will @strong{not} attempt to
remake makefiles which are specified as double-colon targets but have no remake makefiles which are specified as targets of a double-colon rule
dependencies.@refill with commands but no dependencies.@refill
If you do not specify any makefiles to be read with @samp{-f} or If you do not specify any makefiles to be read with @samp{-f} or
@samp{--file} options, @code{make} will try the default makefile names; @samp{--file} options, @code{make} will try the default makefile names;
@@ -1971,16 +1984,19 @@ directory search with no extra effort.
@cindex @code{VPATH}, and link libraries @cindex @code{VPATH}, and link libraries
@cindex search path for dependencies (@code{VPATH}), and link libraries @cindex search path for dependencies (@code{VPATH}), and link libraries
@cindex @code{-l} (library search) @cindex @code{-l} (library search)
@cindex link libraries, patterns matching
@cindex @code{.LIBPATTERNS}, and link libraries
@vindex .LIBPATTERNS
Directory search applies in a special way to libraries used with the Directory search applies in a special way to libraries used with the
linker. This special feature comes into play when you write a dependency linker. This special feature comes into play when you write a dependency
whose name is of the form @samp{-l@var{name}}. (You can tell something whose name is of the form @samp{-l@var{name}}. (You can tell something
strange is going on here because the dependency is normally the name of a strange is going on here because the dependency is normally the name of a
file, and the @emph{file name} of the library looks like file, and the @emph{file name} of a library generally looks like
@file{lib@var{name}.a}, not like @samp{-l@var{name}}.)@refill @file{lib@var{name}.a}, not like @samp{-l@var{name}}.)@refill
When a dependency's name has the form @samp{-l@var{name}}, @code{make} When a dependency's name has the form @samp{-l@var{name}}, @code{make}
handles it specially by searching for the file @file{lib@var{name}.a} in handles it specially by searching for the file @file{lib@var{name}.so} in
the current directory, in directories specified by matching @code{vpath} the current directory, in directories specified by matching @code{vpath}
search paths and the @code{VPATH} search path, and then in the search paths and the @code{VPATH} search path, and then in the
directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib} directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
@@ -1988,7 +2004,11 @@ directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
@code{make} behave as if @var{prefix} is defined to be the root of the @code{make} behave as if @var{prefix} is defined to be the root of the
DJGPP installation tree). DJGPP installation tree).
For example, If that file is not found, then the file @file{lib@var{name}.a} is
searched for, in the same directories as above.
For example, if there is a @file{/usr/lib/libcurses.a} library on your
system (and no @file{/usr/lib/libcurses.so} file), then
@example @example
@group @group
@@ -2002,6 +2022,21 @@ would cause the command @samp{cc foo.c /usr/lib/libcurses.a -o foo} to
be executed when @file{foo} is older than @file{foo.c} or than be executed when @file{foo} is older than @file{foo.c} or than
@file{/usr/lib/libcurses.a}.@refill @file{/usr/lib/libcurses.a}.@refill
Although the default set of files to be searched for is
@file{lib@var{name}.so} and @file{lib@var{name}.a}, this is customizable
via the @code{.LIBPATTERNS} variable. Each word in the value of this
variable is a pattern string. When a dependency like
@samp{-l@var{name}} is seen, @code{make} will replace the percent in
each pattern in the list with @var{name} and perform the above directory
searches using that library filename. If no library is found, the next
word in the list will be used.
The default value for @code{.LIBPATTERNS} is ``@samp{lib%.so lib%.a}'',
which provides the default behavior described above.
You can turn off link library expansion completely by setting this
variable to an empty value.
@node Phony Targets, Force Targets, Directory Search, Rules @node Phony Targets, Force Targets, Directory Search, Rules
@section Phony Targets @section Phony Targets
@cindex phony targets @cindex phony targets
@@ -2162,10 +2197,11 @@ last-modification time, when the rule's commands were last executed. It
does so because one of the commands is a @code{touch} command to update the does so because one of the commands is a @code{touch} command to update the
target file. target file.
The empty target file must have some dependencies. When you ask to remake The empty target file should have some dependencies (otherwise it
the empty target, the commands are executed if any dependency is more doesn't make sense). When you ask to remake the empty target, the
recent than the target; in other words, if a dependency has changed since commands are executed if any dependency is more recent than the target;
the last time you remade the target. Here is an example: in other words, if a dependency has changed since the last time you
remade the target. Here is an example:
@example @example
print: foo.c bar.c print: foo.c bar.c
@@ -2241,8 +2277,7 @@ match that file's name.
The targets which @code{.INTERMEDIATE} depends on are treated as The targets which @code{.INTERMEDIATE} depends on are treated as
intermediate files. @xref{Chained Rules, ,Chains of Implicit Rules}. intermediate files. @xref{Chained Rules, ,Chains of Implicit Rules}.
@code{.INTERMEDIATE} with no dependencies marks all file targets @code{.INTERMEDIATE} with no dependencies has no effect.
mentioned in the makefile as intermediate.
@findex .SECONDARY @findex .SECONDARY
@item .SECONDARY @item .SECONDARY
@@ -2256,6 +2291,15 @@ intermediate files, except that they are never automatically deleted.
@code{.SECONDARY} with no dependencies marks all file targets mentioned @code{.SECONDARY} with no dependencies marks all file targets mentioned
in the makefile as secondary. in the makefile as secondary.
@findex .DELETE_ON_ERROR
@item .DELETE_ON_ERROR
@cindex removing targets on failure
If @code{.DELETE_ON_ERROR} is mentioned as a target anywhere in the
makefile, then @code{make} will delete the target of a rule if it has
changed and its commands exit with a nonzero exit status, just as it
does when it receives a signal. @xref{Errors, ,Errors in Commands}.
@findex .IGNORE @findex .IGNORE
@item .IGNORE @item .IGNORE
@@ -2274,7 +2318,7 @@ commands. @xref{Errors, ,Errors in Commands}.
@item .SILENT @item .SILENT
If you specify dependencies for @code{.SILENT}, then @code{make} will If you specify dependencies for @code{.SILENT}, then @code{make} will
not the print commands to remake those particular files before executing not print the commands to remake those particular files before executing
them. The commands for @code{.SILENT} are not meaningful. them. The commands for @code{.SILENT} are not meaningful.
If mentioned as a target with no dependencies, @code{.SILENT} says not If mentioned as a target with no dependencies, @code{.SILENT} says not
@@ -2832,8 +2876,8 @@ the makefile:
@cindex @code{--just-print} @cindex @code{--just-print}
@cindex @code{--dry-run} @cindex @code{--dry-run}
@cindex @code{--recon} @cindex @code{--recon}
When @code{make} is given the flag @samp{-n} or @samp{--just-print}, When @code{make} is given the flag @samp{-n} or @samp{--just-print}
echoing is all that happens, no execution. @xref{Options Summary, it only echoes commands, it won't execute them. @xref{Options Summary,
,Summary of Options}. In this case and only this case, even the ,Summary of Options}. In this case and only this case, even the
commands starting with @samp{@@} are printed. This flag is useful for commands starting with @samp{@@} are printed. This flag is useful for
finding out which commands @code{make} thinks are necessary without finding out which commands @code{make} thinks are necessary without
@@ -2996,8 +3040,8 @@ there is no limit on the number of job slots. The default number of job
slots is one, which means serial execution (one thing at a time). slots is one, which means serial execution (one thing at a time).
One unpleasant consequence of running several commands simultaneously is One unpleasant consequence of running several commands simultaneously is
that output from all of the commands comes when the commands send it, so that output generated by the commands appears whenever each command
messages from different commands may be interspersed. sends it, so messages from different commands may be interspersed.
Another problem is that two processes cannot both take input from the Another problem is that two processes cannot both take input from the
same device; so to make sure that only one command tries to take input same device; so to make sure that only one command tries to take input
@@ -3021,6 +3065,10 @@ standard input at all if you are using the parallel execution feature; but
if you are not using this feature, then standard input works normally in if you are not using this feature, then standard input works normally in
all commands. all commands.
Finally, handling recursive @code{make} invocations raises issues. For
more information on this, see
@ref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
If a command fails (is killed by a signal or exits with a nonzero If a command fails (is killed by a signal or exits with a nonzero
status), and errors are not ignored for that command status), and errors are not ignored for that command
(@pxref{Errors, ,Errors in Commands}), (@pxref{Errors, ,Errors in Commands}),
@@ -3510,13 +3558,22 @@ into @code{MAKEFLAGS}; these options are not passed down.@refill
@cindex recursion, and @code{-j} @cindex recursion, and @code{-j}
@cindex job slots, and recursion @cindex job slots, and recursion
The @samp{-j} option is a special case (@pxref{Parallel, ,Parallel Execution}). The @samp{-j} option is a special case (@pxref{Parallel, ,Parallel Execution}).
If you set it to some numeric value, @samp{-j 1} is always put into If you set it to some numeric value @samp{N} and your operating system
@code{MAKEFLAGS} instead of the value you specified. This is because if supports it (most any UNIX system will; others typically won't), the
the @w{@samp{-j}} option were passed down to sub-@code{make}s, you would parent @code{make} and all the sub-@code{make}s will communicate to
get many more jobs running in parallel than you asked for. If you give ensure that there are only @samp{N} jobs running at the same time
@samp{-j} with no numeric argument, meaning to run as many jobs as between them all. Note that any job that is marked recursive
possible in parallel, this is passed down, since multiple infinities are (@pxref{Instead of Execution, ,Instead of Executing the Commands})
no more than one.@refill doesn't count against the total jobs (otherwise we could get @samp{N}
sub-@code{make}s running and have no slots left over for any real work!)
If your operating system doesn't support the above communication, then
@samp{-j 1} is always put into @code{MAKEFLAGS} instead of the value you
specified. This is because if the @w{@samp{-j}} option were passed down
to sub-@code{make}s, you would get many more jobs running in parallel
than you asked for. If you give @samp{-j} with no numeric argument,
meaning to run as many jobs as possible in parallel, this is passed
down, since multiple infinities are no more than one.@refill
If you do not want to pass the other flags down, you must change the If you do not want to pass the other flags down, you must change the
value of @code{MAKEFLAGS}, like this: value of @code{MAKEFLAGS}, like this:
@@ -3542,8 +3599,8 @@ MAKEOVERRIDES =
@cindex E2BIG @cindex E2BIG
This is not usually useful to do. However, some systems have a small This is not usually useful to do. However, some systems have a small
fixed limit on the size of the environment, and putting so much fixed limit on the size of the environment, and putting so much
information in into the value of @code{MAKEFLAGS} can exceed it. information into the value of @code{MAKEFLAGS} can exceed it. If you
If you see the error message @samp{Arg list too long}, this may be the problem. see the error message @samp{Arg list too long}, this may be the problem.
@findex .POSIX @findex .POSIX
@cindex POSIX.2 @cindex POSIX.2
(For strict compliance with POSIX.2, changing @code{MAKEOVERRIDES} does (For strict compliance with POSIX.2, changing @code{MAKEOVERRIDES} does
@@ -3727,7 +3784,7 @@ a canned sequence apply to every line in the sequence. So the rule:
@example @example
frob.out: frob.in frob.out: frob.in
@@$(frobnicate) @@$(frobnicate)
@end example @end example
@noindent @noindent
@@ -3763,8 +3820,8 @@ from getting implicit commands (from implicit rules or the
@ignore @ignore
foo: stamp-foo ; foo: stamp-foo ;
stamp-foo: foo.in stamp-foo: foo.in
create foo frm foo.in create foo frm foo.in
touch $@ touch $@
@end ignore @end ignore
You may be inclined to define empty command strings for targets that are You may be inclined to define empty command strings for targets that are
@@ -5143,8 +5200,10 @@ call, just as a variable might be substituted.
* Text Functions:: General-purpose text manipulation functions. * Text Functions:: General-purpose text manipulation functions.
* File Name Functions:: Functions for manipulating file names. * File Name Functions:: Functions for manipulating file names.
* Foreach Function:: Repeat some text with controlled variation. * Foreach Function:: Repeat some text with controlled variation.
* Call Function:: Expand a user-defined function.
* Origin Function:: Find where a variable got its value. * Origin Function:: Find where a variable got its value.
* Shell Function:: Substitute the output of a shell command. * Shell Function:: Substitute the output of a shell command.
* Make Control Functions:: Functions that control how make runs.
@end menu @end menu
@node Syntax of Functions, Text Functions, , Functions @node Syntax of Functions, Text Functions, , Functions
@@ -5167,8 +5226,9 @@ or like this:
$@{@var{function} @var{arguments}@} $@{@var{function} @var{arguments}@}
@end example @end example
Here @var{function} is a function name; one of a short list of names that Here @var{function} is a function name; one of a short list of names
are part of @code{make}. There is no provision for defining new functions. that are part of @code{make}. You can also essentially create your own
functions by using the @code{call} builtin function.
The @var{arguments} are the arguments of the function. They are The @var{arguments} are the arguments of the function. They are
separated from the function name by one or more spaces or tabs, and if separated from the function name by one or more spaces or tabs, and if
@@ -5689,7 +5749,7 @@ that match the pattern.
@xref{Wildcards, ,Using Wildcard Characters in File Names}. @xref{Wildcards, ,Using Wildcard Characters in File Names}.
@end table @end table
@node Foreach Function, Origin Function, File Name Functions, Functions @node Foreach Function, Call Function, File Name Functions, Functions
@section The @code{foreach} Function @section The @code{foreach} Function
@findex foreach @findex foreach
@cindex words, iterating over @cindex words, iterating over
@@ -5777,7 +5837,96 @@ might be useful if the value of @code{find_files} references the variable
whose name is @samp{Esta escrito en espanol!} (es un nombre bastante largo, whose name is @samp{Esta escrito en espanol!} (es un nombre bastante largo,
no?), but it is more likely to be a mistake. no?), but it is more likely to be a mistake.
@node Origin Function, Shell Function, Foreach Function, Functions @node Call Function, Origin Function, Foreach Function, Functions
@section The @code{call} Function
@findex call
@cindex functions, user defined
@cindex user defined functions
The @code{call} function is unique in that it can be used to create new
parameterized functions. You can write a complex expression as the
value of a variable, then use @code{call} to expand it with different
values.
The syntax of the @code{call} function is:
@example
$(call @var{variable}, @var{param}, @var{param}, @dots{})
@end example
When @code{make} expands this function, it assigns each @var{param} to
temporary variables @var{$(1)}, @var{$(2)}, etc. The variable
@var{$(0)} will contain @var{variable}. There is no maximum number of
parameter arguments. There is no minimum, either, but it doesn't make
sense to use @code{call} with no parameters.
Then @var{variable} is expanded as a @code{make} variable in the context
of these temporary assignments. Thus, any reference to @var{$(1)} in
the value of @var{variable} will resolve to the first @var{param} in the
invocation of @code{call}.
Note that @var{variable} is the @emph{name} of a variable, not a
@emph{reference} to that variable. Therefore you would not normally use
a @samp{$} or parentheses when writing it. (You can, however, use a
variable reference in the name if you want the name not to be a
constant.)
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
exists).
Some examples may make this clearer.
This macro simply reverses its arguments:
@smallexample
reverse = $2 $1
foo = a b
bar = $(call reverse,$(foo))
@end smallexample
@noindent
Here @var{bar} will contain @samp{b a}.
This one is slightly more interesting: it defines a macro to search for
the first instance of a program in @code{PATH}:
@smallexample
pathsearch = $(firstword $(wildcard $(addsufix /$1,$(subst :, ,$(PATH)))))
LS := $(call pathsearch,ls)
@end smallexample
@noindent
Now the variable LS contains @code{/bin/ls} or similar.
The @code{call} function can be nested. Each recursive invocation gets
its own local values for @var{$(1)}, etc. that mask the values of
higher-level @code{call}. For example, here is an implementation of a
@dfn{map} function:
@smallexample
map = $(foreach a,$2,$(call $1,$a))
@end smallexample
Now you can @var{map} a function that normally takes only one argument,
such as @code{origin}, to multiple values in one step:
@smallexample
o = $(call map,origin,o map MAKE)
@end smallexample
and end up with @var{o} containing something like @samp{file file default}.
A final caution: be careful when adding whitespace to the arguments to
@code{call}. As with other functions, any whitespace contained in the
second and subsequent arguments is kept; this can cause strange
effects. It's generally safest to remove all extraneous whitespace when
providing parameters to @code{call}.
@node Origin Function, Shell Function, Call Function, Functions
@section The @code{origin} Function @section The @code{origin} Function
@findex origin @findex origin
@cindex variables, origin of @cindex variables, origin of
@@ -5886,7 +6035,7 @@ Here the redefinition takes place if @samp{$(origin bletch)} returns either
@samp{environment} or @samp{environment override}. @samp{environment} or @samp{environment override}.
@xref{Text Functions, , Functions for String Substitution and Analysis}. @xref{Text Functions, , Functions for String Substitution and Analysis}.
@node Shell Function, , Origin Function, Functions @node Shell Function, Make Control Functions, Origin Function, Functions
@section The @code{shell} Function @section The @code{shell} Function
@findex shell @findex shell
@cindex commands, expansion @cindex commands, expansion
@@ -5932,6 +6081,61 @@ sets @code{files} to the expansion of @samp{*.c}. Unless @code{make} is
using a very strange shell, this has the same result as using a very strange shell, this has the same result as
@w{@samp{$(wildcard *.c)}}.@refill @w{@samp{$(wildcard *.c)}}.@refill
@node Make Control Functions, , Shell Function, Functions
@section Functions That Control Make
@cindex functions, for controlling make
@cindex controlling make
These functions control the way make runs. Generally, they are used to
provide information to the user of the makefile or to cause make to stop
if some sort of environmental error is detected.
@table @code
@item $(error @var{text}@dots{})
@findex error
@cindex error, stopping on
@cindex stopping make
Generates a fatal error where the message is @var{text}. Note that the
error is generated whenever this function is evaluated. So, if you put
it inside a command script or on the right side of a recursive variable
assignment, it won't be evaluated until later. The @var{text} will be
expanded before the error is generated.
For example,
@example
ifdef ERROR1
$(error error is $(ERROR1))
endif
@end example
@noindent
will generate a fatal error during the read of the makefile if the
@code{make} variable @code{ERROR1} is defined. Or,
@example
ERR = $(error found an error!)
.PHONY: err
err: ; $(ERR)
@end example
@noindent
will generate a fatal error while @code{make} is running, if the
@code{err} target is invoked.
@item $(warning @var{text}@dots{})
@findex warning
@cindex warnings, printing
@cindex printing user warnings
This function works similarly to the @code{error} function, above,
except that @code{make} doesn't exit. Instead, @var{text} is expanded
and the resulting message is displayed, but processing of the makefile
continues.
The result of the expansion of this function is the empty string.
@end table
@node Running, Implicit Rules, Functions, Top @node Running, Implicit Rules, Functions, Top
@chapter How to Run @code{make} @chapter How to Run @code{make}
@@ -6527,10 +6731,11 @@ Some Files}.@refill
@itemx --print-data-base @itemx --print-data-base
@cindex @code{--print-data-base} @cindex @code{--print-data-base}
Print the data base (rules and variable values) that results from Print the data base (rules and variable values) that results from
reading the makefiles; then execute as usual or as otherwise reading the makefiles; then execute as usual or as otherwise specified.
specified. This also prints the version information given by This also prints the version information given by the @samp{-v} switch
the @samp{-v} switch (see below). To print the data base without (see below). To print the data base without trying to remake any files,
trying to remake any files, use @w{@samp{make -p -f /dev/null}}. use @w{@samp{make -qp}}. To print the data base of predefined rules and
variables, use @w{@samp{make -p -f /dev/null}}.
@item -q @item -q
@cindex @code{-q} @cindex @code{-q}
@@ -6555,7 +6760,17 @@ Rules}). But you can still define your own suffixes with a rule for
@code{.SUFFIXES}, and then define your own suffix rules. Note that only @code{.SUFFIXES}, and then define your own suffix rules. Note that only
@emph{rules} are affected by the @code{-r} option; default variables @emph{rules} are affected by the @code{-r} option; default variables
remain in effect (@pxref{Implicit Variables, ,Variables Used by Implicit remain in effect (@pxref{Implicit Variables, ,Variables Used by Implicit
Rules}). Rules}); see the @samp{-R} option below.
@item -R
@cindex @code{-R}
@itemx --no-builtin-variables
@cindex @code{--no-builtin-variables}
Eliminate use of the built-in rule-specific variables (@pxref{Implicit
Variables, ,Variables Used by Implicit Rules}). You can still define
your own, of course. The @samp{-R} option also automatically enables
the @samp{-r} option (see above), since it doesn't make sense to have
implicit rules without any definitions for the variables that they use.
@item -s @item -s
@cindex @code{-s} @cindex @code{-s}
@@ -6898,7 +7113,7 @@ running the C preprocessor, @code{cpp}. The precise command is
@pindex .o @pindex .o
@file{@var{n}} is made automatically from @file{@var{n}.o} by running @file{@var{n}} is made automatically from @file{@var{n}.o} by running
the linker (usually called @code{ld}) via the C compiler. The precise the linker (usually called @code{ld}) via the C compiler. The precise
command used is @w{@samp{$(CC) $(LDFLAGS) @var{n}.o $(LOADLIBES)}}. command used is @w{@samp{$(CC) $(LDFLAGS) @var{n}.o $(LOADLIBES) $(LDLIBS)}}.
This rule does the right thing for a simple program with only one This rule does the right thing for a simple program with only one
source file. It will also do the right thing if there are multiple source file. It will also do the right thing if there are multiple
@@ -7088,7 +7303,9 @@ the value @w{@samp{; mv $*.o $@@}}.
The commands in built-in implicit rules make liberal use of certain The commands in built-in implicit rules make liberal use of certain
predefined variables. You can alter these variables in the makefile, predefined variables. You can alter these variables in the makefile,
with arguments to @code{make}, or in the environment to alter how the with arguments to @code{make}, or in the environment to alter how the
implicit rules work without redefining the rules themselves. implicit rules work without redefining the rules themselves. You can
cancel all variables used by implicit rules with the @samp{-R} or
@samp{--no-builtin-variables} option.
For example, the command used to compile a C source file actually says For example, the command used to compile a C source file actually says
@samp{$(CC) -c $(CFLAGS) $(CPPFLAGS)}. The default values of the variables @samp{$(CC) -c $(CFLAGS) $(CPPFLAGS)}. The default values of the variables
@@ -7632,9 +7849,9 @@ lib: foo.o bar.o lose.o win.o
@end example @end example
Of the variables listed above, four have values that are single file Of the variables listed above, four have values that are single file
names, and two have values that are lists of file names. These six have names, and three have values that are lists of file names. These seven
variants that get just the file's directory name or just the file name have variants that get just the file's directory name or just the file
within the directory. The variant variables' names are formed by name within the directory. The variant variables' names are formed by
appending @samp{D} or @samp{F}, respectively. These variants are appending @samp{D} or @samp{F}, respectively. These variants are
semi-obsolete in GNU @code{make} since the functions @code{dir} and semi-obsolete in GNU @code{make} since the functions @code{dir} and
@code{notdir} can be used to get a similar effect (@pxref{File Name @code{notdir} can be used to get a similar effect (@pxref{File Name
@@ -8332,8 +8549,8 @@ in the normal way (@pxref{Suffix Rules}). Thus a double-suffix rule
Here is a summary of the features of GNU @code{make}, for comparison Here is a summary of the features of GNU @code{make}, for comparison
with and credit to other versions of @code{make}. We consider the with and credit to other versions of @code{make}. We consider the
features of @code{make} in 4.2 BSD systems as a baseline. If you are features of @code{make} in 4.2 BSD systems as a baseline. If you are
concerned with writing portable makefiles, you should use only the concerned with writing portable makefiles, you should not use the
features of @code{make} @emph{not} listed here or in @ref{Missing}. features of @code{make} listed here, nor the ones in @ref{Missing}.
Many features come from the version of @code{make} in System V. Many features come from the version of @code{make} in System V.
@@ -8617,8 +8834,8 @@ for the particular target that is being processed.
This is not defined in GNU @code{make} because @samp{$$} should always This is not defined in GNU @code{make} because @samp{$$} should always
stand for an ordinary @samp{$}. stand for an ordinary @samp{$}.
It is possible to get this functionality through the use of static pattern It is possible to get portions of this functionality through the use of
rules (@pxref{Static Pattern, ,Static Pattern Rules}). static pattern rules (@pxref{Static Pattern, ,Static Pattern Rules}).
The System V @code{make} rule: The System V @code{make} rule:
@example @example
@@ -8738,6 +8955,8 @@ Conditionally evaluate part of the makefile.@*
@xref{Conditionals}. @xref{Conditionals}.
@item include @var{file} @item include @var{file}
@itemx -include @var{file}
@itemx sinclude @var{file}
Include another makefile.@* Include another makefile.@*
@xref{Include, ,Including Other Makefiles}. @xref{Include, ,Including Other Makefiles}.
@@ -8745,6 +8964,7 @@ Include another makefile.@*
@item override @var{variable} = @var{value} @item override @var{variable} = @var{value}
@itemx override @var{variable} := @var{value} @itemx override @var{variable} := @var{value}
@itemx override @var{variable} += @var{value} @itemx override @var{variable} += @var{value}
@itemx override @var{variable} ?= @var{value}
@itemx override define @var{variable} @itemx override define @var{variable}
@itemx endef @itemx endef
@@ -8761,6 +8981,7 @@ Tell @code{make} to export all variables to child processes by default.@*
@itemx export @var{variable} = @var{value} @itemx export @var{variable} = @var{value}
@itemx export @var{variable} := @var{value} @itemx export @var{variable} := @var{value}
@itemx export @var{variable} += @var{value} @itemx export @var{variable} += @var{value}
@itemx export @var{variable} ?= @var{value}
@itemx unexport @var{variable} @itemx unexport @var{variable}
Tell @code{make} whether or not to export a particular variable to child Tell @code{make} whether or not to export a particular variable to child
processes.@* processes.@*
@@ -8845,6 +9066,10 @@ Extract the @var{n}th word (one-origin) of @var{text}.@*
Count the number of words in @var{text}.@* Count the number of words in @var{text}.@*
@xref{File Name Functions, ,Functions for File Names}. @xref{File Name Functions, ,Functions for File Names}.
@item $(wordlist @var{s},@var{e},@var{text})
Returns the list of words in @var{text} from @var{s} to @var{e}.@*
@xref{File Name Functions, ,Functions for File Names}.
@item $(firstword @var{names}@dots{}) @item $(firstword @var{names}@dots{})
Extract the first word of @var{names}.@* Extract the first word of @var{names}.@*
@xref{File Name Functions, ,Functions for File Names}. @xref{File Name Functions, ,Functions for File Names}.
@@ -8854,6 +9079,18 @@ Find file names matching a shell file name pattern (@emph{not} a
@samp{%} pattern).@* @samp{%} pattern).@*
@xref{Wildcard Function, ,The Function @code{wildcard}}. @xref{Wildcard Function, ,The Function @code{wildcard}}.
@item $(error @var{text}@dots{})
When this function is evaluated, @code{make} generates a fatal error
with the message @var{text}.@*
@xref{Make Control Functions, ,Functions That Control Make}.
@item $(warning @var{text}@dots{})
When this function is evaluated, @code{make} generates a warning with
the message @var{text}.@*
@xref{Make Control Functions, ,Functions That Control Make}.
@item $(shell @var{command}) @item $(shell @var{command})
Execute a shell command and return its output.@* Execute a shell command and return its output.@*
@@ -8870,6 +9107,12 @@ defined.@*
Evaluate @var{text} with @var{var} bound to each word in @var{words}, Evaluate @var{text} with @var{var} bound to each word in @var{words},
and concatenate the results.@* and concatenate the results.@*
@xref{Foreach Function, ,The @code{foreach} Function}. @xref{Foreach Function, ,The @code{foreach} Function}.
@item $(call @var{var},@var{param},@dots{})
Evaluate the variable @var{var} replacing any references to @var{$(1)},
@var{$(2)} with the first, second, etc. @var{param} values.@*
@xref{Call Function, ,The @code{call} Function}.
@end table @end table
Here is a summary of the automatic variables. Here is a summary of the automatic variables.
@@ -8990,6 +9233,11 @@ effect on the operation of @code{make}.@*
@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.
@item .LIBPATTERNS
Defines the naming of the libraries @code{make} searches for, and their
order.@*
@xref{Libraries/Search, ,Directory Search for Link Libraries}.
@end table @end table
@node Make Errors, Complex Makefile, Quick Reference, Top @node Make Errors, Complex Makefile, Quick Reference, Top
@@ -9019,22 +9267,24 @@ These errors are not really @code{make} errors at all. They mean that a
program that @code{make} invoked as part of a command script returned a program that @code{make} invoked as part of a command script returned a
non-0 error code (@samp{Error @var{NN}}), which @code{make} interprets non-0 error code (@samp{Error @var{NN}}), which @code{make} interprets
as failure, or it exited in some other abnormal fashion (with a as failure, or it exited in some other abnormal fashion (with a
signal of some type). signal of some type). @xref{Errors, ,Errors in Commands}.
If no @code{***} is attached to the message, then the subprocess failed If no @code{***} is attached to the message, then the subprocess failed
but the rule in the makefile was prefixed with the @code{-} special but the rule in the makefile was prefixed with the @code{-} special
character, so @code{make} ignored the error. character, so @code{make} ignored the error.
@item missing separator. Stop. @item missing separator. Stop.
This is @code{make}'s generic ``Huh?'' error message. It means that This means that @code{make} could not understand much of anything about
@code{make} was completely unsuccessful at parsing this line of your the command line it just read. GNU @code{make} looks for various kinds
makefile. It basically means ``syntax error''. of separators (@code{:}, @code{=}, TAB characters, etc.) to help it
decide what kind of commandline it's seeing. This means it couldn't
find a valid one.
One of the most common reasons for this message is that you (or perhaps One of the most common reasons for this message is that you (or perhaps
your oh-so-helpful editor, as is the case with many MS-Windows editors) your oh-so-helpful editor, as is the case with many MS-Windows editors)
have attempted to indent your command scripts with spaces instead of a have attempted to indent your command scripts with spaces instead of a
TAB character. Remember that every line in the command script must TAB character. Remember that every line in the command script must
begin with a TAB character. Eight spaces do not count. begin with a TAB character. Eight spaces do not count. @xref{Rule Syntax}.
@item commands commence before first target. Stop. @item commands commence before first target. Stop.
@itemx missing rule before commands. Stop. @itemx missing rule before commands. Stop.
@@ -9045,7 +9295,7 @@ must always be associated with a target.
The second form is generated if the line has a semicolon as the first The second form is generated if the line has a semicolon as the first
non-whitespace character; @code{make} interprets this to mean you left non-whitespace character; @code{make} interprets this to mean you left
out the "target: dependency" section of a rule. out the "target: dependency" section of a rule. @xref{Rule Syntax}.
@item No rule to make target `@var{xxx}'. @item No rule to make target `@var{xxx}'.
@itemx No rule to make target `@var{xxx}', needed by `@var{yyy}'. @itemx No rule to make target `@var{xxx}', needed by `@var{yyy}'.
@@ -9066,6 +9316,7 @@ command line, and @code{make} couldn't find any makefiles to read in.
The latter means that some makefile was found, but it didn't contain any The latter means that some makefile was found, but it didn't contain any
default target and none was given on the command line. GNU @code{make} default target and none was given on the command line. GNU @code{make}
has nothing to do in these situations. has nothing to do in these situations.
@xref{Makefile Arguments, ,Arguments to Specify the Makefile}.@refill
@item Makefile `@var{xxx}' was not found. @item Makefile `@var{xxx}' was not found.
@itemx Included makefile `@var{xxx}' was not found. @itemx Included makefile `@var{xxx}' was not found.
@@ -9078,6 +9329,7 @@ GNU @code{make} allows commands to be specified only once per target
(except for double-colon rules). If you give commands for a target (except for double-colon rules). If you give commands for a target
which already has been defined to have commands, this warning is issued which already has been defined to have commands, this warning is issued
and the second set of commands will overwrite the first set. and the second set of commands will overwrite the first set.
@xref{Multiple Rules, ,Multiple Rules for One Target}.
@item Circular @var{xxx} <- @var{yyy} dependency dropped. @item Circular @var{xxx} <- @var{yyy} dependency dropped.
This means that @code{make} detected a loop in the dependency graph: This means that @code{make} detected a loop in the dependency graph:
@@ -9088,7 +9340,8 @@ dependencies, etc., one of them depended on @var{xxx} again.
This means you've defined a normal (recursive) @code{make} variable This means you've defined a normal (recursive) @code{make} variable
@var{xxx} that, when its expanded, will refer to itself (@var{xxx}). @var{xxx} that, when its expanded, will refer to itself (@var{xxx}).
This is not allowed; either use simply-expanded variables (@code{:=}) or This is not allowed; either use simply-expanded variables (@code{:=}) or
use the append operator (@code{+=}). use the append operator (@code{+=}). @xref{Using Variables, ,How to Use
Variables}.
@item Unterminated variable reference. Stop. @item Unterminated variable reference. Stop.
This means you forgot to provide the proper closing parenthesis This means you forgot to provide the proper closing parenthesis
@@ -9097,7 +9350,7 @@ or brace in your variable or function reference.
@item insufficient arguments to function `@var{xxx}'. Stop. @item insufficient arguments to function `@var{xxx}'. Stop.
This means you haven't provided the requisite number of arguments for This means you haven't provided the requisite number of arguments for
this function. See the documentation of the function for a description this function. See the documentation of the function for a description
of its arguments. of its arguments. @xref{Functions, ,Functions for Transforming Text}.
@item missing target pattern. Stop. @item missing target pattern. Stop.
@itemx multiple target patterns. Stop. @itemx multiple target patterns. Stop.
@@ -9105,7 +9358,8 @@ of its arguments.
These are generated for malformed static pattern rules. The first means These are generated for malformed static pattern rules. The first means
there's no pattern in the target section of the rule, the second means there's no pattern in the target section of the rule, the second means
there are multiple patterns in the target section, and the third means there are multiple patterns in the target section, and the third means
the target doesn't contain a pattern character (@code{%}). the target doesn't contain a pattern character (@code{%}). @xref{Static
Usage, ,Syntax of Static Pattern Rules}.
@end table @end table
@@ -9363,8 +9617,8 @@ dist: $(SRCS) $(AUX)
-rm -rf `cat .fname` -rm -rf `cat .fname`
mkdir `cat .fname` mkdir `cat .fname`
ln $(SRCS) $(AUX) `cat .fname` ln $(SRCS) $(AUX) `cat .fname`
-rm -rf `cat .fname` .fname
tar chZf `cat .fname`.tar.Z `cat .fname` tar chZf `cat .fname`.tar.Z `cat .fname`
-rm -rf `cat .fname` .fname
@end group @end group
@group @group

View File

@@ -3,9 +3,10 @@ $! Makefile.com - builds GNU Make for VMS
$! $!
$! P1 is non-empty if you want to link with the VAXCRTL library instead $! P1 is non-empty if you want to link with the VAXCRTL library instead
$! of the shareable executable $! of the shareable executable
$! P2 = DEBUG will build an image with debug information
$! $!
$! In case of problems with the install you might contact me at $! In case of problems with the install you might contact me at
$! zinser@decus.decus.de (preferred) or eurmpz@eur.sas.com $! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
$! $!
$! Look for the compiler used $! Look for the compiler used
$! $!
@@ -18,8 +19,8 @@ $ else
$ ccopt = "/decc/prefix=all" $ ccopt = "/decc/prefix=all"
$ if f$trnlnm("SYS").eqs."" $ if f$trnlnm("SYS").eqs.""
$ then $ then
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes."" $ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
$ then $ then
$ define sys decc$library_include: $ define sys decc$library_include:
$ else $ else
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" - $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
@@ -27,10 +28,20 @@ $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" - $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]," then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
$ lval=lval+"SYS$LIBRARY:" $ lval=lval+"SYS$LIBRARY:"
$ define sys 'lval $ define sys 'lval
$ endif $ endif
$ endif $ endif
$ endif $ endif
$!
$! Should we build a debug image
$!
$ if (p2.eqs."DEBUG")
$ then
$ ccopt = ccopt + "/noopt/debug"
$ lopt = "/debug"
$ else
$ lopt = ""
$ endif
$ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt1 getopt" $ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt1 getopt"
$ copy config.h-vms config.h $ copy config.h-vms config.h
$ n=0 $ n=0
@@ -45,10 +56,10 @@ $ goto loop
$ linkit: $ linkit:
$ close optf $ close optf
$ if p1 .nes. "" then goto link_using_library $ if p1 .nes. "" then goto link_using_library
$ link/exe=make make.opt/opt $ link/exe=make make.opt/opt'lopt
$ exit $ exit
$ link_using_library: $ link_using_library:
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib $ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
$! $!
$ compileit : subroutine $ compileit : subroutine
$ ploc = f$locate("]",p1) $ ploc = f$locate("]",p1)

View File

@@ -16,7 +16,8 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Make; see the file COPYING. If not, write to # along with GNU Make; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
CC = cc/warn CC = cc/warn
CP = copy CP = copy

241
misc.c
View File

@@ -14,23 +14,59 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
/* Variadic functions. We go through contortions to allow proper function
prototypes for both ANSI and pre-ANSI C compilers, and also for those
which support stdarg.h vs. varargs.h, and finally those which have
vfprintf(), etc. and those who have _doprnt... or nothing.
This fancy stuff all came from GNU fileutils, except for the VA_PRINTF and
VA_END macros used here since we have multiple print functions. */
#if HAVE_VPRINTF || HAVE_DOPRNT
# define HAVE_STDVARARGS 1
# if __STDC__
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
# else
# include <varargs.h>
# define VA_START(args, lastarg) va_start(args)
# endif
# if HAVE_VPRINTF
# define VA_PRINTF(fp, lastarg, args) vfprintf((fp), (lastarg), (args))
# else
# define VA_PRINTF(fp, lastarg, args) _doprnt((lastarg), (args), (fp))
# endif
# define VA_END(args) va_end(args)
#else
/* # undef HAVE_STDVARARGS */
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
# define VA_START(args, lastarg)
# define VA_END(args)
#endif
/* Compare strings *S1 and *S2. /* Compare strings *S1 and *S2.
Return negative if the first is less, positive if it is greater, Return negative if the first is less, positive if it is greater,
zero if they are equal. */ zero if they are equal. */
int int
alpha_compare (s1, s2) alpha_compare (v1, v2)
char **s1, **s2; const void *v1, *v2;
{ {
if (**s1 != **s2) const char *s1 = *((char **)v1);
return **s1 - **s2; const char *s2 = *((char **)v2);
return strcmp (*s1, *s2);
if (*s1 != *s2)
return *s1 - *s2;
return strcmp (s1, s2);
} }
/* Discard each backslash-newline combination from LINE. /* Discard each backslash-newline combination from LINE.
@@ -173,13 +209,22 @@ concat (s1, s2, s3)
/* Print a message on stdout. */ /* Print a message on stdout. */
void void
message (prefix, s1, s2, s3, s4, s5, s6) #if __STDC__ && HAVE_STDVARARGS
message (int prefix, const char *fmt, ...)
#else
message (prefix, fmt, va_alist)
int prefix; int prefix;
char *s1, *s2, *s3, *s4, *s5, *s6; const char *fmt;
va_dcl
#endif
{ {
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1); log_working_directory (1);
if (s1 != 0) if (fmt != 0)
{ {
if (prefix) if (prefix)
{ {
@@ -188,79 +233,78 @@ message (prefix, s1, s2, s3, s4, s5, s6)
else else
printf ("%s[%u]: ", program, makelevel); printf ("%s[%u]: ", program, makelevel);
} }
printf (s1, s2, s3, s4, s5, s6); VA_START (args, fmt);
VA_PRINTF (stdout, fmt, args);
VA_END (args);
putchar ('\n'); putchar ('\n');
} }
fflush (stdout); fflush (stdout);
} }
/* Print an error message and exit. */ /* Print an error message. */
/* VARARGS1 */
void
fatal (s1, s2, s3, s4, s5, s6)
char *s1, *s2, *s3, *s4, *s5, *s6;
{
log_working_directory (1);
if (makelevel == 0)
fprintf (stderr, "%s: *** ", program);
else
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
fputs (". Stop.\n", stderr);
die (2);
}
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
/* VARARGS1 */
void void
error (s1, s2, s3, s4, s5, s6) #if __STDC__ && HAVE_STDVARARGS
char *s1, *s2, *s3, *s4, *s5, *s6; error (const struct floc *flocp, const char *fmt, ...)
#else
error (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{ {
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1); log_working_directory (1);
if (makelevel == 0) if (flocp && flocp->filenm)
fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fprintf (stderr, "%s: ", program); fprintf (stderr, "%s: ", program);
else else
fprintf (stderr, "%s[%u]: ", program, makelevel); fprintf (stderr, "%s[%u]: ", program, makelevel);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
VA_START(args, fmt);
VA_PRINTF (stderr, fmt, args);
VA_END (args);
putc ('\n', stderr); putc ('\n', stderr);
fflush (stderr); fflush (stderr);
} }
void /* Print an error message and exit. */
makefile_error (file, lineno, s1, s2, s3, s4, s5, s6)
char *file;
unsigned int lineno;
char *s1, *s2, *s3, *s4, *s5, *s6;
{
log_working_directory (1);
fprintf (stderr, "%s:%u: ", file, lineno);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
putc ('\n', stderr);
fflush (stderr);
}
void void
makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6) #if __STDC__ && HAVE_STDVARARGS
char *file; fatal (const struct floc *flocp, const char *fmt, ...)
unsigned int lineno; #else
char *s1, *s2, *s3, *s4, *s5, *s6; fatal (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{ {
if (!file) #if HAVE_STDVARARGS
fatal(s1, s2, s3, s4, s5, s6); va_list args;
#endif
log_working_directory (1); log_working_directory (1);
fprintf (stderr, "%s:%u: *** ", file, lineno); if (flocp && flocp->filenm)
fprintf (stderr, s1, s2, s3, s4, s5, s6); fprintf (stderr, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
fputs (". Stop.\n", stderr); else if (makelevel == 0)
fprintf (stderr, "%s: *** ", program);
else
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
VA_START(args, fmt);
VA_PRINTF (stderr, fmt, args);
VA_END (args);
fputs (_(". Stop.\n"), stderr);
die (2); die (2);
} }
@@ -282,7 +326,7 @@ strerror (errnum)
if (errno < sys_nerr) if (errno < sys_nerr)
return sys_errlist[errnum]; return sys_errlist[errnum];
sprintf (buf, "Unknown error %d", errnum); sprintf (buf, _("Unknown error %d"), errnum);
return buf; return buf;
} }
#endif #endif
@@ -293,7 +337,7 @@ void
perror_with_name (str, name) perror_with_name (str, name)
char *str, *name; char *str, *name;
{ {
error ("%s%s: %s", str, name, strerror (errno)); error (NILF, "%s%s: %s", str, name, strerror (errno));
} }
/* Print an error message from errno and exit. */ /* Print an error message from errno and exit. */
@@ -302,15 +346,19 @@ void
pfatal_with_name (name) pfatal_with_name (name)
char *name; char *name;
{ {
fatal ("%s: %s", name, strerror (errno)); fatal (NILF, "%s: %s", name, strerror (errno));
/* NOTREACHED */ /* NOTREACHED */
} }
/* Like malloc but get fatal error if memory is exhausted. */ /* Like malloc but get fatal error if memory is exhausted. */
/* Don't bother if we're using dmalloc; it provides these for us. */
#ifndef HAVE_DMALLOC_H
#undef xmalloc #undef xmalloc
#undef xrealloc #undef xrealloc
#undef xstrdup
char * char *
xmalloc (size) xmalloc (size)
@@ -318,7 +366,7 @@ xmalloc (size)
{ {
char *result = (char *) malloc (size); char *result = (char *) malloc (size);
if (result == 0) if (result == 0)
fatal ("virtual memory exhausted"); fatal (NILF, _("virtual memory exhausted"));
return result; return result;
} }
@@ -328,15 +376,43 @@ xrealloc (ptr, size)
char *ptr; char *ptr;
unsigned int size; unsigned int size;
{ {
char *result = (char *) realloc (ptr, size); char *result;
/* Some older implementations of realloc() don't conform to ANSI. */
result = ptr ? realloc (ptr, size) : malloc (size);
if (result == 0) if (result == 0)
fatal ("virtual memory exhausted"); fatal (NILF, _("virtual memory exhausted"));
return result; return result;
} }
char *
xstrdup (ptr)
const char *ptr;
{
char *result;
#ifdef HAVE_STRDUP
result = strdup (ptr);
#else
result = (char *) malloc (strlen (ptr) + 1);
#endif
if (result == 0)
fatal (NILF, _("virtual memory exhausted"));
#ifdef HAVE_STRDUP
return result;
#else
return strcpy(result, ptr);
#endif
}
#endif /* HAVE_DMALLOC_H */
char * char *
savestring (str, length) savestring (str, length)
char *str; const char *str;
unsigned int length; unsigned int length;
{ {
register char *out = (char *) xmalloc (length + 1); register char *out = (char *) xmalloc (length + 1);
@@ -352,21 +428,28 @@ savestring (str, length)
char * char *
sindex (big, blen, small, slen) sindex (big, blen, small, slen)
char *big; const char *big;
unsigned int blen; unsigned int blen;
char *small; const char *small;
unsigned int slen; unsigned int slen;
{ {
register unsigned int b; if (!blen)
if (blen < 1)
blen = strlen (big); blen = strlen (big);
if (slen < 1) if (!slen)
slen = strlen (small); slen = strlen (small);
for (b = 0; b < blen; ++b) if (slen && blen >= slen)
if (big[b] == *small && !strncmp (&big[b + 1], small + 1, slen - 1)) {
return (&big[b]); register unsigned int b;
/* Quit when there's not enough room left for the small string. */
--slen;
blen -= slen;
for (b = 0; b < blen; ++b, ++big)
if (*big == *small && strneq (big + 1, small + 1, slen))
return (char *)big;
}
return 0; return 0;
} }
@@ -379,12 +462,12 @@ sindex (big, blen, small, slen)
char * char *
lindex (s, limit, c) lindex (s, limit, c)
register char *s, *limit; register const char *s, *limit;
int c; int c;
{ {
while (s < limit) while (s < limit)
if (*s++ == c) if (*s++ == c)
return s - 1; return (char *)(s - 1);
return 0; return 0;
} }
@@ -480,7 +563,7 @@ copy_dep_chain (d)
c = (struct dep *) xmalloc (sizeof (struct dep)); c = (struct dep *) xmalloc (sizeof (struct dep));
bcopy ((char *) d, (char *) c, sizeof (struct dep)); bcopy ((char *) d, (char *) c, sizeof (struct dep));
if (c->name != 0) if (c->name != 0)
c->name = savestring (c->name, strlen (c->name)); c->name = xstrdup (c->name);
c->next = 0; c->next = 0;
if (firstnew == 0) if (firstnew == 0)
firstnew = lastnew = c; firstnew = lastnew = c;
@@ -567,7 +650,7 @@ log_access (flavor)
but we write this one to stderr because it might be but we write this one to stderr because it might be
run in a child fork whose stdout is piped. */ run in a child fork whose stdout is piped. */
fprintf (stderr, "%s access: user %lu (real %lu), group %lu (real %lu)\n", fprintf (stderr, _("%s access: user %lu (real %lu), group %lu (real %lu)\n"),
flavor, (unsigned long) geteuid (), (unsigned long) getuid (), flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
(unsigned long) getegid (), (unsigned long) getgid ()); (unsigned long) getegid (), (unsigned long) getgid ());
fflush (stderr); fflush (stderr);
@@ -588,7 +671,7 @@ init_access ()
if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1) if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1)
pfatal_with_name ("get{e}[gu]id"); pfatal_with_name ("get{e}[gu]id");
log_access ("Initialized"); log_access (_("Initialized"));
current_access = make; current_access = make;
#endif #endif

401
read.c
View File

@@ -14,11 +14,15 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h"
#include <assert.h> #include <assert.h>
#include "make.h" #include <glob.h>
#include "dep.h" #include "dep.h"
#include "filedef.h" #include "filedef.h"
#include "job.h" #include "job.h"
@@ -26,12 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "variable.h" #include "variable.h"
#include "rule.h" #include "rule.h"
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
#ifdef HAVE_GLOB_H
#include <glob.h>
#else
#include "glob/glob.h"
#endif
#ifndef WINDOWS32 #ifndef WINDOWS32
#ifndef _AMIGA #ifndef _AMIGA
@@ -119,26 +117,27 @@ static unsigned int max_incl_len;
/* The filename and pointer to line number of the /* The filename and pointer to line number of the
makefile currently being read in. */ makefile currently being read in. */
char *reading_filename; const struct floc *reading_file;
unsigned int *reading_lineno_ptr;
/* The chain of makefiles read by read_makefile. */ /* The chain of makefiles read by read_makefile. */
static struct dep *read_makefiles = 0; static struct dep *read_makefiles = 0;
static int read_makefile PARAMS ((char *filename, int flags)); static int read_makefile PARAMS ((char *filename, int flags));
static unsigned int readline PARAMS ((struct linebuffer *linebuffer, FILE *stream, static unsigned long readline PARAMS ((struct linebuffer *linebuffer,
char *filename, unsigned int lineno)); FILE *stream, const struct floc *flocp));
static unsigned int do_define PARAMS ((char *name, unsigned int namelen, enum variable_origin origin, static void do_define PARAMS ((char *name, unsigned int namelen,
unsigned int lineno, FILE *infile, char *filename)); enum variable_origin origin, FILE *infile,
static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno)); struct floc *flocp));
static int conditional_line PARAMS ((char *line, const struct floc *flocp));
static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent, static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent,
struct dep *deps, unsigned int cmds_started, char *commands, struct dep *deps, unsigned int cmds_started, char *commands,
unsigned int commands_idx, int two_colon, char *filename, unsigned int commands_idx, int two_colon,
unsigned int lineno, int set_default)); const struct floc *flocp, int set_default));
static void record_target_var PARAMS ((struct nameseq *filenames, char *defn, static void record_target_var PARAMS ((struct nameseq *filenames, char *defn,
int two_colon, enum variable_origin origin, int two_colon,
char *filename, unsigned int lineno)); enum variable_origin origin,
const struct floc *flocp));
static enum make_word_type get_next_mword PARAMS ((char *buffer, char *delim, static enum make_word_type get_next_mword PARAMS ((char *buffer, char *delim,
char **startp, unsigned int *length)); char **startp, unsigned int *length));
@@ -151,7 +150,7 @@ read_all_makefiles (makefiles)
unsigned int num_makefiles = 0; unsigned int num_makefiles = 0;
if (debug_flag) if (debug_flag)
puts ("Reading makefiles..."); puts (_("Reading makefiles..."));
/* If there's a non-null variable MAKEFILES, its value is a list of /* If there's a non-null variable MAKEFILES, its value is a list of
files to read first thing. But don't let it prevent reading the files to read first thing. But don't let it prevent reading the
@@ -282,7 +281,7 @@ read_makefile (filename, flags)
register FILE *infile; register FILE *infile;
struct linebuffer lb; struct linebuffer lb;
unsigned int commands_len = 200; unsigned int commands_len = 200;
char *commands = (char *) xmalloc (200); char *commands;
unsigned int commands_idx = 0; unsigned int commands_idx = 0;
unsigned int cmds_started; unsigned int cmds_started;
char *p; char *p;
@@ -290,11 +289,11 @@ read_makefile (filename, flags)
int len, reading_target; int len, reading_target;
int ignoring = 0, in_ignored_define = 0; int ignoring = 0, in_ignored_define = 0;
int no_targets = 0; /* Set when reading a rule without targets. */ int no_targets = 0; /* Set when reading a rule without targets. */
struct floc fileinfo;
char *passed_filename = filename; char *passed_filename = filename;
struct nameseq *filenames = 0; struct nameseq *filenames = 0;
struct dep *deps; struct dep *deps;
unsigned int lineno = 1;
unsigned int nlines = 0; unsigned int nlines = 0;
int two_colon = 0; int two_colon = 0;
char *pattern = 0, *pattern_percent; char *pattern = 0, *pattern_percent;
@@ -310,27 +309,30 @@ read_makefile (filename, flags)
if (filenames != 0) \ if (filenames != 0) \
record_files (filenames, pattern, pattern_percent, deps, \ record_files (filenames, pattern, pattern_percent, deps, \
cmds_started, commands, commands_idx, \ cmds_started, commands, commands_idx, \
two_colon, filename, lineno, \ two_colon, &fileinfo, \
!(flags & RM_NO_DEFAULT_GOAL)); \ !(flags & RM_NO_DEFAULT_GOAL)); \
filenames = 0; \ filenames = 0; \
commands_idx = 0; \ commands_idx = 0; \
if (pattern) { free(pattern); pattern = 0; } \ if (pattern) { free(pattern); pattern = 0; } \
} while (0) } while (0)
fileinfo.filenm = filename;
fileinfo.lineno = 1;
pattern_percent = 0; pattern_percent = 0;
cmds_started = lineno; cmds_started = fileinfo.lineno;
if (debug_flag) if (debug_flag)
{ {
printf ("Reading makefile `%s'", filename); printf (_("Reading makefile `%s'"), fileinfo.filenm);
if (flags & RM_NO_DEFAULT_GOAL) if (flags & RM_NO_DEFAULT_GOAL)
printf (" (no default goal)"); printf (_(" (no default goal)"));
if (flags & RM_INCLUDED) if (flags & RM_INCLUDED)
printf (" (search path)"); printf (_(" (search path)"));
if (flags & RM_DONTCARE) if (flags & RM_DONTCARE)
printf (" (don't care)"); printf (_(" (don't care)"));
if (flags & RM_NO_TILDE) if (flags & RM_NO_TILDE)
printf (" (no ~ expansion)"); printf (_(" (no ~ expansion)"));
puts ("..."); puts ("...");
} }
@@ -377,7 +379,7 @@ read_makefile (filename, flags)
deps->file = lookup_file (filename); deps->file = lookup_file (filename);
if (deps->file == 0) if (deps->file == 0)
{ {
deps->file = enter_file (savestring (filename, strlen (filename))); deps->file = enter_file (xstrdup (filename));
if (flags & RM_DONTCARE) if (flags & RM_DONTCARE)
deps->file->dontcare = 1; deps->file->dontcare = 1;
} }
@@ -398,8 +400,7 @@ read_makefile (filename, flags)
return 0; return 0;
} }
reading_filename = filename; reading_file = &fileinfo;
reading_lineno_ptr = &lineno;
/* Loop over lines in the file. /* Loop over lines in the file.
The strategy is to accumulate target names in FILENAMES, dependencies The strategy is to accumulate target names in FILENAMES, dependencies
@@ -407,11 +408,12 @@ read_makefile (filename, flags)
when the start of the next rule (or eof) is encountered. */ when the start of the next rule (or eof) is encountered. */
initbuffer (&lb); initbuffer (&lb);
commands = xmalloc (200);
while (!feof (infile)) while (!feof (infile))
{ {
lineno += nlines; fileinfo.lineno += nlines;
nlines = readline (&lb, infile, filename, lineno); nlines = readline (&lb, infile, &fileinfo);
/* Check for a shell command line first. /* Check for a shell command line first.
If it is not one, we can stop treating tab specially. */ If it is not one, we can stop treating tab specially. */
@@ -437,7 +439,7 @@ read_makefile (filename, flags)
/* Append this command line to the line being accumulated. */ /* Append this command line to the line being accumulated. */
p = lb.buffer; p = lb.buffer;
if (commands_idx == 0) if (commands_idx == 0)
cmds_started = lineno; cmds_started = fileinfo.lineno;
len = strlen (p); len = strlen (p);
if (len + 1 + commands_idx > commands_len) if (len + 1 + commands_idx > commands_len)
{ {
@@ -467,7 +469,7 @@ read_makefile (filename, flags)
remove_comments (collapsed); remove_comments (collapsed);
/* Compare a word, both length and contents. */ /* Compare a word, both length and contents. */
#define word1eq(s, l) (len == l && !strncmp (s, p, l)) #define word1eq(s, l) (len == l && strneq (s, p, l))
p = collapsed; p = collapsed;
while (isspace (*p)) while (isspace (*p))
++p; ++p;
@@ -506,12 +508,11 @@ read_makefile (filename, flags)
|| word1eq ("ifeq", 4) || word1eq ("ifneq", 5) || word1eq ("ifeq", 4) || word1eq ("ifneq", 5)
|| word1eq ("else", 4) || word1eq ("endif", 5))) || word1eq ("else", 4) || word1eq ("endif", 5)))
{ {
int i = conditional_line (p, filename, lineno); int i = conditional_line (p, &fileinfo);
if (i >= 0) if (i >= 0)
ignoring = i; ignoring = i;
else else
makefile_fatal (filename, lineno, fatal (&fileinfo, _("invalid syntax in conditional"));
"invalid syntax in conditional");
continue; continue;
} }
@@ -520,7 +521,7 @@ read_makefile (filename, flags)
if (in_ignored_define) if (in_ignored_define)
in_ignored_define = 0; in_ignored_define = 0;
else else
makefile_fatal (filename, lineno, "extraneous `endef'"); fatal (&fileinfo, _("extraneous `endef'"));
continue; continue;
} }
@@ -531,6 +532,9 @@ read_makefile (filename, flags)
else else
{ {
p2 = next_token (p + 6); p2 = next_token (p + 6);
if (*p2 == '\0')
fatal (&fileinfo, _("empty variable name"));
/* Let the variable name be the whole rest of the line, /* Let the variable name be the whole rest of the line,
with trailing blanks stripped (comments have already been with trailing blanks stripped (comments have already been
removed), so it could be a complex variable/function removed), so it could be a complex variable/function
@@ -538,8 +542,7 @@ read_makefile (filename, flags)
p = index (p2, '\0'); p = index (p2, '\0');
while (isblank (p[-1])) while (isblank (p[-1]))
--p; --p;
lineno = do_define (p2, p - p2, o_file, do_define (p2, p - p2, o_file, infile, &fileinfo);
lineno, infile, filename);
} }
continue; continue;
} }
@@ -547,15 +550,18 @@ read_makefile (filename, flags)
if (word1eq ("override", 8)) if (word1eq ("override", 8))
{ {
p2 = next_token (p + 8); p2 = next_token (p + 8);
if (p2 == 0) if (*p2 == '\0')
makefile_error (filename, lineno, "empty `override' directive"); error (&fileinfo, _("empty `override' directive"));
if (!strncmp (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0')) if (strneq (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0'))
{ {
if (ignoring) if (ignoring)
in_ignored_define = 1; in_ignored_define = 1;
else else
{ {
p2 = next_token (p2 + 6); p2 = next_token (p2 + 6);
if (*p2 == '\0')
fatal (&fileinfo, _("empty variable name"));
/* Let the variable name be the whole rest of the line, /* Let the variable name be the whole rest of the line,
with trailing blanks stripped (comments have already been with trailing blanks stripped (comments have already been
removed), so it could be a complex variable/function removed), so it could be a complex variable/function
@@ -563,14 +569,12 @@ read_makefile (filename, flags)
p = index (p2, '\0'); p = index (p2, '\0');
while (isblank (p[-1])) while (isblank (p[-1]))
--p; --p;
lineno = do_define (p2, p - p2, o_override, do_define (p2, p - p2, o_override, infile, &fileinfo);
lineno, infile, filename);
} }
} }
else if (!ignoring else if (!ignoring
&& !try_variable_definition (filename, lineno, && !try_variable_definition (&fileinfo, p2, o_override))
p2, o_override)) error (&fileinfo, _("invalid `override' directive"));
makefile_error (filename, lineno, "empty `override' directive");
continue; continue;
} }
@@ -587,7 +591,7 @@ read_makefile (filename, flags)
p2 = next_token (p + 6); p2 = next_token (p + 6);
if (*p2 == '\0') if (*p2 == '\0')
export_all_variables = 1; export_all_variables = 1;
v = try_variable_definition (filename, lineno, p2, o_file); v = try_variable_definition (&fileinfo, p2, o_file);
if (v != 0) if (v != 0)
v->export = v_export; v->export = v_export;
else else
@@ -653,9 +657,8 @@ read_makefile (filename, flags)
p = allocated_variable_expand (next_token (p + (noerror ? 8 : 7))); p = allocated_variable_expand (next_token (p + (noerror ? 8 : 7)));
if (*p == '\0') if (*p == '\0')
{ {
makefile_error (filename, lineno, error (&fileinfo,
"no file name for `%sinclude'", _("no file name for `%sinclude'"), noerror ? "-" : "");
noerror ? "-" : "");
continue; continue;
} }
@@ -688,8 +691,7 @@ read_makefile (filename, flags)
if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
| (noerror ? RM_DONTCARE : 0))) | (noerror ? RM_DONTCARE : 0)))
&& ! noerror) && ! noerror)
makefile_error (filename, lineno, error (&fileinfo, "%s: %s", name, strerror (errno));
"%s: %s", name, strerror (errno));
free(name); free(name);
} }
@@ -701,11 +703,10 @@ read_makefile (filename, flags)
/* Restore state. */ /* Restore state. */
conditionals = save; conditionals = save;
reading_filename = filename; reading_file = &fileinfo;
reading_lineno_ptr = &lineno;
} }
#undef word1eq #undef word1eq
else if (try_variable_definition (filename, lineno, p, o_file)) else if (try_variable_definition (&fileinfo, p, o_file))
/* This line has been dealt with. */ /* This line has been dealt with. */
; ;
else if (lb.buffer[0] == '\t') else if (lb.buffer[0] == '\t')
@@ -720,8 +721,7 @@ read_makefile (filename, flags)
because there was no preceding target, and the line because there was no preceding target, and the line
might have been usable as a variable definition. might have been usable as a variable definition.
But now it is definitely lossage. */ But now it is definitely lossage. */
makefile_fatal (filename, lineno, fatal(&fileinfo, _("commands commence before first target"));
"commands commence before first target");
} }
else else
{ {
@@ -739,6 +739,7 @@ read_makefile (filename, flags)
enum variable_origin v_origin; enum variable_origin v_origin;
char *cmdleft, *lb_next; char *cmdleft, *lb_next;
unsigned int len, plen = 0; unsigned int len, plen = 0;
char *colonp;
/* Record the previous rule. */ /* Record the previous rule. */
@@ -768,12 +769,10 @@ read_makefile (filename, flags)
{ {
case w_eol: case w_eol:
if (cmdleft != 0) if (cmdleft != 0)
makefile_fatal (filename, lineno, fatal(&fileinfo, _("missing rule before commands"));
"missing rule before commands"); /* This line contained something but turned out to be nothing
else but whitespace (a comment?). */
/* This line contained a variable reference that continue;
expanded to nothing but whitespace. */
continue;
case w_colon: case w_colon:
case w_dcolon: case w_dcolon:
@@ -789,8 +788,6 @@ read_makefile (filename, flags)
p2 = variable_expand_string(NULL, lb_next, len); p2 = variable_expand_string(NULL, lb_next, len);
while (1) while (1)
{ {
char *colonp;
lb_next += len; lb_next += len;
if (cmdleft == 0) if (cmdleft == 0)
{ {
@@ -815,7 +812,7 @@ read_makefile (filename, flags)
entirely consistent, since we do an unconditional entirely consistent, since we do an unconditional
expand below once we know we don't have a expand below once we know we don't have a
target-specific variable. */ target-specific variable. */
(void)variable_expand_string(pend, lb_next, -1); (void)variable_expand_string(pend, lb_next, (long)-1);
lb_next += strlen(lb_next); lb_next += strlen(lb_next);
p2 = variable_buffer + p2_off; p2 = variable_buffer + p2_off;
cmdleft = variable_buffer + cmd_off + 1; cmdleft = variable_buffer + cmd_off + 1;
@@ -825,12 +822,12 @@ read_makefile (filename, flags)
colonp = find_char_unquote(p2, ":", 0); colonp = find_char_unquote(p2, ":", 0);
#if defined(__MSDOS__) || defined(WINDOWS32) #if defined(__MSDOS__) || defined(WINDOWS32)
/* The drive spec brain-damage strikes again... */ /* The drive spec brain-damage strikes again... */
/* FIXME: is whitespace the only possible separator of words /* Note that the only separators of targets in this context
in this context? If not, the `isspace' test below will are whitespace and a left paren. If others are possible,
need to be changed into a call to `index'. */ they should be added to the string in the call to index. */
while (colonp && (colonp[1] == '/' || colonp[1] == '\\') && while (colonp && (colonp[1] == '/' || colonp[1] == '\\') &&
colonp > p2 && isalpha(colonp[-1]) && colonp > p2 && isalpha(colonp[-1]) &&
(colonp == p2 + 1 || isspace(colonp[-2]))) (colonp == p2 + 1 || index(" \t(", colonp[-2]) != 0))
colonp = find_char_unquote(colonp + 1, ":", 0); colonp = find_char_unquote(colonp + 1, ":", 0);
#endif #endif
if (colonp != 0) if (colonp != 0)
@@ -838,7 +835,7 @@ read_makefile (filename, flags)
wtype = get_next_mword(lb_next, NULL, &lb_next, &len); wtype = get_next_mword(lb_next, NULL, &lb_next, &len);
if (wtype == w_eol) if (wtype == w_eol)
makefile_fatal (filename, lineno, "missing separator"); break;
p2 += strlen(p2); p2 += strlen(p2);
*(p2++) = ' '; *(p2++) = ' ';
@@ -850,10 +847,28 @@ read_makefile (filename, flags)
p2 = next_token (variable_buffer); p2 = next_token (variable_buffer);
filenames = multi_glob (parse_file_seq (&p2, ':', /* If the word we're looking at is EOL, see if there's _anything_
on the line. If not, a variable expanded to nothing, so ignore
it. If so, we can't parse this line so punt. */
if (wtype == w_eol)
{
if (*p2 != '\0')
/* There's no need to be ivory-tower about this: check for
one of the most common bugs found in makefiles... */
fatal (&fileinfo, _("missing separator%s"),
!strneq(lb.buffer, " ", 8) ? ""
: _(" (did you mean TAB instead of 8 spaces?)"));
continue;
}
/* Make the colon the end-of-string so we know where to stop
looking for targets. */
*colonp = '\0';
filenames = multi_glob (parse_file_seq (&p2, '\0',
sizeof (struct nameseq), sizeof (struct nameseq),
1), 1),
sizeof (struct nameseq)); sizeof (struct nameseq));
*colonp = ':';
if (!filenames) if (!filenames)
{ {
@@ -886,7 +901,7 @@ read_makefile (filename, flags)
wtype = get_next_mword(p2, NULL, &p, &len); wtype = get_next_mword(p2, NULL, &p, &len);
v_origin = o_file; v_origin = o_file;
if (wtype == w_static && (len == (sizeof("override")-1) if (wtype == w_static && (len == (sizeof("override")-1)
&& !strncmp(p, "override", len))) && strneq(p, "override", len)))
{ {
v_origin = o_override; v_origin = o_override;
(void)get_next_mword(p+len, NULL, &p, &len); (void)get_next_mword(p+len, NULL, &p, &len);
@@ -896,8 +911,7 @@ read_makefile (filename, flags)
if (wtype == w_varassign || v_origin == o_override) if (wtype == w_varassign || v_origin == o_override)
{ {
record_target_var(filenames, p, two_colon, v_origin, record_target_var(filenames, p, two_colon, v_origin, &fileinfo);
filename, lineno);
filenames = 0; filenames = 0;
continue; continue;
} }
@@ -913,7 +927,7 @@ read_makefile (filename, flags)
if (*lb_next != '\0') if (*lb_next != '\0')
{ {
unsigned int l = p2 - variable_buffer; unsigned int l = p2 - variable_buffer;
(void)variable_expand_string(p2 + plen, lb_next, -1); (void)variable_expand_string(p2 + plen, lb_next, (long)-1);
p2 = variable_buffer + l; p2 = variable_buffer + l;
/* Look for a semicolon in the expanded line. */ /* Look for a semicolon in the expanded line. */
@@ -959,7 +973,8 @@ read_makefile (filename, flags)
check_again = 0; check_again = 0;
/* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */ /* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */
if (p != 0 && (p[1] == '\\' || p[1] == '/') && if (p != 0 && (p[1] == '\\' || p[1] == '/') &&
isalpha(p[-1]) && (p == p2 + 1 || index(" \t:", p[-2]) != 0)) { isalpha(p[-1]) &&
(p == p2 + 1 || index(" \t:(", p[-2]) != 0)) {
p = index(p + 1, ':'); p = index(p + 1, ':');
check_again = 1; check_again = 1;
} }
@@ -971,14 +986,13 @@ read_makefile (filename, flags)
target = parse_file_seq (&p2, ':', sizeof (struct nameseq), 1); target = parse_file_seq (&p2, ':', sizeof (struct nameseq), 1);
++p2; ++p2;
if (target == 0) if (target == 0)
makefile_fatal (filename, lineno, "missing target pattern"); fatal (&fileinfo, _("missing target pattern"));
else if (target->next != 0) else if (target->next != 0)
makefile_fatal (filename, lineno, "multiple target patterns"); fatal (&fileinfo, _("multiple target patterns"));
pattern = target->name; pattern = target->name;
pattern_percent = find_percent (pattern); pattern_percent = find_percent (pattern);
if (pattern_percent == 0) if (pattern_percent == 0)
makefile_fatal (filename, lineno, fatal (&fileinfo, _("target pattern contains no `%%'"));
"target pattern contains no `%%'");
free((char *)target); free((char *)target);
} }
else else
@@ -995,7 +1009,7 @@ read_makefile (filename, flags)
/* Semicolon means rest of line is a command. */ /* Semicolon means rest of line is a command. */
unsigned int len = strlen (cmdleft); unsigned int len = strlen (cmdleft);
cmds_started = lineno; cmds_started = fileinfo.lineno;
/* Add this command line to the buffer. */ /* Add this command line to the buffer. */
if (len + 2 > commands_len) if (len + 2 > commands_len)
@@ -1019,7 +1033,7 @@ read_makefile (filename, flags)
} }
if (conditionals->if_cmds) if (conditionals->if_cmds)
makefile_fatal (filename, lineno, "missing `endif'"); fatal (&fileinfo, _("missing `endif'"));
/* At eof, record the last rule. */ /* At eof, record the last rule. */
record_waiting_files (); record_waiting_files ();
@@ -1028,8 +1042,7 @@ read_makefile (filename, flags)
free ((char *) commands); free ((char *) commands);
fclose (infile); fclose (infile);
reading_filename = 0; reading_file = 0;
reading_lineno_ptr = 0;
return 1; return 1;
} }
@@ -1040,14 +1053,13 @@ read_makefile (filename, flags)
LINENO, INFILE and FILENAME refer to the makefile being read. LINENO, INFILE and FILENAME refer to the makefile being read.
The value returned is LINENO, updated for lines read here. */ The value returned is LINENO, updated for lines read here. */
static unsigned int static void
do_define (name, namelen, origin, lineno, infile, filename) do_define (name, namelen, origin, infile, flocp)
char *name; char *name;
unsigned int namelen; unsigned int namelen;
enum variable_origin origin; enum variable_origin origin;
unsigned int lineno;
FILE *infile; FILE *infile;
char *filename; struct floc *flocp;
{ {
struct linebuffer lb; struct linebuffer lb;
unsigned int nlines = 0; unsigned int nlines = 0;
@@ -1067,21 +1079,20 @@ do_define (name, namelen, origin, lineno, infile, filename)
{ {
unsigned int len; unsigned int len;
lineno += nlines; flocp->lineno += nlines;
nlines = readline (&lb, infile, filename, lineno); nlines = readline (&lb, infile, flocp);
collapse_continuations (lb.buffer); collapse_continuations (lb.buffer);
p = next_token (lb.buffer); p = next_token (lb.buffer);
len = strlen (p); len = strlen (p);
if ((len == 5 || (len > 5 && isblank (p[5]))) if ((len == 5 || (len > 5 && isblank (p[5])))
&& !strncmp (p, "endef", 5)) && strneq (p, "endef", 5))
{ {
p += 5; p += 5;
remove_comments (p); remove_comments (p);
if (*next_token (p) != '\0') if (*next_token (p) != '\0')
makefile_error (filename, lineno, error (flocp, _("Extraneous text after `endef' directive"));
"Extraneous text after `endef' directive");
/* Define the variable. */ /* Define the variable. */
if (idx == 0) if (idx == 0)
definition[0] = '\0'; definition[0] = '\0';
@@ -1090,7 +1101,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
(void) define_variable (var, strlen (var), definition, origin, 1); (void) define_variable (var, strlen (var), definition, origin, 1);
free (definition); free (definition);
freebuffer (&lb); freebuffer (&lb);
return (lineno + nlines); return;
} }
else else
{ {
@@ -1110,10 +1121,10 @@ do_define (name, namelen, origin, lineno, infile, filename)
} }
/* No `endef'!! */ /* No `endef'!! */
makefile_fatal (filename, lineno, "missing `endef', unterminated `define'"); fatal (flocp, _("missing `endef', unterminated `define'"));
/* NOTREACHED */ /* NOTREACHED */
return 0; return;
} }
/* Interpret conditional commands "ifdef", "ifndef", "ifeq", /* Interpret conditional commands "ifdef", "ifndef", "ifeq",
@@ -1128,10 +1139,9 @@ do_define (name, namelen, origin, lineno, infile, filename)
1 if following text should be ignored. */ 1 if following text should be ignored. */
static int static int
conditional_line (line, filename, lineno) conditional_line (line, flocp)
char *line; char *line;
char *filename; const struct floc *flocp;
unsigned int lineno;
{ {
int notdef; int notdef;
char *cmdname; char *cmdname;
@@ -1165,17 +1175,15 @@ conditional_line (line, filename, lineno)
if (*cmdname == 'e') if (*cmdname == 'e')
{ {
if (*line != '\0') if (*line != '\0')
makefile_error (filename, lineno, error (flocp, _("Extraneous text after `%s' directive"), cmdname);
"Extraneous text after `%s' directive",
cmdname);
/* "Else" or "endif". */ /* "Else" or "endif". */
if (conditionals->if_cmds == 0) if (conditionals->if_cmds == 0)
makefile_fatal (filename, lineno, "extraneous `%s'", cmdname); fatal (flocp, _("extraneous `%s'"), cmdname);
/* NOTDEF indicates an `endif' command. */ /* NOTDEF indicates an `endif' command. */
if (notdef) if (notdef)
--conditionals->if_cmds; --conditionals->if_cmds;
else if (conditionals->seen_else[conditionals->if_cmds - 1]) else if (conditionals->seen_else[conditionals->if_cmds - 1])
makefile_fatal (filename, lineno, "only one `else' per conditional"); fatal (flocp, _("only one `else' per conditional"));
else else
{ {
/* Toggle the state of ignorance. */ /* Toggle the state of ignorance. */
@@ -1301,10 +1309,12 @@ conditional_line (line, filename, lineno)
if (*line == '(') if (*line == '(')
++count; ++count;
else if (*line == ')') else if (*line == ')')
if (count <= 0) {
break; if (count <= 0)
else break;
--count; else
--count;
}
} }
} }
else else
@@ -1321,9 +1331,7 @@ conditional_line (line, filename, lineno)
*line = '\0'; *line = '\0';
line = next_token (++line); line = next_token (++line);
if (*line != '\0') if (*line != '\0')
makefile_error (filename, lineno, error (flocp, _("Extraneous text after `%s' directive"), cmdname);
"Extraneous text after `%s' directive",
cmdname);
s2 = variable_expand (s2); s2 = variable_expand (s2);
conditionals->ignoring[conditionals->if_cmds - 1] conditionals->ignoring[conditionals->if_cmds - 1]
@@ -1384,13 +1392,12 @@ uniquize_deps (chain)
variable value list. */ variable value list. */
static void static void
record_target_var (filenames, defn, two_colon, origin, filename, lineno) record_target_var (filenames, defn, two_colon, origin, flocp)
struct nameseq *filenames; struct nameseq *filenames;
char *defn; char *defn;
int two_colon; int two_colon;
enum variable_origin origin; enum variable_origin origin;
char *filename; const struct floc *flocp;
unsigned int lineno;
{ {
struct nameseq *nextf; struct nameseq *nextf;
struct variable_set_list *global; struct variable_set_list *global;
@@ -1433,10 +1440,9 @@ record_target_var (filenames, defn, two_colon, origin, filename, lineno)
/* Make the new variable context current and define the variable. */ /* Make the new variable context current and define the variable. */
current_variable_set_list = vlist; current_variable_set_list = vlist;
v = try_variable_definition(filename, lineno, defn, origin); v = try_variable_definition (flocp, defn, origin);
if (!v) if (!v)
makefile_error(filename, lineno, error (flocp, _("Malformed per-target variable definition"));
"Malformed per-target variable definition");
v->per_target = 1; v->per_target = 1;
/* If it's not an override, check to see if there was a command-line /* If it's not an override, check to see if there was a command-line
@@ -1447,10 +1453,10 @@ record_target_var (filenames, defn, two_colon, origin, filename, lineno)
int len = strlen(v->name); int len = strlen(v->name);
current_variable_set_list = global; current_variable_set_list = global;
gv = lookup_variable(v->name, len); gv = lookup_variable (v->name, len);
if (gv && (gv->origin == o_env_override || gv->origin == o_command)) if (gv && (gv->origin == o_env_override || gv->origin == o_command))
define_variable_in_set(v->name, len, gv->value, gv->origin, define_variable_in_set (v->name, len, gv->value, gv->origin,
gv->recursive, vlist->set); gv->recursive, vlist->set);
} }
/* Free name if not needed further. */ /* Free name if not needed further. */
@@ -1474,7 +1480,7 @@ record_target_var (filenames, defn, two_colon, origin, filename, lineno)
static void static void
record_files (filenames, pattern, pattern_percent, deps, cmds_started, record_files (filenames, pattern, pattern_percent, deps, cmds_started,
commands, commands_idx, two_colon, filename, lineno, set_default) commands, commands_idx, two_colon, flocp, set_default)
struct nameseq *filenames; struct nameseq *filenames;
char *pattern, *pattern_percent; char *pattern, *pattern_percent;
struct dep *deps; struct dep *deps;
@@ -1482,8 +1488,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
char *commands; char *commands;
unsigned int commands_idx; unsigned int commands_idx;
int two_colon; int two_colon;
char *filename; const struct floc *flocp;
unsigned int lineno;
int set_default; int set_default;
{ {
struct nameseq *nextf; struct nameseq *nextf;
@@ -1495,8 +1500,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
if (commands_idx > 0) if (commands_idx > 0)
{ {
cmds = (struct commands *) xmalloc (sizeof (struct commands)); cmds = (struct commands *) xmalloc (sizeof (struct commands));
cmds->filename = filename; cmds->fileinfo.filenm = flocp->filenm;
cmds->lineno = cmds_started; cmds->fileinfo.lineno = cmds_started;
cmds->commands = savestring (commands, commands_idx); cmds->commands = savestring (commands, commands_idx);
cmds->command_lines = 0; cmds->command_lines = 0;
} }
@@ -1519,11 +1524,10 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
implicit |= implicit_percent != 0; implicit |= implicit_percent != 0;
if (implicit && pattern != 0) if (implicit && pattern != 0)
makefile_fatal (filename, lineno, fatal (flocp, _("mixed implicit and static pattern rules"));
"mixed implicit and static pattern rules");
if (implicit && implicit_percent == 0) if (implicit && implicit_percent == 0)
makefile_fatal (filename, lineno, "mixed implicit and normal rules"); fatal (flocp, _("mixed implicit and normal rules"));
if (implicit) if (implicit)
{ {
@@ -1555,37 +1559,38 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
this = nextf != 0 ? copy_dep_chain (deps) : deps; this = nextf != 0 ? copy_dep_chain (deps) : deps;
if (pattern != 0) if (pattern != 0)
/* If this is an extended static rule: {
`targets: target%pattern: dep%pattern; cmds', /* If this is an extended static rule:
translate each dependency pattern into a plain filename `targets: target%pattern: dep%pattern; cmds',
using the target pattern and this target's name. */ translate each dependency pattern into a plain filename
if (!pattern_matches (pattern, pattern_percent, name)) using the target pattern and this target's name. */
{ if (!pattern_matches (pattern, pattern_percent, name))
/* Give a warning if the rule is meaningless. */ {
makefile_error (filename, lineno, /* Give a warning if the rule is meaningless. */
"target `%s' doesn't match the target pattern", error (flocp,
name); _("target `%s' doesn't match the target pattern"), name);
this = 0; this = 0;
} }
else else
{ {
/* We use patsubst_expand to do the work of translating /* We use patsubst_expand to do the work of translating
the target pattern, the target's name and the dependencies' the target pattern, the target's name and the dependencies'
patterns into plain dependency names. */ patterns into plain dependency names. */
char *buffer = variable_expand (""); char *buffer = variable_expand ("");
for (d = this; d != 0; d = d->next) for (d = this; d != 0; d = d->next)
{ {
char *o; char *o;
char *percent = find_percent (d->name); char *percent = find_percent (d->name);
if (percent == 0) if (percent == 0)
continue; continue;
o = patsubst_expand (buffer, name, pattern, d->name, o = patsubst_expand (buffer, name, pattern, d->name,
pattern_percent, percent); pattern_percent, percent);
free (d->name); free (d->name);
d->name = savestring (buffer, o - buffer); d->name = savestring (buffer, o - buffer);
} }
} }
}
if (!two_colon) if (!two_colon)
{ {
@@ -1594,29 +1599,25 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
f = enter_file (name); f = enter_file (name);
if (f->double_colon) if (f->double_colon)
makefile_fatal (filename, lineno, fatal (flocp,
"target file `%s' has both : and :: entries", _("target file `%s' has both : and :: entries"), f->name);
f->name);
/* If CMDS == F->CMDS, this target was listed in this rule /* If CMDS == F->CMDS, this target was listed in this rule
more than once. Just give a warning since this is harmless. */ more than once. Just give a warning since this is harmless. */
if (cmds != 0 && cmds == f->cmds) if (cmds != 0 && cmds == f->cmds)
makefile_error error (flocp, _("target `%s' given more than once in the same rule."),
(filename, lineno, f->name);
"target `%s' given more than once in the same rule.",
f->name);
/* Check for two single-colon entries both with commands. /* Check for two single-colon entries both with commands.
Check is_target so that we don't lose on files such as .c.o Check is_target so that we don't lose on files such as .c.o
whose commands were preinitialized. */ whose commands were preinitialized. */
else if (cmds != 0 && f->cmds != 0 && f->is_target) else if (cmds != 0 && f->cmds != 0 && f->is_target)
{ {
makefile_error (cmds->filename, cmds->lineno, error (&cmds->fileinfo,
"warning: overriding commands for target `%s'", _("warning: overriding commands for target `%s'"), f->name);
f->name); error (&f->cmds->fileinfo,
makefile_error (f->cmds->filename, f->cmds->lineno, _("warning: ignoring old commands for target `%s'"),
"warning: ignoring old commands for target `%s'", f->name);
f->name);
} }
f->is_target = 1; f->is_target = 1;
@@ -1696,9 +1697,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
/* Check for both : and :: rules. Check is_target so /* Check for both : and :: rules. Check is_target so
we don't lose on default suffix rules or makefiles. */ we don't lose on default suffix rules or makefiles. */
if (f != 0 && f->is_target && !f->double_colon) if (f != 0 && f->is_target && !f->double_colon)
makefile_fatal (filename, lineno, fatal (flocp,
"target file `%s' has both : and :: entries", _("target file `%s' has both : and :: entries"), f->name);
f->name);
f = enter_file (name); f = enter_file (name);
/* If there was an existing entry and it was a double-colon /* If there was an existing entry and it was a double-colon
entry, enter_file will have returned a new one, making it the entry, enter_file will have returned a new one, making it the
@@ -1746,7 +1746,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next) for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next)
{ {
register unsigned int len = strlen (dep_name (d2)); register unsigned int len = strlen (dep_name (d2));
if (strncmp (name, dep_name (d2), len)) if (!strneq (name, dep_name (d2), len))
continue; continue;
if (streq (name + len, dep_name (d))) if (streq (name + len, dep_name (d)))
{ {
@@ -1942,7 +1942,7 @@ parse_file_seq (stringp, stopchar, size, strip)
* Savestring called because q may be read-only string constant. * Savestring called because q may be read-only string constant.
*/ */
{ {
char *qbase = savestring(q, strlen(q)); char *qbase = xstrdup (q);
char *pbase = qbase + (p-q); char *pbase = qbase + (p-q);
char *q1 = qbase; char *q1 = qbase;
char *q2 = q1; char *q2 = q1;
@@ -2089,12 +2089,11 @@ parse_file_seq (stringp, stopchar, size, strip)
Return the number of actual lines read (> 1 if hacked continuation lines). Return the number of actual lines read (> 1 if hacked continuation lines).
*/ */
static unsigned int static unsigned long
readline (linebuffer, stream, filename, lineno) readline (linebuffer, stream, flocp)
struct linebuffer *linebuffer; struct linebuffer *linebuffer;
FILE *stream; FILE *stream;
char *filename; const struct floc *flocp;
unsigned int lineno;
{ {
char *buffer = linebuffer->buffer; char *buffer = linebuffer->buffer;
register char *p = linebuffer->buffer; register char *p = linebuffer->buffer;
@@ -2116,8 +2115,7 @@ readline (linebuffer, stream, filename, lineno)
lossage strikes again! (xmkmf puts NULs in its makefiles.) lossage strikes again! (xmkmf puts NULs in its makefiles.)
There is nothing really to be done; we synthesize a newline so There is nothing really to be done; we synthesize a newline so
the following line doesn't appear to be part of this line. */ the following line doesn't appear to be part of this line. */
makefile_error (filename, lineno, error (flocp, _("warning: NUL character seen; rest of line ignored"));
"warning: NUL character seen; rest of line ignored");
p[0] = '\n'; p[0] = '\n';
len = 1; len = 1;
} }
@@ -2139,6 +2137,17 @@ readline (linebuffer, stream, filename, lineno)
++nlines; ++nlines;
#if !defined(WINDOWS32) && !defined(__MSDOS__)
/* Check to see if the line was really ended with CRLF; if so ignore
the CR. */
if (len > 1 && p[-2] == '\r')
{
--len;
--p;
p[-1] = '\n';
}
#endif
if (len == 1 && p > buffer) if (len == 1 && p > buffer)
/* P is pointing at a newline and it's the beginning of /* P is pointing at a newline and it's the beginning of
the buffer returned by the last fgets call. However, the buffer returned by the last fgets call. However,
@@ -2177,7 +2186,7 @@ readline (linebuffer, stream, filename, lineno)
} }
if (ferror (stream)) if (ferror (stream))
pfatal_with_name (filename); pfatal_with_name (flocp->filenm);
return nlines; return nlines;
} }
@@ -2296,8 +2305,12 @@ get_next_mword (buffer, delim, startp, length)
case ':': case ':':
#if defined(__MSDOS__) || defined(WINDOWS32) #if defined(__MSDOS__) || defined(WINDOWS32)
/* A word CAN include a colon in its drive spec. */ /* A word CAN include a colon in its drive spec. The drive
if (!(p - beg == 2 && (*p == '/' || *p == '\\') && isalpha (*beg))) spec is allowed either at the beginning of a word, or as part
of the archive member name, like in "libfoo.a(d:/foo/bar.o)". */
if (!(p - beg >= 2 &&
(*p == '/' || *p == '\\') && isalpha (p[-2]) &&
(p - beg == 2 || p[-3] == '(')))
#endif #endif
goto done_word; goto done_word;
@@ -2339,6 +2352,7 @@ get_next_mword (buffer, delim, startp, length)
case '\\': case '\\':
switch (*p) switch (*p)
{ {
case ':':
case ';': case ';':
case '=': case '=':
case '\\': case '\\':
@@ -2526,7 +2540,7 @@ tilde_expand (name)
if (pwent != 0) if (pwent != 0)
{ {
if (userend == 0) if (userend == 0)
return savestring (pwent->pw_dir, strlen (pwent->pw_dir)); return xstrdup (pwent->pw_dir);
else else
return concat (pwent->pw_dir, "/", userend + 1); return concat (pwent->pw_dir, "/", userend + 1);
} }
@@ -2644,8 +2658,7 @@ multi_glob (chain, size)
#endif /* !NO_ARCHIVES */ #endif /* !NO_ARCHIVES */
{ {
struct nameseq *elt = (struct nameseq *) xmalloc (size); struct nameseq *elt = (struct nameseq *) xmalloc (size);
elt->name = savestring (gl.gl_pathv[i], elt->name = xstrdup (gl.gl_pathv[i]);
strlen (gl.gl_pathv[i]));
elt->next = new; elt->next = new;
new = elt; new = elt;
} }
@@ -2657,7 +2670,7 @@ multi_glob (chain, size)
} }
case GLOB_NOSPACE: case GLOB_NOSPACE:
fatal ("virtual memory exhausted"); fatal (NILF, _("virtual memory exhausted"));
break; break;
default: default:

375
remake.c
View File

@@ -14,13 +14,16 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
#include "job.h" #include "job.h"
#include "commands.h" #include "commands.h"
#include "dep.h" #include "dep.h"
#include "variable.h"
#include <assert.h> #include <assert.h>
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
@@ -29,10 +32,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/file.h> #include <sys/file.h>
#endif #endif
#ifdef __MSDOS__
#include "variable.h"
#endif
#ifdef VMS #ifdef VMS
#include <starlet.h> #include <starlet.h>
#endif #endif
@@ -48,13 +47,11 @@ unsigned int commands_started = 0;
static int update_file PARAMS ((struct file *file, unsigned int depth)); static int update_file PARAMS ((struct file *file, unsigned int depth));
static int update_file_1 PARAMS ((struct file *file, unsigned int depth)); static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
static int check_dep PARAMS ((struct file *file, unsigned int depth, time_t this_mtime, int *must_make_ptr)); static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr));
static int touch_file PARAMS ((struct file *file)); static int touch_file PARAMS ((struct file *file));
static void remake_file PARAMS ((struct file *file)); static void remake_file PARAMS ((struct file *file));
static time_t name_mtime PARAMS ((char *name)); static FILE_TIMESTAMP name_mtime PARAMS ((char *name));
static int library_search PARAMS ((char **lib, time_t *mtime_ptr)); static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
extern time_t f_mtime PARAMS ((struct file *file, int search));
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing /* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
@@ -64,6 +61,9 @@ extern time_t f_mtime PARAMS ((struct file *file, int search));
should only make one goal at a time and return as soon as one goal whose should only make one goal at a time and return as soon as one goal whose
`changed' member is nonzero is successfully made. */ `changed' member is nonzero is successfully made. */
/* We need to know this "lower down" for correct error handling. */
static int updating_makefiles = 0;
int int
update_goal_chain (goals, makefiles) update_goal_chain (goals, makefiles)
register struct dep *goals; register struct dep *goals;
@@ -73,6 +73,8 @@ update_goal_chain (goals, makefiles)
unsigned int j = job_slots; unsigned int j = job_slots;
int status = -1; int status = -1;
updating_makefiles = makefiles;
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \ #define MTIME(file) (makefiles ? file_mtime_no_search (file) \
: file_mtime (file)) : file_mtime (file))
@@ -100,6 +102,9 @@ update_goal_chain (goals, makefiles)
job_slots = 1; job_slots = 1;
#endif #endif
/* All files start with the considered bit 0, so the global value is 1. */
considered = 1;
/* Update all the goals until they are all finished. */ /* Update all the goals until they are all finished. */
while (goals != 0) while (goals != 0)
@@ -119,7 +124,7 @@ update_goal_chain (goals, makefiles)
while (g != 0) while (g != 0)
{ {
/* Iterate over all double-colon entries for this file. */ /* Iterate over all double-colon entries for this file. */
struct file *file = g->file; struct file *file;
int stop = 0, any_not_updated = 0; int stop = 0, any_not_updated = 0;
for (file = g->file->double_colon ? g->file->double_colon : g->file; for (file = g->file->double_colon ? g->file->double_colon : g->file;
@@ -128,7 +133,6 @@ update_goal_chain (goals, makefiles)
{ {
unsigned int ocommands_started; unsigned int ocommands_started;
int x; int x;
time_t mtime = MTIME (file);
check_renamed (file); check_renamed (file);
if (makefiles) if (makefiles)
{ {
@@ -175,7 +179,8 @@ update_goal_chain (goals, makefiles)
stop = (!keep_going_flag && !question_flag stop = (!keep_going_flag && !question_flag
&& !makefiles); && !makefiles);
} }
else if (MTIME (file) != mtime) else if (file->updated && g->changed &&
file->last_mtime != file->mtime_before_update)
{ {
/* Updating was done. If this is a makefile and /* Updating was done. If this is a makefile and
just_print_flag or question_flag is set just_print_flag or question_flag is set
@@ -217,8 +222,8 @@ update_goal_chain (goals, makefiles)
/* Never give a message under -s or -q. */ /* Never give a message under -s or -q. */
&& !silent_flag && !question_flag) && !silent_flag && !question_flag)
message (1, ((file->phony || file->cmds == 0) message (1, ((file->phony || file->cmds == 0)
? "Nothing to be done for `%s'." ? _("Nothing to be done for `%s'.")
: "`%s' is up to date."), : _("`%s' is up to date.")),
file->name); file->name);
/* This goal is finished. Remove it from the chain. */ /* This goal is finished. Remove it from the chain. */
@@ -241,6 +246,11 @@ update_goal_chain (goals, makefiles)
g = g->next; g = g->next;
} }
} }
/* If we reached the end of the dependency graph toggle the considered
flag for the next pass. */
if (g == 0)
considered = !considered;
} }
if (makefiles) if (makefiles)
@@ -260,29 +270,30 @@ no_rule_error(file)
struct file *file; struct file *file;
{ {
static const char msg_noparent[] static const char msg_noparent[]
= "%sNo rule to make target `%s'%s"; = _("%sNo rule to make target `%s'%s");
static const char msg_parent[] static const char msg_parent[]
= "%sNo rule to make target `%s', needed by `%s'%s"; = _("%sNo rule to make target `%s', needed by `%s'%s");
if (keep_going_flag || file->dontcare) if (keep_going_flag || file->dontcare)
{ {
if (!file->dontcare) /* If the previous attempt was made while we were creating
makefiles, but we aren't anymore, print an error now. */
if (!file->dontcare
|| (file->mfile_status && !updating_makefiles))
{ {
if (file->parent == 0) if (file->parent == 0)
error (msg_noparent, "*** ", file->name, "."); error (NILF, msg_noparent, "*** ", file->name, ".");
else else
error (msg_parent, "*** ", error (NILF, msg_parent, "*** ",
file->name, file->parent->name, "."); file->name, file->parent->name, ".");
file->shownerror = 1;
} }
file->update_status = 2; file->update_status = 2;
file->mfile_status = updating_makefiles;
} }
else if (file->parent == 0)
fatal (NILF, msg_noparent, "", file->name, "");
else else
{ fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
if (file->parent == 0)
fatal (msg_noparent, "", file->name, "");
else
fatal (msg_parent, "", file->name, file->parent->name, "");
}
} }
/* If FILE is not up to date, execute the commands for it. /* If FILE is not up to date, execute the commands for it.
@@ -305,6 +316,17 @@ update_file (file, depth)
register int status = 0; register int status = 0;
register struct file *f; register struct file *f;
/* Prune the dependency graph: if we've already been here on _this_ pass
through the dependency graph, we don't have to go any further. We won't
reap_children until we start the next pass, so no state change is
possible below here until then. */
if (file->considered == considered)
{
DEBUGPR (_("Pruning file `%s'.\n"));
return 0;
}
file->considered = considered;
for (f = file->double_colon ? file->double_colon : file; f != 0; f = f->prev) for (f = file->double_colon ? file->double_colon : file; f != 0; f = f->prev)
{ {
status |= update_file_1 (f, depth); status |= update_file_1 (f, depth);
@@ -341,30 +363,24 @@ update_file_1 (file, depth)
struct file *file; struct file *file;
unsigned int depth; unsigned int depth;
{ {
register time_t this_mtime; register FILE_TIMESTAMP this_mtime;
int noexist, must_make, deps_changed; int noexist, must_make, deps_changed;
int dep_status = 0; int dep_status = 0;
register struct dep *d, *lastd; register struct dep *d, *lastd;
int running = 0; int running = 0;
DEBUGPR ("Considering target file `%s'.\n"); DEBUGPR (_("Considering target file `%s'.\n"));
if (file->updated) if (file->updated)
{ {
if (file->update_status > 0) if (file->update_status > 0)
{ {
DEBUGPR ("Recently tried and failed to update file `%s'.\n"); DEBUGPR (_("Recently tried and failed to update file `%s'.\n"));
if (!file->shownerror) no_rule_error(file);
{
int dontcare = file->dontcare;
file->dontcare = 0;
no_rule_error(file);
file->dontcare = dontcare;
}
return file->update_status; return file->update_status;
} }
DEBUGPR ("File `%s' was considered already.\n"); DEBUGPR (_("File `%s' was considered already.\n"));
return 0; return 0;
} }
@@ -374,10 +390,10 @@ update_file_1 (file, depth)
case cs_deps_running: case cs_deps_running:
break; break;
case cs_running: case cs_running:
DEBUGPR ("Still updating file `%s'.\n"); DEBUGPR (_("Still updating file `%s'.\n"));
return 0; return 0;
case cs_finished: case cs_finished:
DEBUGPR ("Finished updating file `%s'.\n"); DEBUGPR (_("Finished updating file `%s'.\n"));
return file->update_status; return file->update_status;
default: default:
abort (); abort ();
@@ -396,9 +412,9 @@ update_file_1 (file, depth)
this_mtime = file_mtime (file); this_mtime = file_mtime (file);
check_renamed (file); check_renamed (file);
noexist = this_mtime == (time_t) -1; noexist = this_mtime == (FILE_TIMESTAMP) -1;
if (noexist) if (noexist)
DEBUGPR ("File `%s' does not exist.\n"); DEBUGPR (_("File `%s' does not exist.\n"));
must_make = noexist; must_make = noexist;
@@ -408,15 +424,15 @@ update_file_1 (file, depth)
if (!file->phony && file->cmds == 0 && !file->tried_implicit) if (!file->phony && file->cmds == 0 && !file->tried_implicit)
{ {
if (try_implicit_rule (file, depth)) if (try_implicit_rule (file, depth))
DEBUGPR ("Found an implicit rule for `%s'.\n"); DEBUGPR (_("Found an implicit rule for `%s'.\n"));
else else
DEBUGPR ("No implicit rule found for `%s'.\n"); DEBUGPR (_("No implicit rule found for `%s'.\n"));
file->tried_implicit = 1; file->tried_implicit = 1;
} }
if (file->cmds == 0 && !file->is_target if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0) && default_file != 0 && default_file->cmds != 0)
{ {
DEBUGPR ("Using default commands for `%s'.\n"); DEBUGPR (_("Using default commands for `%s'.\n"));
file->cmds = default_file->cmds; file->cmds = default_file->cmds;
} }
@@ -427,7 +443,7 @@ update_file_1 (file, depth)
d = file->deps; d = file->deps;
while (d != 0) while (d != 0)
{ {
time_t mtime; FILE_TIMESTAMP mtime;
check_renamed (d->file); check_renamed (d->file);
@@ -436,7 +452,7 @@ update_file_1 (file, depth)
if (d->file->updating) if (d->file->updating)
{ {
error ("Circular %s <- %s dependency dropped.", error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name); file->name, d->file->name);
/* We cannot free D here because our the caller will still have /* We cannot free D here because our the caller will still have
a reference to it when we were called recursively via a reference to it when we were called recursively via
@@ -484,7 +500,7 @@ update_file_1 (file, depth)
for (d = file->deps; d != 0; d = d->next) for (d = file->deps; d != 0; d = d->next)
if (d->file->intermediate) if (d->file->intermediate)
{ {
time_t mtime = file_mtime (d->file); FILE_TIMESTAMP mtime = file_mtime (d->file);
check_renamed (d->file); check_renamed (d->file);
d->file->parent = file; d->file->parent = file;
dep_status |= update_file (d->file, depth); dep_status |= update_file (d->file, depth);
@@ -514,13 +530,13 @@ update_file_1 (file, depth)
file->updating = 0; file->updating = 0;
DEBUGPR ("Finished dependencies of target file `%s'.\n"); DEBUGPR (_("Finished dependencies of target file `%s'.\n"));
if (running) if (running)
{ {
set_command_state (file, cs_deps_running); set_command_state (file, cs_deps_running);
--depth; --depth;
DEBUGPR ("The dependencies of `%s' are being made.\n"); DEBUGPR (_("The dependencies of `%s' are being made.\n"));
return 0; return 0;
} }
@@ -533,11 +549,11 @@ update_file_1 (file, depth)
depth--; depth--;
DEBUGPR ("Giving up on target file `%s'.\n"); DEBUGPR (_("Giving up on target file `%s'.\n"));
if (depth == 0 && keep_going_flag if (depth == 0 && keep_going_flag
&& !just_print_flag && !question_flag) && !just_print_flag && !question_flag)
error ("Target `%s' not remade because of errors.", file->name); error (NILF, _("Target `%s' not remade because of errors."), file->name);
return dep_status; return dep_status;
} }
@@ -559,13 +575,13 @@ update_file_1 (file, depth)
deps_changed = 0; deps_changed = 0;
for (d = file->deps; d != 0; d = d->next) for (d = file->deps; d != 0; d = d->next)
{ {
time_t 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 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 == (time_t) -1 && !d->file->intermediate) if (d_mtime == (FILE_TIMESTAMP) -1 && !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;
@@ -581,11 +597,11 @@ update_file_1 (file, depth)
if (debug_flag && !noexist) if (debug_flag && !noexist)
{ {
print_spaces (depth); print_spaces (depth);
if (d_mtime == (time_t) -1) if (d_mtime == (FILE_TIMESTAMP) -1)
printf ("Dependency `%s' does not exist.\n", dep_name (d)); printf (_("Dependency `%s' does not exist.\n"), dep_name (d));
else else
printf ("Dependency `%s' is %s than dependent `%s'.\n", printf (_("Dependency `%s' is %s than dependent `%s'.\n"),
dep_name (d), d->changed ? "newer" : "older", file->name); dep_name (d), d->changed ? _("newer") : _("older"), file->name);
fflush (stdout); fflush (stdout);
} }
} }
@@ -596,12 +612,12 @@ update_file_1 (file, depth)
if (file->double_colon && file->deps == 0) if (file->double_colon && file->deps == 0)
{ {
must_make = 1; must_make = 1;
DEBUGPR ("Target `%s' is double-colon and has no dependencies.\n"); DEBUGPR (_("Target `%s' is double-colon and has no dependencies.\n"));
} }
else if (!noexist && file->is_target && !deps_changed && file->cmds == 0) else if (!noexist && file->is_target && !deps_changed && file->cmds == 0)
{ {
must_make = 0; must_make = 0;
DEBUGPR ("No commands for `%s' and no dependencies actually changed.\n"); DEBUGPR (_("No commands for `%s' and no dependencies actually changed.\n"));
} }
if (!must_make) if (!must_make)
@@ -609,9 +625,9 @@ update_file_1 (file, depth)
if (debug_flag) if (debug_flag)
{ {
print_spaces(depth); print_spaces(depth);
printf("No need to remake target `%s'", file->name); printf(_("No need to remake target `%s'"), file->name);
if (!streq(file->name, file->hname)) if (!streq(file->name, file->hname))
printf("; using VPATH name `%s'", file->hname); printf(_("; using VPATH name `%s'"), file->hname);
printf(".\n"); printf(".\n");
fflush(stdout); fflush(stdout);
} }
@@ -631,7 +647,7 @@ update_file_1 (file, depth)
return 0; return 0;
} }
DEBUGPR ("Must remake target `%s'.\n"); DEBUGPR (_("Must remake target `%s'.\n"));
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the /* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
VPATH. */ VPATH. */
@@ -640,7 +656,7 @@ update_file_1 (file, depth)
if (debug_flag) if (debug_flag)
{ {
print_spaces (depth); print_spaces (depth);
printf(" Ignoring VPATH name `%s'.\n", file->hname); printf(_(" Ignoring VPATH name `%s'.\n"), file->hname);
fflush(stdout); fflush(stdout);
} }
file->ignore_vpath = 1; file->ignore_vpath = 1;
@@ -651,20 +667,20 @@ update_file_1 (file, depth)
if (file->command_state != cs_finished) if (file->command_state != cs_finished)
{ {
DEBUGPR ("Commands of `%s' are being run.\n"); DEBUGPR (_("Commands of `%s' are being run.\n"));
return 0; return 0;
} }
switch (file->update_status) switch (file->update_status)
{ {
case 2: case 2:
DEBUGPR ("Failed to remake target file `%s'.\n"); DEBUGPR (_("Failed to remake target file `%s'.\n"));
break; break;
case 0: case 0:
DEBUGPR ("Successfully remade target file `%s'.\n"); DEBUGPR (_("Successfully remade target file `%s'.\n"));
break; break;
case 1: case 1:
DEBUGPR ("Target file `%s' needs remade under -q.\n"); DEBUGPR (_("Target file `%s' needs remade under -q.\n"));
break; break;
default: default:
assert (file->update_status >= 0 && file->update_status <= 2); assert (file->update_status >= 0 && file->update_status <= 2);
@@ -724,6 +740,9 @@ notice_finished_file (file)
{ {
struct file *f; struct file *f;
assert(file->mtime_before_update == 0);
file->mtime_before_update = file->last_mtime;
if (just_print_flag || question_flag if (just_print_flag || question_flag
|| (file->is_target && file->cmds == 0)) || (file->is_target && file->cmds == 0))
file->last_mtime = NEW_MTIME; file->last_mtime = NEW_MTIME;
@@ -771,7 +790,7 @@ static int
check_dep (file, depth, this_mtime, must_make_ptr) check_dep (file, depth, this_mtime, must_make_ptr)
struct file *file; struct file *file;
unsigned int depth; unsigned int depth;
time_t this_mtime; FILE_TIMESTAMP this_mtime;
int *must_make_ptr; int *must_make_ptr;
{ {
register struct dep *d; register struct dep *d;
@@ -784,32 +803,31 @@ check_dep (file, depth, this_mtime, must_make_ptr)
/* If this is a non-intermediate file, update it and record /* If this is a non-intermediate file, update it and record
whether it is newer than THIS_MTIME. */ whether it is newer than THIS_MTIME. */
{ {
time_t mtime; FILE_TIMESTAMP mtime;
dep_status = update_file (file, depth); dep_status = update_file (file, depth);
check_renamed (file); check_renamed (file);
mtime = file_mtime (file); mtime = file_mtime (file);
check_renamed (file); check_renamed (file);
if (mtime == (time_t) -1 || mtime > this_mtime) if (mtime == (FILE_TIMESTAMP) -1 || mtime > this_mtime)
*must_make_ptr = 1; *must_make_ptr = 1;
} }
else else
{ {
/* FILE is an intermediate file. */ /* FILE is an intermediate file. */
time_t mtime; FILE_TIMESTAMP mtime;
if (!file->phony && file->cmds == 0 && !file->tried_implicit if (!file->phony && file->cmds == 0 && !file->tried_implicit)
&& file->secondary)
{ {
if (try_implicit_rule (file, depth)) if (try_implicit_rule (file, depth))
DEBUGPR ("Found an implicit rule for `%s'.\n"); DEBUGPR (_("Found an implicit rule for `%s'.\n"));
else else
DEBUGPR ("No implicit rule found for `%s'.\n"); DEBUGPR (_("No implicit rule found for `%s'.\n"));
file->tried_implicit = 1; file->tried_implicit = 1;
} }
if (file->cmds == 0 && !file->is_target && file->secondary if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0) && default_file != 0 && default_file->cmds != 0)
{ {
DEBUGPR ("Using default commands for `%s'.\n"); DEBUGPR (_("Using default commands for `%s'.\n"));
file->cmds = default_file->cmds; file->cmds = default_file->cmds;
} }
@@ -818,7 +836,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
check_renamed (file); check_renamed (file);
mtime = file_mtime (file); mtime = file_mtime (file);
check_renamed (file); check_renamed (file);
if (mtime != (time_t) -1 && mtime > this_mtime) if (mtime != (FILE_TIMESTAMP) -1 && mtime > this_mtime)
*must_make_ptr = 1; *must_make_ptr = 1;
/* Otherwise, update all non-intermediate files we depend on, /* Otherwise, update all non-intermediate files we depend on,
if necessary, and see whether any of them is more if necessary, and see whether any of them is more
@@ -833,7 +851,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
{ {
if (d->file->updating) if (d->file->updating)
{ {
error ("Circular %s <- %s dependency dropped.", error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name); file->name, d->file->name);
if (lastd == 0) if (lastd == 0)
{ {
@@ -858,7 +876,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
if (d->file->command_state == cs_running if (d->file->command_state == cs_running
|| d->file->command_state == cs_deps_running) || d->file->command_state == cs_deps_running)
/* Record that some of FILE's dependencies are still being made. /* Record that some of FILE's deps are still being made.
This tells the upper levels to wait on processing it until This tells the upper levels to wait on processing it until
the commands are finished. */ the commands are finished. */
set_command_state (file, cs_deps_running); set_command_state (file, cs_deps_running);
@@ -900,13 +918,10 @@ touch_file (file)
char buf; char buf;
int status; int status;
#ifdef EINTR
do do
#endif
status = fstat (fd, &statbuf); status = fstat (fd, &statbuf);
#ifdef EINTR while (status < 0 && EINTR_SET);
while (status < 0 && errno == EINTR);
#endif
if (status < 0) if (status < 0)
TOUCH_ERROR ("touch: fstat: "); TOUCH_ERROR ("touch: fstat: ");
/* Rewrite character 0 same as it already is. */ /* Rewrite character 0 same as it already is. */
@@ -978,12 +993,12 @@ remake_file (file)
the library's actual name (/lib/libLIBNAME.a, etc.) is substituted into the library's actual name (/lib/libLIBNAME.a, etc.) is substituted into
FILE. */ FILE. */
time_t FILE_TIMESTAMP
f_mtime (file, search) f_mtime (file, search)
register struct file *file; register struct file *file;
int search; int search;
{ {
time_t mtime; FILE_TIMESTAMP mtime;
/* File's mtime is not known; must get it from the system. */ /* File's mtime is not known; must get it from the system. */
@@ -1049,9 +1064,9 @@ f_mtime (file, search)
free (arname); free (arname);
free (memname); free (memname);
if (mtime == (time_t) -1) if (mtime == (FILE_TIMESTAMP) -1)
/* The archive doesn't exist, so it's members don't exist either. */ /* The archive doesn't exist, so it's members don't exist either. */
return (time_t) -1; return (FILE_TIMESTAMP) -1;
mtime = ar_member_date (file->hname); mtime = ar_member_date (file->hname);
} }
@@ -1060,7 +1075,7 @@ f_mtime (file, search)
{ {
mtime = name_mtime (file->name); mtime = name_mtime (file->name);
if (mtime == (time_t) -1 && search && !file->ignore_vpath) if (mtime == (FILE_TIMESTAMP) -1 && search && !file->ignore_vpath)
{ {
/* If name_mtime failed, search VPATH. */ /* If name_mtime failed, search VPATH. */
char *name = file->name; char *name = file->name;
@@ -1098,16 +1113,15 @@ f_mtime (file, search)
We only need to do this once, for now. */ We only need to do this once, for now. */
static time_t now = 0; static FILE_TIMESTAMP now = 0;
if (!clock_skew_detected if (!clock_skew_detected
&& mtime != (time_t)-1 && mtime > now && mtime != (FILE_TIMESTAMP)-1 && mtime > now
&& !file->updated) && !file->updated)
{ {
/* This file's time appears to be in the future. /* This file's time appears to be in the future.
Update our concept of the present, and compare again. */ Update our concept of the present, and compare again. */
extern time_t time (); now = file_timestamp_now ();
time (&now);
#ifdef WINDOWS32 #ifdef WINDOWS32
/* /*
@@ -1126,8 +1140,13 @@ f_mtime (file, search)
#endif #endif
#endif #endif
{ {
error("*** Warning: File `%s' has modification time in the future (%ld > %ld)", char mtimebuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
file->name, mtime, now); char nowbuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
file_timestamp_sprintf (mtimebuf, mtime);
file_timestamp_sprintf (nowbuf, now);
error (NILF, _("*** Warning: File `%s' has modification time in the future (%s > %s)"),
file->name, mtimebuf, nowbuf);
clock_skew_detected = 1; clock_skew_detected = 1;
} }
} }
@@ -1136,11 +1155,22 @@ f_mtime (file, search)
/* Store the mtime into all the entries for this file. */ /* Store the mtime into all the entries for this file. */
if (file->double_colon) if (file->double_colon)
file = file->double_colon; file = file->double_colon;
do do
{ {
/* If this file is not implicit but it is intermediate then it was
made so by the .INTERMEDIATE target. If this file has never
been built by us but was found now, it existed before make
started. So, turn off the intermediate bit so make doesn't
delete it, since it didn't create it. */
if (mtime != (FILE_TIMESTAMP)-1 && file->command_state == cs_not_started
&& !file->tried_implicit && file->intermediate)
file->intermediate = 0;
file->last_mtime = mtime; file->last_mtime = mtime;
file = file->prev; file = file->prev;
} while (file != 0); }
while (file != 0);
return mtime; return mtime;
} }
@@ -1148,16 +1178,16 @@ f_mtime (file, search)
/* Return the mtime of the file or archive-member reference NAME. */ /* Return the mtime of the file or archive-member reference NAME. */
static time_t static FILE_TIMESTAMP
name_mtime (name) name_mtime (name)
register char *name; register char *name;
{ {
struct stat st; struct stat st;
if (stat (name, &st) < 0) if (stat (name, &st) < 0)
return (time_t) -1; return (FILE_TIMESTAMP) -1;
return (time_t) st.st_mtime; return FILE_TIMESTAMP_STAT_MODTIME (st);
} }
@@ -1168,7 +1198,7 @@ name_mtime (name)
static int static int
library_search (lib, mtime_ptr) library_search (lib, mtime_ptr)
char **lib; char **lib;
time_t *mtime_ptr; FILE_TIMESTAMP *mtime_ptr;
{ {
static char *dirs[] = static char *dirs[] =
{ {
@@ -1187,82 +1217,111 @@ library_search (lib, mtime_ptr)
0 0
}; };
char *libname = &(*lib)[2]; /* Name without the `-l'. */ static char *libpatterns = NULL;
time_t mtime;
char *libname = &(*lib)[2]; /* Name without the `-l'. */
FILE_TIMESTAMP mtime;
/* Loop variables for the libpatterns value. */
char *p, *p2;
int len;
/* Buffer to construct possible names in. */
char *buf = xmalloc (sizeof (LIBDIR) + 8 + strlen (libname) + 4 + 2 + 1);
char *file, **dp; char *file, **dp;
/* Look first for `libNAME.a' in the current directory. */ /* If we don't have libpatterns, get it. */
if (!libpatterns)
#ifndef _AMIGA
sprintf (buf, "lib%s.a", libname);
#else
sprintf (buf, "%s.lib", libname);
#endif
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{ {
*lib = buf; int save = warn_undefined_variables_flag;
if (mtime_ptr != 0) warn_undefined_variables_flag = 0;
*mtime_ptr = mtime;
return 1; libpatterns = xstrdup (variable_expand ("$(strip $(.LIBPATTERNS))"));
warn_undefined_variables_flag = save;
} }
/* Now try VPATH search on that. */ /* Loop through all the patterns in .LIBPATTERNS, and search on each one. */
p2 = libpatterns;
file = buf; while ((p = find_next_token (&p2, &len)) != 0)
if (vpath_search (&file, mtime_ptr))
{ {
free (buf); static char *buf = NULL;
*lib = file; static int buflen = 0;
return 1; static int libdir_maxlen = -1;
} char *libbuf = variable_expand ("");
/* Now try the standard set of directories. */ /* Expand the pattern using LIBNAME as a replacement. */
#ifdef __MSDOS__
{
/* The default library directory is at ${DJDIR}/lib. */
struct variable *djdir = lookup_variable ("DJDIR", 5);
if (djdir)
{ {
size_t djdir_len = strlen (djdir->value); char c = p[len];
char *p3, *p4;
if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2) p[len] = '\0';
buf = (char *) xrealloc (djdir_len + 1); p3 = find_percent (p);
sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname); if (!p3)
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{ {
*lib = buf; /* Give a warning if there is no pattern, then remove the
if (mtime_ptr != 0) pattern so it's ignored next time. */
*mtime_ptr = mtime; error (NILF, _(".LIBPATTERNS element `%s' is not a pattern"), p);
return 1; for (; len; --len, ++p)
*p = ' ';
*p = c;
continue;
} }
p4 = variable_buffer_output (libbuf, p, p3-p);
p4 = variable_buffer_output (p4, libname, strlen (libname));
p4 = variable_buffer_output (p4, p3+1, len - (p3-p));
p[len] = c;
} }
}
#endif
for (dp = dirs; *dp != 0; ++dp) /* Look first for `libNAME.a' in the current directory. */
{ mtime = name_mtime (libbuf);
#ifndef _AMIGA if (mtime != (FILE_TIMESTAMP) -1)
sprintf (buf, "%s/lib%s.a", *dp, libname);
#else
sprintf (buf, "%s/%s.lib", *dp, libname);
#endif
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{ {
*lib = buf; *lib = xstrdup (libbuf);
if (mtime_ptr != 0) if (mtime_ptr != 0)
*mtime_ptr = mtime; *mtime_ptr = mtime;
return 1; return 1;
} }
/* Now try VPATH search on that. */
file = libbuf;
if (vpath_search (&file, mtime_ptr))
{
*lib = file;
return 1;
}
/* Now try the standard set of directories. */
if (!buflen)
{
for (dp = dirs; *dp != 0; ++dp)
{
int l = strlen (*dp);
if (l > libdir_maxlen)
libdir_maxlen = l;
}
buflen = strlen (libbuf);
buf = xmalloc(libdir_maxlen + buflen + 2);
}
else if (buflen < strlen (libbuf))
{
buflen = strlen (libbuf);
buf = xrealloc (buf, libdir_maxlen + buflen + 2);
}
for (dp = dirs; *dp != 0; ++dp)
{
sprintf (buf, "%s/%s", *dp, libbuf);
mtime = name_mtime (buf);
if (mtime != (FILE_TIMESTAMP) -1)
{
*lib = xstrdup (buf);
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
}
}
} }
free (buf);
return 0; return 0;
} }

View File

@@ -18,7 +18,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "job.h" #include "job.h"
@@ -157,7 +158,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
retsock = Rpc_UdpCreate (True, 0); retsock = Rpc_UdpCreate (True, 0);
if (retsock < 0) if (retsock < 0)
{ {
error ("exporting: Couldn't create return socket."); error (NILF, "exporting: Couldn't create return socket.");
return 1; return 1;
} }
@@ -202,7 +203,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
{ {
(void) close (retsock); (void) close (retsock);
(void) close (sock); (void) close (sock);
error ("exporting to %s: %s", error (NILF, "exporting to %s: %s",
host ? host->h_name : inet_ntoa (permit.addr), host ? host->h_name : inet_ntoa (permit.addr),
Rpc_ErrorMessage (status)); Rpc_ErrorMessage (status));
return 1; return 1;
@@ -211,14 +212,14 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
{ {
(void) close (retsock); (void) close (retsock);
(void) close (sock); (void) close (sock);
error ("exporting to %s: %s", error (NILF, "exporting to %s: %s",
host ? host->h_name : inet_ntoa (permit.addr), host ? host->h_name : inet_ntoa (permit.addr),
msg); msg);
return 1; return 1;
} }
else else
{ {
error ("*** exported to %s (id %u)", error (NILF, "*** exported to %s (id %u)",
host ? host->h_name : inet_ntoa (permit.addr), host ? host->h_name : inet_ntoa (permit.addr),
permit.id); permit.id);
} }

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"

89
rule.c
View File

@@ -1,5 +1,5 @@
/* Pattern and suffix rule internals for GNU Make. /* Pattern and suffix rule internals for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. Copyright (C) 1988,89,90,91,92,93, 1998 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -333,27 +334,29 @@ new_pattern_rule (rule, override)
if (!streq (dep_name (d), dep_name (d2))) if (!streq (dep_name (d), dep_name (d2)))
break; break;
if (d == 0 && d2 == 0) if (d == 0 && d2 == 0)
/* All the dependencies matched. */ {
if (override) /* All the dependencies matched. */
{ if (override)
/* Remove the old rule. */ {
freerule (r, lastrule); /* Remove the old rule. */
/* Install the new one. */ freerule (r, lastrule);
if (pattern_rules == 0) /* Install the new one. */
pattern_rules = rule; if (pattern_rules == 0)
else pattern_rules = rule;
last_pattern_rule->next = rule; else
last_pattern_rule = rule; last_pattern_rule->next = rule;
last_pattern_rule = rule;
/* We got one. Stop looking. */ /* We got one. Stop looking. */
goto matched; goto matched;
} }
else else
{ {
/* The old rule stays intact. Destroy the new one. */ /* The old rule stays intact. Destroy the new one. */
freerule (rule, (struct rule *) 0); freerule (rule, (struct rule *) 0);
return 0; return 0;
} }
}
} }
} }
@@ -416,11 +419,11 @@ install_pattern_rule (p, terminal)
{ {
r->terminal = terminal; r->terminal = terminal;
r->cmds = (struct commands *) xmalloc (sizeof (struct commands)); r->cmds = (struct commands *) xmalloc (sizeof (struct commands));
r->cmds->filename = 0; r->cmds->fileinfo.filenm = 0;
r->cmds->lineno = 0; r->cmds->fileinfo.lineno = 0;
/* These will all be string literals, but we malloc space for them /* These will all be string literals, but we malloc space for them
anyway because somebody might want to free them later. */ anyway because somebody might want to free them later. */
r->cmds->commands = savestring (p->commands, strlen (p->commands)); r->cmds->commands = xstrdup (p->commands);
r->cmds->command_lines = 0; r->cmds->command_lines = 0;
} }
} }
@@ -436,10 +439,23 @@ freerule (rule, lastrule)
{ {
struct rule *next = rule->next; struct rule *next = rule->next;
register unsigned int i; register unsigned int i;
register struct dep *dep;
for (i = 0; rule->targets[i] != 0; ++i) for (i = 0; rule->targets[i] != 0; ++i)
free (rule->targets[i]); free (rule->targets[i]);
dep = rule->deps;
while (dep)
{
struct dep *t;
t = dep->next;
/* We might leak dep->name here, but I'm not sure how to fix this: I
think that pointer might be shared (e.g., in the file hash?) */
free ((char *) dep);
dep = t;
}
free ((char *) rule->targets); free ((char *) rule->targets);
free ((char *) rule->suffixes); free ((char *) rule->suffixes);
free ((char *) rule->lens); free ((char *) rule->lens);
@@ -583,7 +599,7 @@ lookup_pattern_var (target)
stemlen = targlen - p->len + 1; stemlen = targlen - p->len + 1;
/* Compare the text in the pattern before the stem, if any. */ /* Compare the text in the pattern before the stem, if any. */
if (stem > target && strncmp (p->target, target, stem - target)) if (stem > target && !strneq (p->target, target, stem - target))
continue; continue;
/* Compare the text in the pattern after the stem, if any. /* Compare the text in the pattern after the stem, if any.
@@ -648,10 +664,10 @@ print_rule_data_base ()
} }
if (rules == 0) if (rules == 0)
puts ("\n# No implicit rules."); puts (_("\n# No implicit rules."));
else else
{ {
printf ("\n# %u implicit rules, %u", rules, terminal); printf (_("\n# %u implicit rules, %u"), rules, terminal);
#ifndef NO_FLOAT #ifndef NO_FLOAT
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0); printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
#else #else
@@ -660,14 +676,19 @@ print_rule_data_base ()
printf (" (%d.%d%%)", f/10, f%10); printf (" (%d.%d%%)", f/10, f%10);
} }
#endif #endif
puts (" terminal."); puts (_(" terminal."));
} }
if (num_pattern_rules != rules) if (num_pattern_rules != rules)
fatal ("BUG: num_pattern_rules wrong! %u != %u", {
num_pattern_rules, rules); /* This can happen if a fatal error was detected while reading the
makefiles and thus count_implicit_rule_limits wasn't called yet. */
if (num_pattern_rules != 0)
fatal (NILF, _("BUG: num_pattern_rules wrong! %u != %u"),
num_pattern_rules, rules);
}
puts ("\n# Pattern-specific variable values"); puts (_("\n# Pattern-specific variable values"));
{ {
struct pattern_var *p; struct pattern_var *p;
@@ -682,10 +703,10 @@ print_rule_data_base ()
} }
if (rules == 0) if (rules == 0)
puts ("\n# No pattern-specific variable values."); puts (_("\n# No pattern-specific variable values."));
else else
{ {
printf ("\n# %u pattern-specific variable values", rules); printf (_("\n# %u pattern-specific variable values"), rules);
} }
} }
} }

10
rule.h
View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Structure used for pattern rules. */ /* Structure used for pattern rules. */
@@ -62,3 +63,10 @@ extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
extern int new_pattern_rule PARAMS ((struct rule *rule, int override)); extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix)); extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
extern struct pattern_var *lookup_pattern_var PARAMS ((char *target)); extern struct pattern_var *lookup_pattern_var PARAMS ((char *target));
extern void count_implicit_rule_limits PARAMS ((void));
extern void convert_to_pattern PARAMS ((void));
extern void create_pattern_rule PARAMS ((char **targets,
char **target_percents, int terminal,
struct dep *deps,
struct commands *commands,
int override));

108
signame.c
View File

@@ -17,9 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H #include "make.h"
#include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> /* Some systems need this for <signal.h>. */ #include <sys/types.h> /* Some systems need this for <signal.h>. */
@@ -56,7 +54,7 @@
/* There is too much variation in Sys V signal numbers and names, so /* There is too much variation in Sys V signal numbers and names, so
we must initialize them at runtime. */ we must initialize them at runtime. */
static const char undoc[] = "unknown signal"; static const char *undoc;
const char *sys_siglist[NSIG]; const char *sys_siglist[NSIG];
@@ -70,12 +68,14 @@ extern char *sys_siglist[];
/* Table of abbreviations for signals. Note: A given number can /* Table of abbreviations for signals. Note: A given number can
appear more than once with different abbreviations. */ appear more than once with different abbreviations. */
#define SIG_TABLE_SIZE (NSIG*2)
typedef struct typedef struct
{ {
int number; int number;
const char *abbrev; const char *abbrev;
} num_abbrev; } num_abbrev;
static num_abbrev sig_table[NSIG*2]; static num_abbrev sig_table[SIG_TABLE_SIZE];
/* Number of elements of sig_table used. */ /* Number of elements of sig_table used. */
static int sig_table_nelts = 0; static int sig_table_nelts = 0;
@@ -88,10 +88,18 @@ init_sig (number, abbrev, name)
const char *name; const char *name;
{ {
#ifndef HAVE_SYS_SIGLIST #ifndef HAVE_SYS_SIGLIST
sys_siglist[number] = name; /* If this value is ever greater than NSIG it seems like it'd be a bug in
the system headers, but... better safe than sorry. We know, for
example, that this isn't always true on VMS. */
if (number >= 0 && number < NSIG)
sys_siglist[number] = name;
#endif #endif
sig_table[sig_table_nelts].number = number; if (sig_table_nelts < SIG_TABLE_SIZE)
sig_table[sig_table_nelts++].abbrev = abbrev; {
sig_table[sig_table_nelts].number = number;
sig_table[sig_table_nelts++].abbrev = abbrev;
}
} }
void void
@@ -99,6 +107,10 @@ signame_init ()
{ {
#ifndef HAVE_SYS_SIGLIST #ifndef HAVE_SYS_SIGLIST
int i; int i;
char *u = _("unknown signal");
undoc = xstrdup(u);
/* Initialize signal names. */ /* Initialize signal names. */
for (i = 0; i < NSIG; i++) for (i = 0; i < NSIG; i++)
sys_siglist[i] = undoc; sys_siglist[i] = undoc;
@@ -106,135 +118,135 @@ signame_init ()
/* Initialize signal names. */ /* Initialize signal names. */
#if defined (SIGHUP) #if defined (SIGHUP)
init_sig (SIGHUP, "HUP", "Hangup"); init_sig (SIGHUP, "HUP", _("Hangup"));
#endif #endif
#if defined (SIGINT) #if defined (SIGINT)
init_sig (SIGINT, "INT", "Interrupt"); init_sig (SIGINT, "INT", _("Interrupt"));
#endif #endif
#if defined (SIGQUIT) #if defined (SIGQUIT)
init_sig (SIGQUIT, "QUIT", "Quit"); init_sig (SIGQUIT, "QUIT", _("Quit"));
#endif #endif
#if defined (SIGILL) #if defined (SIGILL)
init_sig (SIGILL, "ILL", "Illegal Instruction"); init_sig (SIGILL, "ILL", _("Illegal Instruction"));
#endif #endif
#if defined (SIGTRAP) #if defined (SIGTRAP)
init_sig (SIGTRAP, "TRAP", "Trace/breakpoint trap"); init_sig (SIGTRAP, "TRAP", _("Trace/breakpoint trap"));
#endif #endif
/* If SIGIOT == SIGABRT, we want to print it as SIGABRT because /* If SIGIOT == SIGABRT, we want to print it as SIGABRT because
SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */ SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */
#if defined (SIGABRT) #if defined (SIGABRT)
init_sig (SIGABRT, "ABRT", "Aborted"); init_sig (SIGABRT, "ABRT", _("Aborted"));
#endif #endif
#if defined (SIGIOT) #if defined (SIGIOT)
init_sig (SIGIOT, "IOT", "IOT trap"); init_sig (SIGIOT, "IOT", _("IOT trap"));
#endif #endif
#if defined (SIGEMT) #if defined (SIGEMT)
init_sig (SIGEMT, "EMT", "EMT trap"); init_sig (SIGEMT, "EMT", _("EMT trap"));
#endif #endif
#if defined (SIGFPE) #if defined (SIGFPE)
init_sig (SIGFPE, "FPE", "Floating point exception"); init_sig (SIGFPE, "FPE", _("Floating point exception"));
#endif #endif
#if defined (SIGKILL) #if defined (SIGKILL)
init_sig (SIGKILL, "KILL", "Killed"); init_sig (SIGKILL, "KILL", _("Killed"));
#endif #endif
#if defined (SIGBUS) #if defined (SIGBUS)
init_sig (SIGBUS, "BUS", "Bus error"); init_sig (SIGBUS, "BUS", _("Bus error"));
#endif #endif
#if defined (SIGSEGV) #if defined (SIGSEGV)
init_sig (SIGSEGV, "SEGV", "Segmentation fault"); init_sig (SIGSEGV, "SEGV", _("Segmentation fault"));
#endif #endif
#if defined (SIGSYS) #if defined (SIGSYS)
init_sig (SIGSYS, "SYS", "Bad system call"); init_sig (SIGSYS, "SYS", _("Bad system call"));
#endif #endif
#if defined (SIGPIPE) #if defined (SIGPIPE)
init_sig (SIGPIPE, "PIPE", "Broken pipe"); init_sig (SIGPIPE, "PIPE", _("Broken pipe"));
#endif #endif
#if defined (SIGALRM) #if defined (SIGALRM)
init_sig (SIGALRM, "ALRM", "Alarm clock"); init_sig (SIGALRM, "ALRM", _("Alarm clock"));
#endif #endif
#if defined (SIGTERM) #if defined (SIGTERM)
init_sig (SIGTERM, "TERM", "Terminated"); init_sig (SIGTERM, "TERM", _("Terminated"));
#endif #endif
#if defined (SIGUSR1) #if defined (SIGUSR1)
init_sig (SIGUSR1, "USR1", "User defined signal 1"); init_sig (SIGUSR1, "USR1", _("User defined signal 1"));
#endif #endif
#if defined (SIGUSR2) #if defined (SIGUSR2)
init_sig (SIGUSR2, "USR2", "User defined signal 2"); init_sig (SIGUSR2, "USR2", _("User defined signal 2"));
#endif #endif
/* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that /* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that
is what is in POSIX.1. */ is what is in POSIX.1. */
#if defined (SIGCHLD) #if defined (SIGCHLD)
init_sig (SIGCHLD, "CHLD", "Child exited"); init_sig (SIGCHLD, "CHLD", _("Child exited"));
#endif #endif
#if defined (SIGCLD) #if defined (SIGCLD)
init_sig (SIGCLD, "CLD", "Child exited"); init_sig (SIGCLD, "CLD", _("Child exited"));
#endif #endif
#if defined (SIGPWR) #if defined (SIGPWR)
init_sig (SIGPWR, "PWR", "Power failure"); init_sig (SIGPWR, "PWR", _("Power failure"));
#endif #endif
#if defined (SIGTSTP) #if defined (SIGTSTP)
init_sig (SIGTSTP, "TSTP", "Stopped"); init_sig (SIGTSTP, "TSTP", _("Stopped"));
#endif #endif
#if defined (SIGTTIN) #if defined (SIGTTIN)
init_sig (SIGTTIN, "TTIN", "Stopped (tty input)"); init_sig (SIGTTIN, "TTIN", _("Stopped (tty input)"));
#endif #endif
#if defined (SIGTTOU) #if defined (SIGTTOU)
init_sig (SIGTTOU, "TTOU", "Stopped (tty output)"); init_sig (SIGTTOU, "TTOU", _("Stopped (tty output)"));
#endif #endif
#if defined (SIGSTOP) #if defined (SIGSTOP)
init_sig (SIGSTOP, "STOP", "Stopped (signal)"); init_sig (SIGSTOP, "STOP", _("Stopped (signal)"));
#endif #endif
#if defined (SIGXCPU) #if defined (SIGXCPU)
init_sig (SIGXCPU, "XCPU", "CPU time limit exceeded"); init_sig (SIGXCPU, "XCPU", _("CPU time limit exceeded"));
#endif #endif
#if defined (SIGXFSZ) #if defined (SIGXFSZ)
init_sig (SIGXFSZ, "XFSZ", "File size limit exceeded"); init_sig (SIGXFSZ, "XFSZ", _("File size limit exceeded"));
#endif #endif
#if defined (SIGVTALRM) #if defined (SIGVTALRM)
init_sig (SIGVTALRM, "VTALRM", "Virtual timer expired"); init_sig (SIGVTALRM, "VTALRM", _("Virtual timer expired"));
#endif #endif
#if defined (SIGPROF) #if defined (SIGPROF)
init_sig (SIGPROF, "PROF", "Profiling timer expired"); init_sig (SIGPROF, "PROF", _("Profiling timer expired"));
#endif #endif
#if defined (SIGWINCH) #if defined (SIGWINCH)
/* "Window size changed" might be more accurate, but even if that /* "Window size changed" might be more accurate, but even if that
is all that it means now, perhaps in the future it will be is all that it means now, perhaps in the future it will be
extended to cover other kinds of window changes. */ extended to cover other kinds of window changes. */
init_sig (SIGWINCH, "WINCH", "Window changed"); init_sig (SIGWINCH, "WINCH", _("Window changed"));
#endif #endif
#if defined (SIGCONT) #if defined (SIGCONT)
init_sig (SIGCONT, "CONT", "Continued"); init_sig (SIGCONT, "CONT", _("Continued"));
#endif #endif
#if defined (SIGURG) #if defined (SIGURG)
init_sig (SIGURG, "URG", "Urgent I/O condition"); init_sig (SIGURG, "URG", _("Urgent I/O condition"));
#endif #endif
#if defined (SIGIO) #if defined (SIGIO)
/* "I/O pending" has also been suggested. A disadvantage is /* "I/O pending" has also been suggested. A disadvantage is
that signal only happens when the process has that signal only happens when the process has
asked for it, not everytime I/O is pending. Another disadvantage asked for it, not everytime I/O is pending. Another disadvantage
is the confusion from giving it a different name than under Unix. */ is the confusion from giving it a different name than under Unix. */
init_sig (SIGIO, "IO", "I/O possible"); init_sig (SIGIO, "IO", _("I/O possible"));
#endif #endif
#if defined (SIGWIND) #if defined (SIGWIND)
init_sig (SIGWIND, "WIND", "SIGWIND"); init_sig (SIGWIND, "WIND", _("SIGWIND"));
#endif #endif
#if defined (SIGPHONE) #if defined (SIGPHONE)
init_sig (SIGPHONE, "PHONE", "SIGPHONE"); init_sig (SIGPHONE, "PHONE", _("SIGPHONE"));
#endif #endif
#if defined (SIGPOLL) #if defined (SIGPOLL)
init_sig (SIGPOLL, "POLL", "I/O possible"); init_sig (SIGPOLL, "POLL", _("I/O possible"));
#endif #endif
#if defined (SIGLOST) #if defined (SIGLOST)
init_sig (SIGLOST, "LOST", "Resource lost"); init_sig (SIGLOST, "LOST", _("Resource lost"));
#endif #endif
#if defined (SIGDANGER) #if defined (SIGDANGER)
init_sig (SIGDANGER, "DANGER", "Danger signal"); init_sig (SIGDANGER, "DANGER", _("Danger signal"));
#endif #endif
#if defined (SIGINFO) #if defined (SIGINFO)
init_sig (SIGINFO, "INFO", "Information request"); init_sig (SIGINFO, "INFO", _("Information request"));
#endif #endif
#if defined (SIGNOFP) #if defined (SIGNOFP)
init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available"); init_sig (SIGNOFP, "NOFP", _("Floating point co-processor not available"));
#endif #endif
} }

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "dep.h" #include "dep.h"
@@ -76,7 +77,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
for (v = set->table[hashval]; v != 0; v = v->next) for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1) && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == '\0') && v->name[length] == '\0')
break; break;
@@ -97,7 +98,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
{ {
if (v->value != 0) if (v->value != 0)
free (v->value); free (v->value);
v->value = savestring (value, strlen (value)); v->value = xstrdup (value);
v->origin = origin; v->origin = origin;
v->recursive = recursive; v->recursive = recursive;
} }
@@ -108,7 +109,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
v = (struct variable *) xmalloc (sizeof (struct variable)); v = (struct variable *) xmalloc (sizeof (struct variable));
v->name = savestring (name, length); v->name = savestring (name, length);
v->value = savestring (value, strlen (value)); v->value = xstrdup (value);
v->origin = origin; v->origin = origin;
v->recursive = recursive; v->recursive = recursive;
v->expanding = 0; v->expanding = 0;
@@ -175,7 +176,7 @@ lookup_variable (name, length)
for (v = set->table[hashval]; v != 0; v = v->next) for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1) && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0) && v->name[length] == 0)
return v; return v;
} }
@@ -204,7 +205,7 @@ lookup_variable_in_set (name, length, set)
for (v = set->table[hash]; v != 0; v = v->next) for (v = set->table[hash]; v != 0; v = v->next)
if (*v->name == *name if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1) && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0) && v->name[length] == 0)
return v; return v;
@@ -265,6 +266,8 @@ pop_variable_scope ()
next = v->next; next = v->next;
free (v->name); free (v->name);
if (v->value)
free (v->value);
free ((char *) v); free ((char *) v);
} }
} }
@@ -443,7 +446,7 @@ define_automatic_variables ()
{ {
free (v->value); free (v->value);
v->origin = o_file; v->origin = o_file;
v->value = savestring (default_shell, strlen (default_shell)); v->value = xstrdup (default_shell);
} }
#endif #endif
@@ -676,9 +679,8 @@ target_environment (file)
returned. */ returned. */
struct variable * struct variable *
try_variable_definition (filename, lineno, line, origin) try_variable_definition (flocp, line, origin)
char *filename; const struct floc *flocp;
unsigned int lineno;
char *line; char *line;
enum variable_origin origin; enum variable_origin origin;
{ {
@@ -688,7 +690,7 @@ try_variable_definition (filename, lineno, line, origin)
register char *end; register char *end;
enum { f_bogus, enum { f_bogus,
f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus; f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus;
char *name, *expanded_name, *value; char *name, *expanded_name, *value, *alloc_value=NULL;
struct variable *v; struct variable *v;
while (1) while (1)
@@ -766,7 +768,7 @@ try_variable_definition (filename, lineno, line, origin)
expanded_name = allocated_variable_expand (name); expanded_name = allocated_variable_expand (name);
if (expanded_name[0] == '\0') if (expanded_name[0] == '\0')
makefile_fatal (filename, lineno, "empty variable name"); fatal (flocp, _("empty variable name"));
/* Calculate the variable's new value in VALUE. */ /* Calculate the variable's new value in VALUE. */
@@ -776,8 +778,11 @@ try_variable_definition (filename, lineno, line, origin)
/* Should not be possible. */ /* Should not be possible. */
abort (); abort ();
case f_simple: case f_simple:
/* A simple variable definition "var := value". Expand the value. */ /* A simple variable definition "var := value". Expand the value.
value = variable_expand (p); We have to allocate memory since otherwise it'll clobber the
variable buffer, and we still need that. */
alloc_value = allocated_variable_expand (p);
value = alloc_value;
break; break;
case f_conditional: case f_conditional:
/* A conditional variable definition "var ?= value". /* A conditional variable definition "var ?= value".
@@ -788,6 +793,7 @@ try_variable_definition (filename, lineno, line, origin)
free(expanded_name); free(expanded_name);
return v; return v;
} }
flavor = f_recursive;
/* FALLTHROUGH */ /* FALLTHROUGH */
case f_recursive: case f_recursive:
/* A recursive variable definition "var = value". /* A recursive variable definition "var = value".
@@ -844,7 +850,7 @@ try_variable_definition (filename, lineno, line, origin)
you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on
your $PATH, then SHELL=/usr/local/bin/bash will have the effect of your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
defining SHELL to be "d:/unix/bash.exe". */ defining SHELL to be "d:/unix/bash.exe". */
if (origin == o_file if ((origin == o_file || origin == o_override)
&& strcmp (expanded_name, "SHELL") == 0) && strcmp (expanded_name, "SHELL") == 0)
{ {
char shellpath[PATH_MAX]; char shellpath[PATH_MAX];
@@ -912,7 +918,7 @@ try_variable_definition (filename, lineno, line, origin)
else else
#endif /* __MSDOS__ */ #endif /* __MSDOS__ */
#ifdef WINDOWS32 #ifdef WINDOWS32
if (origin == o_file if ((origin == o_file || origin == o_override)
&& strcmp (expanded_name, "SHELL") == 0) { && strcmp (expanded_name, "SHELL") == 0) {
extern char* default_shell; extern char* default_shell;
@@ -932,6 +938,8 @@ try_variable_definition (filename, lineno, line, origin)
v = define_variable (expanded_name, strlen (expanded_name), v = define_variable (expanded_name, strlen (expanded_name),
value, origin, flavor == f_recursive); value, origin, flavor == f_recursive);
if (alloc_value)
free (alloc_value);
free (expanded_name); free (expanded_name);
return v; return v;
@@ -1035,21 +1043,21 @@ print_variable_set (set, prefix)
} }
if (nvariables == 0) if (nvariables == 0)
puts ("# No variables."); puts (_("# No variables."));
else else
{ {
printf ("# %u variables in %u hash buckets.\n", printf (_("# %u variables in %u hash buckets.\n"),
nvariables, set->buckets); nvariables, set->buckets);
#ifndef NO_FLOAT #ifndef NO_FLOAT
printf ("# average of %.1f variables per bucket, \ printf (_("# average of %.1f variables per bucket, \
max %u in one bucket.\n", max %u in one bucket.\n"),
(double) nvariables / (double) set->buckets, (double) nvariables / (double) set->buckets,
per_bucket); per_bucket);
#else #else
{ {
int f = (nvariables * 1000 + 5) / set->buckets; int f = (nvariables * 1000 + 5) / set->buckets;
printf ("# average of %d.%d variables per bucket, \ printf (_("# average of %d.%d variables per bucket, \
max %u in one bucket.\n", max %u in one bucket.\n"),
f/10, f%10, f/10, f%10,
per_bucket); per_bucket);
} }
@@ -1063,7 +1071,7 @@ max %u in one bucket.\n",
void void
print_variable_data_base () print_variable_data_base ()
{ {
puts ("\n# Variables\n"); puts (_("\n# Variables\n"));
print_variable_set (&global_variable_set, ""); print_variable_set (&global_variable_set, "");
} }

View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Codes in a variable definition saying where the definition came from. /* Codes in a variable definition saying where the definition came from.
Increasing numeric values signify less-overridable definitions. */ Increasing numeric values signify less-overridable definitions. */
@@ -102,7 +103,7 @@ extern void initialize_file_variables PARAMS ((struct file *file));
extern void print_file_variables PARAMS ((struct file *file)); extern void print_file_variables PARAMS ((struct file *file));
extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix)); extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix));
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1)); extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin)); extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin));
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length)); extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value, extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,

View File

@@ -403,7 +403,7 @@ vmsify (name, type)
{ {
if (*(s2-1) == '.') /* ends in '.]' */ if (*(s2-1) == '.') /* ends in '.]' */
{ {
if (strncmp (fptr, "000000", 6) != 0) if (!strneq (fptr, "000000", 6))
rooted = 0; rooted = 0;
} }
else else
@@ -661,7 +661,7 @@ vmsify (name, type)
nstate = N_OPEN; nstate = N_OPEN;
break; break;
} }
} }
} }
} }
else else
@@ -840,7 +840,7 @@ vmsify (name, type)
} }
while (state > 0); while (state > 0);
} }

27
vpath.c
View File

@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h" #include "make.h"
#include "filedef.h" #include "filedef.h"
@@ -48,7 +49,7 @@ static struct vpath *general_vpath;
static struct vpath *gpaths; static struct vpath *gpaths;
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr)); static int selective_vpath_search PARAMS ((struct vpath *path, char **file, FILE_TIMESTAMP *mtime_ptr));
/* Reverse the chain of selective VPATH lists so they /* Reverse the chain of selective VPATH lists so they
will be searched in the order given in the makefiles will be searched in the order given in the makefiles
@@ -168,7 +169,7 @@ construct_vpath_list (pattern, dirpath)
if (pattern != 0) if (pattern != 0)
{ {
pattern = savestring (pattern, strlen (pattern)); pattern = xstrdup (pattern);
percent = find_percent (pattern); percent = find_percent (pattern);
} }
@@ -323,7 +324,7 @@ gpath_search (file, len)
if (gpaths && (len <= gpaths->maxlen)) if (gpaths && (len <= gpaths->maxlen))
for (gp = gpaths->searchpath; *gp != NULL; ++gp) for (gp = gpaths->searchpath; *gp != NULL; ++gp)
if (!strncmp(*gp, file, len) && (*gp)[len] == '\0') if (strneq (*gp, file, len) && (*gp)[len] == '\0')
return 1; return 1;
return 0; return 0;
@@ -338,7 +339,7 @@ gpath_search (file, len)
int int
vpath_search (file, mtime_ptr) vpath_search (file, mtime_ptr)
char **file; char **file;
time_t *mtime_ptr; FILE_TIMESTAMP *mtime_ptr;
{ {
register struct vpath *v; register struct vpath *v;
@@ -376,7 +377,7 @@ static int
selective_vpath_search (path, file, mtime_ptr) selective_vpath_search (path, file, mtime_ptr)
struct vpath *path; struct vpath *path;
char **file; char **file;
time_t *mtime_ptr; FILE_TIMESTAMP *mtime_ptr;
{ {
int not_target; int not_target;
char *name, *n; char *name, *n;
@@ -524,7 +525,9 @@ selective_vpath_search (path, file, mtime_ptr)
/* Store the modtime into *MTIME_PTR for the caller. /* Store the modtime into *MTIME_PTR for the caller.
If we have had no need to stat the file here, If we have had no need to stat the file here,
we record a zero modtime to indicate this. */ we record a zero modtime to indicate this. */
*mtime_ptr = exists_in_cache ? st.st_mtime : (time_t) 0; *mtime_ptr = (exists_in_cache
? FILE_TIMESTAMP_STAT_MODTIME (st)
: (FILE_TIMESTAMP) 0);
free (name); free (name);
return 1; return 1;
@@ -546,7 +549,7 @@ print_vpath_data_base ()
register unsigned int nvpaths; register unsigned int nvpaths;
register struct vpath *v; register struct vpath *v;
puts ("\n# VPATH Search Paths\n"); puts (_("\n# VPATH Search Paths\n"));
nvpaths = 0; nvpaths = 0;
for (v = vpaths; v != 0; v = v->next) for (v = vpaths; v != 0; v = v->next)
@@ -563,18 +566,18 @@ print_vpath_data_base ()
} }
if (vpaths == 0) if (vpaths == 0)
puts ("# No `vpath' search paths."); puts (_("# No `vpath' search paths."));
else else
printf ("\n# %u `vpath' search paths.\n", nvpaths); printf (_("\n# %u `vpath' search paths.\n"), nvpaths);
if (general_vpath == 0) if (general_vpath == 0)
puts ("\n# No general (`VPATH' variable) search path."); puts (_("\n# No general (`VPATH' variable) search path."));
else else
{ {
register char **path = general_vpath->searchpath; register char **path = general_vpath->searchpath;
register unsigned int i; register unsigned int i;
fputs ("\n# General (`VPATH' variable) search path:\n# ", stdout); fputs (_("\n# General (`VPATH' variable) search path:\n# "), stdout);
for (i = 0; path[i] != 0; ++i) for (i = 0; path[i] != 0; ++i)
printf ("%s%c", path[i], printf ("%s%c", path[i],

View File

@@ -1,60 +1,60 @@
# NOTE: If you have no `make' program at all to process this makefile, run # NOTE: If you have no `make' program at all to process this makefile, run
# `build.bat' instead. # `build.bat' instead.
# #
# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc # Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc
# This file is part of GNU Make. # This file is part of GNU Make.
# #
# GNU Make is free software; you can redistribute it and/or modify # GNU Make is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2, or (at your option)
# any later version. # any later version.
# #
# GNU Make is distributed in the hope that it will be useful, # GNU Make is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Make; see the file COPYING. If not, write to # along with GNU Make; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# NMakefile for GNU Make (subproc library) # NMakefile for GNU Make (subproc library)
# #
LIB = lib LIB = lib
CC = cl CC = cl
OUTDIR=. OUTDIR=.
MAKEFILE=NMakefile MAKEFILE=NMakefile
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../.. CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../../
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/ CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/ CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
all: Release Debug all: Release Debug
Release: Release:
$(MAKE) /f $(MAKEFILE) OUTDIR=WinRel CFLAGS="$(CFLAGS_release)" WinRel/subproc.lib $(MAKE) /f $(MAKEFILE) OUTDIR=WinRel CFLAGS="$(CFLAGS_release)" WinRel/subproc.lib
Debug: Debug:
$(MAKE) /f $(MAKEFILE) OUTDIR=WinDebug CFLAGS="$(CFLAGS_debug)" WinDebug/subproc.lib $(MAKE) /f $(MAKEFILE) OUTDIR=WinDebug CFLAGS="$(CFLAGS_debug)" WinDebug/subproc.lib
clean: clean:
rmdir /s /q WinRel WinDebug rmdir /s /q WinRel WinDebug
erase *.pdb erase *.pdb
$(OUTDIR): $(OUTDIR):
if not exist .\$@\nul mkdir .\$@ if not exist .\$@\nul mkdir .\$@
OBJS = $(OUTDIR)/misc.obj $(OUTDIR)/w32err.obj $(OUTDIR)/sub_proc.obj OBJS = $(OUTDIR)/misc.obj $(OUTDIR)/w32err.obj $(OUTDIR)/sub_proc.obj
$(OUTDIR)/subproc.lib: $(OUTDIR) $(OBJS) $(OUTDIR)/subproc.lib: $(OUTDIR) $(OBJS)
$(LIB) -out:$@ @<< $(LIB) -out:$@ @<<
$(OBJS) $(OBJS)
<< <<
.c{$(OUTDIR)}.obj: .c{$(OUTDIR)}.obj:
$(CC) $(CFLAGS) /c $< $(CC) $(CFLAGS) /c $<
$(OUTDIR)/misc.obj: misc.c proc.h $(OUTDIR)/misc.obj: misc.c proc.h
$(OUTDIR)/sub_proc.obj: sub_proc.c ../include/sub_proc.h ../include/w32err.h proc.h $(OUTDIR)/sub_proc.obj: sub_proc.c ../include/sub_proc.h ../include/w32err.h proc.h
$(OUTDIR)/w32err.obj: w32err.c ../include/w32err.h $(OUTDIR)/w32err.obj: w32err.c ../include/w32err.h

File diff suppressed because it is too large Load Diff