Compare commits

..

70 Commits

Author SHA1 Message Date
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
68 changed files with 8377 additions and 5263 deletions

View File

@@ -11,6 +11,13 @@ makebook*
*.dep *.dvi *.toc *.aux *.log
*.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
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>
GNU Make User's Manual written by:
GNU Make User's Manual
Written by:
Richard M. Stallman <rms@gnu.org>
User's Manual edited by:
Edited by:
Roland McGrath <roland@gnu.org>
Bob Chassell <bob@gnu.org>
Melissa Weisshaus <melissa@gnu.org>
@@ -22,8 +23,9 @@ GNU make porting efforts:
Port to VMS by:
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:
Aaron Digulla <digulla@fh-konstanz.de>
@@ -38,11 +40,14 @@ GNU make porting efforts:
Other contributors:
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>
Michael Joosten
Jim Kelton <jim_kelton@tivoli.com>
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>
Carl Staelin (Princeton University)
Ian Stewartson (Data Logic Limited)

789
ChangeLog
View File

@@ -1,3 +1,732 @@
1999-07-21 Paul D. Smith <psmith@gnu.org>
* Version 3.77.90 released.
* Makefile.am (AUTOMAKE_OPTIONS): Require automake 1.4.
* function.c: Rearrange so we don't need to predeclare the
function_table array; K&R C compilers don't like that.
* acinclude.m4 (AC_FUNC_SELECT): Ouch; this requires an ANSI C
compiler! Change to work with K&R compilers as well.
* configure.in (AC_OUTPUT): Put build.sh back. I don't know how I
thought it would work this way :-/. We'll have to think of
something else.
* Makefile.am: Remove rule to create build.sh.
* default.c (default_suffix_rules): Rearrange the default command
lines to conform to POSIX rules (put the filename argument $<
_after_ the OUTPUT_OPTION, not before it).
* various: Changed !strncmp() calls to strneq() macros.
* misc.c (sindex): Make slightly more efficient.
* dir.c (file_impossible): Change savestring(X,strlen(X)) to xstrdup().
* implicit.c (pattern_search): Ditto.
* main.c (enter_command_line_file): Ditto.
(main): Ditto.
* misc.c (copy_dep_chain): Ditto.
* read.c (read_makefile): Ditto.
(parse_file_seq): Ditto.
(tilde_expand): Ditto.
(multi_glob): Ditto.
* rule.c (install_pattern_rule): Ditto.
* variable.c (define_variable_in_set): Ditto.
(define_automatic_variables): Ditto.
* vpath.c (construct_vpath_list): Ditto.
* misc.c (xrealloc): Some reallocs are non-standard: work around
them in xrealloc by calling malloc if PTR is NULL.
* main.c (main): Call xrealloc() directly instead of testing for
NULL.
* function.c (func_sort): Don't try to free NULL; some older,
non-standard versions of free() don't like it.
* configure.in (--enable-dmalloc): Install some support for using
dmalloc (http://www.dmalloc.com/) with make. Use --enable-dmalloc
with configure to enable it.
* function.c (function_table_entry): Whoops! The function.c
rewrite breaks backward compatibility: all text to a function is
broken into arguments, and extras are ignored. So $(sort a,b,c)
returns "a"! Etc. Ouch. Fix it by making a positive value in
the REQUIRED_ARGS field mean exactly that many arguments to the
function; any "extras" are considered part of the last argument as
before. A negative value means at least that many, but may be
more: in this case all text is broken on commas.
(handle_function): Stop when we've seen REQUIRED_ARGS args, if >0.
(expand_builtin_function): Compare number of args to the absolute
value of REQUIRED_ARGS.
1999-07-20 Paul D. Smith <psmith@gnu.org>
* job.c (start_job_command): Ensure that the state of the target
is cs_running. It might not be if we skipped all the lines due to
-n (for example).
* commands.c (execute_file_commands): If we discover that the
command script is empty and succeed early, set cs_running so the
modtime of the target is still rechecked.
* rule.c (freerule): Free the dependency list for the rule.
* implicit.c (pattern_search): When turning an intermediate file
into a real target, keep the also_make list.
Free the dep->name if we didn't use it during enter_file().
1999-07-16 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): Don't allocate the commands buffer until
we're sure we found a makefile and won't return early (mem leak).
* job.c (start_job_command): Broken #ifdef test: look for F_SETFD,
not FD_SETFD. Close-on-exec isn't getting set on the bad_stdin
file descriptor and it's leaking :-/.
* getloadavg.c (getloadavg): Ditto.
1999-07-15 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): Fix some potential memory stomps parsing
`define' directives where no variable name is given.
* function.c (func_call): Rename from func_apply. Various code
cleanup and tightening.
(function_table): Add "call" as a valid builtin function.
* make.texinfo (Call Function): Document it.
* NEWS: Announce it.
1999-07-09 Eli Zaretskii <eliz@is.elta.co.il>
* variable.c (try_variable_definition) [__MSDOS__, WINDOWS32]:
Treat "override SHELL=" the same as just "SHELL=".
1999-07-09 Paul D. Smith <psmith@gnu.org>
* job.c (start_waiting_job): Don't get a second job token if we
already have one; if we're waiting on the load to go down
start_waiting_job() might get called twice on the same file.
* remake.c (update_goal_chain): If we try to update a goal and it
doesn't complete (e.g., parallel builds) remember that by setting
the `deferred' flag in the goal structure. Later when we're
determining the return value we consider a goal updated if either
the mtime has changed _or_ this flag was set. We need this
because the mtime doesn't change during the update_file() function
if we started a job running; instead it's set during the
reap_children() call. So, the code doesn't know it was updated
and returns a status of -1 (nothing done). This is OK during
"normal" builds since our caller (main) treats these cases
identically in that case, but if you're building makefiles the
difference is very important (whether we re-exec or not).
* dep.h: Add a `deferred' flag to track whether a goal was run but
not completed (parallel builds).
1999-07-08 Paul D. Smith <psmith@gnu.org>
* main.c (switches): Define a new switch -R (or
--no-builtin-variables). This option disables the defining of all
the GNU make builtin variables.
(main): If -R was given, force -r as well.
* default.c (define_default_variables): Test the new flag.
* make.h: Declare global flag.
* make.texinfo (Options Summary): Document the new option.
(Implicit Variables): Ditto.
1999-07-06 Paul D. Smith <psmith@gnu.org>
* make.texinfo (Options Summary): Correct examples in
--print-data-base option summary (problem reported by David Morse
<morse@nichimen.com>).
* arscan.c: Add support for archives in Windows (VC++). Frank
Libbrecht <frankl@abzx.belgium.hp.com> provided info on how to do
this.
* NMakefile.template (CFLAGS_any): Remove NO_ARCHIVES from the
compile line.
* build_w32.bat: Ditto.
* remake.c (no_rule_error): Fix -include/sinclude so it doesn't
give errors if you try to -include the same file twice.
(updating_makefiles): New variable: we need to know this info in
no_rule_error() so we know whether to print an error or not.
(update_file_1): Unconditionally call no_rule_error(), don't try
to play games with the dontcare flag.
1999-06-14 Paul D. Smith <psmith@gnu.org>
* make.texinfo (Remaking Makefiles): Add a description of how to
prevent implicit rule searches for makefiles.
* make.1: Remove statement that make continues processing when -v
is given.
1999-06-14 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): Cast -1 arguments to
variable_expand_string() to long. Alexandre Sauve
<Alexandre.SAUVE@ifp.fr> reports that without casts, this breaks
on a NEC SUPER-UX SX-4 system (and it's wrong without a cast
anyway). Of course, (a) I'd really love to start using function
prototypes, and (b) there's a whole slew of issues related to int
vs. long and signed vs. unsigned in the length handling of
variable buffers, etc. Gross. Needs a complete mucking-out.
* expand.c (variable_expand): Ditto.
* acinclude.m4 (AC_FUNC_SELECT): Slight enhancement for AIX 3.2 by
Lars Hecking <lhecking@nmrc.ucc.ie>.
* read.c (get_next_mword): Allow colons to be escaped in target
names: fix for regression failure.
1999-04-26 Paul D. Smith <psmith@gnu.org>
* main.c (main): Reset read_makefiles to empty after processing so
we get the right error message.
1999-04-25 Paul D. Smith <psmith@gnu.org>
* make.texinfo: Updates to @dircategory and @direntry suggested by
Karl Berry <karl@cs.umb.edu>.
1999-04-23 Eli Zaretskii <eliz@is.elta.co.il>
* job.c (start_job_command) [__MSDOS__]: Call unblock_sigs before
turning off dos_command_running, so child's signals produce the
right effect.
* commands.c (fatal_error_signal) [__MSDOS__]: Use EXIT_FAILURE
instead of 1.
1999-04-18 Eli Zaretskii <eliz@is.elta.co.il>
* configh.dos.template: Update to recognize that version 2.02 of
DJGPP contains sys_siglist stuff.
1999-04-14 Paul D. Smith <psmith@gnu.org>
* make.texinfo (Options/Recursion): Document the job server.
(Parallel): Tweaks.
1999-04-13 Paul D. Smith <psmith@gnu.org>
Implement a new "job server" feature; the implementation was
suggested by Howard Chu <hyc@highlandsun.com>.
* configure.in (job-server): New disable option for job server
support--it's enabled by default. If it works well this will go
away.
* NEWS: Summarize the new feature.
* acconfig.h: New definition MAKE_JOBSERVER if job server support
is enabled.
* config.h-vms.template: Undef MAKE_JOBSERVER for this port.
* config.h.W32.template: Ditto.
* config.ami.template: Ditto.
* main.c (struct command_switch): Add a new type: int_string.
(switches[]) Use int_string for -j if MAKE_JOBSERVER.
(init_switches): Initialize the new int_string switch type.
(print_usage): New function, extracted from decode_switches().
(decode_switches): Call it. Decode the new int_string switch type.
(define_makeflags): Add new int_string switch data to MAKEFLAGS.
(job_fds[]) Array to contain the pipe file descriptors.
(main): Parse the job_slots_str option results. If necessary,
create the pipe and seed it with tokens. Set the non-blocking bit
for the read fd. Enable the signal handler for SIGCHLD even if we
have a non-hanging wait; it's needed to interrupt the select() in
job.c:start_waiting_job().
* make.h: Declare job_fds[].
* job.h (struct child): Add job_token field to store the token for
this job (if any).
* job.c (reap_children): When a child is fully reaped, release the
token back into the pipe.
(free_child): If the child to be freed still has a token, put it
back.
(new_job): Initialize the job_token member.
(start_waiting_job): For local jobs, if we're using the pipe, get
a token before we check the load, etc. We do this by performing a
non-blocking read in a loop. If the read fails, no token is
available. Do a select on the fd to wait for a token. We need to
re-enable the signal handler for SIGCHLD even if we have a
non-hanging waitpid() or wait3(), so that the signal will
interrupt the select() and we can wake up to reap children.
(child_handler): Re-enable the signal handler. The count is still
kept although it's not needed or used unless you don't have
waitpid() or wait3().
1999-04-10 Paul D. Smith <psmith@gnu.org>
* main.c (main): Reset the considered bit on all the makefiles if
something failed to update; we need to examine them again if they
appear as normal targets in order to get the proper error message.
1999-04-09 Paul D. Smith <psmith@gnu.org>
Performance enhancement from Tim Magill <tim.magill@telops.gte.com>.
* remake.c (update_file): If you have large numbers of
dependencies and you run in parallel, make can spend considerable
time each pass through the graph looking at branches it has
already seen. Since we only reap_children() when starting a pass,
not in the middle, if a branch has been seen already in that pass
nothing interesting can happen until the next pass. So, we toggle
a bit saying whether we've seen this target in this pass or not.
(update_goal_chain): Initially set the global considered toggle to
1, since all targets initialize their boolean to 0. At the end of
each pass, toggle the global considered variable. * filedef.h
(struct file): Per-file considered toggle bit. * file.c: New
global toggle variable considered.
1999-04-05 Paul D. Smith <psmith@gnu.org>
* arscan.c (ar_scan): Added support for ARFZMAG (compressed
archives?) for Digital UNIX C++. Information provided by
Patrick E. Krogel <pekrogel@mtu.edu>.
(ar_member_touch): Ditto.
1999-04-03 Paul D. Smith <psmith@gnu.org>
* remake.c (f_mtime): If: a) we found a file and b) we didn't
create it and c) it's not marked as an implicit target and d) it
is marked as an intermediate target, then it was so marked due to
an .INTERMEDIATE special target, but it already existed in the
directory. In this case, unset the intermediate flag so we won't
delete it when make is done. It feels like it would be cleaner to
put this check in update_file_1() but I worry it'll get missed...
1999-04-01 Paul D. Smith <psmith@gnu.org>
* job.c (construct_command_argv_internal): Use bcopy() to copy
overlapping strings, rather than strcpy(). ISO C says the latter
is undefined. Found this in a bug report from 1996! Ouch!
1999-03-31 Paul D. Smith <psmith@gnu.org>
* read.c (readline): Ignore carriage returns at the end of the
line, to allow Windows-y CRLF line terminators.
1999-03-30 Paul D. Smith <psmith@gnu.org>
* configure.in: Don't put build.sh here, since build.sh.in doesn't
exist initially. This cause autoreconf and automake to fail when
run on a clean CVS checkout. Instead, we create build.sh in the
Makefile (see below).
* Makefile.am: Remove BUILT_SOURCES; this is no longer relevant.
Put those files directly into EXTRA_DIST so they're distributed.
Create a local build rule to create build.sh.
Create a local maintainer-clean rule to delete all the funky
maintainers files.
* maintMakefile: Makefile.in depends on README, since automake
fails if it doesn't exist. Also don't remove glob/Makefile.in
here, as it causes problems.
1999-03-26 Paul D. Smith <psmith@gnu.org>
* configure.in: Substitute GLOBLIB if we need the link the
glob/libglob.a library.
* Makefile.am (make_LDADD): Use the subst variable GLOBLIB so we
don't link the local libglob.a at all if we don't need it.
* build.template: Don't compile glob/*.o unless we want globlib.
* maintMakefile (build.sh.in): Substitute the glob/*.o files
separately.
1999-03-25 Paul D. Smith <psmith@gnu.org>
* make.texinfo: Various typos and additions, pointed out by James
G. Sack <jsack@dornfeld.com>.
1999-03-22 Paul D. Smith <psmith@gnu.org>
* make.texinfo (Functions): Add a new section documenting the new
$(error ...) and $(warning ...) functions. Also updated copyright
dates.
* NEWS: Updated for the new functions.
* function.c (func_error): Implement the new $(error ...) and
$(warning ...) functions.
(function_table): Insert new functions into the table.
(func_firstword): Don't call find_next_token() with argv[0]
itself, since that function modifies the pointer.
* function.c: Cleanups and slight changes to the new method of
calling functions.
1999-03-20 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* function.c: Rewrite to use one C function per make function,
instead of a huge switch statement. Also allows some cleanup of
multi-architecture issues, and a cleaner API which makes things
like func_apply() simple.
* function.c (func_apply): Initial implementation. Expand either
a builtin function or a make variable in the context of some
arguments, provided as $1, $2, ... $N.
1999-03-19 Eli Zaretskii <eliz@is.elta.co.il>
1999-03-19 Rob Tulloh <rob_tulloh@dev.tivoli.com>
* job.c (construct_command_argv_internal): Don't treat _all_
backslashes as escapes, only those which really escape a special
character. This allows most normal "\" directory separators to be
treated normally.
1999-03-05 Paul D. Smith <psmith@gnu.org>
* configure.in: Check for a system strdup().
* misc.c (xstrdup): Created. Suggestion by Han-Wen Nienhuys
<hanwen@cs.uu.nl>.
* make.h: Prototype xstrdup().
* remake.c (library_search): Use it.
* main.c (main): Use it.
(find_and_set_default_shell): Use it.
* job.c (construct_command_argv_internal): Use it.
* dir.c (find_directory): Use it.
* Makefile.am, configure.in: Use AC_SUBST_FILE to insert the
maintMakefile instead of "include", to avoid automake 1.4
incompatibility.
1999-03-04 Paul D. Smith <psmith@gnu.org>
* amiga.c, amiga.h, ar.c, arscan.c, commands.c, commands.h,
* default.c, dep.h, dir.c, expand.c, file.c, filedef.h, function.c,
* implicit.c, job.c, job.h, main.c, make.h, misc.c, read.c, remake.c
* remote-cstms.c, remote-stub.c, rule.h, variable.c, variable.h,
* vpath.c, Makefile.ami, NMakefile.template, build.template,
* makefile.vms: Updated FSF address in the copyright notice.
* variable.c (try_variable_definition): If we see a conditional
variable and we decide to set it, re-type it as recursive so it
will be expanded properly later.
1999-02-22 Paul D. Smith <psmith@gnu.org>
* NEWS: Mention new .LIBPATTERNS feature.
* make.texinfo (Libraries/Search): Describe the use and
ramifications of the new .LIBPATTERNS variable.
* remake.c (library_search): Instead of searching only for the
hardcoded expansion "libX.a" for a library reference "-lX", we
obtain a list of patterns from the .LIBPATTERNS variable and
search those in order.
* default.c: Added a new default variable .LIBPATTERNS. The
default for UNIX is "lib%.so lib%.a". Amiga and DOS values are
also provided.
* read.c: Remove bogus HAVE_GLOB_H references; always include
vanilla glob.h.
1999-02-21 Paul D. Smith <psmith@gnu.org>
* function.c (expand_function): Set value to 0 to avoid freeing it.
* variable.c (pop_variable_scope): Free the value of the variable.
(try_variable_definition): For simple variables, use
allocated_variable_expand() to avoid stomping on the variable
buffer when we still need it for other things.
* arscan.c: Modified to support AIX 4.3 big archives. The changes
are based on information provided by Phil Adams
<padams@austin.ibm.com>; thanks!
1999-02-19 Paul D. Smith <psmith@gnu.org>
* configure.in: Check to see if the GNU glob library is already
installed on the system. If so, _don't_ add -I./glob to the
compile line. Using the system glob code with the local headers
is very bad mojo!
Rewrite SCCS macros to use more autoconf facilities.
* Makefile.am: Move -Iglob out of INCLUDES; it'll get added to
CPPFLAGS by configure now.
Automake 1.4 introduced its own "include" feature which conflicts
with the maintMakefile stuff. A hack that seems to work is add a
space before the include :-/.
* build.template: Move -Iglob out of the compile line; it'll get
added to CPPFLAGS by configure now.
1999-02-16 Glenn D. Wolf <Glenn_Wolf@email.sps.mot.com>
* arscan.c (ar_scan) [VMS]: Initialized VMS_member_date before
calling lbr$get_index since if the archive is empty,
VMS_get_member_info won't get called at all, and any leftover date
will be used. This bug shows up if any member of any archive is
made, followed by a dependency check on a different, empty
archive.
1998-12-13 Martin Zinser <zinser@decus.decus.de>
* config.h-vms [VMS]: Set _POSIX_C_SOURCE. Redefine the getopt
functions so we don't use the broken VMS versions.
* makefile.com [VMS]: Allow debugging.
* dir.c (dir_setup_glob) [VMS]: Don't extern stat() on VMS.
1998-11-30 Paul D. Smith <psmith@gnu.org>
* signame.c (init_sig): Check the sizes of signals being set up to
avoid array overwrites (if the system headers have problems).
1998-11-17 Paul D. Smith <psmith@gnu.org>
* read.c (record_files): Clean up some indentation.
1998-11-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* rule.c (print_rule_data_base): Fix arguments to fatal() call.
1998-10-13 Paul D. Smith <psmith@gnu.org>
* job.c (start_job_command): If the command list resolves to no
chars at all (e.g.: "foo:;$(empty)") then command_ptr is NULL;
quit early.
1998-10-12 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* rule.c (print_rule_data_base): Ignore num_pattern_rules if it is
zero.
1998-10-09 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): Allow non-empty lines to expand to the
empty string after variable, etc., expansion, and be ignored.
1998-09-21 Paul D. Smith <psmith@gnu.org>
* job.c (construct_command_argv_internal): Only add COMMAND.COM
"@echo off" line for non-UNIXy shells.
1998-09-09 Paul D. Smith <psmith@gnu.org>
* w32/subproc/sub_proc.c: Add in missing HAVE_MKS_SHELL tests.
1998-09-04 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): If we hit the "missing separator" error,
check for the common case of 8 spaces instead of a TAB and give an
extra comment to help people out.
1998-08-29 Paul Eggert <eggert@twinsun.com>
* configure.in (AC_STRUCT_ST_MTIM_NSEC):
Renamed from AC_STRUCT_ST_MTIM.
* acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Likewise.
Port to UnixWare 2.1.2 and pedantic Solaris 2.6.
* acconfig.h (ST_MTIM_NSEC):
Renamed from HAVE_ST_MTIM, with a new meaning.
* filedef.h (FILE_TIMESTAMP_FROM_S_AND_NS):
Use new ST_MTIM_NSEC macro.
1998-08-26 Paul D. Smith <psmith@gnu.org>
* remake.c (check_dep): For any intermediate file, not just
secondary ones, try implicit and default rules if no explicit
rules are given. I'm not sure why this was restricted to
secondary rules in the first place.
1998-08-24 Paul D. Smith <psmith@gnu.org>
* make.texinfo (Special Targets): Update documentation for
.INTERMEDIATE: if used with no dependencies, then it does nothing;
old docs said it marked all targets as intermediate, which it
didn't... and which would be silly :).
* implicit.c (pattern_search): If we find a dependency in our
internal tables, make sure it's not marked intermediate before
accepting it as a found_file[].
1998-08-20 Paul D. Smith <psmith@gnu.org>
* ar.c (ar_glob): Use existing alpha_compare() with qsort.
(ar_glob_alphacompare): Remove it.
Modify Paul Eggert's patch so we don't abandon older systems:
* configure.in: Warn the user if neither waitpid() nor wait3() is
available.
* job.c (WAIT_NOHANG): Don't syntax error on ancient hosts.
(child_handler, dead_children): Define these if WAIT_NOHANG is not
available.
(reap_children): Only track the dead_children count if no
WAIT_NOHANG. Otherwise, it's a boolean.
* main.c (main): Add back signal handler if no WAIT_NOHANG is
available; only use default signal handler if it is.
1998-08-20 Paul Eggert <eggert@twinsun.com>
Install a more robust signal handling mechanism for systems which
support it.
* job.c (WAIT_NOHANG): Define to a syntax error if our host
is truly ancient; this should never happen.
(child_handler, dead_children): Remove.
(reap_children): Don't try to keep separate track of how many
dead children we have, as this is too bug-prone.
Just ask the OS instead.
(vmsHandleChildTerm): Fix typo in error message; don't mention
child_handler.
* main.c (main): Make sure we're not ignoring SIGCHLD/SIGCLD;
do this early, before we could possibly create a subprocess.
Just use the default behavior; don't have our own handler.
1998-08-18 Eli Zaretskii <eliz@is.elta.co.il>
* read.c (read_makefile) [__MSDOS__, WINDOWS32]: Add code to
recognize library archive members when dealing with drive spec
mess. Discovery and initial fix by George Racz <gracz@mincom.com>.
1998-08-18 Paul D. Smith <psmith@gnu.org>
* configure.in: Check for stdlib.h explicitly (some hosts have it
but don't have STDC_HEADERS).
* make.h: Use HAVE_STDLIB_H. Clean up some #defines.
* config.ami: Re-compute based on new config.h.in contents.
* config.h-vms: Ditto.
* config.h.W32: Ditto.
* configh.dos: Ditto.
* dir.c (find_directory) [WINDOWS32]: Windows stat() fails if
directory names end with `\' so strip it.
1998-08-17 Paul D. Smith <psmith@gnu.org>
* make.texinfo: Added copyright year to the printed copy. Removed
the price from the manual. Change the top-level reference to
running make to be "Invoking make" instead of "make Invocation",
to comply with GNU doc standards.
* make.h (__format__, __printf__): Added support for these in
__attribute__ macro.
(message, error, fatal): Use ... prototype form under __STDC__.
Add __format__ attributes for printf-style functions.
* configure.in (AC_FUNC_VPRINTF): Check for vprintf()/_doprnt().
* misc.c(message, error, fatal): Add preprocessor stuff to enable
creation of variable-argument functions with appropriate
prototypes, that works with ANSI, pre-ANSI, varargs.h, stdarg.h,
v*printf(), _doprnt(), or none of the above. Culled from GNU
fileutils and slightly modified.
(makefile_error, makefile_error): Removed (merged into error() and
fatal(), respectively).
* amiga.c: Use them.
* ar.c: Use them.
* arscan.c: Use them.
* commands.c: Use them.
* expand.c: Use them.
* file.c: Use them.
* function.c: Use them.
* job.c: Use them.
* main.c: Use them.
* misc.c: Use them.
* read.c: Use them.
* remake.c: Use them.
* remote-cstms.c: Use them.
* rule.c: Use them.
* variable.c: Use them.
* make.h (struct floc): New structure to store file location
information.
* commands.h (struct commands): Use it.
* variable.c (try_variable_definition): Use it.
* commands.c: Use it.
* default.c: Use it.
* file.c: Use it.
* function.c: Use it.
* misc.c: Use it.
* read.c: Use it.
* rule.c: Use it.
1998-08-16 Paul Eggert <eggert@twinsun.com>
* filedef.h (FILE_TIMESTAMP_PRINT_LEN_BOUND): Add 10, for nanoseconds.
1998-08-16 Paul Eggert <eggert@twinsun.com>
* filedef.h (FLOOR_LOG2_SECONDS_PER_YEAR): New macro.
(FILE_TIMESTAMP_PRINT_LEN_BOUND): Tighten bound, and try to
make it easier to understand.
1998-08-14 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): We've already unquoted any colon chars
by the time we're done reading the targets, so arrange for
parse_file_seq() on the target list to not do so again.
1998-08-05 Paul D. Smith <psmith@gnu.org>
* configure.in: Added glob/configure.in data. We'll have the glob
code include the regular make config.h, rather than creating its
own.
* getloadavg.c (main): Change return type to int.
1998-08-01 Paul Eggert <eggert@twinsun.com>
* job.c (reap_children): Ignore unknown children.
1998-07-31 Paul D. Smith <psmith@gnu.org>
* make.h, filedef.h, dep.h, rule.h, commands.h, remake.c:
Add prototypes for functions. Some prototypes needed to be moved
in order to get #include order reasonable.
1998-07-30 Paul D. Smith <psmith@gnu.org>
* make.h: Added MIN/MAX.
* filedef.h: Use them; remove FILE_TIMESTAMP_MIN.
1998-07-30 Paul Eggert <eggert@twinsun.com>
Add support for sub-second timestamp resolution on hosts that
support it (just Solaris 2.6, so far).
* acconfig.h (HAVE_ST_MTIM, uintmax_t): New undefs.
* acinclude.m4 (jm_AC_HEADER_INTTYPES_H, AC_STRUCT_ST_MTIM,
jm_AC_TYPE_UINTMAX_T): New defuns.
* commands.c (delete_target): Convert file timestamp to
seconds before comparing to archive timestamp. Extract mod
time from struct stat using FILE_TIMESTAMP_STAT_MODTIME.
* configure.in (C_STRUCT_ST_MTIM, jm_AC_TYPE_UINTMAX_T): Add.
(AC_CHECK_LIB, AC_CHECK_FUNCS): Add clock_gettime.
* file.c (snap_deps): Use FILE_TIMESTAMP, not time_t.
(file_timestamp_now, file_timestamp_sprintf): New functions.
(print_file): Print file timestamps as FILE_TIMESTAMP, not
time_t.
* filedef.h: Include <inttypes.h> if available and if HAVE_ST_MTIM.
(FILE_TIMESTAMP, FILE_TIMESTAMP_STAT_MODTIME, FILE_TIMESTAMP_MIN,
FILE_TIMESTAMPS_PER_S, FILE_TIMESTAMP_FROM_S_AND_NS,
FILE_TIMESTAMP_DIV, FILE_TIMESTAMP_MOD, FILE_TIMESTAMP_S,
FILE_TIMESTAMP_NS, FILE_TIMESTAMP_PRINT_LEN_BOUND): New macros.
(file_timestamp_now, file_timestamp_sprintf): New decls.
(struct file.last_mtime, f_mtime, file_mtime_1, NEW_MTIME):
time_t -> FILE_TIMESTAMP.
* implicit.c (pattern_search): Likewise.
* vpath.c (vpath_search, selective_vpath_search): Likewise.
* main.c (main): Likewise.
* remake.c (check_dep, name_mtime, library_search, f_mtime): Likewise.
(f_mtime): Use file_timestamp_now instead of `time'.
Print file timestamp with file_timestamp_sprintf.
* vpath.c (selective_vpath_search): Extract file time stamp from
struct stat with FILE_TIMESTAMP_STAT_MODTIME.
1998-07-28 Paul D. Smith <psmith@gnu.org>
* Version 3.77 released.
@@ -118,7 +847,7 @@
1998-06-19 Eli Zaretskii <eliz@is.elta.co.il>
* job.c (start_job_command): Reset execute_by_shell after an empty
* job.c (start_job_command): Reset execute_by_shell after an empty
command was skipped.
1998-06-09 Paul D. Smith <psmith@gnu.org>
@@ -219,7 +948,7 @@
1998-05-11 Rob Tulloh <rob_tulloh@tivoli.com>
* job.c (construct_command_argv_internal): [WINDOWS32] Turn off
* job.c (construct_command_argv_internal) [WINDOWS32]: Turn off
echo when using a batch file, and make sure the command ends in a
newline.
@@ -352,8 +1081,8 @@
Tue Oct 07 15:00:00 1997 Phil Brooks <phillip_brooks@hp.com>
* make.h: [WINDOWS32] make case sensitivity configurable
* dir.c: [WINDOWS32] make case sensitivity configurable
* make.h [WINDOWS32]: make case sensitivity configurable
* dir.c [WINDOWS32]: make case sensitivity configurable
* README.W32: Document case sensitivity
* config.ami: Share case warping code with Windows
@@ -361,20 +1090,20 @@ Mon Oct 6 18:48:45 CDT 1997 Rob Tulloh <rob_tulloh@dev.tivoli.com>
* w32/subproc/sub_proc.c: Added support for MKS toolkit shell
(turn on HAVE_MKS_SHELL).
* read.c: [WINDOWS32] Fixed a problem with multiple target rules
* read.c [WINDOWS32]: Fixed a problem with multiple target rules
reported by Gilbert Catipon (gcatipon@tibco.com). If multiple
path tokens in a rule did not have drive letters, make would
incorrectly concatenate the 2 tokens together.
* main.c/variable.c: [WINDOWS32] changed SHELL detection code to
* main.c/variable.c [WINDOWS32]: changed SHELL detection code to
follow what MSDOS did. In addition to watching for SHELL variable
updates, make's main will attempt to default the value of SHELL
before and after makefiles are parsed.
* job.c/job.h: [WINDOWS32] The latest changes made to enable use
* job.c/job.h [WINDOWS32]: The latest changes made to enable use
of the GNUWIN32 shell from make could cause make to fail due to a
concurrency condition between parent and child processes. Make
now creates a batch file per job instead of trying to reuse the
same singleton batch file.
* job.c/job.h/function.c/config.h.W32: [WINDOWS32] Renamed macro
* job.c/job.h/function.c/config.h.W32 [WINDOWS32]: Renamed macro
from HAVE_CYGNUS_GNUWIN32_TOOLS to BATCH_MODE_ONLY_SHELL. Reworked
logic to reduce complexity. WINDOWS32 now uses the unixy_shell
variable to detect Bourne-shell compatible environments. There is
@@ -390,19 +1119,19 @@ Mon Oct 6 18:48:45 CDT 1997 Rob Tulloh <rob_tulloh@dev.tivoli.com>
Mon Oct 6 00:04:25 1997 Rob Tulloh <rob_tulloh@dev.tivoli.com>
* main.c: [WINDOWS32] The function define_variable() does not
* main.c [WINDOWS32]: The function define_variable() does not
handle NULL. Test before calling it to set Path.
* main.c: [WINDOWS32] Search Path again after makefiles have been
* main.c [WINDOWS32]: Search Path again after makefiles have been
parsed to detect sh.exe.
* job.c: [WINDOWS32] Added support for Cygnus GNU WIN32 tools.
* job.c [WINDOWS32]: Added support for Cygnus GNU WIN32 tools.
To use, turn on HAVE_CYGNUS_GNUWIN32_TOOLS in config.h.W32.
* config.h.W32: Added HAVE_CYGNUS_GNUWIN32_TOOLS macro.
Sun Oct 5 22:43:59 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
* glob/glob.c (glob_in_dir): [VMS] Globbing shouldn't be
* glob/glob.c (glob_in_dir) [VMS]: Globbing shouldn't be
case-sensitive.
* job.c (child_execute_job): [VMS] Use a VMS .com file if the
* job.c (child_execute_job) [VMS]: Use a VMS .com file if the
command contains a newline (e.g. from a define/enddef block).
* vmsify.c (vmsify): Return relative pathnames wherever possible.
* vmsify.c (vmsify): An input string like "../.." returns "[--]".
@@ -412,22 +1141,22 @@ Wed Oct 1 15:45:09 1997 Rob Tulloh <rob_tulloh@tivoli.com>
* NMakefile: Changed nmake to $(MAKE).
* subproc.bat: Take the make command name from the command
line. If no command name was given, default to nmake.
* job.c: [WINDOWS32/MSDOS] Fix memory stomp: temporary file names
* job.c [MSDOS, WINDOWS32]: Fix memory stomp: temporary file names
are now always created in heap memory.
* w32/subproc/sub_proc.c: New implementation of make_command_line()
which is more compatible with different Bourne shell implementations.
Deleted the now obsolete fix_command_line() function.
* main.c: [WINDOWS32] Any arbitrary spelling of Path can be
* main.c [WINDOWS32]: Any arbitrary spelling of Path can be
detected. Make will ensure that the special spelling `Path' is
inserted into the environment when the path variable is propagated
within itself and to make's children.
* main.c: [WINDOWS32] Detection of sh.exe was occurring too
* main.c [WINDOWS32]: Detection of sh.exe was occurring too
soon. The 2nd check for the existence of sh.exe must come after
the call to read_all_makefiles().
Fri Sep 26 01:14:18 1997 <zinser@axp602.gsi.de>
* makefile.com: [VMS] Fixed definition of sys.
* makefile.com [VMS]: Fixed definition of sys.
* readme.vms: Comments on what's changed lately.
Fri Sep 26 01:14:18 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
@@ -478,7 +1207,7 @@ Fri Aug 29 02:01:27 1997 Paul D. Smith <psmith@baynetworks.com>
Thu Aug 28 19:39:06 1997 Rob Tulloh <rob_tulloh@tivoli.com>
* job.c (exec_command): [WINDOWS32] If exec_command() is invoked
* job.c (exec_command) [WINDOWS32]: If exec_command() is invoked
from main() to re-exec make, the call to execvp() would
incorrectly return control to parent shell before the exec'ed
command could run to completion. I believe this is a feature of
@@ -498,12 +1227,12 @@ Thu Aug 28 17:04:47 1997 Paul D. Smith <psmith@baynetworks.com>
* configure.in: Check for pstat_getdynamic for getloadvg on HP.
* job.c (start_job_command): [VMS,_AMIGA] Don't perform empty
* job.c (start_job_command) [VMS, _AMIGA]: Don't perform empty
command optimization on these systems; it doesn't make sense.
Wed Aug 27 17:09:32 1997 Paul D. Smith <psmith@baynetworks.com>
* Version 3.75.92
* Version 3.75.92
Tue Aug 26 11:59:15 1997 Paul D. Smith <psmith@baynetworks.com>
@@ -530,7 +1259,7 @@ Sat Aug 23 1997 Eli Zaretskii <eliz@is.elta.co.il>
Fri Aug 22 1997 Eli Zaretskii <eliz@is.elta.co.il>
* job.c (start_job_command): [__MSDOS__] Don't test for "/bin/sh"
* job.c (start_job_command) [__MSDOS__]: Don't test for "/bin/sh"
literally, use value of unixy_shell instead.
* filedef.h (NEW_MTIME): Use 1 less than maximum possible value if
@@ -538,21 +1267,21 @@ Fri Aug 22 1997 Eli Zaretskii <eliz@is.elta.co.il>
Sat Aug 16 00:56:15 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
* vmsify.c (vmsify, case 11): After translating `..' elements, set
* vmsify.c (vmsify, case 11): After translating `..' elements, set
nstate to N_OPEN if there are still more elements to process.
(vmsify, case 2): After translating `foo/bar' up to the slash,
set nstate to N_OPEN, not N_DOT.
Fri Aug 8 15:18:09 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
* dir.c (vmsstat_dir): Leave name unmodified on exit.
* make.h (PATH_SEPARATOR_CHAR): Set to comma for VMS.
* vpath.c: Fix comments to refer to path separator, not colon.
* dir.c (vmsstat_dir): Leave name unmodified on exit.
* make.h (PATH_SEPARATOR_CHAR): Set to comma for VMS.
* vpath.c: Fix comments to refer to path separator, not colon.
(selective_vpath_search): Avoid Unixy slash handling for VMS.
Thu Aug 7 22:24:03 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
* ar.c: [VMS] Don't declare ar_member_touch.
* ar.c [VMS]: Don't declare ar_member_touch.
Delete VMS version of ar_member_date.
Enable non-VMS versions of ar_member_date and ar_member_date_1 for
VMS too.
@@ -565,11 +1294,11 @@ Thu Aug 7 22:24:03 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
* remake.c: Delete declaration of vms_stat.
(name_mtime): Don't call vms_stat.
(f_mtime): [VMS] Funky time value manipulation no longer necessary.
(f_mtime) [VMS]: Funky time value manipulation no longer necessary.
* file.c (print_file): [VMS] Use ctime, not cvt_time.
* make.h: [VMS] Don't define POSIX.
* make.h [VMS]: Don't define POSIX.
* makefile.com (filelist): Include ar and arscan.
Also include them in the link commands.
@@ -849,9 +1578,9 @@ Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
when killing final space and dash before setting MFLAGS.
From Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>:
* dir.c [__MSDOS__] [DJGPP > 1]: Include <libc/dosio.h> and defin
* dir.c [__MSDOS__ && DJGPP > 1]: Include <libc/dosio.h> and defin
`__opendir_flags' initialized to 0.
[__MSDOS__] (dosify) [DJGPP > 1]: Return name unchanged if _USE_LFN.
(dosify) [__MSDOS__ && DJGPP > 1]: Return name unchanged if _USE_LFN.
(find_directory) [__MSDOS__ && DJGPP > 1]: If _USE_LGN, set
__opendir_flags to __OPENDIR_PRESERVE_CASE.

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,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
@@ -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 \
signame.c signame.h \
getopt.c getopt1.c getopt.h
make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a
make_LDADD = @LIBOBJS@ @ALLOCA@ @GLOBLIB@
info_TEXINFOS = make.texinfo
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 = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c\
EXTRA_DIST = README build.sh.in $(man_MANS) README.customs remote-cstms.c\
make-stds.texi texinfo.tex SCOPTIONS SMakefile\
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
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)
# --------------- Local CLEAN section
maintainer-clean-local:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
# --------------- Maintainer's Section
if 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
@MAINT_MAKEFILE@

View File

@@ -16,7 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# 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

57
NEWS
View File

@@ -1,12 +1,48 @@
GNU make NEWS -*-indented-text-*-
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.
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.
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
* Implement BSD make's "?=" variable assignment operator. The variable
@@ -659,18 +695,11 @@ Version 3.05
----------------------------------------------------------------------
Copyright information:
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved,
thus giving the recipient permission to redistribute in turn.
copyright notice and this permission notice are preserved, thus
giving the recipient permission to redistribute in turn.
Permission is granted to distribute modified versions
of this document, or of portions of it,
under the above conditions, provided also that they
carry prominent notices stating who last changed them.
Local variables:
version-control: never
end:
Permission is granted to distribute modified versions of this
document, or of portions of it, under the above conditions, provided
also that they carry prominent notices stating who last changed them.

View File

@@ -16,7 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# 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
@@ -29,7 +30,7 @@ OUTDIR=.
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_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/

View File

@@ -3,17 +3,40 @@ All bugs reported for previous releases have been fixed.
Some bugs surely remain.
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,
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
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
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
GNU Make. If you get errors from your system's Make when building GNU
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
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
# 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
#
# 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 = .'.
srcdir = /make-3.74/
srcdir = /make-%VERSION%/
CC = sc
RM = delete

View File

@@ -10,6 +10,13 @@
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
#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'. */
#undef HAVE_SYS_SIGLIST
@@ -18,3 +25,18 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */
#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 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 The problem is that the default compilation flags in Solaris 2.6 won't
@@ -129,3 +129,171 @@ AC_DEFUN(AC_LFS,
done ;;
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
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 "variable.h"
@@ -45,7 +46,7 @@ char ** argv;
buffer = AllocMem (len, MEMF_ANY);
if (!buffer)
fatal ("MyExecute: Cannot allocate space for calling a command");
fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
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
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 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
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"
@@ -46,7 +47,7 @@ ar_name (name)
return 0;
if (p[1] == '(' && end[-1] == ')')
fatal ("attempt to use unsupported feature: `%s'", name);
fatal (NILF, "attempt to use unsupported feature: `%s'", name);
return 1;
}
@@ -137,7 +138,7 @@ int
ar_touch (name)
char *name;
{
error ("touch archive member is not available on VMS");
error (NILF, "touch archive member is not available on VMS");
return -1;
}
#else
@@ -169,22 +170,24 @@ ar_touch (name)
switch (ar_member_touch (arname, memname))
{
case -1:
error ("touch: Archive `%s' does not exist", arname);
error (NILF, "touch: Archive `%s' does not exist", arname);
break;
case -2:
error ("touch: `%s' is not a valid archive", arname);
error (NILF, "touch: `%s' is not a valid archive", arname);
break;
case -3:
perror_with_name ("touch: ", arname);
break;
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;
case 0:
val = 0;
break;
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)
@@ -233,15 +236,6 @@ ar_glob_match (desc, mem, truncated,
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.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int
@@ -316,7 +310,7 @@ ar_glob (arname, member_pattern, size)
names[i++] = n->name;
/* 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. */
i = 0;

250
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
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"
@@ -69,7 +70,7 @@ VMS_get_member_info (module, rfa)
&bufdesc.dsc$w_length, 0);
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);
lbr$close (&VMS_lib_idx);
@@ -151,7 +152,7 @@ ar_scan (archive, function, arg)
if (! status)
{
error ("lbr$ini_control failed with status = %d",status);
error (NILF, "lbr$ini_control failed with status = %d",status);
return -2;
}
@@ -162,7 +163,7 @@ ar_scan (archive, function, arg)
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);
return -1;
}
@@ -177,6 +178,7 @@ ar_scan (archive, function, arg)
VMS_function = function;
VMS_member_date = (time_t) -1;
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
/* Undo the damage. */
@@ -212,11 +214,46 @@ ar_scan (archive, function, arg)
#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. */
#ifndef AR_HDR_SIZE
#define AR_HDR_SIZE (sizeof (struct ar_hdr))
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
#endif
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
@@ -254,6 +291,10 @@ ar_scan (archive, function, arg)
{
#ifdef AIAMAG
FL_HDR fl_header;
#ifdef AIAMAGBIG
int big_archive = 0;
FL_HDR_BIG fl_header_big;
#endif
#else
int long_name = 0;
#endif
@@ -275,11 +316,42 @@ ar_scan (archive, function, arg)
#ifdef AIAMAG
{
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);
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
{
@@ -307,8 +379,18 @@ ar_scan (archive, function, arg)
long int member_offset;
long int last_member_offset;
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
#ifdef AIAMAGBIG
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)
{
@@ -329,6 +411,9 @@ ar_scan (archive, function, arg)
{
register int nread;
struct ar_hdr member_header;
#ifdef AIAMAGBIG
struct ar_hdr_big member_header_big;
#endif
#ifdef AIAMAG
char name[256];
int name_len;
@@ -351,34 +436,73 @@ ar_scan (archive, function, arg)
}
#ifdef AIAMAG
#define AR_MEMHDR (AR_HDR_SIZE - sizeof (member_header._ar_name))
nread = read (desc, (char *) &member_header, AR_MEMHDR);
#define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
if (nread != AR_MEMHDR)
#ifdef AIAMAGBIG
if (big_archive)
{
(void) close (desc);
return -2;
nread = read (desc, (char *) &member_header_big,
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);
}
sscanf (member_header.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
else
#endif
{
(void) close (desc);
return -2;
nread = read (desc, (char *) &member_header,
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);
}
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;
data_offset += data_offset % 2;
fnval =
(*function) (desc, name, 0,
@@ -393,8 +517,20 @@ ar_scan (archive, function, arg)
break;
if (nread != AR_HDR_SIZE
#ifdef ARFMAG
|| bcmp (member_header.ar_fmag, ARFMAG, 2)
#if defined(ARFMAG) || defined(ARFZMAG)
|| (
# 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
)
{
@@ -492,7 +628,12 @@ ar_scan (archive, function, arg)
/* End of the chain. */
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)
{
@@ -561,37 +702,6 @@ ar_name_equal (name, mem, truncated)
if (p != 0)
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
if (truncated)
{
@@ -601,17 +711,15 @@ ar_name_equal (name, mem, truncated)
#else
struct ar_hdr hdr;
#if !defined (__hpux) && !defined (cray)
return !strncmp (name, mem, sizeof(hdr.ar_name) - 1);
return strneq (name, mem, sizeof(hdr.ar_name) - 1);
#else
return !strncmp (name, mem, sizeof(hdr.ar_name) - 2);
return strneq (name, mem, sizeof(hdr.ar_name) - 2);
#endif /* !__hpux && !cray */
#endif /* !AIAMAG */
}
#endif /* !VMS */
return !strcmp (name, mem);
#endif
}
#ifndef VMS
@@ -672,7 +780,7 @@ ar_member_touch (arname, memname)
#else
fstat (fd, &statbuf);
#endif
#if defined(ARFMAG) || defined(AIAMAG)
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG)
/* Advance member's time to that time */
for (i = 0; i < sizeof ar_hdr.ar_date; i++)
ar_hdr.ar_date[i] = ' ';

View File

@@ -17,7 +17,8 @@
#
# You should have received a copy of the GNU General Public License
# 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.
@@ -31,6 +32,7 @@ ALLOCA='@ALLOCA@'
LOADLIBES='@LIBS@'
extras='@LIBOBJS@'
REMOTE='@REMOTE@'
GLOBLIB='@GLOBLIB@'
# Common prefix for machine-independent installed files.
prefix='@prefix@'
@@ -47,11 +49,15 @@ set -e
# These are all the objects we need to link together.
objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
if [ x"$GLOBLIB" != x ]; then
objs="$objs %globobjs%"
fi
# Compile the source files into those objects.
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
echo compiling ${file}...
$CC $defines $CPPFLAGS $CFLAGS \
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
-c -I. -I${srcdir} ${srcdir}/$file
done
# 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 on
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 off
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 not exist .\WinRel\nul mkdir .\WinRel
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 off
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
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 "dep.h"
@@ -87,7 +88,7 @@ set_file_variables (file)
for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next)
{
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);
break;
@@ -343,6 +344,7 @@ execute_file_commands (file)
/* We are all out of commands.
If we have gotten this far, all the previous commands
have run successfully, so we have winning update status. */
set_command_state (file, cs_running);
file->update_status = 0;
notice_finished_file (file);
return;
@@ -379,7 +381,7 @@ fatal_error_signal (sig)
return;
}
remove_intermediates (1);
exit (1);
exit (EXIT_FAILURE);
#else /* not __MSDOS__ */
#ifdef _AMIGA
remove_intermediates (1);
@@ -473,13 +475,13 @@ delete_target (file, on_behalf_of)
#ifndef NO_ARCHIVES
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)
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);
else
error ("*** Archive member `%s' may be bogus; not deleted",
error (NILF, "*** Archive member `%s' may be bogus; not deleted",
file->name);
}
return;
@@ -488,12 +490,12 @@ delete_target (file, on_behalf_of)
if (stat (file->name, &st) == 0
&& 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)
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name);
error (NILF, "*** [%s] Deleting file `%s'", on_behalf_of, file->name);
else
error ("*** Deleting file `%s'", file->name);
error (NILF, "*** Deleting file `%s'", file->name);
if (unlink (file->name) < 0
&& errno != ENOENT) /* It disappeared; so what. */
perror_with_name ("unlink: ", file->name);
@@ -533,10 +535,11 @@ print_commands (cmds)
fputs ("# commands to execute", stdout);
if (cmds->filename == 0)
if (cmds->fileinfo.filenm == 0)
puts (" (built-in):");
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;
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
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
and information about where these commands came from. */
struct commands
{
char *filename; /* File that contains commands. */
unsigned int lineno; /* Line number in file. */
struct floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
unsigned int ncommand_lines;/* Number of command lines. */
char **command_lines; /* Commands chopped up into lines. */

View File

@@ -4,121 +4,123 @@
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
#undef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define if using alloca.c. */
#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. */
#undef const
/* #undef const */
/* 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. */
#undef CRAY_STACKSEG_END
/* #undef CRAY_STACKSEG_END */
/* 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. */
#undef GETLOADAVG_PRIVILEGED
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int
/* 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). */
#undef HAVE_ALLOCA_H
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* #undef HAVE_ALLOCA_H */
/* 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. */
#undef HAVE_GETLOADAVG
/* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT
/* #undef HAVE_GETMNTENT */
/* 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 HAVE_LONG_FILE_NAMES
#define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption
by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS
/* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
/* #undef HAVE_ST_BLKSIZE */
/* 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 HAVE_STRCOLL
#define HAVE_STRCOLL 1
/* 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 HAVE_STRFTIME
#define HAVE_STRFTIME 1
/* 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. */
#undef HAVE_TM_ZONE
/* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array
tzname. */
#define HAVE_TZNAME
/* #define tzname __tzname */
#define HAVE_TZNAME 1
/* 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. */
#undef HAVE_UTIME_NULL
/* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF
#define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */
#undef HAVE_WAIT3
/* #undef HAVE_WAIT3 */
/* Define if on MINIX. */
#undef _MINIX
/* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION
/* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */
#undef NLIST_STRUCT
/* #undef NLIST_STRUCT */
/* 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 pid_t int
/* Define if the system does not provide POSIX.1 features except
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. */
#undef _POSIX_SOURCE
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
@@ -126,7 +128,7 @@
/* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V
before release 3. */
#undef SETVBUF_REVERSED
/* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
@@ -138,29 +140,29 @@
#define STACK_DIRECTION -1
/* 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 STDC_HEADERS
/* Define on System V Release 4. */
#undef SVR4
/* #undef SVR4 */
/* 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 uid_t int
/* Define for Encore UMAX. */
#undef UMAX
/* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */
#undef UMAX4_3
/* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* #undef vfork */
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
@@ -172,112 +174,137 @@
#define SCCS_GET "get"
/* 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'. */
#undef HAVE_SYS_SIGLIST
/* #undef HAVE_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>. */
#undef HAVE_UNION_WAIT
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
#undef HAVE_SYSCONF_OPEN_MAX
/* #undef HAVE_UNION_WAIT */
/* Define if you have the dup2 function. */
#undef HAVE_DUP2
/* #undef HAVE_DUP2 */
/* Define if you have the getcwd function. */
#define HAVE_GETCWD
/* Define if you have the getdtablesize function. */
#undef HAVE_GETDTABLESIZE
#define HAVE_GETCWD 1
/* 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 HAVE_MKTEMP
#define HAVE_MKTEMP 1
/* 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. */
#undef HAVE_SETEGID
/* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */
#undef HAVE_SETEUID
/* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF
/* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */
#undef HAVE_SETREGID
/* #undef HAVE_SETREGID */
/* Define if you have the setreuid function. */
#undef HAVE_SETREUID
/* #undef HAVE_SETREUID */
/* 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 HAVE_STRERROR
#define HAVE_STRERROR 1
/* Define if you have the strsignal function. */
#undef HAVE_STRSIGNAL
/* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */
#undef HAVE_WAIT3
/* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID
/* #undef HAVE_WAITPID */
/* 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 HAVE_FCNTL_H
#define HAVE_FCNTL_H 1
/* 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. */
#undef HAVE_MACH_MACH_H
/* #undef HAVE_MACH_MACH_H */
/* 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. */
#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 HAVE_STRING_H
#define HAVE_STRING_H 1
/* 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. */
#undef HAVE_SYS_NDIR_H
/* #undef HAVE_SYS_NDIR_H */
/* 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. */
#undef HAVE_SYS_TIMEB_H
/* #undef HAVE_SYS_TIMEB_H */
/* 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 HAVE_UNISTD_H
#define HAVE_UNISTD_H 1
/* 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). */
#undef HAVE_LIBSUN
/* #undef HAVE_LIBSUN */
/* Define for Case Insensitve behavior */
#define HAVE_CASE_INSENSITIVE_FS

View File

@@ -12,6 +12,9 @@
/* Define if using alloca.c. */
/* #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. */
/* #undef const */
@@ -23,7 +26,7 @@
/* #undef DGUX */
/* 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. */
/* #undef gid_t */
@@ -32,14 +35,14 @@
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H 1 */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* #undef HAVE_ALLOCA_H */
/* Define if you don't have vprintf but do 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. */
/* #undef HAVE_GETLOADAVG */
@@ -66,16 +69,16 @@
/* #undef HAVE_ST_BLOCKS */
/* 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. */
/* #undef HAVE_ST_RDEV */
/* #undef HAVE_ST_RDEV */
/* Define if you have the strftime function. */
/* #undef HAVE_STRFTIME */
/* 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. */
/* #undef HAVE_TM_ZONE */
@@ -93,13 +96,13 @@
/* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H 1 */
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */
/* #undef HAVE_WAIT3 1 */
/* #undef HAVE_WAIT3 */
/* Define if on MINIX. */
/* #undef _MINIX */
@@ -108,7 +111,7 @@
/* #undef NLIST_NAME_UNION */
/* 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. */
/* #undef NO_MINUS_C_MINUS_O */
@@ -120,8 +123,12 @@
with this defined. */
/* #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. */
/* #undef _POSIX_SOURCE */
#define _POSIX_C_SOURCE 1
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
@@ -129,7 +136,7 @@
/* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V
before release 3. */
/* #undef SETVBUF_REVERSED 1 */
/* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
@@ -162,23 +169,30 @@
instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* 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. */
/* #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'. */
/* #undefine HAVE_SYS_SIGLIST 1 */
/* #undefine HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */
@@ -186,45 +200,60 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */
/* #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 HAVE_DUP2 1
/* Define if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getdtablesize function. */
/* #undef HAVE_GETDTABLESIZE 1 */
/* 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 HAVE_MKTEMP 1
/* 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. */
/* #undef HAVE_SETEGID 1 */
/* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */
/* #undef HAVE_SETEUID 1 */
/* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF 1 */
/* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */
/* #undefine HAVE_SETREGID 1 */
/* #undefine HAVE_SETREGID */
/* Define if you have the setreuid function. */
/* #define HAVE_SETREUID 1 */
/* #define HAVE_SETREUID */
/* Define if you have the sigsetmask function. */
#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 HAVE_STRERROR 1
@@ -232,13 +261,13 @@
/* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */
/* #define HAVE_WAIT3 1 */
/* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */
/* #undef HAVE_WAITPID 1 */
/* #undef HAVE_WAITPID */
/* 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. */
#ifdef __DECC
@@ -252,17 +281,17 @@
/* #undef HAVE_MACH_MACH_H */
/* 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. */
/* #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 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. */
/* #undef HAVE_SYS_DIR_H */
@@ -270,27 +299,40 @@
/* #undef HAVE_SYS_NDIR_H */
/* 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 HAVE_SYS_TIMEB_H 1
/* 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). */
/* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */
/* VMS specific */
#define HAVE_VMSDIR_H 1
#define HAVE_STDLIB_H 1
#define INCLUDEDIR "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__)
#undef PARAMS
#define PARAMS(protos) protos

View File

@@ -4,24 +4,27 @@
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
#undef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* 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. */
#undef const
/* #undef const */
/* 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. */
#undef CRAY_STACKSEG_END
/* #undef CRAY_STACKSEG_END */
/* 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. */
#undef GETLOADAVG_PRIVILEGED
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
@@ -32,40 +35,39 @@
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
#define HAVE_MEMMOVE 1
/* #undef HAVE_ALLOCA_H */
/* 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. */
#undef HAVE_GETLOADAVG
/* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT
/* #undef HAVE_GETMNTENT */
/* 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. */
#undef HAVE_LONG_FILE_NAMES
#define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption
by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS
/* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
/* #undef HAVE_ST_BLKSIZE */
/* 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. */
#undef HAVE_STRCOLL
@@ -80,10 +82,10 @@
#define HAVE_STRFTIME 1
/* 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. */
#undef HAVE_TM_ZONE
/* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array
tzname. */
@@ -91,33 +93,33 @@
#define HAVE_TZNAME 1
/* 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. */
#undef HAVE_UTIME_NULL
#define HAVE_UTIME_NULL 1
/* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
#define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */
#undef HAVE_WAIT3
/* #undef HAVE_WAIT3 */
/* Define if on MINIX. */
#undef _MINIX
/* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION
/* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */
#undef NLIST_STRUCT
/* #undef NLIST_STRUCT */
/* 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. */
#undef pid_t
@@ -125,7 +127,7 @@
/* Define if the system does not provide POSIX.1 features except
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. */
#undef _POSIX_SOURCE
@@ -138,7 +140,7 @@
/* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V
before release 3. */
#undef SETVBUF_REVERSED
/* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the
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 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* #undef STACK_DIRECTION */
/* 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. */
#undef STDC_HEADERS
#define STDC_HEADERS 1
/* Define on System V Release 4. */
#undef SVR4
/* #undef SVR4 */
/* 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. */
#undef uid_t
#define uid_t int
/* Define for Encore UMAX. */
#undef UMAX
/* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */
#undef UMAX4_3
/* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* #undef vfork */
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
@@ -187,16 +189,23 @@
#define SCCS_GET "echo no sccs get"
/* 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'. */
#undef HAVE_SYS_SIGLIST
/* #undef HAVE_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>. */
#undef HAVE_UNION_WAIT
/* #undef HAVE_UNION_WAIT */
/* Define if you have the dup2 function. */
#undef HAVE_DUP2
@@ -207,45 +216,67 @@
#define HAVE_GETCWD 1
/* 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. */
#undef HAVE_MKTEMP
#define HAVE_MKTEMP 1
/* 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. */
#undef HAVE_SETEGID
/* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */
#undef HAVE_SETEUID
/* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF
/* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */
#undef HAVE_SETREGID
/* #undef HAVE_SETREGID */
/* Define if you have the setreuid function. */
#undef HAVE_SETREUID
/* #undef HAVE_SETREUID */
/* 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. */
#undef HAVE_STRERROR
#define HAVE_STRERROR 1
/* Define if you have the strsignal function. */
#undef HAVE_STRSIGNAL
/* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */
#undef HAVE_WAIT3
/* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID
/* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@@ -260,43 +291,46 @@
#define HAVE_LIMITS_H 1
/* 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. */
#undef HAVE_MEMORY_H
#define HAVE_MEMORY_H 1
/* 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. */
#undef HAVE_STRING_H
#define HAVE_STRING_H 1
/* 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. */
#undef HAVE_SYS_NDIR_H
/* #undef HAVE_SYS_NDIR_H */
/* 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. */
#undef HAVE_SYS_TIMEB_H
#define HAVE_SYS_TIMEB_H 1
/* 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. */
#undef HAVE_UNISTD_H
/* #undef HAVE_UNISTD_H */
/* 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). */
#undef HAVE_LIBSUN
/* #undef HAVE_LIBSUN */
/*
* 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. */
#include <sys/config.h>
@@ -9,8 +8,20 @@
/* Version of this package (needed by automake) */
#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 SIGMAX
# define NSIG SIGMAX
#endif
/* Define if you have sigsetmask. */
#define HAVE_SIGSETMASK 1

View File

@@ -1,21 +1,19 @@
dnl Process this file with autoconf to produce a configure script.
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.
AM_INIT_AUTOMAKE(make, 3.77)
AM_INIT_AUTOMAKE(make, 3.77.90)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob)
AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
dnl Regular configure stuff
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_RANLIB
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_ISC_POSIX
AC_MINIX
@@ -30,12 +28,15 @@ AC_HEADER_DIRENT
AC_TYPE_UID_T dnl Also does gid_t.
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
sys/timeb.h)
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
memory.h sys/timeb.h)
AC_PROG_CC_C_O
AC_C_CONST dnl getopt needs this.
AC_HEADER_STAT
AC_STRUCT_ST_MTIM_NSEC
jm_AC_TYPE_UINTMAX_T
AC_SUBST(LIBOBJS)
AC_DEFUN(AC_CHECK_SYMBOL, [dnl
@@ -51,19 +52,26 @@ changequote([,])dnl
fi
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
dup2 getcwd sigsetmask getgroups setlinebuf \
seteuid setegid setreuid setregid strerror strsignal)
# clock_gettime is in -lposix4 in Solaris 2.6.
AC_CHECK_LIB(posix4, clock_gettime)
AC_CHECK_FUNCS(memmove strdup psignal mktemp pstat_getdynamic \
clock_gettime dup2 getcwd sigsetmask getgroups setlinebuf \
seteuid setegid setreuid setregid strerror strsignal pipe)
AC_CHECK_SYMBOL(sys_siglist)
AC_FUNC_ALLOCA
AC_FUNC_VFORK
AC_FUNC_VPRINTF
AC_FUNC_STRCOLL
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_GETLOADAVG
AC_FUNC_SELECT
AC_CHECK_LIB(kstat, kstat_open)
AC_FUNC_STRCOLL
# 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_CACHE_VAL(make_cv_union_wait, [dnl
AC_TRY_LINK([#include <sys/types.h>
@@ -117,27 +125,92 @@ AC_ARG_WITH(customs,
;;
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"],
[make_cv_job_server="yes"])
case "$ac_cv_func_pipe $make_cv_job_server" in
"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
SCCS_GET=/usr/sccs/get
AC_DEFINE(SCCS_GET, "/usr/sccs/get")
make_cv_path_sccs_get=/usr/sccs/get
else
SCCS_GET=get
AC_DEFINE(SCCS_GET, "get")
fi
make_cv_path_sccs_get=get
fi])
AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
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 &&
test -f s.conftest; then
# We successfully created an SCCS file.
echo checking if SCCS get command understands -G
if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast; then
AC_DEFINE(SCCS_GET_MINUS_G)
fi
AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast; then
make_cv_sys_get_minus_G=yes
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
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)
dnl build.sh is also an AC_OUTPUT, but we can't specify it here because
dnl it's built from build.template and autoconf will crap out. So, we
dnl build it in the makefiles themselves.
AC_OUTPUT(build.sh Makefile glob/Makefile)
case "$make_badcust" in
yes) echo
@@ -159,6 +232,15 @@ case "$with_customs" in
fi ;;
esac
case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
no/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
dnl Local Variables:
dnl comment-start: "dnl "
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
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 "rule.h"
@@ -182,21 +183,21 @@ static char *default_suffix_rules[] =
".S.o",
"$(COMPILE.S) -o $@ $<",
".c.o",
"$(COMPILE.c) $< $(OUTPUT_OPTION)",
"$(COMPILE.c) $(OUTPUT_OPTION) $<",
".cc.o",
"$(COMPILE.cc) $< $(OUTPUT_OPTION)",
"$(COMPILE.cc) $(OUTPUT_OPTION) $<",
".C.o",
"$(COMPILE.C) $< $(OUTPUT_OPTION)",
"$(COMPILE.C) $(OUTPUT_OPTION) $<",
".cpp.o",
"$(COMPILE.cpp) $< $(OUTPUT_OPTION)",
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o",
"$(COMPILE.f) $< $(OUTPUT_OPTION)",
"$(COMPILE.f) $(OUTPUT_OPTION) $<",
".p.o",
"$(COMPILE.p) $< $(OUTPUT_OPTION)",
"$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o",
"$(COMPILE.F) $< $(OUTPUT_OPTION)",
"$(COMPILE.F) $(OUTPUT_OPTION) $<",
".r.o",
"$(COMPILE.r) $< $(OUTPUT_OPTION)",
"$(COMPILE.r) $(OUTPUT_OPTION) $<",
".mod.o",
"$(COMPILE.mod) -o $@ $<",
@@ -221,9 +222,9 @@ static char *default_suffix_rules[] =
"@$(RM) $@ \n $(LEX.l) $< > $@",
".F.f",
"$(PREPROCESS.F) $< $(OUTPUT_OPTION)",
"$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f",
"$(PREPROCESS.r) $< $(OUTPUT_OPTION)",
"$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
/* This might actually make lex.yy.c if there's no %R%
directive in $*.l, but in that case why were you
@@ -425,6 +426,16 @@ static char *default_variables[] =
"SCCS_OUTPUT_OPTION", "-G$@",
#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 */
0, 0
};
@@ -468,7 +479,7 @@ install_default_suffix_rules ()
if (f->cmds == 0)
{
f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
f->cmds->filename = 0;
f->cmds->fileinfo.filenm = 0;
f->cmds->commands = s[1];
f->cmds->command_lines = 0;
}
@@ -498,6 +509,9 @@ define_default_variables ()
{
register char **s;
if (no_builtin_variables_flag)
return;
for (s = default_variables; *s != 0; s += 2)
(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
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.
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 ();
#endif
extern struct dep *copy_dep_chain PARAMS ((struct dep *d));
extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
/* 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
extern int update_goal_chain PARAMS ((struct dep *goals, int makefiles));
extern void uniquize_deps PARAMS ((struct dep *));

16
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
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"
@@ -331,6 +332,13 @@ find_directory (name)
#ifdef VMS
if (vmsstat_dir (name, &st) < 0)
#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)
#endif
{
@@ -384,7 +392,7 @@ find_directory (name)
/* Enter it in the contents hash table. */
dc->dev = st.st_dev;
#ifdef WINDOWS32
dc->path_key = strdup(w32_path);
dc->path_key = xstrdup(w32_path);
dc->mtime = st.st_mtime;
/*
@@ -771,7 +779,7 @@ file_impossible (filename)
new = (struct dirfile *) xmalloc (sizeof (struct dirfile));
new->next = dir->contents->files[hash];
dir->contents->files[hash] = new;
new->name = savestring (filename, strlen (filename));
new->name = xstrdup (filename);
new->impossible = 1;
}
@@ -1060,7 +1068,9 @@ void
dir_setup_glob (gl)
glob_t *gl;
{
#ifndef VMS
extern int stat ();
#endif
/* Bogus sunos4 compiler complains (!) about & before functions. */
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
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 "filedef.h"
@@ -95,17 +96,9 @@ recursively_expand (v)
char *value;
if (v->expanding)
{
/* Expanding V causes infinite recursion. Lose. */
if (reading_filename == 0)
fatal ("Recursive variable `%s' references itself (eventually)",
v->name);
else
makefile_fatal
(reading_filename, *reading_lineno_ptr,
"Recursive variable `%s' references itself (eventually)",
v->name);
}
/* Expanding V causes infinite recursion. Lose. */
fatal (reading_file,
"Recursive variable `%s' references itself (eventually)", v->name);
v->expanding = 1;
value = allocated_variable_expand (v->value);
@@ -125,14 +118,8 @@ warn_undefined (name, length)
unsigned int length;
{
if (warn_undefined_variables_flag)
{
static const char warnmsg[] = "warning: undefined variable `%.*s'";
if (reading_filename != 0)
makefile_error (reading_filename, *reading_lineno_ptr,
warnmsg, length, name);
else
error (warnmsg, length, name);
}
error (reading_file,
"warning: undefined variable `%.*s'", (int)length, name);
}
/* Expand a simple reference to variable NAME, which is LENGTH chars long. */
@@ -243,14 +230,8 @@ variable_expand_string (line, string, length)
end = index (beg, closeparen);
if (end == 0)
{
/* Unterminated variable reference. */
if (reading_filename != 0)
makefile_fatal (reading_filename, *reading_lineno_ptr,
"unterminated variable reference");
else
fatal ("unterminated variable reference");
}
/* Unterminated variable reference. */
fatal (reading_file, "unterminated variable reference");
p1 = lindex (beg, end, '$');
if (p1 != 0)
{
@@ -417,7 +398,7 @@ char *
variable_expand (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.
@@ -460,8 +441,7 @@ variable_expand_for_file (line, file)
save = current_variable_set_list;
current_variable_set_list = file->variables;
reading_filename = file->cmds->filename;
reading_lineno_ptr = &file->cmds->lineno;
reading_file = &file->cmds->fileinfo;
fnext = file->variables->next;
/* See if there's a pattern-specific variable struct for this target. */
if (!file->pat_searched)
@@ -476,8 +456,7 @@ variable_expand_for_file (line, file)
}
result = variable_expand (line);
current_variable_set_list = save;
reading_filename = 0;
reading_lineno_ptr = 0;
reading_file = 0;
file->variables->next = fnext;
return result;

94
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
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 "dep.h"
@@ -22,7 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "job.h"
#include "commands.h"
#include "variable.h"
#include <assert.h>
/* 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;
/* 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.
lookup_file given a name, return the struct file * for that name,
@@ -294,22 +299,22 @@ file_hash_enter (file, name, oldhash, oldname)
/* We have two sets of commands. We will go with the
one given in the rule explicitly mentioning this name,
but give a message to let the user know what's going on. */
if (oldfile->cmds->filename != 0)
makefile_error (file->cmds->filename, file->cmds->lineno,
"Commands were specified for \
file `%s' at %s:%u,",
oldname, oldfile->cmds->filename,
oldfile->cmds->lineno);
if (oldfile->cmds->fileinfo.filenm != 0)
error (&file->cmds->fileinfo,
"Commands were specified for \
file `%s' at %s:%lu,",
oldname, oldfile->cmds->fileinfo.filenm,
oldfile->cmds->fileinfo.lineno);
else
makefile_error (file->cmds->filename, file->cmds->lineno,
error (&file->cmds->fileinfo,
"Commands for file `%s' were found by \
implicit rule search,",
oldname);
makefile_error (file->cmds->filename, file->cmds->lineno,
error (&file->cmds->fileinfo,
"but `%s' is now considered the same file \
as `%s'.",
oldname, name);
makefile_error (file->cmds->filename, file->cmds->lineno,
error (&file->cmds->fileinfo,
"Commands for `%s' will be ignored \
in favor of those for `%s'.",
name, oldname);
@@ -331,12 +336,12 @@ in favor of those for `%s'.",
merge_variable_set_lists (&oldfile->variables, file->variables);
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);
if (!oldfile->double_colon && file->double_colon)
{
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);
else
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. */
oldfile->last_mtime = file->last_mtime;
oldfile->mtime_before_update = file->mtime_before_update;
#define MERGE(field) oldfile->field |= file->field
MERGE (precious);
MERGE (tried_implicit);
@@ -401,7 +408,7 @@ remove_intermediates (sig)
if (!f->dontcare)
{
if (sig)
error ("*** Deleting intermediate file `%s'", f->name);
error (NILF, "*** Deleting intermediate file `%s'", f->name);
else if (!silent_flag)
{
if (! doneany)
@@ -465,7 +472,8 @@ snap_deps ()
{
/* Mark this file as phony and nonexistent. */
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)
@@ -549,6 +557,51 @@ set_command_state (file, 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. */
static void
@@ -587,13 +640,16 @@ print_file (f)
printf (" %s", dep_name (d));
putchar ('\n');
}
if (f->last_mtime == (time_t) 0)
if (f->last_mtime == 0)
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.");
else
printf ("# Last modified %.24s (%ld)\n",
ctime (&f->last_mtime), (long int) f->last_mtime);
{
char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
file_timestamp_sprintf (buf, f->last_mtime);
printf ("# Last modified %s\n", buf);
}
printf ("# File has%s been updated.\n",
f->updated ? "" : " not");
switch (f->command_state)

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
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
that the makefile says how to make.
@@ -32,7 +34,9 @@ struct file
char *stem; /* Implicit stem, if an implicit
rule has been used */
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;
used when there are multiple double-colon
entries for the same file. */
@@ -83,25 +87,83 @@ struct file
unsigned int secondary:1;
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
this target cannot be remade. */
unsigned int shownerror:1; /* Nonzero if we printed an error */
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */
unsigned int mfile_status:1;/* Nonzero if update_status was obtained
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
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. */
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 *lookup_file (), *enter_file ();
extern void remove_intermediates (), snap_deps ();
extern void rename_file (), rehash_file (), file_hash_enter ();
extern void set_command_state ();
extern struct file *lookup_file PARAMS ((char *name));
extern struct file *enter_file PARAMS ((char *name));
extern void remove_intermediates PARAMS ((int sig));
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.
The value is -1 if the file does not exist. */
#define file_mtime(f) file_mtime_1 ((f), 1)
@@ -110,9 +172,9 @@ extern void set_command_state ();
we don't find it.
The value is -1 if the file does not exist. */
#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) \
((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
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
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",
so use one less than that, because -1 is used for non-existing files. */
If FILE_TIMESTAMP is unsigned, its maximum value is the same as
((FILE_TIMESTAMP) -1), so use one less than that, because -1 is
used for non-existing files. */
#define NEW_MTIME \
(INTEGER_TYPE_SIGNED (time_t) \
? INTEGER_TYPE_MAXIMUM (time_t) \
: (INTEGER_TYPE_MAXIMUM (time_t) - 1))
(INTEGER_TYPE_SIGNED (FILE_TIMESTAMP) \
? INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
: (INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) - 1))
#define check_renamed(file) \
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */

2871
function.c

File diff suppressed because it is too large Load Diff

View File

@@ -132,6 +132,12 @@ extern int errno;
# undef FSCALE
# 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 a little farther down with #ifndef. */
@@ -528,13 +534,13 @@ static long offset;
#if !defined(VMS) && !defined(sgi) && !defined(__linux__)
static struct nlist nl[2];
#endif
#endif /* Not VMS or sgi */
#ifdef SUNOS_5
static kvm_t *kd;
#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
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
litter any child's descriptor table. */
# ifdef FD_SETFD
# ifdef F_SETFD
# ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
# endif
@@ -1032,7 +1038,7 @@ getloadavg (loadavg, nelem)
#endif /* ! HAVE_GETLOADAVG */
#ifdef TEST
void
int
main (argc, argv)
int argc;
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>
* glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich

View File

@@ -1,6 +1,6 @@
# -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.3 foreign
AUTOMAKE_OPTIONS = 1.4 foreign
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 library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@
#include <fnmatch.h>
#include <ctype.h>
#if HAVE_STRING_H
#if HAVE_STRING_H || defined _LIBC
# include <string.h>
#else
# include <strings.h>
@@ -127,16 +127,35 @@ extern char *getenv ();
extern int errno;
# 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
it matches, nonzero if not. */
int
fnmatch (pattern, string, flags)
static int
#ifdef _LIBC
internal_function
#endif
internal_fnmatch (pattern, string, no_leading_period, flags)
const char *pattern;
const char *string;
int no_leading_period;
int flags;
{
register const char *p = pattern, *n = string;
register char c;
register unsigned char c;
/* Note that this evaluates C many times. */
# ifdef _LIBC
@@ -154,10 +173,11 @@ fnmatch (pattern, string, flags)
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
else if (*n == '/' && (flags & FNM_FILE_NAME))
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
else if (*n == '.' && no_leading_period
&& (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
break;
@@ -170,18 +190,19 @@ fnmatch (pattern, string, flags)
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD (*n) != c)
if (FOLD ((unsigned char) *n) != c)
return FNM_NOMATCH;
break;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
if (*n == '.' && no_leading_period
&& (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
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. */
return FNM_NOMATCH;
else if (c == '?')
@@ -199,17 +220,65 @@ fnmatch (pattern, string, flags)
}
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;
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
return FNM_NOMATCH;
}
endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
if (c == '[')
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
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 '[':
{
@@ -224,8 +293,10 @@ fnmatch (pattern, string, flags)
if (*n == '\0')
return FNM_NOMATCH;
if (*n == '.' && (flags & FNM_PERIOD) &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
if (*n == '.' && no_leading_period && (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME))))
return FNM_NOMATCH;
if (*n == '/' && (flags & FNM_FILE_NAME))
@@ -239,13 +310,14 @@ fnmatch (pattern, string, flags)
c = *p++;
for (;;)
{
int fn = FOLD (*n);
unsigned char fn = FOLD ((unsigned char) *n);
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
c = FOLD (*p++);
c = FOLD ((unsigned char) *p);
++p;
if (c == fn)
goto matched;
@@ -258,6 +330,7 @@ fnmatch (pattern, string, flags)
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt;
# endif
const char *startp = p;
for (;;)
{
@@ -272,7 +345,15 @@ fnmatch (pattern, string, flags)
p += 2;
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';
@@ -282,47 +363,52 @@ fnmatch (pattern, string, flags)
/* Invalid character class name. */
return FNM_NOMATCH;
if (__iswctype (__btowc (*n), wt))
if (__iswctype (__btowc ((unsigned char) *n), wt))
goto matched;
# else
if ((STREQ (str, "alnum") && ISALNUM (*n))
|| (STREQ (str, "alpha") && ISALPHA (*n))
|| (STREQ (str, "blank") && ISBLANK (*n))
|| (STREQ (str, "cntrl") && ISCNTRL (*n))
|| (STREQ (str, "digit") && ISDIGIT (*n))
|| (STREQ (str, "graph") && ISGRAPH (*n))
|| (STREQ (str, "lower") && ISLOWER (*n))
|| (STREQ (str, "print") && ISPRINT (*n))
|| (STREQ (str, "punct") && ISPUNCT (*n))
|| (STREQ (str, "space") && ISSPACE (*n))
|| (STREQ (str, "upper") && ISUPPER (*n))
|| (STREQ (str, "xdigit") && ISXDIGIT (*n)))
if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|| (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|| (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|| (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|| (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|| (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|| (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|| (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|| (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|| (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|| (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|| (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
goto matched;
# endif
}
else if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
else if (FOLD (c) == fn)
goto matched;
cold = c;
c = *p++;
if (c == '-' && *p != ']')
else
{
/* It is a range. */
char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend))
normal_bracket:
if (FOLD (c) == fn)
goto matched;
cold = c;
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 == ']')
break;
}
@@ -363,7 +449,7 @@ fnmatch (pattern, string, flags)
break;
default:
if (c != FOLD (*n))
if (c != FOLD ((unsigned char) *n))
return FNM_NOMATCH;
}
@@ -382,4 +468,14 @@ fnmatch (pattern, string, flags)
# 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__. */

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.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,8 +24,10 @@ extern "C" {
#endif
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# undef __P
# define __P(protos) protos
# if !defined __GLIBC__ || !defined __P
# undef __P
# define __P(protos) protos
# endif
#else /* Not C++ or ANSI C. */
# undef __P
# define __P(protos) ()
@@ -66,13 +68,13 @@ extern "C" {
`fnmatch'. 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
#ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1)
#endif
/* Match STRING against the filename pattern PATTERN,
/* Match NAME against the filename pattern PATTERN,
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));
#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
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
# define HAVE_MEMPCPY 1
# undef mempcpy
# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
#endif
#ifndef __GNU_LIBRARY__
# ifdef __GNUC__
__inline
@@ -240,11 +240,17 @@ extern char *alloca ();
#endif
#ifdef _LIBC
# undef strdup
# define strdup(str) __strdup (str)
# define sysconf(id) __sysconf (id)
# define closedir(dir) __closedir (dir)
# define opendir(name) __opendir (name)
# 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
#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
@@ -274,6 +280,12 @@ extern char *alloca ();
# undef GLOB_PERIOD
#endif
#include <glob.h>
#ifdef HAVE_GETLOGIN_R
extern int getlogin_r __P ((char *, size_t));
#else
extern char *getlogin __P ((void));
#endif
static
#if __GNUC__ - 0 >= 2
@@ -282,7 +294,7 @@ inline
const char *next_brace_sub __P ((const char *begin));
static int glob_in_dir __P ((const char *pattern, const char *directory,
int flags,
int (*errfunc) __P ((const char *, int)),
int (*errfunc) (const char *, int),
glob_t *pglob));
static int prefix_array __P ((const char *prefix, char **array, size_t n));
static int collated_compare __P ((const __ptr_t, const __ptr_t));
@@ -349,7 +361,7 @@ glob (pattern, flags, errfunc, pglob)
glob_t *pglob;
{
const char *filename;
char *dirname;
const char *dirname;
size_t dirlen;
int status;
int oldcount;
@@ -501,39 +513,40 @@ glob (pattern, flags, errfunc, pglob)
{
/* This can mean two things: a simple name or "~name". The later
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);
/* Set FILENAME to NULL as a special flag. This is ugly but
other solutions would require much more code. We test for
this special case below. */
filename = NULL;
/* Set FILENAME to NULL as a special flag. This is ugly but
other solutions would require much more code. We test for
this special case below. */
filename = NULL;
}
else
{
filename = pattern;
filename = pattern;
#ifdef _AMIGA
dirname = (char *) "";
dirname = "";
#else
dirname = (char *) ".";
dirname = ".";
#endif
dirlen = 0;
}
dirlen = 0;
}
}
else if (filename == pattern)
{
/* "/pattern". */
dirname = (char *) "/";
dirname = "/";
dirlen = 1;
++filename;
}
else
{
char *newp;
dirlen = filename - pattern;
#if defined __MSDOS__ || defined WINDOWS32
if ((*filename == ':')
if (*filename == ':'
|| (filename > pattern + 1 && filename[-1] == ':'))
{
char *drive_spec;
@@ -555,30 +568,31 @@ glob (pattern, flags, errfunc, pglob)
from "d:/", since "d:" and "d:/" are not the same.*/
}
#endif
dirname = (char *) __alloca (dirlen + 1);
newp = (char *) __alloca (dirlen + 1);
#ifdef HAVE_MEMPCPY
*((char *) mempcpy (dirname, pattern, dirlen)) = '\0';
*((char *) mempcpy (newp, pattern, dirlen)) = '\0';
#else
memcpy (dirname, pattern, dirlen);
dirname[dirlen] = '\0';
memcpy (newp, pattern, dirlen);
newp[dirlen] = '\0';
#endif
dirname = newp;
++filename;
if (filename[0] == '\0'
#if defined __MSDOS__ || defined WINDOWS32
&& dirname[dirlen-1] != ':'
&& (dirlen < 3 || dirname[dirlen-2] != ':'
|| dirname[dirlen-1] != '/')
&& dirname[dirlen - 1] != ':'
&& (dirlen < 3 || dirname[dirlen - 2] != ':'
|| dirname[dirlen - 1] != '/')
#endif
&& dirlen > 1)
/* "pattern/". Expand "pattern", appending slashes. */
{
int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
if (val == 0)
pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
| (flags & GLOB_MARK));
return val;
}
&& dirlen > 1)
/* "pattern/". Expand "pattern", appending slashes. */
{
int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
if (val == 0)
pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
| (flags & GLOB_MARK));
return val;
}
}
if (!(flags & GLOB_APPEND))
@@ -590,12 +604,12 @@ glob (pattern, flags, errfunc, pglob)
oldcount = pglob->gl_pathc;
#ifndef VMS
if ((flags & GLOB_TILDE) && dirname[0] == '~')
if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/')
{
/* Look up home directory. */
char *home_dir = getenv ("HOME");
const char *home_dir = getenv ("HOME");
# ifdef _AMIGA
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS:";
@@ -607,45 +621,61 @@ glob (pattern, flags, errfunc, pglob)
if (home_dir == NULL || home_dir[0] == '\0')
{
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;
# if defined HAVE_GETLOGIN_R || defined _LIBC
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
if (buflen == 0)
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
a moderate value. */
buflen = 16;
buflen = 20;
name = (char *) __alloca (buflen);
success = getlogin_r (name, buflen) >= 0;
# else
extern char *getlogin __P ((void));
char *name;
success = (name = getlogin ()) != NULL;
# endif
if (success)
{
struct passwd *p;
# if defined HAVE_GETPWNAM_R || defined _LIBC
size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
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);
success = (__getpwnam_r (name, &pwbuf, pwtmpbuf,
pwbuflen, &p) >= 0);
while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
!= 0)
{
if (errno != ERANGE)
{
p = NULL;
break;
}
pwbuflen *= 2;
pwtmpbuf = (char *) __alloca (pwbuflen);
__set_errno (save);
}
# else
struct passwd *p = getpwnam (name);
success = p != NULL;
p = getpwnam (name);
# endif
if (success)
if (p != NULL)
home_dir = p->pw_dir;
}
}
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
/* Now construct the full directory. */
@@ -670,40 +700,58 @@ glob (pattern, flags, errfunc, pglob)
else
{
char *end_name = strchr (dirname, '/');
char *user_name;
char *home_dir;
const char *user_name;
const char *home_dir;
if (end_name == NULL)
user_name = dirname + 1;
else
{
user_name = (char *) __alloca (end_name - dirname);
char *newp;
newp = (char *) __alloca (end_name - dirname);
# ifdef HAVE_MEMPCPY
*((char *) mempcpy (user_name, dirname + 1, end_name - dirname))
*((char *) mempcpy (newp, dirname + 1, end_name - dirname))
= '\0';
# else
memcpy (user_name, dirname + 1, end_name - dirname);
user_name[end_name - dirname - 1] = '\0';
memcpy (newp, dirname + 1, end_name - dirname);
newp[end_name - dirname - 1] = '\0';
# endif
user_name = newp;
}
/* Look up specific user's home directory. */
{
struct passwd *p;
# if defined HAVE_GETPWNAM_R || defined _LIBC
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf = (char *) __alloca (buflen);
struct passwd pwbuf, *p;
if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
home_dir = p->pw_dir;
else
home_dir = NULL;
char *pwtmpbuf;
struct passwd pwbuf;
int save = errno;
if (buflen == -1)
/* `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
struct passwd *p = getpwnam (user_name);
p = getpwnam (user_name);
# endif
if (p != NULL)
home_dir = p->pw_dir;
else
home_dir = NULL;
# endif
}
/* If we found a home directory use this. */
if (home_dir != NULL)
@@ -722,6 +770,11 @@ glob (pattern, flags, errfunc, pglob)
# endif
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. */
}
@@ -850,78 +903,80 @@ glob (pattern, flags, errfunc, pglob)
flag was set we must return the list consisting of the disrectory
names followed by the filename. */
if (pglob->gl_pathc == oldcount)
/* No matches. */
if (flags & GLOB_NOCHECK)
{
size_t filename_len = strlen (filename) + 1;
char **new_pathv;
struct stat st;
{
/* No matches. */
if (flags & GLOB_NOCHECK)
{
size_t filename_len = strlen (filename) + 1;
char **new_pathv;
struct stat st;
/* This is an pessimistic guess about the size. */
pglob->gl_pathv
= (char **) realloc (pglob->gl_pathv,
(pglob->gl_pathc +
((flags & GLOB_DOOFFS) ?
pglob->gl_offs : 0) +
dirs.gl_pathc + 1) *
sizeof (char *));
if (pglob->gl_pathv == NULL)
{
globfree (&dirs);
return GLOB_NOSPACE;
}
/* This is an pessimistic guess about the size. */
pglob->gl_pathv
= (char **) realloc (pglob->gl_pathv,
(pglob->gl_pathc +
((flags & GLOB_DOOFFS) ?
pglob->gl_offs : 0) +
dirs.gl_pathc + 1) *
sizeof (char *));
if (pglob->gl_pathv == NULL)
{
globfree (&dirs);
return GLOB_NOSPACE;
}
if (flags & GLOB_DOOFFS)
while (pglob->gl_pathc < pglob->gl_offs)
pglob->gl_pathv[pglob->gl_pathc++] = NULL;
if (flags & GLOB_DOOFFS)
while (pglob->gl_pathc < pglob->gl_offs)
pglob->gl_pathv[pglob->gl_pathc++] = NULL;
for (i = 0; i < dirs.gl_pathc; ++i)
{
const char *dir = dirs.gl_pathv[i];
size_t dir_len = strlen (dir);
for (i = 0; i < dirs.gl_pathc; ++i)
{
const char *dir = dirs.gl_pathv[i];
size_t dir_len = strlen (dir);
/* First check whether this really is a directory. */
if (((flags & GLOB_ALTDIRFUNC)
? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0
|| !S_ISDIR (st.st_mode))
/* No directory, ignore this entry. */
continue;
/* First check whether this really is a directory. */
if (((flags & GLOB_ALTDIRFUNC)
? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0
|| !S_ISDIR (st.st_mode))
/* No directory, ignore this entry. */
continue;
pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1
+ filename_len);
if (pglob->gl_pathv[pglob->gl_pathc] == NULL)
{
globfree (&dirs);
globfree (pglob);
return GLOB_NOSPACE;
}
pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1
+ filename_len);
if (pglob->gl_pathv[pglob->gl_pathc] == NULL)
{
globfree (&dirs);
globfree (pglob);
return GLOB_NOSPACE;
}
#ifdef HAVE_MEMPCPY
mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc],
dir, dir_len),
"/", 1),
filename, filename_len);
mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc],
dir, dir_len),
"/", 1),
filename, filename_len);
#else
memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len);
pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/';
memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1],
filename, filename_len);
memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len);
pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/';
memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1],
filename, filename_len);
#endif
++pglob->gl_pathc;
}
++pglob->gl_pathc;
}
pglob->gl_pathv[pglob->gl_pathc] = NULL;
pglob->gl_flags = flags;
pglob->gl_pathv[pglob->gl_pathc] = NULL;
pglob->gl_flags = flags;
/* Now we know how large the gl_pathv vector must be. */
new_pathv = (char **) realloc (pglob->gl_pathv,
((pglob->gl_pathc + 1)
* sizeof (char *)));
if (new_pathv != NULL)
pglob->gl_pathv = new_pathv;
}
else
return GLOB_NOMATCH;
/* Now we know how large the gl_pathv vector must be. */
new_pathv = (char **) realloc (pglob->gl_pathv,
((pglob->gl_pathc + 1)
* sizeof (char *)));
if (new_pathv != NULL)
pglob->gl_pathv = new_pathv;
}
else
return GLOB_NOMATCH;
}
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.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
int
@@ -1126,8 +1183,9 @@ __glob_pattern_p (pattern, quote)
return 0;
}
#ifdef _LIBC
# ifdef _LIBC
weak_alias (__glob_pattern_p, glob_pattern_p)
# endif
#endif
@@ -1213,8 +1271,9 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
: (__ptr_t) opendir (directory));
if (stream == NULL)
{
if ((errfunc != NULL && (*errfunc) (directory, errno))
|| (flags & GLOB_ERR))
if (errno != ENOTDIR
&& ((errfunc != NULL && (*errfunc) (directory, errno))
|| (flags & GLOB_ERR)))
return GLOB_ABORTED;
nfound = 0;
meta = 0;
@@ -1317,10 +1376,12 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
save = errno;
if (stream != NULL)
if (flags & GLOB_ALTDIRFUNC)
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
{
if (flags & GLOB_ALTDIRFUNC)
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
}
__set_errno (save);
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
modify it under the terms of the GNU Library General Public License as
@@ -24,21 +24,42 @@ extern "C" {
#undef __ptr_t
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# undef __P
# define __P(protos) protos
# define __ptr_t void *
# if !defined __GNUC__ || __GNUC__ < 2
# undef __const
# define __const const
# if !defined __GLIBC__ || !defined __P
# undef __P
# undef __PMT
# define __P(protos) protos
# define __PMT(protos) protos
# if !defined __GNUC__ || __GNUC__ < 2
# undef __const
# define __const const
# endif
# endif
# define __ptr_t void *
#else /* Not C++ or ANSI C. */
# undef __P
# undef __PMT
# define __P(protos) ()
# define __PMT(protos) ()
# undef __const
# define __const
# define __ptr_t char *
#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'. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */
#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_TILDE (1 << 12)/* Expand ~user and ~ to home 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| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR)
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
@@ -71,41 +94,52 @@ extern "C" {
#define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
#ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of
GLOB_ABORTED. Provide a compatibility definition here. */
# define GLOB_ABEND GLOB_ABORTED
#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. */
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
struct stat;
#endif
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. */
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. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */
void (*gl_closedir) __P ((void *));
struct dirent *(*gl_readdir) __P ((void *));
__ptr_t (*gl_opendir) __P ((__const char *));
int (*gl_lstat) __P ((__const char *, struct stat *));
int (*gl_stat) __P ((__const char *, struct stat *));
void (*gl_closedir) __PMT ((void *));
struct dirent *(*gl_readdir) __PMT ((void *));
__ptr_t (*gl_opendir) __PMT ((__const char *));
int (*gl_lstat) __PMT ((__const char *, struct stat *));
int (*gl_stat) __PMT ((__const char *, struct stat *));
} 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.
The bits defined above may be set in FLAGS.
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.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
#if _FILE_OFFSET_BITS != 64
extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) __P ((__const char *, int)),
int (*__errfunc) (__const char *, int),
glob_t *__pglob));
/* Free storage allocated in PGLOB by a previous `glob' call. */
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
@@ -128,7 +183,6 @@ extern void globfree __P ((glob_t *__pglob));
This function is not part of the interface specified by POSIX.2
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));
#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
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 "rule.h"
@@ -148,7 +149,7 @@ pattern_search (file, archive, depth, recursions)
that is not just `%'. */
int specific_rule_matched = 0;
register unsigned int i;
register unsigned int i = 0; /* uninit checks OK */
register struct rule *rule;
register struct dep *dep;
@@ -246,11 +247,11 @@ pattern_search (file, archive, depth, recursions)
if (check_lastslash)
{
if (stem > (lastslash + 1)
&& strncmp (target, lastslash + 1, stem - lastslash - 1))
&& !strneq (target, lastslash + 1, stem - lastslash - 1))
continue;
}
else if (stem > filename
&& strncmp (target, filename, stem - filename))
&& !strneq (target, filename, stem - filename))
continue;
/* Check that the rule pattern matches the text after the stem.
@@ -342,6 +343,8 @@ pattern_search (file, archive, depth, recursions)
deps_found = 0;
for (dep = rule->deps; dep != 0; dep = dep->next)
{
struct file *fp;
/* If the dependency name has a %, substitute the stem. */
p = index (dep_name (dep), '%');
if (p != 0)
@@ -390,17 +393,20 @@ pattern_search (file, archive, depth, recursions)
dependency file we are actually looking for is in a different
directory (the one gotten by prepending FILENAME's directory),
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)
&& (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;
}
/* This code, given FILENAME = "lib/foo.o", dependency name
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
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);
strcpy(vp, p);
@@ -426,7 +432,7 @@ pattern_search (file, archive, depth, recursions)
if (pattern_search (intermediate_file, 0, depth + 1,
recursions + 1))
{
p = savestring (p, strlen (p));
p = xstrdup (p);
intermediate_patterns[deps_found]
= intermediate_file->name;
intermediate_file->name = p;
@@ -435,7 +441,7 @@ pattern_search (file, archive, depth, recursions)
/* Allocate an extra copy to go in FOUND_FILES,
because every elt of FOUND_FILES is consumed
or freed later. */
found_files[deps_found] = savestring (p, strlen (p));
found_files[deps_found] = xstrdup (p);
++deps_found;
continue;
}
@@ -518,6 +524,7 @@ pattern_search (file, archive, depth, recursions)
f->deps = imf->deps;
f->cmds = imf->cmds;
f->stem = imf->stem;
f->also_make = imf->also_make;
imf = lookup_file (intermediate_patterns[deps_found]);
if (imf != 0 && imf->precious)
f->precious = 1;
@@ -526,6 +533,9 @@ pattern_search (file, archive, depth, recursions)
for (dep = f->deps; dep != 0; dep = dep->next)
{
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->file->tried_implicit |= dep->changed;
}
@@ -585,10 +595,9 @@ pattern_search (file, archive, depth, recursions)
file->cmds = rule->cmds;
/* Put the targets other than the one that
matched into FILE's `also_make' member. */
/* If this rule builds other targets, too, put the others into FILE's
`also_make' member. */
/* If there was only one target, there is nothing to do. */
if (rule->targets[1] != 0)
for (i = 0; rule->targets[i] != 0; ++i)
if (i != matches[foundrule])

503
job.c
View File

@@ -1,5 +1,5 @@
/* Job execution and handling 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.
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
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 "job.h"
@@ -29,25 +30,25 @@ char *default_shell = "sh.exe";
int no_default_sh_exe = 1;
int batch_mode_shell = 1;
#else /* WINDOWS32 */
#ifdef _AMIGA
# ifdef _AMIGA
char default_shell[] = "";
extern int MyExecute (char **);
#else /* _AMIGA */
#ifdef __MSDOS__
# else /* _AMIGA */
# ifdef __MSDOS__
/* The default shell is a pointer so we can change it if Makefile
says so. It is without an explicit path so we get a chance
to search the $PATH for it (since MSDOS doesn't have standard
directories we could trust). */
char *default_shell = "command.com";
#else /* __MSDOS__ */
# else /* __MSDOS__ */
char default_shell[] = "/bin/sh";
#endif /* __MSDOS__ */
# endif /* __MSDOS__ */
int batch_mode_shell = 0;
#endif /* _AMIGA */
# endif /* _AMIGA */
#endif /* WINDOWS32 */
#ifdef __MSDOS__
#include <process.h>
# include <process.h>
static int execute_by_shell;
static int dos_pid = 123;
int dos_status;
@@ -55,7 +56,7 @@ int dos_command_running;
#endif /* __MSDOS__ */
#ifdef _AMIGA
#include <proto/dos.h>
# include <proto/dos.h>
static int amiga_pid = 123;
static int amiga_status;
static char amiga_bname[32];
@@ -63,101 +64,101 @@ static int amiga_batch_file;
#endif /* Amiga. */
#ifdef VMS
#include <time.h>
#include <processes.h>
#include <starlet.h>
#include <lib$routines.h>
# include <time.h>
# include <processes.h>
# include <starlet.h>
# include <lib$routines.h>
#endif
#ifdef WINDOWS32
#include <windows.h>
#include <io.h>
#include <process.h>
#include "sub_proc.h"
#include "w32err.h"
#include "pathstuff.h"
# include <windows.h>
# include <io.h>
# include <process.h>
# include "sub_proc.h"
# include "w32err.h"
# include "pathstuff.h"
#endif /* WINDOWS32 */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#else
#include <sys/file.h>
# include <sys/file.h>
#endif
#if defined (HAVE_SYS_WAIT_H) || defined (HAVE_UNION_WAIT)
#include <sys/wait.h>
# include <sys/wait.h>
#endif
#ifdef HAVE_WAITPID
#define WAIT_NOHANG(status) waitpid (-1, (status), WNOHANG)
#ifdef HAVE_WAITPID
# define WAIT_NOHANG(status) waitpid (-1, (status), WNOHANG)
#else /* Don't have waitpid. */
#ifdef HAVE_WAIT3
#ifndef wait3
# ifdef HAVE_WAIT3
# ifndef wait3
extern int wait3 ();
#endif
#define WAIT_NOHANG(status) wait3 ((status), WNOHANG, (struct rusage *) 0)
#endif /* Have wait3. */
#endif /* Have waitpid. */
# endif
# define WAIT_NOHANG(status) wait3 ((status), WNOHANG, (struct rusage *) 0)
# endif /* Have wait3. */
#endif /* Have waitpid. */
#if !defined (wait) && !defined (POSIX)
#if !defined (wait) && !defined (POSIX)
extern int wait ();
#endif
#ifndef HAVE_UNION_WAIT
#define WAIT_T int
# define WAIT_T int
#ifndef WTERMSIG
#define WTERMSIG(x) ((x) & 0x7f)
#endif
#ifndef WCOREDUMP
#define WCOREDUMP(x) ((x) & 0x80)
#endif
#ifndef WEXITSTATUS
#define WEXITSTATUS(x) (((x) >> 8) & 0xff)
#endif
#ifndef WIFSIGNALED
#define WIFSIGNALED(x) (WTERMSIG (x) != 0)
#endif
#ifndef WIFEXITED
#define WIFEXITED(x) (WTERMSIG (x) == 0)
#endif
# ifndef WTERMSIG
# define WTERMSIG(x) ((x) & 0x7f)
# endif
# ifndef WCOREDUMP
# define WCOREDUMP(x) ((x) & 0x80)
# endif
# ifndef WEXITSTATUS
# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
# endif
# ifndef WIFSIGNALED
# define WIFSIGNALED(x) (WTERMSIG (x) != 0)
# endif
# ifndef WIFEXITED
# define WIFEXITED(x) (WTERMSIG (x) == 0)
# endif
#else /* Have `union wait'. */
#define WAIT_T union wait
#ifndef WTERMSIG
#define WTERMSIG(x) ((x).w_termsig)
#endif
#ifndef WCOREDUMP
#define WCOREDUMP(x) ((x).w_coredump)
#endif
#ifndef WEXITSTATUS
#define WEXITSTATUS(x) ((x).w_retcode)
#endif
#ifndef WIFSIGNALED
#define WIFSIGNALED(x) (WTERMSIG(x) != 0)
#endif
#ifndef WIFEXITED
#define WIFEXITED(x) (WTERMSIG(x) == 0)
#endif
# define WAIT_T union wait
# ifndef WTERMSIG
# define WTERMSIG(x) ((x).w_termsig)
# endif
# ifndef WCOREDUMP
# define WCOREDUMP(x) ((x).w_coredump)
# endif
# ifndef WEXITSTATUS
# define WEXITSTATUS(x) ((x).w_retcode)
# endif
# ifndef WIFSIGNALED
# define WIFSIGNALED(x) (WTERMSIG(x) != 0)
# endif
# ifndef WIFEXITED
# define WIFEXITED(x) (WTERMSIG(x) == 0)
# endif
#endif /* Don't have `union wait'. */
#ifdef VMS
static int vms_jobsefnmask=0;
static int vms_jobsefnmask = 0;
#endif /* !VMS */
#ifndef HAVE_UNISTD_H
extern int dup2 ();
extern int execve ();
extern void _exit ();
#ifndef VMS
# ifndef VMS
extern int geteuid ();
extern int getegid ();
extern int setgid ();
extern int getgid ();
#endif
# endif
#endif
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
@@ -169,7 +170,6 @@ extern int start_remote_job_p PARAMS ((int));
extern int remote_status PARAMS ((int *exit_code_ptr, int *signal_ptr,
int *coredump_ptr, int block));
RETSIGTYPE child_handler PARAMS ((int));
static void free_child PARAMS ((struct child *));
static void start_job_command PARAMS ((struct child *child));
static int load_too_high PARAMS ((void));
@@ -224,21 +224,19 @@ child_error (target_name, exit_code, exit_sig, coredump, ignored)
#ifdef VMS
if (!(exit_code & 1))
error("*** [%s] Error 0x%x%s", target_name, exit_code, ((ignored)? " (ignored)" : ""));
error (NILF, "*** [%s] Error 0x%x%s", target_name, exit_code, ((ignored)? " (ignored)" : ""));
#else
if (exit_sig == 0)
error (ignored ? "[%s] Error %d (ignored)" :
error (NILF, ignored ? "[%s] Error %d (ignored)" :
"*** [%s] Error %d",
target_name, exit_code);
else
error ("*** [%s] %s%s",
error (NILF, "*** [%s] %s%s",
target_name, strsignal (exit_sig),
coredump ? " (core dumped)" : "");
#endif /* VMS */
}
static unsigned int dead_children = 0;
#ifdef VMS
/* Wait for nchildren children to terminate */
static void
@@ -259,6 +257,13 @@ vmsWaitForChildren(int *status)
#endif
/* Count the number of dead children we have. If we can use wait3() or
waitpid() then we'll never use this count: it's completely unnecessary.
But we need the handler installed to interrupt the select() call for
the jobs pipe, so we might as well keep it. */
static unsigned int dead_children = 0;
/* Notice that a child died.
reap_children should be called when convenient. */
RETSIGTYPE
@@ -268,9 +273,10 @@ child_handler (sig)
++dead_children;
if (debug_flag)
printf ("Got a SIGCHLD; %d unreaped children.\n", dead_children);
printf ("Got a SIGCHLD; %u unreaped children.\n", dead_children);
}
extern int shell_function_pid, shell_function_completed;
/* Reap dead children, storing the returned status and the new command
@@ -284,9 +290,16 @@ reap_children (block, err)
int block, err;
{
WAIT_T status;
#ifdef WAIT_NOHANG
/* Initially, assume we have some. */
int reap_more = 1;
# define REAP_MORE reap_more
#else
# define REAP_MORE dead_children
#endif
while ((children != 0 || shell_function_pid != 0) &&
(block || dead_children > 0))
(block || REAP_MORE))
{
int remote = 0;
register int pid;
@@ -295,14 +308,19 @@ reap_children (block, err)
int child_failed;
int any_remote, any_local;
if (err && dead_children == 0)
if (err && block)
{
/* We might block for a while, so let the user know why. */
fflush (stdout);
error ("*** Waiting for unfinished jobs....");
error (NILF, "*** Waiting for unfinished jobs....");
}
/* We have one less dead child to reap.
/* We have one less dead child to reap. As noted in
child_handler() above, this count is completely unimportant for
all modern, POSIX-y systems that support wait3() or waitpid().
The rest of this comment below applies only to early, broken
pre-POSIX systems. We keep the count only because... it's there...
The test and decrement are not atomic; if it is compiled into:
register = dead_children - 1;
dead_children = register;
@@ -338,8 +356,12 @@ reap_children (block, err)
else
pid = 0;
if (pid < 0)
if (pid > 0)
/* We got a remote child. */
remote = 1;
else if (pid < 0)
{
/* A remote status command failed miserably. Punt. */
remote_status_lose:
#ifdef EINTR
if (errno == EINTR)
@@ -347,11 +369,11 @@ reap_children (block, err)
#endif
pfatal_with_name ("remote_status");
}
else if (pid == 0)
else
{
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
/* No remote children. Check for local children. */
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
if (any_local)
{
#ifdef VMS
@@ -371,15 +393,26 @@ reap_children (block, err)
if (pid < 0)
{
/* The wait*() failed miserably. Punt. */
#ifdef EINTR
if (errno == EINTR)
continue;
#endif
pfatal_with_name ("wait");
}
else if (pid == 0)
else if (pid > 0)
{
/* No local children. */
/* We got one; chop the status word up. */
exit_code = WEXITSTATUS (status);
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
coredump = WCOREDUMP (status);
}
else
{
/* No local children are dead. */
#ifdef WAIT_NOHANG
reap_more = 0;
#endif
if (block && any_remote)
{
/* Now try a blocking wait for a remote child. */
@@ -396,14 +429,7 @@ reap_children (block, err)
else
break;
}
else
{
/* Chop the status word up. */
exit_code = WEXITSTATUS (status);
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
coredump = WCOREDUMP (status);
}
#else /* __MSDOS__, Amiga, WINDOWS32. */
#endif /* !__MSDOS__, !Amiga, !WINDOWS32. */
#ifdef __MSDOS__
/* Life is very different on MSDOS. */
pid = dos_pid - 1;
@@ -423,39 +449,35 @@ reap_children (block, err)
coredump = 0;
#endif /* _AMIGA */
#ifdef WINDOWS32
{
HANDLE hPID;
int err;
{
HANDLE hPID;
int err;
/* wait for anything to finish */
if (hPID = process_wait_for_any()) {
/* wait for anything to finish */
if (hPID = process_wait_for_any()) {
/* was an error found on this process? */
err = process_last_err(hPID);
/* was an error found on this process? */
err = process_last_err(hPID);
/* get exit data */
exit_code = process_exit_code(hPID);
/* get exit data */
exit_code = process_exit_code(hPID);
if (err)
fprintf(stderr, "make (e=%d): %s",
exit_code, map_windows32_error_to_string(exit_code));
if (err)
fprintf(stderr, "make (e=%d): %s",
exit_code, map_windows32_error_to_string(exit_code));
/* signal */
exit_sig = process_signal(hPID);
/* signal */
exit_sig = process_signal(hPID);
/* cleanup process */
process_cleanup(hPID);
/* cleanup process */
process_cleanup(hPID);
coredump = 0;
}
pid = (int) hPID;
}
coredump = 0;
}
pid = (int) hPID;
}
#endif /* WINDOWS32 */
#endif /* Not __MSDOS__ */
}
else
/* We got a remote child. */
remote = 1;
/* Check if this is the child of the `shell' function. */
if (!remote && pid == shell_function_pid)
@@ -478,14 +500,9 @@ reap_children (block, err)
if (c == 0)
{
/* An unknown child died. */
char buf[100];
sprintf (buf, "Unknown%s job %d", remote ? " remote" : "", pid);
if (child_failed)
child_error (buf, exit_code, exit_sig, coredump,
ignore_errors_flag);
else
error ("%s finished.", buf);
/* An unknown child died.
Ignore it; it was inherited from our invoker. */
continue;
}
else
{
@@ -495,17 +512,17 @@ reap_children (block, err)
(unsigned long int) c,
(long) c->pid, c->remote ? " (remote)" : "");
if (c->sh_batch_file) {
if (debug_flag)
printf("Cleaning up temporary batch file %s\n", c->sh_batch_file);
if (c->sh_batch_file) {
if (debug_flag)
printf("Cleaning up temp batch file %s\n", c->sh_batch_file);
/* just try and remove, don't care if this fails */
remove(c->sh_batch_file);
/* just try and remove, don't care if this fails */
remove(c->sh_batch_file);
/* all done with memory */
free(c->sh_batch_file);
c->sh_batch_file = NULL;
}
/* all done with memory */
free(c->sh_batch_file);
c->sh_batch_file = NULL;
}
/* If this child had the good stdin, say it is now free. */
if (c->good_stdin)
@@ -601,6 +618,22 @@ reap_children (block, err)
live and call reap_children again. */
block_sigs ();
#ifdef MAKE_JOBSERVER
/* If this job has a token out, return it. */
if (c->job_token)
{
assert(job_slots_used > 0);
write (job_fds[1], &c->job_token, 1);
if (debug_flag)
printf ("Released token `%c' for child 0x%08lx.\n",
c->job_token, (unsigned long int) c);
c->job_token = 0;
}
#endif
/* There is now another slot open. */
if (job_slots_used > 0)
--job_slots_used;
/* Remove the child from the chain and free it. */
if (lastc == 0)
children = c->next;
@@ -609,10 +642,6 @@ reap_children (block, err)
if (! handling_fatal_signal) /* Don't bother if about to die. */
free_child (c);
/* There is now another slot open. */
if (job_slots_used > 0)
--job_slots_used;
unblock_sigs ();
/* If the job failed, and the -k flag was not given, die,
@@ -651,6 +680,19 @@ free_child (child)
free ((char *) child->environment);
}
#ifdef MAKE_JOBSERVER
/* If this child has a token it hasn't relinquished, give it up now.
This can happen if the job completes immediately, mainly because
all the command lines evaluated to empty strings. */
if (child->job_token)
{
write (job_fds[1], &child->job_token, 1);
if (debug_flag)
printf ("Freed token `%c' for child 0x%08lx.\n",
child->job_token, (unsigned long int) child);
}
#endif
free ((char *) child);
}
@@ -661,12 +703,12 @@ extern sigset_t fatal_signal_set;
void
block_sigs ()
{
#ifdef POSIX
#ifdef POSIX
(void) sigprocmask (SIG_BLOCK, &fatal_signal_set, (sigset_t *) 0);
#else
#ifdef HAVE_SIGSETMASK
# ifdef HAVE_SIGSETMASK
(void) sigblock (fatal_signal_mask);
#endif
# endif
#endif
}
@@ -702,6 +744,10 @@ start_job_command (child)
char **argv;
#endif
/* If we have a completely empty commandset, stop now. */
if (!child->command_ptr)
goto next_command;
/* Combine the flags parsed for the line itself with
the flags specified globally for this target. */
flags = (child->file->command_flags
@@ -770,14 +816,16 @@ start_job_command (child)
{
next_command:
#ifdef __MSDOS__
execute_by_shell = 0; /* in case construct_command_argv sets it */
execute_by_shell = 0; /* in case construct_command_argv sets it */
#endif
/* This line has no commands. Go to the next. */
if (job_next_command (child))
start_job_command (child);
else
{
/* No more commands. All done. */
/* No more commands. Make sure we're "running"; we might not be if
(e.g.) all commands were skipped due to -n. */
set_command_state (child->file, cs_running);
child->file->update_status = 0;
notice_finished_file (child->file);
}
@@ -801,11 +849,12 @@ start_job_command (child)
#else
(argv[0] && !strcmp(argv[0], "/bin/sh"))
#endif
&& (argv[1] && !strcmp(argv[1], "-c"))
&& (argv[2] && !strcmp(argv[2], ":"))
&& (argv[1] && !strcmp(argv[1], "-c"))
&& (argv[2] && !strcmp(argv[2], ":"))
&& argv[3] == NULL)
{
set_command_state (child->file, cs_running);
free (argv[0]);
free ((char *) argv);
goto next_command;
}
#endif /* !VMS && !_AMIGA */
@@ -855,7 +904,7 @@ start_job_command (child)
/* Set the descriptor to close on exec, so it does not litter any
child's descriptor table. When it is dup2'd onto descriptor 0,
that descriptor will not close on exec. */
#ifdef FD_SETFD
#ifdef F_SETFD
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif
@@ -938,7 +987,7 @@ start_job_command (child)
/* We are the child side. */
unblock_sigs ();
child_execute_job (child->good_stdin ? 0 : bad_stdin, 1,
argv, child->environment);
argv, child->environment);
}
else if (child->pid < 0)
{
@@ -982,7 +1031,6 @@ start_job_command (child)
dos_command_running = 1;
proc_return = system (cmdline);
dos_command_running = 0;
environ = parent_environ;
execute_by_shell = 0; /* for the next time */
}
@@ -990,9 +1038,16 @@ start_job_command (child)
{
dos_command_running = 1;
proc_return = spawnvpe (P_WAIT, argv[0], argv, child->environment);
dos_command_running = 0;
}
/* Need to unblock signals before turning off
dos_command_running, so that child's signals
will be treated as such (see fatal_error_signal). */
unblock_sigs ();
dos_command_running = 0;
/* If the child got a signal, dos_status has its
high 8 bits set, so be careful not to alter them. */
if (proc_return == -1)
dos_status |= 0xff;
else
@@ -1072,35 +1127,85 @@ static int
start_waiting_job (c)
struct child *c;
{
struct file *f = c->file;
/* If we can start a job remotely, we always want to, and don't care about
the local load average. We record that the job should be started
remotely in C->remote for start_job_command to test. */
c->remote = start_remote_job_p (1);
/* If this job is to be started locally, and we are already running
some jobs, make this one wait if the load average is too high. */
if (!c->remote && job_slots_used > 0 && load_too_high ())
/* If not, start it locally. */
if (!c->remote)
{
/* Put this child on the chain of children waiting
for the load average to go down. */
set_command_state (c->file, cs_running);
c->next = waiting_jobs;
waiting_jobs = c;
return 0;
#ifdef MAKE_JOBSERVER
/* If this is not a recurse command and we are controlling
multiple jobs, and we don't yet have one, obtain a token before
starting child. */
if (job_fds[0] >= 0 && !f->cmds->any_recurse && !c->job_token)
{
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(job_fds[0], &rfds);
/* Read a token. We set the non-blocking bit on this earlier,
so if there's no token to be read we'll fall through to the
select. The select blocks until (a) there's data to read,
in which case we come back around and try to grab the token
before someone else does, or (b) a signal, such as SIGCHLD,
is caught (because we installed a handler for it). If the
latter, call reap_children() to try to free up some slots. */
while (read (job_fds[0], &c->job_token, 1) < 1)
{
int r = select (job_fds[0]+1, SELECT_FD_SET_CAST &rfds,
NULL, NULL, NULL);
if (r < 0)
{
#ifdef EINTR
if (errno != EINTR)
/* We should definitely handle this more gracefully!
What kinds of things can happen here? ^C closes the
pipe? Something else closes it? */
pfatal_with_name ("read jobs pipe");
#endif
/* We were interrupted; handle any dead children. */
reap_children (1, 0);
}
}
assert(c->job_token != 0);
if (debug_flag)
printf ("Obtained token `%c' for child 0x%08lx.\n",
c->job_token, (unsigned long int) c);
}
#endif
/* If we are running at least one job already and the load average
is too high, make this one wait. */
if (job_slots_used > 0 && load_too_high ())
{
/* Put this child on the chain of children waiting
for the load average to go down. */
set_command_state (f, cs_running);
c->next = waiting_jobs;
waiting_jobs = c;
return 0;
}
}
/* Start the first command; reap_children will run later command lines. */
start_job_command (c);
switch (c->file->command_state)
switch (f->command_state)
{
case cs_running:
c->next = children;
if (debug_flag)
printf ("Putting child 0x%08lx PID %05d%s on the chain.\n",
printf ("Putting child 0x%08lx PID %ld%s on the chain.\n",
(unsigned long int) c,
c->pid, c->remote ? " (remote)" : "");
(long) c->pid, c->remote ? " (remote)" : "");
children = c;
/* One more job slot is in use. */
++job_slots_used;
@@ -1109,16 +1214,16 @@ start_waiting_job (c)
case cs_not_started:
/* All the command lines turned out to be empty. */
c->file->update_status = 0;
f->update_status = 0;
/* FALLTHROUGH */
case cs_finished:
notice_finished_file (c->file);
notice_finished_file (f);
free_child (c);
break;
default:
assert (c->file->command_state == cs_finished);
assert (f->command_state == cs_finished);
break;
}
@@ -1146,8 +1251,9 @@ new_job (file)
/* Chop the commands up into lines if they aren't already. */
chop_commands (cmds);
/* Wait for a job slot to be freed up. If we allow an infinite number
don't bother; also job_slots will == 0 if we're using the job pipe. */
if (job_slots != 0)
/* Wait for a job slot to be freed up. */
while (job_slots_used == job_slots)
reap_children (1, 0);
@@ -1262,6 +1368,7 @@ new_job (file)
c->command_ptr = 0;
c->environment = 0;
c->sh_batch_file = NULL;
c->job_token = 0;
/* Fetch the first command line to be run. */
job_next_command (c);
@@ -1322,7 +1429,7 @@ load_too_high ()
{
if (errno == 0)
/* An errno value of zero means getloadavg is just unsupported. */
error ("cannot enforce load limits on this operating system");
error (NILF, "cannot enforce load limits on this operating system");
else
perror_with_name ("cannot enforce load limit: ", "getloadavg");
}
@@ -1427,8 +1534,7 @@ int vmsHandleChildTerm(struct child *child)
break;
default:
error ("internal error: `%s' command_state \
%d in child_handler", c->file->name);
error (NILF, "internal error: `%s' command_state", c->file->name);
abort ();
break;
}
@@ -1682,7 +1788,7 @@ exec_command (argv, envp)
switch (errno)
{
case ENOENT:
error ("%s: Command not found", argv[0]);
error (NILF, "%s: Command not found", argv[0]);
break;
case ENOEXEC:
{
@@ -1711,7 +1817,7 @@ exec_command (argv, envp)
execvp (shell, new_argv);
if (errno == ENOENT)
error ("%s: Shell program not found", shell);
error (NILF, "%s: Shell program not found", shell);
else
perror_with_name ("execvp: ", shell);
break;
@@ -1999,7 +2105,10 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
since it was most likely used to line
up the continued line with the previous one. */
if (*p == '\t')
strcpy (p, p + 1);
/* Note these overlap and strcpy() is undefined for
overlapping objects in ANSI C. The strlen() _IS_ right,
since we need to copy the nul byte too. */
bcopy (p + 1, p, strlen(p));
if (instring)
goto string_char;
@@ -2015,8 +2124,35 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
}
}
else if (p[1] != '\0')
/* Copy and skip the following char. */
*ap++ = *++p;
{
#if defined(__MSDOS__) || defined(WINDOWS32)
/* Only remove backslashes before characters special
to Unixy shells. All other backslashes are copied
verbatim, since they are probably DOS-style
directory separators. This still leaves a small
window for problems, but at least it should work
for the vast majority of naive users. */
#ifdef __MSDOS__
/* A dot is only special as part of the "..."
wildcard. */
if (strneq (p + 1, ".\\.\\.", 5))
{
*ap++ = '.';
*ap++ = '.';
p += 4;
}
else
#endif
if (p[1] != '\\' && p[1] != '\'' && !isspace (p[1])
&& (index (sh_chars_sh, p[1]) == 0))
/* back up one notch, to copy the backslash */
--p;
#endif /* __MSDOS__ || WINDOWS32 */
/* Copy and skip the following char. */
*ap++ = *++p;
}
break;
case '\'':
@@ -2205,8 +2341,8 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
p = next_token (p);
--p;
if (unixy_shell && !batch_mode_shell)
*ap++ = '\\';
if (unixy_shell && !batch_mode_shell)
*ap++ = '\\';
*ap++ = ' ';
continue;
}
@@ -2218,7 +2354,7 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
|| index (sh_chars, *p) != 0))
*ap++ = '\\';
#ifdef __MSDOS__
else if (unixy_shell && strncmp (p, "...", 3) == 0)
else if (unixy_shell && strneq (p, "...", 3))
{
/* The case of `...' wildcard again. */
strcpy (ap, "\\.\\.\\");
@@ -2234,11 +2370,9 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
*ap = '\0';
#ifdef WINDOWS32
/*
* Some shells do not work well when invoked as 'sh -c xxx' to run
* a command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems).
* In these cases, run commands via a script file.
*/
/* Some shells do not work well when invoked as 'sh -c xxx' to run a
command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems). In these
cases, run commands via a script file. */
if ((no_default_sh_exe || batch_mode_shell) && batch_filename_ptr) {
FILE* batch = NULL;
int id = GetCurrentProcessId();
@@ -2269,7 +2403,8 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
/* create batch file to execute command */
batch = fopen (*batch_filename_ptr, "w");
fputs ("@echo off\n", batch);
if (!unixy_shell)
fputs ("@echo off\n", batch);
fputs (command_ptr, batch);
fputc ('\n', batch);
fclose (batch);
@@ -2277,10 +2412,10 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
/* create argv */
new_argv = (char **) xmalloc(3 * sizeof(char *));
if (unixy_shell) {
new_argv[0] = strdup (shell);
new_argv[0] = xstrdup (shell);
new_argv[1] = *batch_filename_ptr; /* only argv[0] gets freed later */
} else {
new_argv[0] = strdup (*batch_filename_ptr);
new_argv[0] = xstrdup (*batch_filename_ptr);
new_argv[1] = NULL;
}
new_argv[2] = NULL;
@@ -2305,7 +2440,7 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
}
#else
else
fatal("%s (line %d) Invalid shell context (!unixy && !batch_mode_shell)\n",
fatal (NILF, "%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n",
__FILE__, __LINE__);
#endif
}

8
job.h
View File

@@ -1,5 +1,5 @@
/* 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.
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
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
#define SEEN_JOB_H
@@ -38,13 +39,14 @@ struct child
int efn; /* Completion event flag number */
int cstatus; /* Completion status */
#endif
char *sh_batch_file; /* Script file for shell commands */
unsigned int remote:1; /* Nonzero if executing remotely. */
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
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;

572
main.c
View File

@@ -1,5 +1,5 @@
/* Argument parsing and main program of GNU Make.
Copyright (C) 1988,89,90,91,94,95,96,97,98 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,94,95,96,97,98,99 Free Software Foundation, Inc.
This file is part of GNU Make.
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
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 "dep.h"
@@ -22,16 +23,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "variable.h"
#include "job.h"
#include "commands.h"
#include "rule.h"
#include "getopt.h"
#include <assert.h>
#ifdef _AMIGA
# include <dos/dos.h>
# include <proto/dos.h>
# include <dos/dos.h>
# include <proto/dos.h>
#endif
#ifdef WINDOWS32
#include <windows.h>
#include "pathstuff.h"
#endif
#if defined(MAKE_JOBSERVER) && defined(HAVE_FCNTL_H)
# include <fcntl.h>
#endif
#ifdef _AMIGA
int __stack = 20000; /* Make sure we have 20K of stack space */
@@ -41,7 +46,6 @@ extern void init_dir PARAMS ((void));
extern void remote_setup PARAMS ((void));
extern void remote_cleanup PARAMS ((void));
extern RETSIGTYPE fatal_error_signal PARAMS ((int sig));
extern RETSIGTYPE child_handler PARAMS ((int sig));
extern void print_variable_data_base PARAMS ((void));
extern void print_dir_data_base PARAMS ((void));
@@ -49,18 +53,22 @@ extern void print_rule_data_base PARAMS ((void));
extern void print_file_data_base PARAMS ((void));
extern void print_vpath_data_base PARAMS ((void));
#if defined HAVE_WAITPID || defined HAVE_WAIT3
# define HAVE_WAIT_NOHANG
#endif
#ifndef HAVE_UNISTD_H
extern int chdir ();
#endif
#ifndef STDC_HEADERS
#ifndef sun /* Sun has an incorrect decl in a header. */
extern void exit ();
#endif
# ifndef sun /* Sun has an incorrect decl in a header. */
extern void exit PARAMS ((int)) __attribute__ ((noreturn));
# endif
extern double atof ();
#endif
extern char *mktemp ();
static void print_data_base PARAMS((void));
static void print_data_base PARAMS ((void));
static void print_version PARAMS ((void));
static void decode_switches PARAMS ((int argc, char **argv, int env));
static void decode_env_switches PARAMS ((char *envar, unsigned int len));
@@ -78,6 +86,7 @@ struct command_switch
flag, /* Turn int flag on. */
flag_off, /* Turn int flag off. */
string, /* One string per switch. */
int_string, /* One string. */
positive_int, /* A positive integer. */
floating, /* A floating-point number (double). */
ignore /* Ignored. */
@@ -154,9 +163,10 @@ int print_data_base_flag = 0;
int question_flag = 0;
/* Nonzero means do not use any of the builtin rules (-r). */
/* Nonzero means do not use any of the builtin rules (-r) / variables (-R). */
int no_builtin_rules_flag = 0;
int no_builtin_variables_flag = 0;
/* Nonzero means keep going even if remaking some file fails (-k). */
@@ -185,9 +195,16 @@ static struct stringlist *makefiles = 0;
unsigned int job_slots = 1;
unsigned int default_job_slots = 1;
/* Value of job_slots that means no limit. */
static char *job_slots_str = "1";
#ifndef MAKE_JOBSERVER
/* Value of job_slots that means no limit. */
static unsigned int inf_jobs = 0;
#endif
/* File descriptors for the jobs pipe. */
int job_fds[2] = { -1, -1 };
/* Maximum load average at which multiple jobs will be run.
Negative values mean unlimited, while zero means limit to
@@ -259,8 +276,13 @@ static const struct command_switch switches[] =
{ 'I', string, (char *) &include_directories, 1, 1, 0, 0, 0,
"include-dir", "DIRECTORY",
"Search DIRECTORY for included makefiles" },
{ 'j', positive_int, (char *) &job_slots, 1, 1, 0,
{ 'j',
#ifndef MAKE_JOBSERVER
positive_int, (char *) &job_slots, 1, 1, 0,
(char *) &inf_jobs, (char *) &default_job_slots,
#else
int_string, (char *)&job_slots_str, 1, 1, 0, "0", "1",
#endif
"jobs", "N",
"Allow N jobs at once; infinite jobs with no arg" },
{ 'k', flag, (char *) &keep_going_flag, 1, 1, 0,
@@ -296,6 +318,9 @@ static const struct command_switch switches[] =
{ 'r', flag, (char *) &no_builtin_rules_flag, 1, 1, 0, 0, 0,
"no-builtin-rules", 0,
"Disable the built-in implicit rules" },
{ 'R', flag, (char *) &no_builtin_variables_flag, 1, 1, 0, 0, 0,
"no-builtin-variables", 0,
"Disable the built-in variable settings" },
{ 's', flag, (char *) &silent_flag, 1, 1, 0, 0, 0,
"silent", 0,
"Don't echo commands" },
@@ -413,7 +438,7 @@ enter_command_line_file (name)
char *name;
{
if (name[0] == '\0')
fatal ("empty string invalid as file name");
fatal (NILF, "empty string invalid as file name");
if (name[0] == '~')
{
@@ -443,7 +468,7 @@ enter_command_line_file (name)
name[2] = '\0';
}
return enter_file (savestring (name, strlen (name)));
return enter_file (xstrdup (name));
}
/* Toggle -d on receipt of SIGUSR1. */
@@ -563,7 +588,7 @@ find_and_set_default_shell(char *token)
} else if (file_exists_p(search_token)) {
/* search token path was found */
sprintf(sh_path, "%s", search_token);
default_shell = strdup(w32ify(sh_path,0));
default_shell = xstrdup(w32ify(sh_path,0));
if (debug_flag)
printf("find_and_set_shell setting default_shell = %s\n", default_shell);
sh_found = 1;
@@ -585,7 +610,7 @@ find_and_set_default_shell(char *token)
if (dir_file_exists_p(p, search_token)) {
sprintf(sh_path, "%s/%s", p, search_token);
default_shell = strdup(w32ify(sh_path,0));
default_shell = xstrdup(w32ify(sh_path,0));
sh_found = 1;
*ep = PATH_SEPARATOR_CHAR;
@@ -602,7 +627,7 @@ find_and_set_default_shell(char *token)
/* be sure to check last element of Path */
if (p && *p && dir_file_exists_p(p, search_token)) {
sprintf(sh_path, "%s/%s", p, search_token);
default_shell = strdup(w32ify(sh_path,0));
default_shell = xstrdup(w32ify(sh_path,0));
sh_found = 1;
}
@@ -664,8 +689,7 @@ int main (int argc, char ** argv)
#endif
default_goal_file = 0;
reading_filename = 0;
reading_lineno_ptr = 0;
reading_file = 0;
#if defined (__MSDOS__) && !defined (_POSIX_SOURCE)
/* Request the most powerful version of `system', to
@@ -722,6 +746,20 @@ int main (int argc, char ** argv)
#undef FATAL_SIG
/* Do not ignore the child-death signal. This must be done before
any children could possibly be created; otherwise, the wait
functions won't work on systems with the SVR4 ECHILD brain
damage, if our invoker is ignoring this signal. */
#ifdef HAVE_WAIT_NOHANG
# if defined SIGCHLD
(void) signal (SIGCHLD, SIG_DFL);
# endif
# if defined SIGCLD && SIGCLD != SIGCHLD
(void) signal (SIGCLD, SIG_DFL);
# endif
#endif
/* Make sure stdout is line-buffered. */
#ifdef HAVE_SETLINEBUF
@@ -782,14 +820,13 @@ int main (int argc, char ** argv)
#ifdef HAVE_GETCWD
perror_with_name ("getcwd: ", "");
#else
error ("getwd: %s", current_directory);
error (NILF, "getwd: %s", current_directory);
#endif
current_directory[0] = '\0';
directory_before_chdir = 0;
}
else
directory_before_chdir = savestring (current_directory,
strlen (current_directory));
directory_before_chdir = xstrdup (current_directory);
#ifdef __MSDOS__
/* Make sure we will return to the initial directory, come what may. */
atexit (msdos_return_to_initial_directory);
@@ -811,7 +848,7 @@ int main (int argc, char ** argv)
while (*ep != '=')
++ep;
#ifdef WINDOWS32
if (!unix_path && !strncmp(envp[i], "PATH=", 5))
if (!unix_path && strneq(envp[i], "PATH=", 5))
unix_path = ep+1;
else if (!windows32_path && !strnicmp(envp[i], "Path=", 5)) {
do_not_define = 1; /* it gets defined after loop exits */
@@ -922,8 +959,8 @@ int main (int argc, char ** argv)
*/
if (strpbrk(argv[0], "/:\\") ||
strstr(argv[0], "..") ||
!strncmp(argv[0], "//", 2))
argv[0] = strdup(w32ify(argv[0],1));
strneq(argv[0], "//", 2))
argv[0] = xstrdup(w32ify(argv[0],1));
#else /* WINDOWS32 */
if (current_directory[0] != '\0'
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
@@ -1031,6 +1068,10 @@ int main (int argc, char ** argv)
if (inhibit_print_directory_flag)
print_directory_flag = 0;
/* If -R was given, set -r too (doesn't make sense otherwise!) */
if (no_builtin_variables_flag)
no_builtin_rules_flag = 1;
/* Construct the list of include directories to search. */
construct_include_path (include_directories == 0 ? (char **) 0
@@ -1051,7 +1092,7 @@ int main (int argc, char ** argv)
#ifdef HAVE_GETCWD
perror_with_name ("getcwd: ", "");
#else
error ("getwd: %s", current_directory);
error (NILF, "getwd: %s", current_directory);
#endif
starting_directory = 0;
}
@@ -1089,7 +1130,7 @@ int main (int argc, char ** argv)
#endif
if (stdin_nm)
fatal("Makefile from standard input specified twice.");
fatal (NILF, "Makefile from standard input specified twice.");
outfile = fopen (name, "w");
if (outfile == 0)
@@ -1126,14 +1167,26 @@ int main (int argc, char ** argv)
}
}
/* Set up to handle children dying. This must be done before
reading in the makefiles so that `shell' function calls will work. */
#if defined(MAKE_JOBSERVER) || !defined(HAVE_WAIT_NOHANG)
/* If we don't have a hanging wait we have to fall back to old, broken
functionality here and rely on the signal handler and counting
children.
#ifdef SIGCHLD
(void) signal (SIGCHLD, child_handler);
#endif
#ifdef SIGCLD
(void) signal (SIGCLD, child_handler);
Also, if we're using the jobs pipe we need a signal handler so that
SIGCHLD is not ignored; we need it to interrupt select(2) in
job.c:start_waiting_job() if we're waiting on the pipe for a token. */
{
extern RETSIGTYPE child_handler PARAMS ((int sig));
/* Set up to handle children dying. This must be done before
reading in the makefiles so that `shell' function calls will work. */
# if defined SIGCHLD
(void) signal (SIGCHLD, child_handler);
# endif
# if defined SIGCLD && SIGCLD != SIGCHLD
(void) signal (SIGCLD, child_handler);
# endif
}
#endif
/* Let the user send us SIGUSR1 to toggle the -d flag during the run. */
@@ -1178,8 +1231,8 @@ int main (int argc, char ** argv)
no_default_sh_exe = !find_and_set_default_shell(NULL);
if (no_default_sh_exe && job_slots != 1) {
error("Do not specify -j or --jobs if sh.exe is not available.");
error("Resetting make for single job mode.");
error (NILF, "Do not specify -j or --jobs if sh.exe is not available.");
error (NILF, "Resetting make for single job mode.");
job_slots = 1;
}
#endif /* WINDOWS32 */
@@ -1212,6 +1265,59 @@ int main (int argc, char ** argv)
decode_env_switches ("MFLAGS", 6);
#endif
#ifdef MAKE_JOBSERVER
/* If extended jobs are available then the -j option can have one of 4
formats: (1) not specified: default is "1"; (2) specified with no
value: default is "0" (infinite); (3) specified with a single
value: this means the user wants N job slots; or (4) specified with
2 values separated by commas. The latter means we're a submake and
the two values are the read and write FDs, respectively, for the
pipe. Note this last form is undocumented for the user!
*/
sscanf(job_slots_str, "%d", &job_slots);
{
char *cp = index(job_slots_str, ',');
if (cp && sscanf(cp+1, "%d", &job_fds[1]) == 1)
{
job_fds[0] = job_slots;
job_slots = 0;
}
}
/* In case #3 above, set up the pipe and set up the submake options
properly. */
if (job_slots > 1)
{
char buf[(sizeof("1024")*2)+1];
char c = '0';
if (pipe(job_fds) < 0)
pfatal_with_name("creating jobs pipe");
/* Set the read FD to nonblocking; we'll use select() to wait
for it in job.c. */
fcntl (job_fds[0], F_SETFL, O_NONBLOCK);
for (; job_slots; --job_slots)
{
write(job_fds[1], &c, 1);
if (c == '9')
c = 'a';
else if (c == 'z')
c = 'A';
else if (c == 'Z')
c = '0'; /* Start over again!! */
else
++c;
}
sprintf(buf, "%d,%d", job_fds[0], job_fds[1]);
job_slots_str = xstrdup(buf);
}
#endif
/* Set up MAKEFLAGS and MFLAGS again, so they will be right. */
define_makeflags (1, 0);
@@ -1251,7 +1357,7 @@ int main (int argc, char ** argv)
for (p = old_files->list; *p != 0; ++p)
{
f = enter_command_line_file (*p);
f->last_mtime = (time_t) 1;
f->last_mtime = f->mtime_before_update = (FILE_TIMESTAMP) 1;
f->updated = 1;
f->update_status = 0;
f->command_state = cs_finished;
@@ -1262,7 +1368,7 @@ int main (int argc, char ** argv)
for (p = new_files->list; *p != 0; ++p)
{
f = enter_command_line_file (*p);
f->last_mtime = NEW_MTIME;
f->last_mtime = f->mtime_before_update = NEW_MTIME;
}
}
@@ -1273,7 +1379,7 @@ int main (int argc, char ** argv)
{
/* Update any makefiles if necessary. */
time_t *makefile_mtimes = 0;
FILE_TIMESTAMP *makefile_mtimes = 0;
unsigned int mm_idx = 0;
char **nargv = argv;
int nargc = argc;
@@ -1322,12 +1428,9 @@ int main (int argc, char ** argv)
}
if (f == NULL || !f->double_colon)
{
if (makefile_mtimes == 0)
makefile_mtimes = (time_t *) xmalloc (sizeof (time_t));
else
makefile_mtimes = (time_t *)
xrealloc ((char *) makefile_mtimes,
(mm_idx + 1) * sizeof (time_t));
makefile_mtimes = (FILE_TIMESTAMP *)
xrealloc ((char *) makefile_mtimes,
(mm_idx + 1) * sizeof (FILE_TIMESTAMP));
makefile_mtimes[mm_idx++] = file_mtime_no_search (d->file);
last = d;
d = d->next;
@@ -1362,51 +1465,59 @@ int main (int argc, char ** argv)
struct dep *d;
for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next)
if (d->file->updated)
{
/* This makefile was updated. */
if (d->file->update_status == 0)
{
/* It was successfully updated. */
any_remade |= (file_mtime_no_search (d->file)
!= makefile_mtimes[i]);
}
else if (! (d->changed & RM_DONTCARE))
{
time_t mtime;
/* The update failed and this makefile was not
from the MAKEFILES variable, so we care. */
error ("Failed to remake makefile `%s'.",
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != (time_t) -1
&& mtime != makefile_mtimes[i]);
}
}
else
/* This makefile was not found at all. */
if (! (d->changed & RM_DONTCARE))
{
/* Reset the considered flag; we may need to look at the file
again to print an error. */
d->file->considered = 0;
if (d->file->updated)
{
/* This is a makefile we care about. See how much. */
if (d->changed & RM_INCLUDED)
/* An included makefile. We don't need
to die, but we do want to complain. */
error ("Included makefile `%s' was not found.",
dep_name (d));
else
/* This makefile was updated. */
if (d->file->update_status == 0)
{
/* A normal makefile. We must die later. */
error ("Makefile `%s' was not found", dep_name (d));
any_failed = 1;
/* It was successfully updated. */
any_remade |= (file_mtime_no_search (d->file)
!= makefile_mtimes[i]);
}
else if (! (d->changed & RM_DONTCARE))
{
FILE_TIMESTAMP mtime;
/* The update failed and this makefile was not
from the MAKEFILES variable, so we care. */
error (NILF, "Failed to remake makefile `%s'.",
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != (FILE_TIMESTAMP) -1
&& mtime != makefile_mtimes[i]);
}
}
else
/* This makefile was not found at all. */
if (! (d->changed & RM_DONTCARE))
{
/* This is a makefile we care about. See how much. */
if (d->changed & RM_INCLUDED)
/* An included makefile. We don't need
to die, but we do want to complain. */
error (NILF, "Included makefile `%s' was not found.",
dep_name (d));
else
{
/* A normal makefile. We must die later. */
error (NILF, "Makefile `%s' was not found",
dep_name (d));
any_failed = 1;
}
}
}
/* Reset this to empty so we get the right error message below. */
read_makefiles = 0;
if (any_remade)
goto re_exec;
else if (any_failed)
if (any_failed)
die (2);
else
break;
break;
}
case 0:
@@ -1425,7 +1536,7 @@ int main (int argc, char ** argv)
/* These names might have changed. */
register unsigned int i, j = 0;
for (i = 1; i < argc; ++i)
if (!strncmp (argv[i], "-f", 2)) /* XXX */
if (strneq (argv[i], "-f", 2)) /* XXX */
{
char *p = &argv[i][2];
if (*p == '\0')
@@ -1440,7 +1551,7 @@ int main (int argc, char ** argv)
if (stdin_nm)
{
nargv = (char **)xmalloc((nargc + 2) * sizeof(char *));
bcopy(argv, nargv, argc * sizeof(char *));
bcopy((char *)argv, (char *)nargv, argc * sizeof(char *));
nargv[nargc++] = concat("-o", stdin_nm, "");
nargv[nargc] = 0;
}
@@ -1461,12 +1572,12 @@ int main (int argc, char ** argv)
else
bad = 1;
if (bad)
fatal ("Couldn't change back to original directory.");
fatal (NILF, "Couldn't change back to original directory.");
}
#ifndef _AMIGA
for (p = environ; *p != 0; ++p)
if (!strncmp (*p, "MAKELEVEL=", 10))
if (strneq (*p, "MAKELEVEL=", 10))
{
/* The SGI compiler apparently can't understand
the concept of storing the result of a function
@@ -1539,45 +1650,43 @@ int main (int argc, char ** argv)
else
lastgoal->next = 0;
if (goals != 0)
if (!goals)
{
/* Update the goals. */
if (read_makefiles == 0)
fatal (NILF, "No targets specified and no makefile found");
if (debug_flag)
puts ("Updating goal targets....");
fatal (NILF, "No targets");
}
switch (update_goal_chain (goals, 0))
{
case -1:
/* Nothing happened. */
case 0:
/* Updated successfully. */
status = EXIT_SUCCESS;
break;
case 2:
/* Updating failed. POSIX.2 specifies exit status >1 for this;
but in VMS, there is only success and failure. */
status = EXIT_FAILURE ? 2 : EXIT_FAILURE;
break;
case 1:
/* We are under -q and would run some commands. */
status = EXIT_FAILURE;
break;
default:
abort ();
}
}
else
{
if (read_makefiles == 0)
fatal ("No targets specified and no makefile found");
else
fatal ("No targets");
}
/* Update the goals. */
if (debug_flag)
puts ("Updating goal targets....");
switch (update_goal_chain (goals, 0))
{
case -1:
/* Nothing happened. */
case 0:
/* Updated successfully. */
status = EXIT_SUCCESS;
break;
case 2:
/* Updating failed. POSIX.2 specifies exit status >1 for this;
but in VMS, there is only success and failure. */
status = EXIT_FAILURE ? 2 : EXIT_FAILURE;
break;
case 1:
/* We are under -q and would run some commands. */
status = EXIT_FAILURE;
break;
default:
abort ();
}
/* If we detected some clock skew, generate one last warning */
if (clock_skew_detected)
error("*** Warning: Clock skew detected. Your build may be incomplete.");
error (NILF, "*** Warning: Clock skew detected. Your build may be incomplete.");
/* Exit. */
die (status);
@@ -1627,6 +1736,7 @@ init_switches ()
long_options[i].has_arg = no_argument;
break;
case int_string:
case string:
case positive_int:
case floating:
@@ -1661,7 +1771,7 @@ handle_non_switch_argument (arg, env)
if (arg[0] == '-' && arg[1] == '\0')
/* Ignore plain `-' for compatibility. */
return;
v = try_variable_definition ((char *) 0, 0, arg, o_command);
v = try_variable_definition (0, arg, o_command);
if (v != 0)
{
/* It is indeed a variable definition. Record a pointer to
@@ -1719,6 +1829,103 @@ handle_non_switch_argument (arg, env)
}
}
/* Print a nice usage method. */
static void
print_usage (bad)
int bad;
{
register const struct command_switch *cs;
FILE *usageto;
if (print_version_flag)
print_version ();
usageto = bad ? stderr : stdout;
fprintf (usageto, "Usage: %s [options] [target] ...\n", program);
fputs ("Options:\n", usageto);
for (cs = switches; cs->c != '\0'; ++cs)
{
char buf[1024], shortarg[50], longarg[50], *p;
if (cs->description[0] == '-')
continue;
switch (long_options[cs - switches].has_arg)
{
case no_argument:
shortarg[0] = longarg[0] = '\0';
break;
case required_argument:
sprintf (longarg, "=%s", cs->argdesc);
sprintf (shortarg, " %s", cs->argdesc);
break;
case optional_argument:
sprintf (longarg, "[=%s]", cs->argdesc);
sprintf (shortarg, " [%s]", cs->argdesc);
break;
}
p = buf;
if (isalnum (cs->c))
{
sprintf (buf, " -%c%s", cs->c, shortarg);
p += strlen (p);
}
if (cs->long_name != 0)
{
unsigned int i;
sprintf (p, "%s--%s%s",
!isalnum (cs->c) ? " " : ", ",
cs->long_name, longarg);
p += strlen (p);
for (i = 0; i < (sizeof (long_option_aliases) /
sizeof (long_option_aliases[0]));
++i)
if (long_option_aliases[i].val == cs->c)
{
sprintf (p, ", --%s%s",
long_option_aliases[i].name, longarg);
p += strlen (p);
}
}
{
const struct command_switch *ncs = cs;
while ((++ncs)->c != '\0')
if (ncs->description[0] == '-' &&
ncs->description[1] == cs->c)
{
/* This is another switch that does the same
one as the one we are processing. We want
to list them all together on one line. */
sprintf (p, ", -%c%s", ncs->c, shortarg);
p += strlen (p);
if (ncs->long_name != 0)
{
sprintf (p, ", --%s%s", ncs->long_name, longarg);
p += strlen (p);
}
}
}
if (p - buf > DESCRIPTION_COLUMN - 2)
/* The list of option names is too long to fit on the same
line with the description, leaving at least two spaces.
Print it on its own line instead. */
{
fprintf (usageto, "%s\n", buf);
buf[0] = '\0';
}
fprintf (usageto, "%*s%s.\n",
- DESCRIPTION_COLUMN,
buf, cs->description);
}
}
/* Decode switches from ARGC and ARGV.
They came from the environment if ENV is nonzero. */
@@ -1783,6 +1990,20 @@ decode_switches (argc, argv, env)
*(int *) cs->value_ptr = cs->type == flag;
break;
case int_string:
if (optarg == 0 && argc > optind
&& isdigit (argv[optind][0]))
optarg = argv[optind++];
if (!doit)
break;
if (optarg == 0)
optarg = cs->noarg_value;
*(char **)cs->value_ptr = optarg;
break;
case string:
if (!doit)
break;
@@ -1825,7 +2046,7 @@ decode_switches (argc, argv, env)
if (i < 1)
{
if (doit)
error ("the `-%c' option requires a \
error (NILF, "the `-%c' option requires a \
positive integral argument",
cs->c);
bad = 1;
@@ -1868,96 +2089,7 @@ positive integral argument",
if (!env && (bad || print_usage_flag))
{
/* Print a nice usage message. */
FILE *usageto;
if (print_version_flag)
print_version ();
usageto = bad ? stderr : stdout;
fprintf (usageto, "Usage: %s [options] [target] ...\n", program);
fputs ("Options:\n", usageto);
for (cs = switches; cs->c != '\0'; ++cs)
{
char buf[1024], shortarg[50], longarg[50], *p;
if (cs->description[0] == '-')
continue;
switch (long_options[cs - switches].has_arg)
{
case no_argument:
shortarg[0] = longarg[0] = '\0';
break;
case required_argument:
sprintf (longarg, "=%s", cs->argdesc);
sprintf (shortarg, " %s", cs->argdesc);
break;
case optional_argument:
sprintf (longarg, "[=%s]", cs->argdesc);
sprintf (shortarg, " [%s]", cs->argdesc);
break;
}
p = buf;
if (isalnum (cs->c))
{
sprintf (buf, " -%c%s", cs->c, shortarg);
p += strlen (p);
}
if (cs->long_name != 0)
{
unsigned int i;
sprintf (p, "%s--%s%s",
!isalnum (cs->c) ? " " : ", ",
cs->long_name, longarg);
p += strlen (p);
for (i = 0; i < (sizeof (long_option_aliases) /
sizeof (long_option_aliases[0]));
++i)
if (long_option_aliases[i].val == cs->c)
{
sprintf (p, ", --%s%s",
long_option_aliases[i].name, longarg);
p += strlen (p);
}
}
{
const struct command_switch *ncs = cs;
while ((++ncs)->c != '\0')
if (ncs->description[0] == '-' &&
ncs->description[1] == cs->c)
{
/* This is another switch that does the same
one as the one we are processing. We want
to list them all together on one line. */
sprintf (p, ", -%c%s", ncs->c, shortarg);
p += strlen (p);
if (ncs->long_name != 0)
{
sprintf (p, ", --%s%s", ncs->long_name, longarg);
p += strlen (p);
}
}
}
if (p - buf > DESCRIPTION_COLUMN - 2)
/* The list of option names is too long to fit on the same
line with the description, leaving at least two spaces.
Print it on its own line instead. */
{
fprintf (usageto, "%s\n", buf);
buf[0] = '\0';
}
fprintf (usageto, "%*s%s.\n",
- DESCRIPTION_COLUMN,
buf, cs->description);
}
print_usage(bad);
die (bad ? 2 : 0);
}
}
@@ -2170,6 +2302,22 @@ define_makeflags (all, makefile)
break;
#endif
case int_string:
if (all)
{
char *vp = *(char **)cs->value_ptr;
if (cs->default_value != 0
&& streq(vp, cs->default_value))
break;
if (cs->noarg_value != 0
&& streq(vp, cs->noarg_value))
ADD_FLAG("", 0); /* Optional value omitted; see below. */
else
ADD_FLAG(vp, strlen(vp));
}
break;
case string:
if (all)
{
@@ -2339,7 +2487,7 @@ print_version ()
printf ("-%s", remote_description);
printf (", by Richard Stallman and Roland McGrath.\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99\n\
%s\tFree Software Foundation, Inc.\n\
%sThis is free software; see the source for copying conditions.\n\
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\

View File

@@ -1,5 +1,6 @@
# 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!
@@ -10,6 +11,11 @@ globhdr := $(wildcard glob/*.h)
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
MTEMPLATES = Makefile.DOS SMakefile
# We need this to ensure that README is created on time to avoid errors
# by automake.
#
Makefile.in: README
# General rule for turning a .template into a regular file.
#
$(TEMPLATES) : % : %.template configure.in
@@ -45,9 +51,9 @@ NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
#
build.sh.in: build.template Makefile.am maintMakefile
rm -f $@
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
$(patsubst %.c,%.o,$(globsrc)))@' \
$< > $@
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@' \
-e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@' \
$< > $@
chmod a-w+x $@
# 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 ;)
#
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
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
missing build.sh.in .dep_segment

View File

@@ -21,6 +21,8 @@ chapter
@end ifclear
@end iftex
describes conventions for writing the Makefiles for GNU programs.
Using Automake will help you write a Makefile that follows these
conventions.
@menu
* Makefile Basics:: General Conventions for Makefiles
@@ -257,6 +259,18 @@ $(INSTALL_PROGRAM) foo $(bindir)/foo
$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
@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
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
@@ -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{/}.
(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
A prefix used in constructing the default values of some of the
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
machine-specific files (such as executables and subroutine libraries),
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
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 Please do not reformat it without talking to roland@gnu.ai.mit.edu.
@smallexample
$(infodir)/foo.info: foo.info
$(DESTDIR)$(infodir)/foo.info: foo.info
$(POST_INSTALL)
# There may be a newer info file in . than in srcdir.
-if test -f foo.info; then d=.; \
else d=$(srcdir); fi; \
$(INSTALL_DATA) $$d/foo.info $@@; \
$(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \
# Run install-info only if it exists.
# Use `if' instead of just prepending `-' to the
# 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.
if $(SHELL) -c 'install-info --version' \
>/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir \
$(infodir)/foo.info; \
install-info --dir-file=$(DESTDIR)$(infodir)/dir \
$(DESTDIR)$(infodir)/foo.info; \
else true; fi
@end smallexample

5
make.1
View File

@@ -257,11 +257,6 @@ Print the version of the
.I make
program plus a copyright, a list of authors and a notice that there
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
.B \-w
Print a message containing the working directory

517
make.h
View File

@@ -1,5 +1,5 @@
/* 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.
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
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. */
#if defined (_AIX) && !defined (__GNUC__)
@@ -25,27 +26,32 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because make.h was found in $srcdir). */
#include <config.h>
#undef HAVE_CONFIG_H
#define HAVE_CONFIG_H
#undef HAVE_CONFIG_H
#define HAVE_CONFIG_H 1
/* Use prototypes if available. */
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef PARAMS
#define PARAMS(protos) protos
# undef PARAMS
# define PARAMS(protos) protos
#else /* Not C++ or ANSI C. */
#undef PARAMS
#define PARAMS(protos) ()
# undef PARAMS
# define PARAMS(protos) ()
#endif /* C++ or ANSI C. */
#ifdef CRAY
#ifdef CRAY
/* This must happen before #include <signal.h> so
that the declaration therein is changed. */
#define signal bsdsignal
# define signal bsdsignal
#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/stat.h>
#include <signal.h>
@@ -55,35 +61,35 @@ 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
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. */
#include <sys/timeb.h>
# include <sys/timeb.h>
#endif
#include <time.h>
#include <errno.h>
#ifndef errno
#ifndef errno
extern int errno;
#endif
#ifndef isblank
#define isblank(c) ((c) == ' ' || (c) == '\t')
#ifndef isblank
# define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
#if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
#define POSIX
#endif
# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
# define POSIX 1
# endif
#endif
/* 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)))
#undef POSIX
# undef POSIX
#endif
#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE)
#define POSIX
# define POSIX 1
#endif
#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED)
@@ -91,54 +97,54 @@ extern char *sys_siglist[];
#endif
#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
#include "signame.h"
# include "signame.h"
#endif
/* Some systems do not define NSIG in <signal.h>. */
#ifndef NSIG
#ifdef _NSIG
#define NSIG _NSIG
#else
#define NSIG 32
#endif
#ifndef NSIG
# ifdef _NSIG
# define NSIG _NSIG
# else
# define NSIG 32
# endif
#endif
#ifndef RETSIGTYPE
#define RETSIGTYPE void
#ifndef RETSIGTYPE
# define RETSIGTYPE void
#endif
#ifndef sigmask
#define sigmask(sig) (1 << ((sig) - 1))
#ifndef sigmask
# define sigmask(sig) (1 << ((sig) - 1))
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifndef PATH_MAX
#ifndef POSIX
#define PATH_MAX MAXPATHLEN
#endif /* Not POSIX. */
#endif /* No PATH_MAX. */
#ifndef PATH_MAX
# ifndef POSIX
# define PATH_MAX MAXPATHLEN
# endif
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif /* No MAXPATHLEN. */
# define MAXPATHLEN 1024
#endif
#ifdef PATH_MAX
#define GET_PATH_MAX PATH_MAX
#define PATH_VAR(var) char var[PATH_MAX]
#ifdef PATH_MAX
# define GET_PATH_MAX PATH_MAX
# define PATH_VAR(var) char var[PATH_MAX]
#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));
#define GET_PATH_MAX (get_path_max ())
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
# define CHAR_BIT 8
#endif
/* Nonzero if the integer type T is signed. */
@@ -150,171 +156,189 @@ extern unsigned int get_path_max PARAMS ((void));
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
#ifdef STAT_MACROS_BROKEN
#ifdef S_ISREG
#undef S_ISREG
#endif
#ifdef S_ISDIR
#undef S_ISDIR
#endif
#endif /* STAT_MACROS_BROKEN. */
#ifdef STAT_MACROS_BROKEN
# ifdef S_ISREG
# undef S_ISREG
# endif
# ifdef S_ISDIR
# undef S_ISDIR
# endif
#endif /* STAT_MACROS_BROKEN. */
#ifndef S_ISREG
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#ifndef S_ISDIR
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#ifdef VMS
#include <stdio.h>
#include <types.h>
#include <unixlib.h>
#include <unixio.h>
#include <errno.h>
#include <perror.h>
# include <stdio.h>
# include <types.h>
# include <unixlib.h>
# include <unixio.h>
# include <errno.h>
# include <perror.h>
#endif
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) || defined(VMS))
#include <stdlib.h>
#include <string.h>
#define ANSI_STRING
#else /* No standard headers. */
#ifdef HAVE_STRING_H
#include <string.h>
#define ANSI_STRING
#else
#include <strings.h>
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(x)
# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# 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 *realloc PARAMS ((char *, int));
extern void free PARAMS ((char *));
extern void abort PARAMS ((void));
extern void exit PARAMS ((int));
extern void abort PARAMS ((void)) __attribute__ ((noreturn));
extern void exit PARAMS ((int)) __attribute__ ((noreturn));
# endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */
#endif /* Standard headers. */
#ifdef ANSI_STRING
#ifndef index
#define index(s, c) strchr((s), (c))
#endif
#ifndef rindex
#define rindex(s, c) strrchr((s), (c))
#if ST_MTIM_NSEC
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif
# define FILE_TIMESTAMP uintmax_t
#else
# define FILE_TIMESTAMP time_t
#endif
#ifndef bcmp
#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
#ifdef ANSI_STRING
#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
extern int bcmp ();
#endif
#ifndef bzero
extern void bzero ();
#endif
#ifndef bcopy
extern void bcopy ();
#endif
# ifndef bcmp
# 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
#endif /* ANSI_STRING. */
#undef ANSI_STRING
#else /* Not 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>. */
#undef strerror
#undef strerror
#if !defined(ANSI_STRING) && !defined(__DECC)
extern char *strerror PARAMS ((int errnum));
#endif
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
# define __attribute__(x)
# endif
#endif
#ifdef __GNUC__
#undef alloca
#define alloca(n) __builtin_alloca (n)
#else /* Not GCC. */
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else /* Not HAVE_ALLOCA_H. */
#ifndef _AIX
#ifdef __GNUC__
# undef alloca
# 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 ();
#endif /* Not AIX. */
#endif /* HAVE_ALLOCA_H. */
#endif /* GCC. */
# endif /* Not AIX. */
# endif /* HAVE_ALLOCA_H. */
#endif /* GCC. */
#ifndef iAPX286
#define streq(a, b) \
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
#ifdef HAVE_CASE_INSENSITIVE_FS
#define strieq(a, b) \
((a) == (b) || \
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
#else
#define strieq(a, b) \
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
#endif
#ifndef iAPX286
# define streq(a, b) \
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
# ifdef HAVE_CASE_INSENSITIVE_FS
/* This is only used on Windows/DOS platforms, so we assume strcmpi(). */
# define strieq(a, b) \
((a) == (b) || \
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
# else
# define strieq(a, b) streq(a, b)
# endif
#else
/* Buggy compiler can't handle this. */
#define streq(a, b) (strcmp ((a), (b)) == 0)
#define strieq(a, b) (strcmp ((a), (b)) == 0)
# define streq(a, b) (strcmp ((a), (b)) == 0)
# define strieq(a, b) (strcmp ((a), (b)) == 0)
#endif
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
/* 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)))
#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */
#define HASHI(var, c) \
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
# define HASHI(var, c) \
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
#else
#define HASHI(var, c) HASH(var,c)
# define HASHI(var, c) HASH(var,c)
#endif
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
#define ENUM_BITFIELD(bits) :bits
# define ENUM_BITFIELD(bits) :bits
#else
#define ENUM_BITFIELD(bits)
# define ENUM_BITFIELD(bits)
#endif
#if defined(__MSDOS__) || defined(WINDOWS32)
#define PATH_SEPARATOR_CHAR ';'
# define PATH_SEPARATOR_CHAR ';'
#else
#if defined(VMS)
#define PATH_SEPARATOR_CHAR ','
#else
#define PATH_SEPARATOR_CHAR ':'
#endif
# if defined(VMS)
# define PATH_SEPARATOR_CHAR ','
# else
# define PATH_SEPARATOR_CHAR ':'
# endif
#endif
#ifdef WINDOWS32
#include <fcntl.h>
#include <malloc.h>
#define pipe(p) _pipe(p, 512, O_BINARY)
#define kill(pid,sig) w32_kill(pid,sig)
# include <fcntl.h>
# include <malloc.h>
# define pipe(p) _pipe(p, 512, O_BINARY)
# define kill(pid,sig) w32_kill(pid,sig)
extern void sync_Path_environment(void);
extern int kill(int pid, int sig);
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);
/* indicates whether or not we have Bourne shell */
@@ -323,72 +347,83 @@ extern int no_default_sh_exe;
/* is default_shell unixy? */
extern int unixy_shell;
#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
extern int ar_name ();
extern void ar_parse_name ();
extern int ar_touch ();
extern time_t ar_member_date ();
struct floc
{
char *filenm;
unsigned long lineno;
};
#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
extern void dir_load ();
extern int dir_file_exists_p ();
extern int file_exists_p ();
extern int file_impossible_p ();
extern void file_impossible ();
extern char *dir_name ();
extern void die PARAMS ((int)) __attribute__ ((noreturn));
extern void log_working_directory PARAMS ((int));
extern void pfatal_with_name PARAMS ((char *)) __attribute__ ((noreturn));
extern void perror_with_name PARAMS ((char *, char *));
extern char *savestring PARAMS ((const char *, unsigned int));
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 ();
extern void set_default_suffixes ();
extern void install_default_suffix_rules ();
extern void install_default_implicit_rules ();
extern void count_implicit_rule_limits ();
extern void convert_to_pattern ();
extern void create_pattern_rule ();
#ifndef NO_ARCHIVES
extern int ar_name PARAMS ((char *));
extern void ar_parse_name PARAMS ((char *, char **, char **));
extern int ar_touch PARAMS ((char *));
extern time_t ar_member_date PARAMS ((char *));
#endif
extern void build_vpath_lists ();
extern void construct_vpath_list ();
extern int vpath_search ();
extern int gpath_search ();
extern int dir_file_exists_p PARAMS ((char *, char *));
extern int file_exists_p PARAMS ((char *));
extern int file_impossible_p PARAMS ((char *));
extern void file_impossible PARAMS ((char *));
extern char *dir_name PARAMS ((char *));
extern void construct_include_path ();
extern void uniquize_deps ();
extern void define_default_variables PARAMS ((void));
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 notice_finished_file ();
extern void build_vpath_lists PARAMS ((void));
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 make_access ();
extern void child_access ();
extern void construct_include_path PARAMS ((char **arg_dirs));
#ifdef HAVE_VFORK_H
#include <vfork.h>
extern void user_access PARAMS ((void));
extern void make_access PARAMS ((void));
extern void child_access PARAMS ((void));
#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
@@ -397,38 +432,38 @@ extern void child_access ();
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
extern long int atol ();
#ifndef VMS
# ifndef VMS
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 ();
#ifdef VMS
# ifdef VMS
extern char *getwd PARAMS ((char *));
#endif
# endif
#else
extern char *getwd ();
#define getcwd(buf, len) getwd (buf)
# define getcwd(buf, len) getwd (buf)
#endif
extern const struct floc *reading_file;
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 debug_flag, print_data_base_flag, question_flag, touch_flag;
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
extern int print_directory_flag, warn_undefined_variables_flag;
extern int posix_pedantic;
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
extern int print_version_flag, print_directory_flag;
extern int warn_undefined_variables_flag, posix_pedantic;
extern int clock_skew_detected;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
extern unsigned int job_slots;
extern int job_fds[2];
#ifndef NO_FLOAT
extern double max_load_average;
#else
@@ -445,9 +480,16 @@ extern unsigned int commands_started;
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) \
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
fflush (stdout); } while (0)
fflush (stdout); } while (0)
#ifdef VMS
# ifndef EXIT_FAILURE
@@ -471,3 +513,8 @@ extern int handling_fatal_signal;
# 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.
@set RCSID $Id$
@set EDITION 0.52
@set VERSION 3.77
@set UPDATED 20 May 1998
@set UPDATE-MONTH May 1998
@set EDITION 0.53
@set VERSION 3.78
@set UPDATED 14 April 1999
@set UPDATE-MONTH April 1999
@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
@@ -24,12 +24,12 @@
@c Combine the program and concept indices:
@syncodeindex pg cp
@ifinfo
@dircategory The GNU make utility
@dircategory GNU Packages
@direntry
* Make: (make.info). The GNU make utility.
* Make: (make). Remake files automatically.
@end direntry
@ifinfo
This file documents the GNU Make utility, which determines
automatically which pieces of a large program need to be recompiled,
and issues the commands to recompile them.
@@ -37,7 +37,7 @@ and issues the commands to recompile them.
This is Edition @value{EDITION}, last updated @value{UPDATED},
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.
Permission is granted to make and distribute verbatim copies of
@@ -68,19 +68,21 @@ by the Free Software Foundation.
@titlepage
@title GNU Make
@subtitle A Program for Directing Recompilation
@subtitle GNU @code{make} Version @value{VERSION}.
@subtitle GNU @code{make} Version @value{VERSION}
@subtitle @value{UPDATE-MONTH}
@author Richard M. Stallman and Roland McGrath
@page
@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
Published by the Free Software Foundation @*
59 Temple Place -- Suite 330, @*
Boston, MA 02111-1307 USA @*
Printed copies are available for $20 each. @*
ISBN @value{ISBN} @*
Maintenance and updates since Version 3.76 by Paul D. Smith.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
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
on the values of variables.
* 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,
based on their file names.
* Archives:: How @code{make} can update library archives.
@@ -267,6 +269,7 @@ Functions for Transforming Text
* Text Functions:: General-purpose text manipulation functions.
* File Name Functions:: Functions for manipulating file names.
* Foreach Function:: Repeat some text with controlled variation.
* Call Function:: Expand a user-defined function.
* Origin Function:: Find where a variable got its value.
* 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
program need to be recompiled, and issues commands to recompile them.
This manual describes GNU @code{make}, which was implemented by Richard
Stallman and Roland McGrath. GNU @code{make} conforms to section 6.2 of
@cite{IEEE Standard 1003.2-1992} (POSIX.2).
Stallman and Roland McGrath. Development since Version 3.76 has been
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 IEEE Standard 1003.2
@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
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
commands but no dependencies, that file will always be remade
(@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:
@code{make} would constantly remake the makefile, and never do anything
else. So, to avoid this, @code{make} will @strong{not} attempt to
remake makefiles which are specified as double-colon targets but have no
dependencies.@refill
remake makefiles which are specified as targets of a double-colon rule
with commands but no dependencies.@refill
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;
@@ -1971,16 +1984,19 @@ directory search with no extra effort.
@cindex @code{VPATH}, and link libraries
@cindex search path for dependencies (@code{VPATH}), and link libraries
@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
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
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
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}
search paths and the @code{VPATH} search path, and then in the
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
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
@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
@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
@section 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
target file.
The empty target file must have some dependencies. When you ask to remake
the empty target, the commands are executed if any dependency is more
recent than the target; in other words, if a dependency has changed since
the last time you remade the target. Here is an example:
The empty target file should have some dependencies (otherwise it
doesn't make sense). When you ask to remake the empty target, the
commands are executed if any dependency is more recent than the target;
in other words, if a dependency has changed since the last time you
remade the target. Here is an example:
@example
print: foo.c bar.c
@@ -2241,8 +2277,7 @@ match that file's name.
The targets which @code{.INTERMEDIATE} depends on are treated as
intermediate files. @xref{Chained Rules, ,Chains of Implicit Rules}.
@code{.INTERMEDIATE} with no dependencies marks all file targets
mentioned in the makefile as intermediate.
@code{.INTERMEDIATE} with no dependencies has no effect.
@findex .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
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
@item .IGNORE
@@ -2274,7 +2318,7 @@ commands. @xref{Errors, ,Errors in Commands}.
@item .SILENT
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.
If mentioned as a target with no dependencies, @code{.SILENT} says not
@@ -2832,8 +2876,8 @@ the makefile:
@cindex @code{--just-print}
@cindex @code{--dry-run}
@cindex @code{--recon}
When @code{make} is given the flag @samp{-n} or @samp{--just-print},
echoing is all that happens, no execution. @xref{Options Summary,
When @code{make} is given the flag @samp{-n} or @samp{--just-print}
it only echoes commands, it won't execute them. @xref{Options Summary,
,Summary of Options}. In this case and only this case, even the
commands starting with @samp{@@} are printed. This flag is useful for
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).
One unpleasant consequence of running several commands simultaneously is
that output from all of the commands comes when the commands send it, so
messages from different commands may be interspersed.
that output generated by the commands appears whenever each command
sends it, so messages from different commands may be interspersed.
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
@@ -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
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
status), and errors are not ignored for that command
(@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 job slots, and recursion
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
@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 set it to some numeric value @samp{N} and your operating system
supports it (most any UNIX system will; others typically won't), the
parent @code{make} and all the sub-@code{make}s will communicate to
ensure that there are only @samp{N} jobs running at the same time
between them all. Note that any job that is marked recursive
(@pxref{Instead of Execution, ,Instead of Executing the Commands})
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
value of @code{MAKEFLAGS}, like this:
@@ -3542,8 +3599,8 @@ MAKEOVERRIDES =
@cindex E2BIG
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
information in into the value of @code{MAKEFLAGS} can exceed it.
If you see the error message @samp{Arg list too long}, this may be the problem.
information into the value of @code{MAKEFLAGS} can exceed it. If you
see the error message @samp{Arg list too long}, this may be the problem.
@findex .POSIX
@cindex POSIX.2
(For strict compliance with POSIX.2, changing @code{MAKEOVERRIDES} does
@@ -5143,8 +5200,10 @@ call, just as a variable might be substituted.
* Text Functions:: General-purpose text manipulation functions.
* File Name Functions:: Functions for manipulating file names.
* Foreach Function:: Repeat some text with controlled variation.
* Call Function:: Expand a user-defined function.
* Origin Function:: Find where a variable got its value.
* Shell Function:: Substitute the output of a shell command.
* Make Control Functions:: Functions that control how make runs.
@end menu
@node Syntax of Functions, Text Functions, , Functions
@@ -5167,8 +5226,9 @@ or like this:
$@{@var{function} @var{arguments}@}
@end example
Here @var{function} is a function name; one of a short list of names that
are part of @code{make}. There is no provision for defining new functions.
Here @var{function} is a function name; one of a short list of names
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
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}.
@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
@findex foreach
@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,
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
@findex origin
@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}.
@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
@findex shell
@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
@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
@chapter How to Run @code{make}
@@ -6527,10 +6731,11 @@ Some Files}.@refill
@itemx --print-data-base
@cindex @code{--print-data-base}
Print the data base (rules and variable values) that results from
reading the makefiles; then execute as usual or as otherwise
specified. This also prints the version information given by
the @samp{-v} switch (see below). To print the data base without
trying to remake any files, use @w{@samp{make -p -f /dev/null}}.
reading the makefiles; then execute as usual or as otherwise specified.
This also prints the version information given by the @samp{-v} switch
(see below). To print the data base without trying to remake any files,
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
@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
@emph{rules} are affected by the @code{-r} option; default variables
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
@cindex @code{-s}
@@ -6898,7 +7113,7 @@ running the C preprocessor, @code{cpp}. The precise command is
@pindex .o
@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
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
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
predefined variables. You can alter these variables in the makefile,
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
@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
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
variants that get just the file's directory name or just the file name
within the directory. The variant variables' names are formed by
names, and three have values that are lists of file names. These seven
have variants that get just the file's directory name or just the file
name within the directory. The variant variables' names are formed by
appending @samp{D} or @samp{F}, respectively. These variants are
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
@@ -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
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
concerned with writing portable makefiles, you should use only the
features of @code{make} @emph{not} listed here or in @ref{Missing}.
concerned with writing portable makefiles, you should not use the
features of @code{make} listed here, nor the ones in @ref{Missing}.
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
stand for an ordinary @samp{$}.
It is possible to get this functionality through the use of static pattern
rules (@pxref{Static Pattern, ,Static Pattern Rules}).
It is possible to get portions of this functionality through the use of
static pattern rules (@pxref{Static Pattern, ,Static Pattern Rules}).
The System V @code{make} rule:
@example
@@ -9019,22 +9236,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
non-0 error code (@samp{Error @var{NN}}), which @code{make} interprets
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
but the rule in the makefile was prefixed with the @code{-} special
character, so @code{make} ignored the error.
@item missing separator. Stop.
This is @code{make}'s generic ``Huh?'' error message. It means that
@code{make} was completely unsuccessful at parsing this line of your
makefile. It basically means ``syntax error''.
This means that @code{make} could not understand much of anything about
the command line it just read. GNU @code{make} looks for various kinds
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
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
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.
@itemx missing rule before commands. Stop.
@@ -9045,7 +9264,7 @@ must always be associated with a target.
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
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}'.
@itemx No rule to make target `@var{xxx}', needed by `@var{yyy}'.
@@ -9066,6 +9285,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
default target and none was given on the command line. GNU @code{make}
has nothing to do in these situations.
@xref{Makefile Arguments, ,Arguments to Specify the Makefile}.@refill
@item Makefile `@var{xxx}' was not found.
@itemx Included makefile `@var{xxx}' was not found.
@@ -9078,6 +9298,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
which already has been defined to have commands, this warning is issued
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.
This means that @code{make} detected a loop in the dependency graph:
@@ -9088,7 +9309,8 @@ dependencies, etc., one of them depended on @var{xxx} again.
This means you've defined a normal (recursive) @code{make} variable
@var{xxx} that, when its expanded, will refer to itself (@var{xxx}).
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.
This means you forgot to provide the proper closing parenthesis
@@ -9097,7 +9319,7 @@ or brace in your variable or function reference.
@item insufficient arguments to function `@var{xxx}'. Stop.
This means you haven't provided the requisite number of arguments for
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.
@itemx multiple target patterns. Stop.
@@ -9105,7 +9327,8 @@ of its arguments.
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 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
@@ -9363,8 +9586,8 @@ dist: $(SRCS) $(AUX)
-rm -rf `cat .fname`
mkdir `cat .fname`
ln $(SRCS) $(AUX) `cat .fname`
-rm -rf `cat .fname` .fname
tar chZf `cat .fname`.tar.Z `cat .fname`
-rm -rf `cat .fname` .fname
@end 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
$! 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
$! zinser@decus.decus.de (preferred) or eurmpz@eur.sas.com
$! In case of problems with the install you might contact me at
$! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
$!
$! Look for the compiler used
$!
@@ -18,8 +19,8 @@ $ else
$ ccopt = "/decc/prefix=all"
$ if f$trnlnm("SYS").eqs.""
$ then
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
$ then
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
$ then
$ define sys decc$library_include:
$ else
$ 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."" -
then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
$ lval=lval+"SYS$LIBRARY:"
$ define sys 'lval
$ define sys 'lval
$ 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"
$ copy config.h-vms config.h
$ n=0
@@ -45,10 +56,10 @@ $ goto loop
$ linkit:
$ close optf
$ if p1 .nes. "" then goto link_using_library
$ link/exe=make make.opt/opt
$ link/exe=make make.opt/opt'lopt
$ exit
$ 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
$ ploc = f$locate("]",p1)

View File

@@ -16,7 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# 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
CP = copy

233
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
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 "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.
Return negative if the first is less, positive if it is greater,
zero if they are equal. */
int
alpha_compare (s1, s2)
char **s1, **s2;
alpha_compare (v1, v2)
const void *v1, *v2;
{
if (**s1 != **s2)
return **s1 - **s2;
return strcmp (*s1, *s2);
const char *s1 = *((char **)v1);
const char *s2 = *((char **)v2);
if (*s1 != *s2)
return *s1 - *s2;
return strcmp (s1, s2);
}
/* Discard each backslash-newline combination from LINE.
@@ -173,13 +209,22 @@ concat (s1, s2, s3)
/* Print a message on stdout. */
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;
char *s1, *s2, *s3, *s4, *s5, *s6;
const char *fmt;
va_dcl
#endif
{
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1);
if (s1 != 0)
if (fmt != 0)
{
if (prefix)
{
@@ -188,78 +233,77 @@ message (prefix, s1, s2, s3, s4, s5, s6)
else
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');
}
fflush (stdout);
}
/* Print an error message and exit. */
/* 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 */
/* Print an error message. */
void
error (s1, s2, s3, s4, s5, s6)
char *s1, *s2, *s3, *s4, *s5, *s6;
#if __STDC__ && HAVE_STDVARARGS
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);
if (makelevel == 0)
if (flocp && flocp->filenm)
fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fprintf (stderr, "%s: ", program);
else
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);
fflush (stderr);
}
void
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);
}
/* Print an error message and exit. */
void
makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
char *file;
unsigned int lineno;
char *s1, *s2, *s3, *s4, *s5, *s6;
#if __STDC__ && HAVE_STDVARARGS
fatal (const struct floc *flocp, const char *fmt, ...)
#else
fatal (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{
if (!file)
fatal(s1, s2, s3, s4, s5, s6);
#if HAVE_STDVARARGS
va_list args;
#endif
log_working_directory (1);
fprintf (stderr, "%s:%u: *** ", file, lineno);
fprintf (stderr, s1, s2, s3, s4, s5, s6);
if (flocp && flocp->filenm)
fprintf (stderr, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
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);
@@ -293,7 +337,7 @@ void
perror_with_name (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. */
@@ -302,15 +346,19 @@ void
pfatal_with_name (name)
char *name;
{
fatal ("%s: %s", name, strerror (errno));
fatal (NILF, "%s: %s", name, strerror (errno));
/* NOTREACHED */
}
/* 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 xrealloc
#undef xstrdup
char *
xmalloc (size)
@@ -318,7 +366,7 @@ xmalloc (size)
{
char *result = (char *) malloc (size);
if (result == 0)
fatal ("virtual memory exhausted");
fatal (NILF, "virtual memory exhausted");
return result;
}
@@ -328,15 +376,43 @@ xrealloc (ptr, size)
char *ptr;
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)
fatal ("virtual memory exhausted");
fatal (NILF, "virtual memory exhausted");
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 *
savestring (str, length)
char *str;
const char *str;
unsigned int length;
{
register char *out = (char *) xmalloc (length + 1);
@@ -352,21 +428,28 @@ savestring (str, length)
char *
sindex (big, blen, small, slen)
char *big;
const char *big;
unsigned int blen;
char *small;
const char *small;
unsigned int slen;
{
register unsigned int b;
if (blen < 1)
if (!blen)
blen = strlen (big);
if (slen < 1)
if (!slen)
slen = strlen (small);
for (b = 0; b < blen; ++b)
if (big[b] == *small && !strncmp (&big[b + 1], small + 1, slen - 1))
return (&big[b]);
if (slen && blen >= slen)
{
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;
}
@@ -379,12 +462,12 @@ sindex (big, blen, small, slen)
char *
lindex (s, limit, c)
register char *s, *limit;
register const char *s, *limit;
int c;
{
while (s < limit)
if (*s++ == c)
return s - 1;
return (char *)(s - 1);
return 0;
}
@@ -480,7 +563,7 @@ copy_dep_chain (d)
c = (struct dep *) xmalloc (sizeof (struct dep));
bcopy ((char *) d, (char *) c, sizeof (struct dep));
if (c->name != 0)
c->name = savestring (c->name, strlen (c->name));
c->name = xstrdup (c->name);
c->next = 0;
if (firstnew == 0)
firstnew = lastnew = c;

379
read.c
View File

@@ -14,10 +14,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
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 <glob.h>
#include "make.h"
#include "dep.h"
#include "filedef.h"
@@ -26,12 +29,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "variable.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 _AMIGA
@@ -119,26 +116,27 @@ static unsigned int max_incl_len;
/* The filename and pointer to line number of the
makefile currently being read in. */
char *reading_filename;
unsigned int *reading_lineno_ptr;
const struct floc *reading_file;
/* The chain of makefiles read by read_makefile. */
static struct dep *read_makefiles = 0;
static int read_makefile PARAMS ((char *filename, int flags));
static unsigned int readline PARAMS ((struct linebuffer *linebuffer, FILE *stream,
char *filename, unsigned int lineno));
static unsigned int do_define PARAMS ((char *name, unsigned int namelen, enum variable_origin origin,
unsigned int lineno, FILE *infile, char *filename));
static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno));
static unsigned long readline PARAMS ((struct linebuffer *linebuffer,
FILE *stream, const struct floc *flocp));
static void do_define PARAMS ((char *name, unsigned int namelen,
enum variable_origin origin, FILE *infile,
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,
struct dep *deps, unsigned int cmds_started, char *commands,
unsigned int commands_idx, int two_colon, char *filename,
unsigned int lineno, int set_default));
unsigned int commands_idx, int two_colon,
const struct floc *flocp, int set_default));
static void record_target_var PARAMS ((struct nameseq *filenames, char *defn,
int two_colon, enum variable_origin origin,
char *filename, unsigned int lineno));
int two_colon,
enum variable_origin origin,
const struct floc *flocp));
static enum make_word_type get_next_mword PARAMS ((char *buffer, char *delim,
char **startp, unsigned int *length));
@@ -282,7 +280,7 @@ read_makefile (filename, flags)
register FILE *infile;
struct linebuffer lb;
unsigned int commands_len = 200;
char *commands = (char *) xmalloc (200);
char *commands;
unsigned int commands_idx = 0;
unsigned int cmds_started;
char *p;
@@ -290,11 +288,11 @@ read_makefile (filename, flags)
int len, reading_target;
int ignoring = 0, in_ignored_define = 0;
int no_targets = 0; /* Set when reading a rule without targets. */
struct floc fileinfo;
char *passed_filename = filename;
struct nameseq *filenames = 0;
struct dep *deps;
unsigned int lineno = 1;
unsigned int nlines = 0;
int two_colon = 0;
char *pattern = 0, *pattern_percent;
@@ -310,19 +308,22 @@ read_makefile (filename, flags)
if (filenames != 0) \
record_files (filenames, pattern, pattern_percent, deps, \
cmds_started, commands, commands_idx, \
two_colon, filename, lineno, \
two_colon, &fileinfo, \
!(flags & RM_NO_DEFAULT_GOAL)); \
filenames = 0; \
commands_idx = 0; \
if (pattern) { free(pattern); pattern = 0; } \
} while (0)
fileinfo.filenm = filename;
fileinfo.lineno = 1;
pattern_percent = 0;
cmds_started = lineno;
cmds_started = fileinfo.lineno;
if (debug_flag)
{
printf ("Reading makefile `%s'", filename);
printf ("Reading makefile `%s'", fileinfo.filenm);
if (flags & RM_NO_DEFAULT_GOAL)
printf (" (no default goal)");
if (flags & RM_INCLUDED)
@@ -377,7 +378,7 @@ read_makefile (filename, flags)
deps->file = lookup_file (filename);
if (deps->file == 0)
{
deps->file = enter_file (savestring (filename, strlen (filename)));
deps->file = enter_file (xstrdup (filename));
if (flags & RM_DONTCARE)
deps->file->dontcare = 1;
}
@@ -398,8 +399,7 @@ read_makefile (filename, flags)
return 0;
}
reading_filename = filename;
reading_lineno_ptr = &lineno;
reading_file = &fileinfo;
/* Loop over lines in the file.
The strategy is to accumulate target names in FILENAMES, dependencies
@@ -407,11 +407,12 @@ read_makefile (filename, flags)
when the start of the next rule (or eof) is encountered. */
initbuffer (&lb);
commands = xmalloc (200);
while (!feof (infile))
{
lineno += nlines;
nlines = readline (&lb, infile, filename, lineno);
fileinfo.lineno += nlines;
nlines = readline (&lb, infile, &fileinfo);
/* Check for a shell command line first.
If it is not one, we can stop treating tab specially. */
@@ -437,7 +438,7 @@ read_makefile (filename, flags)
/* Append this command line to the line being accumulated. */
p = lb.buffer;
if (commands_idx == 0)
cmds_started = lineno;
cmds_started = fileinfo.lineno;
len = strlen (p);
if (len + 1 + commands_idx > commands_len)
{
@@ -467,7 +468,7 @@ read_makefile (filename, flags)
remove_comments (collapsed);
/* 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;
while (isspace (*p))
++p;
@@ -506,12 +507,11 @@ read_makefile (filename, flags)
|| word1eq ("ifeq", 4) || word1eq ("ifneq", 5)
|| word1eq ("else", 4) || word1eq ("endif", 5)))
{
int i = conditional_line (p, filename, lineno);
int i = conditional_line (p, &fileinfo);
if (i >= 0)
ignoring = i;
else
makefile_fatal (filename, lineno,
"invalid syntax in conditional");
fatal (&fileinfo, "invalid syntax in conditional");
continue;
}
@@ -520,7 +520,7 @@ read_makefile (filename, flags)
if (in_ignored_define)
in_ignored_define = 0;
else
makefile_fatal (filename, lineno, "extraneous `endef'");
fatal (&fileinfo, "extraneous `endef'");
continue;
}
@@ -531,6 +531,9 @@ read_makefile (filename, flags)
else
{
p2 = next_token (p + 6);
if (*p2 == '\0')
fatal (&fileinfo, "empty variable name");
/* Let the variable name be the whole rest of the line,
with trailing blanks stripped (comments have already been
removed), so it could be a complex variable/function
@@ -538,8 +541,7 @@ read_makefile (filename, flags)
p = index (p2, '\0');
while (isblank (p[-1]))
--p;
lineno = do_define (p2, p - p2, o_file,
lineno, infile, filename);
do_define (p2, p - p2, o_file, infile, &fileinfo);
}
continue;
}
@@ -547,15 +549,18 @@ read_makefile (filename, flags)
if (word1eq ("override", 8))
{
p2 = next_token (p + 8);
if (p2 == 0)
makefile_error (filename, lineno, "empty `override' directive");
if (!strncmp (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0'))
if (*p2 == '\0')
error (&fileinfo, "empty `override' directive");
if (strneq (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0'))
{
if (ignoring)
in_ignored_define = 1;
else
{
p2 = next_token (p2 + 6);
if (*p2 == '\0')
fatal (&fileinfo, "empty variable name");
/* Let the variable name be the whole rest of the line,
with trailing blanks stripped (comments have already been
removed), so it could be a complex variable/function
@@ -563,14 +568,12 @@ read_makefile (filename, flags)
p = index (p2, '\0');
while (isblank (p[-1]))
--p;
lineno = do_define (p2, p - p2, o_override,
lineno, infile, filename);
do_define (p2, p - p2, o_override, infile, &fileinfo);
}
}
else if (!ignoring
&& !try_variable_definition (filename, lineno,
p2, o_override))
makefile_error (filename, lineno, "empty `override' directive");
&& !try_variable_definition (&fileinfo, p2, o_override))
error (&fileinfo, "invalid `override' directive");
continue;
}
@@ -587,7 +590,7 @@ read_makefile (filename, flags)
p2 = next_token (p + 6);
if (*p2 == '\0')
export_all_variables = 1;
v = try_variable_definition (filename, lineno, p2, o_file);
v = try_variable_definition (&fileinfo, p2, o_file);
if (v != 0)
v->export = v_export;
else
@@ -653,7 +656,7 @@ read_makefile (filename, flags)
p = allocated_variable_expand (next_token (p + (noerror ? 8 : 7)));
if (*p == '\0')
{
makefile_error (filename, lineno,
error (&fileinfo,
"no file name for `%sinclude'",
noerror ? "-" : "");
continue;
@@ -688,7 +691,7 @@ read_makefile (filename, flags)
if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
| (noerror ? RM_DONTCARE : 0)))
&& ! noerror)
makefile_error (filename, lineno,
error (&fileinfo,
"%s: %s", name, strerror (errno));
free(name);
}
@@ -701,11 +704,10 @@ read_makefile (filename, flags)
/* Restore state. */
conditionals = save;
reading_filename = filename;
reading_lineno_ptr = &lineno;
reading_file = &fileinfo;
}
#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. */
;
else if (lb.buffer[0] == '\t')
@@ -720,8 +722,7 @@ read_makefile (filename, flags)
because there was no preceding target, and the line
might have been usable as a variable definition.
But now it is definitely lossage. */
makefile_fatal (filename, lineno,
"commands commence before first target");
fatal(&fileinfo, "commands commence before first target");
}
else
{
@@ -739,6 +740,7 @@ read_makefile (filename, flags)
enum variable_origin v_origin;
char *cmdleft, *lb_next;
unsigned int len, plen = 0;
char *colonp;
/* Record the previous rule. */
@@ -768,12 +770,10 @@ read_makefile (filename, flags)
{
case w_eol:
if (cmdleft != 0)
makefile_fatal (filename, lineno,
"missing rule before commands");
else
/* This line contained a variable reference that
expanded to nothing but whitespace. */
continue;
fatal(&fileinfo, "missing rule before commands");
/* This line contained something but turned out to be nothing
but whitespace (a comment?). */
continue;
case w_colon:
case w_dcolon:
@@ -789,8 +789,6 @@ read_makefile (filename, flags)
p2 = variable_expand_string(NULL, lb_next, len);
while (1)
{
char *colonp;
lb_next += len;
if (cmdleft == 0)
{
@@ -815,7 +813,7 @@ read_makefile (filename, flags)
entirely consistent, since we do an unconditional
expand below once we know we don't have a
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);
p2 = variable_buffer + p2_off;
cmdleft = variable_buffer + cmd_off + 1;
@@ -825,12 +823,12 @@ read_makefile (filename, flags)
colonp = find_char_unquote(p2, ":", 0);
#if defined(__MSDOS__) || defined(WINDOWS32)
/* The drive spec brain-damage strikes again... */
/* FIXME: is whitespace the only possible separator of words
in this context? If not, the `isspace' test below will
need to be changed into a call to `index'. */
/* Note that the only separators of targets in this context
are whitespace and a left paren. If others are possible,
they should be added to the string in the call to index. */
while (colonp && (colonp[1] == '/' || 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);
#endif
if (colonp != 0)
@@ -838,7 +836,7 @@ read_makefile (filename, flags)
wtype = get_next_mword(lb_next, NULL, &lb_next, &len);
if (wtype == w_eol)
makefile_fatal (filename, lineno, "missing separator");
break;
p2 += strlen(p2);
*(p2++) = ' ';
@@ -850,10 +848,28 @@ read_makefile (filename, flags)
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),
1),
sizeof (struct nameseq));
*colonp = ':';
if (!filenames)
{
@@ -886,7 +902,7 @@ read_makefile (filename, flags)
wtype = get_next_mword(p2, NULL, &p, &len);
v_origin = o_file;
if (wtype == w_static && (len == (sizeof("override")-1)
&& !strncmp(p, "override", len)))
&& strneq(p, "override", len)))
{
v_origin = o_override;
(void)get_next_mword(p+len, NULL, &p, &len);
@@ -896,8 +912,7 @@ read_makefile (filename, flags)
if (wtype == w_varassign || v_origin == o_override)
{
record_target_var(filenames, p, two_colon, v_origin,
filename, lineno);
record_target_var(filenames, p, two_colon, v_origin, &fileinfo);
filenames = 0;
continue;
}
@@ -913,7 +928,7 @@ read_makefile (filename, flags)
if (*lb_next != '\0')
{
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;
/* Look for a semicolon in the expanded line. */
@@ -959,7 +974,8 @@ read_makefile (filename, flags)
check_again = 0;
/* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */
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, ':');
check_again = 1;
}
@@ -971,13 +987,13 @@ read_makefile (filename, flags)
target = parse_file_seq (&p2, ':', sizeof (struct nameseq), 1);
++p2;
if (target == 0)
makefile_fatal (filename, lineno, "missing target pattern");
fatal (&fileinfo, "missing target pattern");
else if (target->next != 0)
makefile_fatal (filename, lineno, "multiple target patterns");
fatal (&fileinfo, "multiple target patterns");
pattern = target->name;
pattern_percent = find_percent (pattern);
if (pattern_percent == 0)
makefile_fatal (filename, lineno,
fatal (&fileinfo,
"target pattern contains no `%%'");
free((char *)target);
}
@@ -995,7 +1011,7 @@ read_makefile (filename, flags)
/* Semicolon means rest of line is a command. */
unsigned int len = strlen (cmdleft);
cmds_started = lineno;
cmds_started = fileinfo.lineno;
/* Add this command line to the buffer. */
if (len + 2 > commands_len)
@@ -1019,7 +1035,7 @@ read_makefile (filename, flags)
}
if (conditionals->if_cmds)
makefile_fatal (filename, lineno, "missing `endif'");
fatal (&fileinfo, "missing `endif'");
/* At eof, record the last rule. */
record_waiting_files ();
@@ -1028,8 +1044,7 @@ read_makefile (filename, flags)
free ((char *) commands);
fclose (infile);
reading_filename = 0;
reading_lineno_ptr = 0;
reading_file = 0;
return 1;
}
@@ -1040,14 +1055,13 @@ read_makefile (filename, flags)
LINENO, INFILE and FILENAME refer to the makefile being read.
The value returned is LINENO, updated for lines read here. */
static unsigned int
do_define (name, namelen, origin, lineno, infile, filename)
static void
do_define (name, namelen, origin, infile, flocp)
char *name;
unsigned int namelen;
enum variable_origin origin;
unsigned int lineno;
FILE *infile;
char *filename;
struct floc *flocp;
{
struct linebuffer lb;
unsigned int nlines = 0;
@@ -1067,21 +1081,20 @@ do_define (name, namelen, origin, lineno, infile, filename)
{
unsigned int len;
lineno += nlines;
nlines = readline (&lb, infile, filename, lineno);
flocp->lineno += nlines;
nlines = readline (&lb, infile, flocp);
collapse_continuations (lb.buffer);
p = next_token (lb.buffer);
len = strlen (p);
if ((len == 5 || (len > 5 && isblank (p[5])))
&& !strncmp (p, "endef", 5))
&& strneq (p, "endef", 5))
{
p += 5;
remove_comments (p);
if (*next_token (p) != '\0')
makefile_error (filename, lineno,
"Extraneous text after `endef' directive");
error (flocp, "Extraneous text after `endef' directive");
/* Define the variable. */
if (idx == 0)
definition[0] = '\0';
@@ -1090,7 +1103,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
(void) define_variable (var, strlen (var), definition, origin, 1);
free (definition);
freebuffer (&lb);
return (lineno + nlines);
return;
}
else
{
@@ -1110,10 +1123,10 @@ do_define (name, namelen, origin, lineno, infile, filename)
}
/* No `endef'!! */
makefile_fatal (filename, lineno, "missing `endef', unterminated `define'");
fatal (flocp, "missing `endef', unterminated `define'");
/* NOTREACHED */
return 0;
return;
}
/* Interpret conditional commands "ifdef", "ifndef", "ifeq",
@@ -1128,10 +1141,9 @@ do_define (name, namelen, origin, lineno, infile, filename)
1 if following text should be ignored. */
static int
conditional_line (line, filename, lineno)
conditional_line (line, flocp)
char *line;
char *filename;
unsigned int lineno;
const struct floc *flocp;
{
int notdef;
char *cmdname;
@@ -1165,17 +1177,16 @@ conditional_line (line, filename, lineno)
if (*cmdname == 'e')
{
if (*line != '\0')
makefile_error (filename, lineno,
"Extraneous text after `%s' directive",
cmdname);
error (flocp,
"Extraneous text after `%s' directive", cmdname);
/* "Else" or "endif". */
if (conditionals->if_cmds == 0)
makefile_fatal (filename, lineno, "extraneous `%s'", cmdname);
fatal (flocp, "extraneous `%s'", cmdname);
/* NOTDEF indicates an `endif' command. */
if (notdef)
--conditionals->if_cmds;
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
{
/* Toggle the state of ignorance. */
@@ -1301,10 +1312,12 @@ conditional_line (line, filename, lineno)
if (*line == '(')
++count;
else if (*line == ')')
if (count <= 0)
break;
else
--count;
{
if (count <= 0)
break;
else
--count;
}
}
}
else
@@ -1321,9 +1334,8 @@ conditional_line (line, filename, lineno)
*line = '\0';
line = next_token (++line);
if (*line != '\0')
makefile_error (filename, lineno,
"Extraneous text after `%s' directive",
cmdname);
error (flocp,
"Extraneous text after `%s' directive", cmdname);
s2 = variable_expand (s2);
conditionals->ignoring[conditionals->if_cmds - 1]
@@ -1384,13 +1396,12 @@ uniquize_deps (chain)
variable value list. */
static void
record_target_var (filenames, defn, two_colon, origin, filename, lineno)
record_target_var (filenames, defn, two_colon, origin, flocp)
struct nameseq *filenames;
char *defn;
int two_colon;
enum variable_origin origin;
char *filename;
unsigned int lineno;
const struct floc *flocp;
{
struct nameseq *nextf;
struct variable_set_list *global;
@@ -1433,10 +1444,9 @@ record_target_var (filenames, defn, two_colon, origin, filename, lineno)
/* Make the new variable context current and define the variable. */
current_variable_set_list = vlist;
v = try_variable_definition(filename, lineno, defn, origin);
v = try_variable_definition(flocp, defn, origin);
if (!v)
makefile_error(filename, lineno,
"Malformed per-target variable definition");
error (flocp, "Malformed per-target variable definition");
v->per_target = 1;
/* If it's not an override, check to see if there was a command-line
@@ -1474,7 +1484,7 @@ record_target_var (filenames, defn, two_colon, origin, filename, lineno)
static void
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;
char *pattern, *pattern_percent;
struct dep *deps;
@@ -1482,8 +1492,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
char *commands;
unsigned int commands_idx;
int two_colon;
char *filename;
unsigned int lineno;
const struct floc *flocp;
int set_default;
{
struct nameseq *nextf;
@@ -1495,8 +1504,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
if (commands_idx > 0)
{
cmds = (struct commands *) xmalloc (sizeof (struct commands));
cmds->filename = filename;
cmds->lineno = cmds_started;
cmds->fileinfo.filenm = flocp->filenm;
cmds->fileinfo.lineno = cmds_started;
cmds->commands = savestring (commands, commands_idx);
cmds->command_lines = 0;
}
@@ -1519,11 +1528,10 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
implicit |= implicit_percent != 0;
if (implicit && pattern != 0)
makefile_fatal (filename, lineno,
"mixed implicit and static pattern rules");
fatal (flocp, "mixed implicit and static pattern rules");
if (implicit && implicit_percent == 0)
makefile_fatal (filename, lineno, "mixed implicit and normal rules");
fatal (flocp, "mixed implicit and normal rules");
if (implicit)
{
@@ -1555,37 +1563,38 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
this = nextf != 0 ? copy_dep_chain (deps) : deps;
if (pattern != 0)
/* If this is an extended static rule:
`targets: target%pattern: dep%pattern; cmds',
translate each dependency pattern into a plain filename
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,
"target `%s' doesn't match the target pattern",
name);
this = 0;
}
else
{
/* We use patsubst_expand to do the work of translating
the target pattern, the target's name and the dependencies'
patterns into plain dependency names. */
char *buffer = variable_expand ("");
{
/* If this is an extended static rule:
`targets: target%pattern: dep%pattern; cmds',
translate each dependency pattern into a plain filename
using the target pattern and this target's name. */
if (!pattern_matches (pattern, pattern_percent, name))
{
/* Give a warning if the rule is meaningless. */
error (flocp,
"target `%s' doesn't match the target pattern", name);
this = 0;
}
else
{
/* We use patsubst_expand to do the work of translating
the target pattern, the target's name and the dependencies'
patterns into plain dependency names. */
char *buffer = variable_expand ("");
for (d = this; d != 0; d = d->next)
{
char *o;
char *percent = find_percent (d->name);
if (percent == 0)
continue;
o = patsubst_expand (buffer, name, pattern, d->name,
pattern_percent, percent);
free (d->name);
d->name = savestring (buffer, o - buffer);
}
}
for (d = this; d != 0; d = d->next)
{
char *o;
char *percent = find_percent (d->name);
if (percent == 0)
continue;
o = patsubst_expand (buffer, name, pattern, d->name,
pattern_percent, percent);
free (d->name);
d->name = savestring (buffer, o - buffer);
}
}
}
if (!two_colon)
{
@@ -1594,29 +1603,25 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
f = enter_file (name);
if (f->double_colon)
makefile_fatal (filename, lineno,
"target file `%s' has both : and :: entries",
f->name);
fatal (flocp,
"target file `%s' has both : and :: entries", f->name);
/* If CMDS == F->CMDS, this target was listed in this rule
more than once. Just give a warning since this is harmless. */
if (cmds != 0 && cmds == f->cmds)
makefile_error
(filename, lineno,
"target `%s' given more than once in the same rule.",
f->name);
error (flocp, "target `%s' given more than once in the same rule.",
f->name);
/* Check for two single-colon entries both with commands.
Check is_target so that we don't lose on files such as .c.o
whose commands were preinitialized. */
else if (cmds != 0 && f->cmds != 0 && f->is_target)
{
makefile_error (cmds->filename, cmds->lineno,
"warning: overriding commands for target `%s'",
f->name);
makefile_error (f->cmds->filename, f->cmds->lineno,
"warning: ignoring old commands for target `%s'",
f->name);
error (&cmds->fileinfo,
"warning: overriding commands for target `%s'", f->name);
error (&f->cmds->fileinfo,
"warning: ignoring old commands for target `%s'",
f->name);
}
f->is_target = 1;
@@ -1696,9 +1701,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
/* Check for both : and :: rules. Check is_target so
we don't lose on default suffix rules or makefiles. */
if (f != 0 && f->is_target && !f->double_colon)
makefile_fatal (filename, lineno,
"target file `%s' has both : and :: entries",
f->name);
fatal (flocp,
"target file `%s' has both : and :: entries", f->name);
f = enter_file (name);
/* If there was an existing entry and it was a double-colon
entry, enter_file will have returned a new one, making it the
@@ -1746,7 +1750,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next)
{
register unsigned int len = strlen (dep_name (d2));
if (strncmp (name, dep_name (d2), len))
if (!strneq (name, dep_name (d2), len))
continue;
if (streq (name + len, dep_name (d)))
{
@@ -1942,7 +1946,7 @@ parse_file_seq (stringp, stopchar, size, strip)
* 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 *q1 = qbase;
char *q2 = q1;
@@ -2089,12 +2093,11 @@ parse_file_seq (stringp, stopchar, size, strip)
Return the number of actual lines read (> 1 if hacked continuation lines).
*/
static unsigned int
readline (linebuffer, stream, filename, lineno)
static unsigned long
readline (linebuffer, stream, flocp)
struct linebuffer *linebuffer;
FILE *stream;
char *filename;
unsigned int lineno;
const struct floc *flocp;
{
char *buffer = linebuffer->buffer;
register char *p = linebuffer->buffer;
@@ -2116,8 +2119,7 @@ readline (linebuffer, stream, filename, lineno)
lossage strikes again! (xmkmf puts NULs in its makefiles.)
There is nothing really to be done; we synthesize a newline so
the following line doesn't appear to be part of this line. */
makefile_error (filename, lineno,
"warning: NUL character seen; rest of line ignored");
error (flocp, "warning: NUL character seen; rest of line ignored");
p[0] = '\n';
len = 1;
}
@@ -2139,6 +2141,17 @@ readline (linebuffer, stream, filename, lineno)
++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)
/* P is pointing at a newline and it's the beginning of
the buffer returned by the last fgets call. However,
@@ -2177,7 +2190,7 @@ readline (linebuffer, stream, filename, lineno)
}
if (ferror (stream))
pfatal_with_name (filename);
pfatal_with_name (flocp->filenm);
return nlines;
}
@@ -2296,8 +2309,12 @@ get_next_mword (buffer, delim, startp, length)
case ':':
#if defined(__MSDOS__) || defined(WINDOWS32)
/* A word CAN include a colon in its drive spec. */
if (!(p - beg == 2 && (*p == '/' || *p == '\\') && isalpha (*beg)))
/* A word CAN include a colon in its drive spec. The drive
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
goto done_word;
@@ -2339,6 +2356,7 @@ get_next_mword (buffer, delim, startp, length)
case '\\':
switch (*p)
{
case ':':
case ';':
case '=':
case '\\':
@@ -2526,7 +2544,7 @@ tilde_expand (name)
if (pwent != 0)
{
if (userend == 0)
return savestring (pwent->pw_dir, strlen (pwent->pw_dir));
return xstrdup (pwent->pw_dir);
else
return concat (pwent->pw_dir, "/", userend + 1);
}
@@ -2644,8 +2662,7 @@ multi_glob (chain, size)
#endif /* !NO_ARCHIVES */
{
struct nameseq *elt = (struct nameseq *) xmalloc (size);
elt->name = savestring (gl.gl_pathv[i],
strlen (gl.gl_pathv[i]));
elt->name = xstrdup (gl.gl_pathv[i]);
elt->next = new;
new = elt;
}
@@ -2657,7 +2674,7 @@ multi_glob (chain, size)
}
case GLOB_NOSPACE:
fatal ("virtual memory exhausted");
fatal (NILF, "virtual memory exhausted");
break;
default:

300
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
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 "filedef.h"
#include "job.h"
#include "commands.h"
#include "dep.h"
#include "variable.h"
#include <assert.h>
#ifdef HAVE_FCNTL_H
@@ -48,13 +51,11 @@ unsigned int commands_started = 0;
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 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 void remake_file PARAMS ((struct file *file));
static time_t name_mtime PARAMS ((char *name));
static int library_search PARAMS ((char **lib, time_t *mtime_ptr));
extern time_t f_mtime PARAMS ((struct file *file, int search));
static FILE_TIMESTAMP name_mtime PARAMS ((char *name));
static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
@@ -64,6 +65,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
`changed' member is nonzero is successfully made. */
/* We need to know this "lower down" for correct error handling. */
static int updating_makefiles = 0;
int
update_goal_chain (goals, makefiles)
register struct dep *goals;
@@ -73,6 +77,8 @@ update_goal_chain (goals, makefiles)
unsigned int j = job_slots;
int status = -1;
updating_makefiles = makefiles;
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \
: file_mtime (file))
@@ -100,6 +106,9 @@ update_goal_chain (goals, makefiles)
job_slots = 1;
#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. */
while (goals != 0)
@@ -119,7 +128,7 @@ update_goal_chain (goals, makefiles)
while (g != 0)
{
/* Iterate over all double-colon entries for this file. */
struct file *file = g->file;
struct file *file;
int stop = 0, any_not_updated = 0;
for (file = g->file->double_colon ? g->file->double_colon : g->file;
@@ -128,7 +137,6 @@ update_goal_chain (goals, makefiles)
{
unsigned int ocommands_started;
int x;
time_t mtime = MTIME (file);
check_renamed (file);
if (makefiles)
{
@@ -175,7 +183,8 @@ update_goal_chain (goals, makefiles)
stop = (!keep_going_flag && !question_flag
&& !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
just_print_flag or question_flag is set
@@ -241,6 +250,11 @@ update_goal_chain (goals, makefiles)
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)
@@ -263,26 +277,27 @@ no_rule_error(file)
= "%sNo rule to make target `%s'%s";
static const char msg_parent[]
= "%sNo rule to make target `%s', needed by `%s'%s";
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)
error (msg_noparent, "*** ", file->name, ".");
error (NILF, msg_noparent, "*** ", file->name, ".");
else
error (msg_parent, "*** ",
error (NILF, msg_parent, "*** ",
file->name, file->parent->name, ".");
file->shownerror = 1;
}
file->update_status = 2;
file->mfile_status = updating_makefiles;
}
else if (file->parent == 0)
fatal (NILF, msg_noparent, "", file->name, "");
else
{
if (file->parent == 0)
fatal (msg_noparent, "", file->name, "");
else
fatal (msg_parent, "", file->name, file->parent->name, "");
}
fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
}
/* If FILE is not up to date, execute the commands for it.
@@ -305,6 +320,17 @@ update_file (file, depth)
register int status = 0;
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)
{
status |= update_file_1 (f, depth);
@@ -341,7 +367,7 @@ update_file_1 (file, depth)
struct file *file;
unsigned int depth;
{
register time_t this_mtime;
register FILE_TIMESTAMP this_mtime;
int noexist, must_make, deps_changed;
int dep_status = 0;
register struct dep *d, *lastd;
@@ -354,13 +380,7 @@ update_file_1 (file, depth)
if (file->update_status > 0)
{
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
if (!file->shownerror)
{
int dontcare = file->dontcare;
file->dontcare = 0;
no_rule_error(file);
file->dontcare = dontcare;
}
no_rule_error(file);
return file->update_status;
}
@@ -396,7 +416,7 @@ update_file_1 (file, depth)
this_mtime = file_mtime (file);
check_renamed (file);
noexist = this_mtime == (time_t) -1;
noexist = this_mtime == (FILE_TIMESTAMP) -1;
if (noexist)
DEBUGPR ("File `%s' does not exist.\n");
@@ -427,7 +447,7 @@ update_file_1 (file, depth)
d = file->deps;
while (d != 0)
{
time_t mtime;
FILE_TIMESTAMP mtime;
check_renamed (d->file);
@@ -436,7 +456,7 @@ update_file_1 (file, depth)
if (d->file->updating)
{
error ("Circular %s <- %s dependency dropped.",
error (NILF, "Circular %s <- %s dependency dropped.",
file->name, d->file->name);
/* We cannot free D here because our the caller will still have
a reference to it when we were called recursively via
@@ -484,7 +504,7 @@ update_file_1 (file, depth)
for (d = file->deps; d != 0; d = d->next)
if (d->file->intermediate)
{
time_t mtime = file_mtime (d->file);
FILE_TIMESTAMP mtime = file_mtime (d->file);
check_renamed (d->file);
d->file->parent = file;
dep_status |= update_file (d->file, depth);
@@ -537,7 +557,7 @@ update_file_1 (file, depth)
if (depth == 0 && keep_going_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;
}
@@ -559,13 +579,13 @@ update_file_1 (file, depth)
deps_changed = 0;
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);
#if 1 /* %%% In version 4, remove this code completely to
implement not remaking deps if their deps are newer
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
exist and is not intermediate. */
must_make = 1;
@@ -581,7 +601,7 @@ update_file_1 (file, depth)
if (debug_flag && !noexist)
{
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));
else
printf ("Dependency `%s' is %s than dependent `%s'.\n",
@@ -724,6 +744,9 @@ notice_finished_file (file)
{
struct file *f;
assert(file->mtime_before_update == 0);
file->mtime_before_update = file->last_mtime;
if (just_print_flag || question_flag
|| (file->is_target && file->cmds == 0))
file->last_mtime = NEW_MTIME;
@@ -771,7 +794,7 @@ static int
check_dep (file, depth, this_mtime, must_make_ptr)
struct file *file;
unsigned int depth;
time_t this_mtime;
FILE_TIMESTAMP this_mtime;
int *must_make_ptr;
{
register struct dep *d;
@@ -784,21 +807,20 @@ check_dep (file, depth, this_mtime, must_make_ptr)
/* If this is a non-intermediate file, update it and record
whether it is newer than THIS_MTIME. */
{
time_t mtime;
FILE_TIMESTAMP mtime;
dep_status = update_file (file, depth);
check_renamed (file);
mtime = file_mtime (file);
check_renamed (file);
if (mtime == (time_t) -1 || mtime > this_mtime)
if (mtime == (FILE_TIMESTAMP) -1 || mtime > this_mtime)
*must_make_ptr = 1;
}
else
{
/* FILE is an intermediate file. */
time_t mtime;
FILE_TIMESTAMP mtime;
if (!file->phony && file->cmds == 0 && !file->tried_implicit
&& file->secondary)
if (!file->phony && file->cmds == 0 && !file->tried_implicit)
{
if (try_implicit_rule (file, depth))
DEBUGPR ("Found an implicit rule for `%s'.\n");
@@ -806,7 +828,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
DEBUGPR ("No implicit rule found for `%s'.\n");
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)
{
DEBUGPR ("Using default commands for `%s'.\n");
@@ -818,7 +840,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
check_renamed (file);
mtime = file_mtime (file);
check_renamed (file);
if (mtime != (time_t) -1 && mtime > this_mtime)
if (mtime != (FILE_TIMESTAMP) -1 && mtime > this_mtime)
*must_make_ptr = 1;
/* Otherwise, update all non-intermediate files we depend on,
if necessary, and see whether any of them is more
@@ -833,7 +855,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
{
if (d->file->updating)
{
error ("Circular %s <- %s dependency dropped.",
error (NILF, "Circular %s <- %s dependency dropped.",
file->name, d->file->name);
if (lastd == 0)
{
@@ -858,7 +880,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
if (d->file->command_state == cs_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
the commands are finished. */
set_command_state (file, cs_deps_running);
@@ -978,12 +1000,12 @@ remake_file (file)
the library's actual name (/lib/libLIBNAME.a, etc.) is substituted into
FILE. */
time_t
FILE_TIMESTAMP
f_mtime (file, search)
register struct file *file;
int search;
{
time_t mtime;
FILE_TIMESTAMP mtime;
/* File's mtime is not known; must get it from the system. */
@@ -1049,9 +1071,9 @@ f_mtime (file, search)
free (arname);
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. */
return (time_t) -1;
return (FILE_TIMESTAMP) -1;
mtime = ar_member_date (file->hname);
}
@@ -1060,7 +1082,7 @@ f_mtime (file, search)
{
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. */
char *name = file->name;
@@ -1098,16 +1120,15 @@ f_mtime (file, search)
We only need to do this once, for now. */
static time_t now = 0;
static FILE_TIMESTAMP now = 0;
if (!clock_skew_detected
&& mtime != (time_t)-1 && mtime > now
&& mtime != (FILE_TIMESTAMP)-1 && mtime > now
&& !file->updated)
{
/* This file's time appears to be in the future.
Update our concept of the present, and compare again. */
extern time_t time ();
time (&now);
now = file_timestamp_now ();
#ifdef WINDOWS32
/*
@@ -1126,8 +1147,13 @@ f_mtime (file, search)
#endif
#endif
{
error("*** Warning: File `%s' has modification time in the future (%ld > %ld)",
file->name, mtime, now);
char mtimebuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
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;
}
}
@@ -1136,11 +1162,22 @@ f_mtime (file, search)
/* Store the mtime into all the entries for this file. */
if (file->double_colon)
file = file->double_colon;
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 = file->prev;
} while (file != 0);
}
while (file != 0);
return mtime;
}
@@ -1148,16 +1185,16 @@ f_mtime (file, search)
/* Return the mtime of the file or archive-member reference NAME. */
static time_t
static FILE_TIMESTAMP
name_mtime (name)
register char *name;
{
struct stat st;
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 +1205,7 @@ name_mtime (name)
static int
library_search (lib, mtime_ptr)
char **lib;
time_t *mtime_ptr;
FILE_TIMESTAMP *mtime_ptr;
{
static char *dirs[] =
{
@@ -1187,82 +1224,111 @@ library_search (lib, mtime_ptr)
0
};
char *libname = &(*lib)[2]; /* Name without the `-l'. */
time_t mtime;
static char *libpatterns = NULL;
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;
/* Look first for `libNAME.a' in the current directory. */
#ifndef _AMIGA
sprintf (buf, "lib%s.a", libname);
#else
sprintf (buf, "%s.lib", libname);
#endif
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
/* If we don't have libpatterns, get it. */
if (!libpatterns)
{
*lib = buf;
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
int save = warn_undefined_variables_flag;
warn_undefined_variables_flag = 0;
libpatterns = xstrdup (variable_expand ("$(strip $(.LIBPATTERNS))"));
warn_undefined_variables_flag = save;
}
/* Now try VPATH search on that. */
file = buf;
if (vpath_search (&file, mtime_ptr))
/* Loop through all the patterns in .LIBPATTERNS, and search on each one. */
p2 = libpatterns;
while ((p = find_next_token (&p2, &len)) != 0)
{
free (buf);
*lib = file;
return 1;
}
static char *buf = NULL;
static int buflen = 0;
static int libdir_maxlen = -1;
char *libbuf = variable_expand ("");
/* Now try the standard set of directories. */
#ifdef __MSDOS__
{
/* The default library directory is at ${DJDIR}/lib. */
struct variable *djdir = lookup_variable ("DJDIR", 5);
if (djdir)
/* Expand the pattern using LIBNAME as a replacement. */
{
size_t djdir_len = strlen (djdir->value);
char c = p[len];
char *p3, *p4;
if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2)
buf = (char *) xrealloc (djdir_len + 1);
sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname);
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
p[len] = '\0';
p3 = find_percent (p);
if (!p3)
{
*lib = buf;
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
/* Give a warning if there is no pattern, then remove the
pattern so it's ignored next time. */
error (NILF, ".LIBPATTERNS element `%s' is not a pattern", p);
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)
{
#ifndef _AMIGA
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)
/* Look first for `libNAME.a' in the current directory. */
mtime = name_mtime (libbuf);
if (mtime != (FILE_TIMESTAMP) -1)
{
*lib = buf;
*lib = xstrdup (libbuf);
if (mtime_ptr != 0)
*mtime_ptr = mtime;
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;
}

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
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 "job.h"
@@ -157,7 +158,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
retsock = Rpc_UdpCreate (True, 0);
if (retsock < 0)
{
error ("exporting: Couldn't create return socket.");
error (NILF, "exporting: Couldn't create return socket.");
return 1;
}
@@ -202,7 +203,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
{
(void) close (retsock);
(void) close (sock);
error ("exporting to %s: %s",
error (NILF, "exporting to %s: %s",
host ? host->h_name : inet_ntoa (permit.addr),
Rpc_ErrorMessage (status));
return 1;
@@ -211,14 +212,14 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
{
(void) close (retsock);
(void) close (sock);
error ("exporting to %s: %s",
error (NILF, "exporting to %s: %s",
host ? host->h_name : inet_ntoa (permit.addr),
msg);
return 1;
}
else
{
error ("*** exported to %s (id %u)",
error (NILF, "*** exported to %s (id %u)",
host ? host->h_name : inet_ntoa (permit.addr),
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
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 "filedef.h"

77
rule.c
View File

@@ -1,5 +1,5 @@
/* 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.
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
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 "dep.h"
@@ -333,27 +334,29 @@ new_pattern_rule (rule, override)
if (!streq (dep_name (d), dep_name (d2)))
break;
if (d == 0 && d2 == 0)
/* All the dependencies matched. */
if (override)
{
/* Remove the old rule. */
freerule (r, lastrule);
/* Install the new one. */
if (pattern_rules == 0)
pattern_rules = rule;
else
last_pattern_rule->next = rule;
last_pattern_rule = rule;
{
/* All the dependencies matched. */
if (override)
{
/* Remove the old rule. */
freerule (r, lastrule);
/* Install the new one. */
if (pattern_rules == 0)
pattern_rules = rule;
else
last_pattern_rule->next = rule;
last_pattern_rule = rule;
/* We got one. Stop looking. */
goto matched;
}
else
{
/* The old rule stays intact. Destroy the new one. */
freerule (rule, (struct rule *) 0);
return 0;
}
/* We got one. Stop looking. */
goto matched;
}
else
{
/* The old rule stays intact. Destroy the new one. */
freerule (rule, (struct rule *) 0);
return 0;
}
}
}
}
@@ -416,11 +419,11 @@ install_pattern_rule (p, terminal)
{
r->terminal = terminal;
r->cmds = (struct commands *) xmalloc (sizeof (struct commands));
r->cmds->filename = 0;
r->cmds->lineno = 0;
r->cmds->fileinfo.filenm = 0;
r->cmds->fileinfo.lineno = 0;
/* These will all be string literals, but we malloc space for them
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;
}
}
@@ -436,10 +439,23 @@ freerule (rule, lastrule)
{
struct rule *next = rule->next;
register unsigned int i;
register struct dep *dep;
for (i = 0; rule->targets[i] != 0; ++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->suffixes);
free ((char *) rule->lens);
@@ -583,7 +599,7 @@ lookup_pattern_var (target)
stemlen = targlen - p->len + 1;
/* 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;
/* Compare the text in the pattern after the stem, if any.
@@ -664,8 +680,13 @@ print_rule_data_base ()
}
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");

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
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. */
@@ -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 struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
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));

View File

@@ -70,12 +70,14 @@ extern char *sys_siglist[];
/* Table of abbreviations for signals. Note: A given number can
appear more than once with different abbreviations. */
#define SIG_TABLE_SIZE (NSIG*2)
typedef struct
{
int number;
const char *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. */
static int sig_table_nelts = 0;
@@ -88,10 +90,18 @@ init_sig (number, abbrev, name)
const char *name;
{
#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
sig_table[sig_table_nelts].number = number;
sig_table[sig_table_nelts++].abbrev = abbrev;
if (sig_table_nelts < SIG_TABLE_SIZE)
{
sig_table[sig_table_nelts].number = number;
sig_table[sig_table_nelts++].abbrev = abbrev;
}
}
void

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
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 "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)
if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1)
&& strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == '\0')
break;
@@ -97,7 +98,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
{
if (v->value != 0)
free (v->value);
v->value = savestring (value, strlen (value));
v->value = xstrdup (value);
v->origin = origin;
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->name = savestring (name, length);
v->value = savestring (value, strlen (value));
v->value = xstrdup (value);
v->origin = origin;
v->recursive = recursive;
v->expanding = 0;
@@ -175,7 +176,7 @@ lookup_variable (name, length)
for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1)
&& strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0)
return v;
}
@@ -204,7 +205,7 @@ lookup_variable_in_set (name, length, set)
for (v = set->table[hash]; v != 0; v = v->next)
if (*v->name == *name
&& !strncmp (v->name + 1, name + 1, length - 1)
&& strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0)
return v;
@@ -265,6 +266,8 @@ pop_variable_scope ()
next = v->next;
free (v->name);
if (v->value)
free (v->value);
free ((char *) v);
}
}
@@ -443,7 +446,7 @@ define_automatic_variables ()
{
free (v->value);
v->origin = o_file;
v->value = savestring (default_shell, strlen (default_shell));
v->value = xstrdup (default_shell);
}
#endif
@@ -676,9 +679,8 @@ target_environment (file)
returned. */
struct variable *
try_variable_definition (filename, lineno, line, origin)
char *filename;
unsigned int lineno;
try_variable_definition (flocp, line, origin)
const struct floc *flocp;
char *line;
enum variable_origin origin;
{
@@ -688,7 +690,7 @@ try_variable_definition (filename, lineno, line, origin)
register char *end;
enum { 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;
while (1)
@@ -766,7 +768,7 @@ try_variable_definition (filename, lineno, line, origin)
expanded_name = allocated_variable_expand (name);
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. */
@@ -776,8 +778,11 @@ try_variable_definition (filename, lineno, line, origin)
/* Should not be possible. */
abort ();
case f_simple:
/* A simple variable definition "var := value". Expand the value. */
value = variable_expand (p);
/* A simple variable definition "var := value". Expand the value.
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;
case f_conditional:
/* A conditional variable definition "var ?= value".
@@ -788,6 +793,7 @@ try_variable_definition (filename, lineno, line, origin)
free(expanded_name);
return v;
}
flavor = f_recursive;
/* FALLTHROUGH */
case f_recursive:
/* 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
your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
defining SHELL to be "d:/unix/bash.exe". */
if (origin == o_file
if ((origin == o_file || origin == o_override)
&& strcmp (expanded_name, "SHELL") == 0)
{
char shellpath[PATH_MAX];
@@ -912,7 +918,7 @@ try_variable_definition (filename, lineno, line, origin)
else
#endif /* __MSDOS__ */
#ifdef WINDOWS32
if (origin == o_file
if ((origin == o_file || origin == o_override)
&& strcmp (expanded_name, "SHELL") == 0) {
extern char* default_shell;
@@ -932,6 +938,8 @@ try_variable_definition (filename, lineno, line, origin)
v = define_variable (expanded_name, strlen (expanded_name),
value, origin, flavor == f_recursive);
if (alloc_value)
free (alloc_value);
free (expanded_name);
return v;

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
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.
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_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 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 *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 (strncmp (fptr, "000000", 6) != 0)
if (!strneq (fptr, "000000", 6))
rooted = 0;
}
else
@@ -661,7 +661,7 @@ vmsify (name, type)
nstate = N_OPEN;
break;
}
}
}
}
}
else
@@ -840,7 +840,7 @@ vmsify (name, type)
}
while (state > 0);
}

17
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
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 "filedef.h"
@@ -48,7 +49,7 @@ static struct vpath *general_vpath;
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
will be searched in the order given in the makefiles
@@ -168,7 +169,7 @@ construct_vpath_list (pattern, dirpath)
if (pattern != 0)
{
pattern = savestring (pattern, strlen (pattern));
pattern = xstrdup (pattern);
percent = find_percent (pattern);
}
@@ -323,7 +324,7 @@ gpath_search (file, len)
if (gpaths && (len <= gpaths->maxlen))
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 0;
@@ -338,7 +339,7 @@ gpath_search (file, len)
int
vpath_search (file, mtime_ptr)
char **file;
time_t *mtime_ptr;
FILE_TIMESTAMP *mtime_ptr;
{
register struct vpath *v;
@@ -376,7 +377,7 @@ static int
selective_vpath_search (path, file, mtime_ptr)
struct vpath *path;
char **file;
time_t *mtime_ptr;
FILE_TIMESTAMP *mtime_ptr;
{
int not_target;
char *name, *n;
@@ -524,7 +525,9 @@ selective_vpath_search (path, file, mtime_ptr)
/* Store the modtime into *MTIME_PTR for the caller.
If we have had no need to stat the file here,
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);
return 1;

View File

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

File diff suppressed because it is too large Load Diff