mirror of
https://github.com/mirror/make.git
synced 2026-09-05 22:25:00 +08:00
Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d1d6aa6de | ||
|
|
e2403327e9 | ||
|
|
65a7296e2c | ||
|
|
99454e6a1e | ||
|
|
411a01acce | ||
|
|
33654a7af4 | ||
|
|
fa1ec9e1f3 | ||
|
|
fefeb0f7bd | ||
|
|
6cca2382f0 | ||
|
|
44309109fe | ||
|
|
d153373039 | ||
|
|
ccac245bf5 | ||
|
|
f106953139 | ||
|
|
54727192c0 | ||
|
|
20258f42d4 | ||
|
|
4f79de612b | ||
|
|
ea9504a609 | ||
|
|
511cb55530 | ||
|
|
65d7b12aeb | ||
|
|
2968844002 | ||
|
|
a709205e81 | ||
|
|
9391fb8e4c | ||
|
|
4950159344 | ||
|
|
91da8b09df | ||
|
|
e3e88767f1 | ||
|
|
76ae1bc064 | ||
|
|
e24c9e161a | ||
|
|
f0a7421adc | ||
|
|
8204f56f2f | ||
|
|
e97f8e6f57 | ||
|
|
20b68e968a | ||
|
|
9d31f1e1f1 | ||
|
|
2fcce1d3b0 | ||
|
|
1290679bc3 | ||
|
|
dc70a3bc0b | ||
|
|
aa9ec7c2c7 | ||
|
|
04c488df1c | ||
|
|
8de0e41662 | ||
|
|
e94d73997a | ||
|
|
7585dedefc | ||
|
|
57ba55d08c | ||
|
|
886748c02d | ||
|
|
d378e4204d | ||
|
|
e7e9b799c4 | ||
|
|
a3a7581c1a | ||
|
|
3e12cad198 | ||
|
|
e2ffc653aa | ||
|
|
4e58a6ca4c | ||
|
|
41dcca8426 | ||
|
|
161a026602 | ||
|
|
e244062995 | ||
|
|
24fec5cb53 | ||
|
|
b903988475 | ||
|
|
6ea87be73b | ||
|
|
f6490d62cf | ||
|
|
480ad62713 | ||
|
|
acd666ce50 | ||
|
|
be3fb0ae6d | ||
|
|
dd0c939e78 | ||
|
|
fff468765c | ||
|
|
63dff1e0bc | ||
|
|
e746a9c951 | ||
|
|
74d4418f1c | ||
|
|
062e5f6aae | ||
|
|
c495345f7c |
51
AUTHORS
Normal file
51
AUTHORS
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
GNU make development up to version 3.75 by:
|
||||||
|
Roland McGrath <roland@gnu.org>
|
||||||
|
|
||||||
|
|
||||||
|
Development starting with GNU make 3.76 by:
|
||||||
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
|
||||||
|
GNU Make User's Manual written by:
|
||||||
|
Richard M. Stallman <rms@gnu.org>
|
||||||
|
|
||||||
|
User's Manual edited by:
|
||||||
|
Roland McGrath <roland@gnu.org>
|
||||||
|
Bob Chassell <bob@gnu.org>
|
||||||
|
Melissa Weisshaus <melissa@gnu.org>
|
||||||
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
Port to Amiga by:
|
||||||
|
Aaron Digulla <digulla@fh-konstanz.de>
|
||||||
|
|
||||||
|
|
||||||
|
Port to MS-DOS (DJGPP) and MS-Windows 95/NT by:
|
||||||
|
DJ Delorie <dj@delorie.com>
|
||||||
|
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
Other contributors:
|
||||||
|
|
||||||
|
Janet Carson <janet_carson@tivoli.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>
|
||||||
|
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
Carl Staelin (Princeton University)
|
||||||
|
Ian Stewartson (Data Logic Limited)
|
||||||
|
|
||||||
|
With suggestions/comments/bug reports from a cast of ... well ...
|
||||||
|
hundreds, anyway :)
|
||||||
664
ChangeLog
664
ChangeLog
@@ -1,3 +1,667 @@
|
|||||||
|
1998-07-28 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* Version 3.77 released.
|
||||||
|
|
||||||
|
* dosbuild.bat: Change to DOS CRLF line terminators.
|
||||||
|
|
||||||
|
* make-stds.texi: Update from latest version.
|
||||||
|
|
||||||
|
* make.texinfo (Options Summary): Clarify that the -r option
|
||||||
|
affects only rules, not builtin variables.
|
||||||
|
|
||||||
|
1998-07-27 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* make.h: Make __attribute__ resolve to empty for non-GCC _and_
|
||||||
|
for GCC pre-2.5.x.
|
||||||
|
|
||||||
|
* misc.c (log_access): Print UID/GID's as unsigned long int for
|
||||||
|
maximum portability.
|
||||||
|
|
||||||
|
* job.c (reap_children): Print PIDs as long int for maximum
|
||||||
|
portability.
|
||||||
|
|
||||||
|
1998-07-24 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* Makefile.DOS (*_INSTALL, *_UNINSTALL): Replace `true' with `:'.
|
||||||
|
|
||||||
|
1998-07-25 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* Version 3.76.94 released.
|
||||||
|
|
||||||
|
1998-07-23 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* config.h.W32.template: Make sure all the #defines of macros here
|
||||||
|
have a value (e.g., use ``#define HAVE_STRING_H 1'' instead of
|
||||||
|
just ``#define HAVE_STRING_H''. Keeps the preprocessor happy in
|
||||||
|
some contexts.
|
||||||
|
|
||||||
|
* make.h: Remove __attribute__((format...)) stuff; using it with
|
||||||
|
un-prototyped functions causes older GCC's to fail.
|
||||||
|
|
||||||
|
* Version 3.76.93 released.
|
||||||
|
|
||||||
|
1998-07-22 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* file.c (print_file_data_base): Fix average calculation.
|
||||||
|
|
||||||
|
1998-07-20 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* main.c (die): Postpone the chdir() until after
|
||||||
|
remove_intermediates() so that intermediate targets with relative
|
||||||
|
pathnames are removed properly.
|
||||||
|
|
||||||
|
1998-07-17 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* filedef.h (struct file): New flag: did we print an error or not?
|
||||||
|
|
||||||
|
* remake.c (no_rule_error): New function to print error messages,
|
||||||
|
extraced from remake_file().
|
||||||
|
|
||||||
|
* remake.c (remake_file): Invoke the new error print function.
|
||||||
|
(update_file_1): Invoke the error print function if we see that we
|
||||||
|
already tried this target and it failed, but that an error wasn't
|
||||||
|
printed for it. This can happen if a file is included with
|
||||||
|
-include or sinclude and couldn't be built, then later is also
|
||||||
|
the dependency of another target. Without this change, make just
|
||||||
|
silently stops :-/.
|
||||||
|
|
||||||
|
1998-07-16 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* make.texinfo: Removed "beta" version designator.
|
||||||
|
Updated ISBN for the next printing.
|
||||||
|
|
||||||
|
1998-07-13 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
|
* acinclude.m4: New AC_LFS macro to determine if special compiler
|
||||||
|
flags are needed to allow access to large files (e.g., Solaris 2.6).
|
||||||
|
* configure.in: Invoke it.
|
||||||
|
|
||||||
|
1998-07-08 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* Makefile.DOS: track changes in Makefile.in.
|
||||||
|
|
||||||
|
1998-07-07 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* remote-cstms.c (start_remote_job): Move gethostbyaddr() to the
|
||||||
|
top so host is initialized early enough.
|
||||||
|
|
||||||
|
* acinclude.m4: New file. Need some special autoconf macros to
|
||||||
|
check for network libraries (-lsocket, -lnsl, etc.) when
|
||||||
|
configuring Customs.
|
||||||
|
|
||||||
|
* configure.in (make_try_customs): Invoke new network libs macro.
|
||||||
|
|
||||||
|
1998-07-06 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* Version 3.76.92 released.
|
||||||
|
|
||||||
|
* README.customs: Added to the distribution.
|
||||||
|
|
||||||
|
* configure.in (make_try_customs): Rewrite to require an installed
|
||||||
|
Customs library, rather than looking at the build directory.
|
||||||
|
|
||||||
|
* Makefile.am (man_MANS): Install make.1.
|
||||||
|
* make.1: Renamed from make.man.
|
||||||
|
|
||||||
|
* make.texinfo (Bugs): New mailing list address for GNU make bug
|
||||||
|
reports.
|
||||||
|
|
||||||
|
1998-07-02 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* Version 3.76.91 released.
|
||||||
|
|
||||||
|
* default.c: Added default rule for new-style RCS master file
|
||||||
|
storage; ``% :: RCS/%''.
|
||||||
|
Added default rules for DOS-style C++ files with suffix ".cpp".
|
||||||
|
They use the new LINK.cpp and COMPILE.cpp macros, which are set by
|
||||||
|
default to be equal to LINK.cc and COMPILE.cc.
|
||||||
|
|
||||||
|
1998-06-19 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* job.c (start_job_command): Reset execute_by_shell after an empty
|
||||||
|
command was skipped.
|
||||||
|
|
||||||
|
1998-06-09 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* main.c (main): Keep track of the temporary filename created when
|
||||||
|
reading a makefile from stdin (-f-) and attempt to remove it
|
||||||
|
as soon as we know we're not going to re-exec. If we are, add it
|
||||||
|
to the exec'd make's cmd line with "-o" so the exec'd make doesn't
|
||||||
|
try to rebuild it. We still have a hole: if make re-execs then
|
||||||
|
the temporary file will never be removed. To fix this we'd need
|
||||||
|
a brand new option that meant "really delete this".
|
||||||
|
* AUTHORS, getopt.c, getopt1.c, getopt.h, main.c (print_version):
|
||||||
|
Updated mailing addresses.
|
||||||
|
|
||||||
|
1998-06-08 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* main.c (main): Andreas Luik <luik@isa.de> points out that the
|
||||||
|
check for makefile :: rules with commands but no dependencies
|
||||||
|
causing a loop terminates incorrectly.
|
||||||
|
|
||||||
|
* maintMakefile: Make a template for README.DOS to update version
|
||||||
|
numbers.
|
||||||
|
|
||||||
|
1998-05-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* remake.c (update_file_1): Don't free the memory for the
|
||||||
|
dependency structure when dropping a circular dependency.
|
||||||
|
|
||||||
|
1998-05-30 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* dir.c (file_exists_p, file_impossible_p, file_impossible)
|
||||||
|
[__MSDOS__, WINDOWS32]: Retain trailing slash in "d:/", and make
|
||||||
|
dirname of "d:foo" be "d:".
|
||||||
|
|
||||||
|
1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* read.c (read_makefile): Avoid running past EOS when scanning
|
||||||
|
file name after `include'.
|
||||||
|
|
||||||
|
1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* make.texinfo (Flavors): Correct description of conditional
|
||||||
|
assignment, which is not equivalent to ifndef.
|
||||||
|
(Setting): Likewise.
|
||||||
|
|
||||||
|
1998-05-24 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* arscan.c (ar_name_equal): strncmp() might be implemented as a
|
||||||
|
macro, so don't put preprocessor conditions inside the arguments
|
||||||
|
list.
|
||||||
|
|
||||||
|
1998-05-23 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* read.c (read_makefile) [__MSDOS__, WINDOWS32]: Skip colons in
|
||||||
|
drive specs when parsing targets, target-specific variables and
|
||||||
|
static pattern rules. A colon can only be part of drive spec if
|
||||||
|
it is after the first letter in a token.
|
||||||
|
|
||||||
|
1998-05-22 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* remake.c (f_mtime) [__MSDOS__]: Allow up to 3 sec of skew before
|
||||||
|
yelling bloody murder.
|
||||||
|
|
||||||
|
* dosbuild.bat: Use -DINCLUDEDIR= and -DLIBDIR= where appropriate.
|
||||||
|
|
||||||
|
* read.c (parse_file_seq): Combine the special file-handling code
|
||||||
|
for WINDOWS32 and __MSDOS__ into a single snippet.
|
||||||
|
(get_next_mword) [__MSDOS__, WINDOWS32]: Allow a word to include a
|
||||||
|
colon as part of a drive spec.
|
||||||
|
|
||||||
|
* job.c (batch_mode_shell) [__MSDOS__]: Declare.
|
||||||
|
|
||||||
|
1998-05-20 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* Version 3.76.90 released.
|
||||||
|
|
||||||
|
1998-05-19 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* make.texinfo (Make Errors): Added a new appendix describing
|
||||||
|
common errors make might generate and how to resolve them (or at
|
||||||
|
least more information on what they mean).
|
||||||
|
|
||||||
|
* maintMakefile (NMAKEFILES): Use the new automake 1.3 feature
|
||||||
|
to create a dependency file to construct Makefile.DOS, SMakefile,
|
||||||
|
and NMakefile.
|
||||||
|
(.dep_segment): Generate the dependency fragment file.
|
||||||
|
|
||||||
|
1998-05-14 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* make.man: Minor changes.
|
||||||
|
|
||||||
|
1998-05-13 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* function.c (pattern_matches,expand_function): Change variables
|
||||||
|
and types named "word" to something else, to avoid compilation
|
||||||
|
problems on Cray C90 Unicos.
|
||||||
|
* variable.h: Modify the function prototype.
|
||||||
|
|
||||||
|
1998-05-11 Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* job.c (construct_command_argv_internal): [WINDOWS32] Turn off
|
||||||
|
echo when using a batch file, and make sure the command ends in a
|
||||||
|
newline.
|
||||||
|
|
||||||
|
1998-05-03 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* configure.in (make_try_customs): Add some customs flags if the
|
||||||
|
user configures custom support.
|
||||||
|
|
||||||
|
* job.c, remote-cstms.c: Merge in changes for custom library.
|
||||||
|
|
||||||
|
* remote-stub.c: Add option to stub start_remote_job_p().
|
||||||
|
|
||||||
|
1998-05-01 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* remake.c (f_mtime): Install VPATH+ handling for archives; use
|
||||||
|
the hname field instead of the name field, and rehash when
|
||||||
|
appropriate.
|
||||||
|
|
||||||
|
1998-04-30 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* rule.c (print_rule_data_base): Print out any pattern-specific
|
||||||
|
variable values into the rules database.
|
||||||
|
|
||||||
|
* variable.c (print_variable_set): Make this variable extern, to
|
||||||
|
be called by print_rule_data_base() for pattern-specific variables.
|
||||||
|
|
||||||
|
* make.texinfo (Pattern-specific): Document pattern-specific
|
||||||
|
variables.
|
||||||
|
|
||||||
|
1998-04-29 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* expand.c (variable_expand_for_file): Make static; its only
|
||||||
|
called internally. Look up this target in the list of
|
||||||
|
pattern-specific variables and insert the variable set into the
|
||||||
|
queue to be searched.
|
||||||
|
|
||||||
|
* filedef.h (struct file): Add a new field to hold the
|
||||||
|
previously-found pattern-specific variable reference. Add a new
|
||||||
|
flag to remember whether we already searched for this file.
|
||||||
|
|
||||||
|
* rule.h (struct pattern_var): New structure for storing
|
||||||
|
pattern-specific variable values. Define new function prototypes.
|
||||||
|
|
||||||
|
* rule.c: New variables pattern_vars and last_pattern_var for
|
||||||
|
storage and handling of pattern-specific variable values.
|
||||||
|
(create_pattern_var): Create a new pattern-specific variable value
|
||||||
|
structure.
|
||||||
|
(lookup_pattern_var): Try to match a target to one of the
|
||||||
|
pattern-specific variable values.
|
||||||
|
|
||||||
|
1998-04-22 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* make.texinfo (Target-specific): Document target-specific
|
||||||
|
variables.
|
||||||
|
|
||||||
|
1998-04-21 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* variable.c (define_variable_in_set): Made globally visible.
|
||||||
|
(lookup_variable_in_set): New function: like lookup_variable but
|
||||||
|
look only in a specific variable set.
|
||||||
|
(target_environment): Use lookup_variable_in_set() to get the
|
||||||
|
correct export rules for a target-specific variable.
|
||||||
|
(create_new_variable_set): Create a new variable set, and just
|
||||||
|
return it without installing it anywhere.
|
||||||
|
(push_new_variable_scope): Reimplement in terms of
|
||||||
|
create_new_variable_set.
|
||||||
|
|
||||||
|
* read.c (record_target_var): Like record_files, but instead of
|
||||||
|
files create a target-specific variable value for each of the
|
||||||
|
listed targets. Invoked from read_makefile() when the target line
|
||||||
|
turns out to be a target-specific variable assignment.
|
||||||
|
|
||||||
|
1998-04-19 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* read.c (read_makefile): Rewrite the entire target parsing
|
||||||
|
section to implement target-specific variables. In particular, we
|
||||||
|
cannot expand the entire line as soon as it's read in, since we
|
||||||
|
may want to evaluate parts of it with different variable contexts
|
||||||
|
active. Instead, start expanding from the beginning until we find
|
||||||
|
the `:' (or `::'), then determine what kind of line this is and
|
||||||
|
continue appropriately.
|
||||||
|
|
||||||
|
* read.c (get_next_mword): New function to parse a makefile line
|
||||||
|
by "words", considering an entire variable or function as one
|
||||||
|
word. Return the type read in, along with its starting position
|
||||||
|
and length.
|
||||||
|
(enum make_word_type): The types of words that are recognized by
|
||||||
|
get_next_mword().
|
||||||
|
|
||||||
|
* variable.h (struct variable): Add a flag to specify a per-target
|
||||||
|
variable.
|
||||||
|
|
||||||
|
* expand.c: Make variable_buffer global. We need this during the
|
||||||
|
new parsing of the makefile.
|
||||||
|
(variable_expand_string): New function. Like variable_expand(),
|
||||||
|
but start at a specific point in the buffer, not the beginning.
|
||||||
|
(variable_expand): Rewrite to simply call variable_expand_string().
|
||||||
|
|
||||||
|
1998-04-13 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* remake.c (update_goal_chain): Allow the rebuilding makefiles
|
||||||
|
step to use parallel jobs. Not sure why this was disabled:
|
||||||
|
hopefully we won't find out :-/.
|
||||||
|
|
||||||
|
1998-04-11 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* main.c (main): Set the CURDIR makefile variable.
|
||||||
|
* make.texinfo (Recursion): Document it.
|
||||||
|
|
||||||
|
1998-03-17 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* misc.c (makefile_fatal): If FILE is nil, invoke plain fatal().
|
||||||
|
* variable.c (try_variable_definition): Use new feature.
|
||||||
|
|
||||||
|
1998-03-10 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* main.c (main): Don't pass included, rebuilt makefiles to
|
||||||
|
re-exec'd makes with -o. Reopens a possible loop, but it caused
|
||||||
|
too many problems.
|
||||||
|
|
||||||
|
1998-03-02 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* variable.c (try_variable_definition): Implement ?=.
|
||||||
|
* make.texinfo (Setting): Document it.
|
||||||
|
|
||||||
|
1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* job.c (start_job_command): Reset execute_by_shell after an empty
|
||||||
|
command, like ":", has been seen.
|
||||||
|
|
||||||
|
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
|
||||||
|
* README.W32: Document case sensitivity
|
||||||
|
* config.ami: Share case warping code with Windows
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
also a batch_mode_shell variable that determines whether not
|
||||||
|
command lines should be executed via script files. A WINDOWS32
|
||||||
|
system with no sh.exe installed would have unixy_shell set to
|
||||||
|
FALSE and batch_mode_shell set to TRUE. If you have a unixy shell
|
||||||
|
that does not behave well when invoking things via 'sh -c xxx',
|
||||||
|
you may want to turn on BATCH_MODE_ONLY_SHELL and see if things
|
||||||
|
improve.
|
||||||
|
* NMakefile: Added /D DEBUG to debug build flags so that unhandled
|
||||||
|
exceptions could be debugged.
|
||||||
|
|
||||||
|
Mon Oct 6 00:04:25 1997 Rob Tulloh <rob_tulloh@dev.tivoli.com>
|
||||||
|
|
||||||
|
* 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
|
||||||
|
parsed to detect sh.exe.
|
||||||
|
* 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
|
||||||
|
case-sensitive.
|
||||||
|
* 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 "[--]".
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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.
|
||||||
|
* readme.vms: Comments on what's changed lately.
|
||||||
|
|
||||||
|
Fri Sep 26 01:14:18 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
|
||||||
|
|
||||||
|
* read.c (read_all_makefiles): Allow make to find files named
|
||||||
|
"MAKEFILE" with no extension on VMS.
|
||||||
|
* file.c (lookup_file): Lowercase filenames on VMS.
|
||||||
|
|
||||||
|
1997-09-29 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* read.c (read_makefile): Reworked target detection again; the old
|
||||||
|
version had an obscure quirk.
|
||||||
|
|
||||||
|
Fri Sep 19 09:20:49 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* Version 3.76.1 released.
|
||||||
|
|
||||||
|
* Makefile.am: Add loadavg files to clean rules.
|
||||||
|
|
||||||
|
* configure.in (AC_OUTPUT): Remove stamp-config; no longer needed.
|
||||||
|
* Makefile.ami (distclean): Ditto.
|
||||||
|
* SMakefile (distclean): Ditto.
|
||||||
|
|
||||||
|
* main.c (main): Arg count should be int, not char! Major braino.
|
||||||
|
|
||||||
|
Tue Sep 16 10:18:22 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* Version 3.76 released.
|
||||||
|
|
||||||
|
Tue Sep 2 10:07:39 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* function.c (expand_function): When processing $(shell...)
|
||||||
|
translate a CRLF (\r\n) sequence as well as a newline (\n) to a
|
||||||
|
space. Also remove an ending \r\n sequence.
|
||||||
|
* make.texinfo (Shell Function): Document it.
|
||||||
|
|
||||||
|
Fri Aug 29 12:59:06 1997 Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* w32/pathstuff.c (convert_Path_to_windows32): Fix problem where
|
||||||
|
paths which contain single character entries like `.' are not
|
||||||
|
handled correctly.
|
||||||
|
|
||||||
|
* README.W32: Document path handling issues on Windows systems.
|
||||||
|
|
||||||
|
Fri Aug 29 02:01:27 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* Version 3.75.93.
|
||||||
|
|
||||||
|
Thu Aug 28 19:39:06 1997 Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* 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
|
||||||
|
the way that execvp() is implemented on top of WINDOWS32 APIs. To
|
||||||
|
alleviate the problem, use the supplied process launch function in
|
||||||
|
the sub_proc library and suspend the parent process until the
|
||||||
|
child process has run. When the child exits, exit the parent make
|
||||||
|
with the exit code of the child make.
|
||||||
|
|
||||||
|
Thu Aug 28 17:04:47 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* Makefile.DOS.template (distdir): Fix a line that got wrapped in
|
||||||
|
email.
|
||||||
|
|
||||||
|
* Makefile.am (loadavg): Give the necessary cmdline options when
|
||||||
|
linking loadavg.
|
||||||
|
|
||||||
|
* configure.in: Check for pstat_getdynamic for getloadvg on HP.
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
|
Tue Aug 26 11:59:15 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* main.c (print_version): Add '97 to copyright years.
|
||||||
|
|
||||||
|
* read.c (do_define): Check the length of the array before looking
|
||||||
|
at a particular offset.
|
||||||
|
|
||||||
|
* job.c (construct_command_argv_internal): Examine the last byte
|
||||||
|
of the previous arg, not the byte after that.
|
||||||
|
|
||||||
|
Sat Aug 23 1997 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* Makefile.DOS.template: New file (converted to Makefile.DOS in
|
||||||
|
the distribution).
|
||||||
|
|
||||||
|
* configure.bat: Rewrite to use Makefile.DOS instead of editing
|
||||||
|
Makefile.in. Add support for building from outside of the source
|
||||||
|
directory. Fail if the environment block is too small.
|
||||||
|
|
||||||
|
* configh.dos: Use <sys/config.h>.
|
||||||
|
|
||||||
|
* README.DOS: Update instructions.
|
||||||
|
|
||||||
|
Fri Aug 22 1997 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* 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
|
||||||
|
time_t is unsigned.
|
||||||
|
|
||||||
|
Sat Aug 16 00:56:15 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
(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.
|
||||||
|
Delete VMS version of ar_member_date.
|
||||||
|
Enable non-VMS versions of ar_member_date and ar_member_date_1 for
|
||||||
|
VMS too.
|
||||||
|
* arscan.c (VMS_get_member_info): New function.
|
||||||
|
(ar_scan): Provide version for VMS systems.
|
||||||
|
(ar_name_equal): Simply compare name and mem on VMS systems.
|
||||||
|
Don't define ar_member_pos or ar_member_touch on VMS systems.
|
||||||
|
|
||||||
|
* config.h-vms (pid_t, uid_t): Don't define.
|
||||||
|
|
||||||
|
* remake.c: Delete declaration of vms_stat.
|
||||||
|
(name_mtime): Don't call vms_stat.
|
||||||
|
(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.
|
||||||
|
|
||||||
|
* makefile.com (filelist): Include ar and arscan.
|
||||||
|
Also include them in the link commands.
|
||||||
|
Don't define NO_ARCHIVES in cc command.
|
||||||
|
|
||||||
|
* makefile.vms (ARCHIVES, ARCHIVES_SRC): Uncomment.
|
||||||
|
(defines): Delete NO_ARCHIVES from list.
|
||||||
|
|
||||||
|
* remake.c (f_mtime): Only check to see if intermediate file is
|
||||||
|
out of date if it also exists (i.e., mtime != (time_t) -1).
|
||||||
|
|
||||||
|
* vmsdir.h (u_long, u_short): Skip typedefs if using DEC C.
|
||||||
|
|
||||||
|
Fri Jun 20 23:02:07 1997 Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* w32/subproc/sub_proc.c: Get W32 sub_proc to handle shebang
|
||||||
|
(#!/bin/sh) in script files correctly.
|
||||||
|
Fixed a couple of memory leaks.
|
||||||
|
Fixed search order in find_file() (w32/subproc/sub_proc.c) so that
|
||||||
|
files with extensions are preferred over files without extensions.
|
||||||
|
Added search for files with .cmd extension too.
|
||||||
|
* w32/subproc/misc.c (arr2envblk): Fixed memory leak.
|
||||||
|
|
||||||
|
Mon Aug 18 09:41:08 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* Version 3.75.91
|
||||||
|
|
||||||
|
Fri Aug 15 13:50:54 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* read.c (do_define): Remember to count the newline after the endef.
|
||||||
|
|
||||||
|
Thu Aug 14 23:14:37 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* many: Rewrote builds to use Automake 1.2.
|
||||||
|
|
||||||
|
* AUTHORS: New file.
|
||||||
|
* maintMakefile: Contains maintainer-only make snippets.
|
||||||
|
* GNUmakefile: This now only runs the initial auto* tools.
|
||||||
|
* COPYING,texinfo.tex,mkinstalldirs,install-sh: Removed (obtained
|
||||||
|
automatically by automake).
|
||||||
|
* compatMakefile: Removed (not needed anymore).
|
||||||
|
* README,build.sh.in: Removed (built from templates).
|
||||||
|
* config.h.in,Makefile.in: Removed (built by tools).
|
||||||
|
|
||||||
|
Wed Aug 13 02:22:08 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* make.texinfo: Updates for DOS/Windows information (Eli Zaretskii)
|
||||||
|
* README,README.DOS: Ditto.
|
||||||
|
|
||||||
|
* remake.c (update_file_1,f_mtime): Fix GPATH handling.
|
||||||
|
* vpath.c (gpath_search): Ditto.
|
||||||
|
|
||||||
|
* file.c (rename_file): New function: rehash, but also rename to
|
||||||
|
the hashname.
|
||||||
|
* filedef.h: Declare it.
|
||||||
|
|
||||||
|
* variable.c (merge_variable_set_lists): Remove free() of variable
|
||||||
|
set; since various files can share variable sets we don't want to
|
||||||
|
free them here.
|
||||||
|
|
||||||
|
Tue Aug 12 10:51:54 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* configure.in: Require autoconf 2.12
|
||||||
|
|
||||||
|
* make.texinfo: Replace all "cd subdir; $(MAKE)" examples with a
|
||||||
|
more stylistically correct "cd subdir && $(MAKE)".
|
||||||
|
|
||||||
|
* main.c: Global variable `clock_skew_detected' defined.
|
||||||
|
(main): Print final warning if it's set.
|
||||||
|
* make.h: Declare it.
|
||||||
|
* remake.c (f_mtime): Test and set it.
|
||||||
|
|
||||||
|
* job.c (start_job_command): Add special optimizations for
|
||||||
|
"do-nothing" rules, containing just the shell no-op ":". This is
|
||||||
|
useful for timestamp files and can make a real difference if you
|
||||||
|
have a lot of them (requested by Fergus Henderson <fjh@cs.mu.oz.au>).
|
||||||
|
|
||||||
|
* configure.in,Makefile.in: Rewrote to use the new autoconf
|
||||||
|
program_transform_name macro.
|
||||||
|
|
||||||
|
* function.c (function_strip): Strip newlines as well as spaces
|
||||||
|
and TABs.
|
||||||
|
|
||||||
|
Fri Jun 6 23:41:04 1997 Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* remake.c (f_mtime): Datestamps on FAT-based files are rounded to
|
||||||
|
even seconds when stored, so if the date check fails on WINDOWS32
|
||||||
|
systems, see if this "off-by-one" error is the problem.
|
||||||
|
|
||||||
|
* General: If your TZ environment variable is not set correctly
|
||||||
|
then all your timestamps will be off by hours. So, set it!
|
||||||
|
|
||||||
Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com>
|
Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
* Version 3.75.1
|
* Version 3.75.1
|
||||||
|
|||||||
325
GNUmakefile
325
GNUmakefile
@@ -1,299 +1,54 @@
|
|||||||
# GNU Make-specific makefile for GNU Make.
|
# This is a maintainer's-only makefile
|
||||||
|
|
||||||
# Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
|
||||||
# This file is part of GNU Make.
|
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# It bootstraps a GNU make maintainer's directory
|
||||||
# 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
|
.SUFFIXES:
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
NORECURSE = true
|
||||||
|
|
||||||
|
# If the user asked for a specific target, invoke the Makefile instead.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
.DEFAULT:
|
||||||
# along with GNU Make; see the file COPYING. If not, write to
|
@[ -f Makefile.in -a -f configure -a -f aclocal.m4 -a -f config.h.in ] \
|
||||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|| $(MAKE) __cfg NORECURSE=
|
||||||
|
@[ -f Makefile ] \
|
||||||
|
|| ./configure
|
||||||
|
$(MAKE) -f Makefile $@
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: __cfg __cfg_basic
|
||||||
default:
|
|
||||||
|
|
||||||
# Set `ARCH' to a string for the type of machine.
|
# This is variable since the glob subdirectory doesn't use it.
|
||||||
ifndef ARCH
|
#
|
||||||
ifdef machine
|
ACCONFIG = acconfig.h
|
||||||
ARCH = $(machine)
|
|
||||||
endif # machine
|
|
||||||
endif # not ARCH
|
|
||||||
|
|
||||||
override srcdir := .
|
__cfg: __cfg_basic config.h.in TAGS
|
||||||
override CC := $(CC)
|
cd glob && $(MAKE) -f ../GNUmakefile __cfg_basic ACCONFIG=
|
||||||
|
ifdef NORECURSE
|
||||||
ifeq ($(ARCH),hp300)
|
@echo ""; echo "Now you should run one of:"; echo ""; \
|
||||||
#customs=yes
|
echo " make all"; \
|
||||||
endif
|
echo " make dist"; \
|
||||||
ifdef customs
|
echo " make distdir"; \
|
||||||
override REMOTE := cstms
|
echo " make distcheck"; echo ""; \
|
||||||
else
|
echo "Or similar to proceed.";\
|
||||||
override REMOTE := stub
|
echo ""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Get most of the information from the Unix-compatible makefile.
|
__cfg_basic: aclocal.m4 stamp-h.in configure Makefile.in
|
||||||
include compatMakefile
|
|
||||||
|
|
||||||
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
|
aclocal.m4: configure.in $(wildcard acinclude.m4)
|
||||||
|
aclocal
|
||||||
|
|
||||||
CVS = cvs
|
config.h.in: stamp-h.in
|
||||||
|
stamp-h.in: configure.in aclocal.m4 $(ACCONFIG)
|
||||||
|
autoheader
|
||||||
|
echo timestamp > $@
|
||||||
|
|
||||||
# Remove autoconf magic.
|
|
||||||
prefix = /usr/local
|
|
||||||
exec_prefix = $(prefix)
|
|
||||||
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
|
||||||
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
|
||||||
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
|
||||||
CPPFLAGS := $(filter-out @%@,$(defines) $(CPPFLAGS)) -DHAVE_CONFIG_H
|
|
||||||
|
|
||||||
ifdef AC_MACRODIR
|
|
||||||
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
|
||||||
config.h.in: $(AC_MACRODIR)/acconfig.h
|
|
||||||
endif
|
|
||||||
configure: configure.in aclocal.m4
|
configure: configure.in aclocal.m4
|
||||||
autoconf $(ACFLAGS)
|
autoconf
|
||||||
-test -d CVS && $(CVS) commit -m'autoconf $(ACFLAGS)' $@
|
|
||||||
config.h.in: configure.in aclocal.m4
|
|
||||||
autoheader $(ACFLAGS)
|
|
||||||
-test -d CVS && $(CVS) commit -m'autoheader $(ACFLAGS)' $@
|
|
||||||
|
|
||||||
ifdef customs
|
Makefile.in: configure.in config.h.in Makefile.am aclocal.m4
|
||||||
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
automake --add-missing
|
||||||
LOADLIBES := $(addprefix pmake/customs/,customslib.o rpc.o xlog.o) \
|
|
||||||
pmake/lib/sprite/libsprite.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ARCH
|
TAGS:
|
||||||
|
find . -name '*.[ch]' -print | etags -
|
||||||
ifndef no_libc
|
|
||||||
libc_dir = /home/gd2/gnu/libc/$(ARCH)
|
|
||||||
ifneq ($(wildcard $(libc_dir)),)
|
|
||||||
ifneq ($(wildcard $(libc_dir)/works-for-make),)
|
|
||||||
#CPPFLAGS := -I$(libc_dir)/include
|
|
||||||
#LDFLAGS := -nostdlib $(libc_dir)/lib/start.o
|
|
||||||
#LOADLIBES := $(LOADLIBES) \
|
|
||||||
# $(libc_dir)/lib/mcheck-init.o \
|
|
||||||
# $(libc_dir)/lib/libc.a \
|
|
||||||
# -lgcc \
|
|
||||||
# $(libc_dir)/lib/libc.a
|
|
||||||
CC := $(CC) -b glibc
|
|
||||||
|
|
||||||
# getopt is in libc.
|
|
||||||
GETOPT =
|
|
||||||
#GETOPT_SRC = Don't clear this or dist will break.
|
|
||||||
|
|
||||||
# glob is in libc too.
|
|
||||||
GLOB =
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
endif # works-for-make
|
|
||||||
endif # $(libc_dir)
|
|
||||||
endif # !no_libc
|
|
||||||
|
|
||||||
# We know the type of machine, so put the binaries in subdirectories.
|
|
||||||
$(ARCH)/%.o: %.c
|
|
||||||
$(COMPILE.c) -Iglob $< $(OUTPUT_OPTION)
|
|
||||||
$(ARCH)/glob/libglob.a: FORCE
|
|
||||||
$(MAKE) -C $(@D) $(@F)
|
|
||||||
FORCE:
|
|
||||||
objs := $(addprefix $(ARCH)/,$(objs))
|
|
||||||
prog := $(ARCH)/make
|
|
||||||
|
|
||||||
archpfx = $(ARCH)/
|
|
||||||
|
|
||||||
$(archpfx)load.o: load.c
|
|
||||||
$(COMPILE.c) $(LOAD_AVG) $< -o $@
|
|
||||||
$(archpfx)load.dep: load.c
|
|
||||||
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
|
||||||
|
|
||||||
CPPFLAGS := -I$(ARCH) -Iglob -DHAVE_CONFIG_H $(filter-out @%@,$(CPPFLAGS))
|
|
||||||
|
|
||||||
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
|
||||||
include $(ARCH)/makefile
|
|
||||||
endif
|
|
||||||
objs := $(objs) $(addprefix $(ARCH)/,$(ALLOCA) $(extras))
|
|
||||||
|
|
||||||
else # Not ARCH
|
|
||||||
prog := make
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq "$(findstring gcc,$(CC))" ""
|
|
||||||
CFLAGS = -g -Wall -Wtraditional -Wid-clash-31 -Wpointer-arith \
|
|
||||||
-Wbad-function-cast -Wconversion
|
|
||||||
else
|
|
||||||
CFLAGS = -g
|
|
||||||
endif
|
|
||||||
LDFLAGS = -g
|
|
||||||
|
|
||||||
# Define the command to make dependencies.
|
|
||||||
mkdep-nolib = $(CC) -MM $(CPPFLAGS)
|
|
||||||
mkdep = $(CC) -M $(CPPFLAGS)
|
|
||||||
|
|
||||||
depfiles = $(patsubst %.o,%.dep,$(filter %.o,$(objs)))
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: default
|
|
||||||
default: $(prog)
|
|
||||||
|
|
||||||
$(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
|
||||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
|
||||||
mv -f $@.new $@
|
|
||||||
|
|
||||||
libc-srcdir = ../libc
|
|
||||||
globfiles = $(addprefix glob/,COPYING.LIB configure.in configure Makefile.in \
|
|
||||||
Makefile.ami SCOPTIONS SMakefile \
|
|
||||||
configure.bat glob.c fnmatch.c glob.h fnmatch.h)
|
|
||||||
$(globfiles): stamp-glob ;
|
|
||||||
stamp-glob: $(libc-srcdir)/posix/glob.tar
|
|
||||||
-rm -f stamp-glob glob/*
|
|
||||||
tar xvf $< glob
|
|
||||||
$(CVS) commit -m'Updated from libc' glob
|
|
||||||
touch $@
|
|
||||||
$(libc-srcdir)/posix/glob.tar: force
|
|
||||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
|
||||||
.PHONY: force
|
|
||||||
force:
|
|
||||||
|
|
||||||
# Make the Unix-compatible Makefile to be distributed by appending
|
|
||||||
# the automatically-generated dependencies to compatMakefile.
|
|
||||||
ifeq ($(mkdep),$(mkdep-nolib))
|
|
||||||
nolib-deps = $(depfiles)
|
|
||||||
else
|
|
||||||
%.dep: %.c
|
|
||||||
$(mkdep-nolib) $< | sed -e 's,$*\.o,$(@:.dep=.o) $@,' > $(@:.dep=.dtm)
|
|
||||||
mv -f $(@:.dep=.dtm) $@
|
|
||||||
nolib-deps = $(patsubst $(archpfx)%,%,$(depfiles))
|
|
||||||
endif
|
|
||||||
# The distributed Makefile.in should contain deps for remote-stub only.
|
|
||||||
Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
|
|
||||||
(sed 's/^MAKE[ ]*=.*$$/@SET_MAKE@/' $<; \
|
|
||||||
echo '# Automatically generated dependencies.'; \
|
|
||||||
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
|
||||||
) > $@
|
|
||||||
$(CVS) commit -mRegenerated $@
|
|
||||||
|
|
||||||
.SUFFIXES: .dep
|
|
||||||
# Maintain the automatically-generated dependencies.
|
|
||||||
ifndef no_deps
|
|
||||||
-include $(depfiles)
|
|
||||||
endif
|
|
||||||
$(archpfx)%.dep: %.c
|
|
||||||
$(mkdep) $< | sed 's,$*\.o,$(@:.dep=.o) $@,' > $@
|
|
||||||
|
|
||||||
ETAGS = etags -T # for v19 etags
|
|
||||||
|
|
||||||
# Run the tests.
|
|
||||||
.PHONY: tests
|
|
||||||
testdir := $(shell ls -d1 make-test-?.? | sort -n +0.10 -0.11 +0.12 | tail -1l)
|
|
||||||
tests:# $(testdir)/run_make_tests.pl $(prog)
|
|
||||||
# cd $(<D); MAKELEVEL=0 perl $(<F)
|
|
||||||
|
|
||||||
build.sh.in: build.template compatMakefile
|
|
||||||
sed -e 's@%objs%@$(filter-out remote-% $(GLOB) $(ALLOCA) $(extras),\
|
|
||||||
$(patsubst $(archpfx)%,%,$(objs)))\
|
|
||||||
$(patsubst %.c,%.o,$(filter %.c,$(globfiles)))@' \
|
|
||||||
$< > $@.new
|
|
||||||
chmod a+x $@.new
|
|
||||||
mv -f $@.new $@
|
|
||||||
$(CVS) commit -mRegenerated $@
|
|
||||||
|
|
||||||
# Make the distribution tar files.
|
|
||||||
|
|
||||||
.PHONY: dist
|
|
||||||
# Figure out the version number from the source of `version.c'.
|
|
||||||
version := \
|
|
||||||
$(strip $(shell sed -e '/=/!d' -e 's/^.*"\(.*\)";$$/\1/' < version.c))
|
|
||||||
tarfiles := make # make-doc
|
|
||||||
tarfiles := $(addsuffix -$(version).tar,$(tarfiles))
|
|
||||||
tarfiles := $(tarfiles:%=%.gz) # no more compress $(tarfiles:%=%.Z)
|
|
||||||
# Depend on default and doc so we don't ship anything that won't compile.
|
|
||||||
dist: cvs-mark default info dvi tests tarfiles
|
|
||||||
.PHONY: tarfiles
|
|
||||||
tarfiles: $(tarfiles)
|
|
||||||
|
|
||||||
vmsfiles = config.h-vms makefile.com makefile.vms readme.vms \
|
|
||||||
vmsdir.h vmsfunctions.c vmsify.c
|
|
||||||
amigafiles = README.Amiga config.ami Makefile.ami SCOPTIONS SMakefile \
|
|
||||||
amiga.c amiga.h make.lnk
|
|
||||||
dosfiles = README.DOS dosbuild.bat
|
|
||||||
w32files = README.W32 build_w32.bat config.h.W32 subproc.bat NMakefile \
|
|
||||||
$(addprefix w32/,pathstuff.c compat/dirent.c include/dirent.h \
|
|
||||||
include/pathstuff.h include/sub_proc.h \
|
|
||||||
include/w32err.h subproc/NMakefile \
|
|
||||||
subproc/build.bat subproc/misc.c \
|
|
||||||
subproc/proc.h subproc/sub_proc.c \
|
|
||||||
subproc/w32err.c)
|
|
||||||
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
|
||||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
|
||||||
configh.dos configure.bat \
|
|
||||||
$(amigafiles) $(vmsfiles) $(w32files) $(dosfiles) \
|
|
||||||
aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \
|
|
||||||
make.texinfo make-stds.texi \
|
|
||||||
$(wildcard make.?? make.??s make.toc make.aux) make.man texinfo.tex \
|
|
||||||
TAGS tags install-sh \
|
|
||||||
make.info make.info*
|
|
||||||
|
|
||||||
ifndef dist-flavor
|
|
||||||
dist-flavor = alpha
|
|
||||||
endif
|
|
||||||
.PHONY: cvs-mark
|
|
||||||
cvs-mark: $(distfiles)
|
|
||||||
$(CVS) tag -F make-$(subst .,-,$(version))
|
|
||||||
|
|
||||||
dist: local-inst
|
|
||||||
.PHONY: local-inst
|
|
||||||
local-inst: $(prog)
|
|
||||||
install -c -g kmem -o $(USER) -m 2755 $< /usr/local/gnubin/make
|
|
||||||
|
|
||||||
# Put the alpha distribution files in the anonymous FTP directory.
|
|
||||||
alpha-files = $(tarfiles) GNUmakefile compatMakefile $(testdir).tar.Z
|
|
||||||
dist: alpha
|
|
||||||
.PHONY: alpha
|
|
||||||
alpha-dir := ~ftp/gnu
|
|
||||||
alpha-files := $(addprefix $(alpha-dir)/,$(alpha-files))
|
|
||||||
alpha: $(alpha-dir) $(alpha-files)
|
|
||||||
$(alpha-dir)/%: %
|
|
||||||
@rm -f $@
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
# Implicit rule to make README and README-doc.
|
|
||||||
%: %.template version.c
|
|
||||||
rm -f $@
|
|
||||||
sed 's/VERSION/$(version)/' < $< > $@
|
|
||||||
# Make sure I don't edit it by accident.
|
|
||||||
chmod a-w $@
|
|
||||||
$(CVS) commit -m'Regenerated for $(version)' $@
|
|
||||||
|
|
||||||
define make-tar
|
|
||||||
@rm -fr make-$(version)
|
|
||||||
ln -s . make-$(version)
|
|
||||||
tar cvhof $@ $(addprefix make-$(version)/,$^)
|
|
||||||
rm -f make-$(version)
|
|
||||||
endef
|
|
||||||
|
|
||||||
%.Z: %; compress -c $< > $@
|
|
||||||
%.gz: %; gzip -9 -c -v $< > $@
|
|
||||||
|
|
||||||
make-$(version).tar: $(distfiles)
|
|
||||||
$(make-tar)
|
|
||||||
|
|
||||||
ifneq (,)
|
|
||||||
tests := $(filter-out %~,$(wildcard tests/*))
|
|
||||||
make-tests-$(version).tar.Z: $(tests)
|
|
||||||
@rm -fr make-tests-$(version)
|
|
||||||
ln -s tests make-tests-$(version)
|
|
||||||
tar cvhf $(@:.Z=) $(patsubst tests/%,make-tests-$(version)/%,$^)
|
|
||||||
rm -f make-tests-$(version)
|
|
||||||
compress -f $(@:.Z=)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(archpfx)loadtest: $(archpfx)load.o
|
|
||||||
|
|||||||
10
INSTALL
10
INSTALL
@@ -1,8 +1,6 @@
|
|||||||
Basic Installation
|
Basic Installation
|
||||||
==================
|
==================
|
||||||
|
|
||||||
These are generic installation instructions.
|
|
||||||
|
|
||||||
The `configure' shell script attempts to guess correct values for
|
The `configure' shell script attempts to guess correct values for
|
||||||
various system-dependent variables used during compilation. It uses
|
various system-dependent variables used during compilation. It uses
|
||||||
those values to create a `Makefile' in each directory of the package.
|
those values to create a `Makefile' in each directory of the package.
|
||||||
@@ -36,7 +34,13 @@ The simplest way to compile this package is:
|
|||||||
|
|
||||||
2. Type `make' to compile the package.
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
3. Optionally, type `make check' to run any self-tests that come with
|
If you're building GNU make on a system which does not already have
|
||||||
|
a `make', you can use the build.sh shell script to compile. Run
|
||||||
|
`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.
|
||||||
|
|
||||||
|
3. Optionally, type `./make check' to run any self-tests that come with
|
||||||
the package.
|
the package.
|
||||||
|
|
||||||
4. Type `make install' to install the programs and any data files and
|
4. Type `make install' to install the programs and any data files and
|
||||||
|
|||||||
501
Makefile.DOS.template
Normal file
501
Makefile.DOS.template
Normal file
@@ -0,0 +1,501 @@
|
|||||||
|
# -*-Makefile-*- template for DJGPP
|
||||||
|
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.DOS is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy, distribute and modify it.
|
||||||
|
|
||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
srcdir = .
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
# $DJDIR is defined automatically by DJGPP to point
|
||||||
|
# to the root of the DJGPP installation tree.
|
||||||
|
prefix = ${DJDIR}
|
||||||
|
exec_prefix = ${prefix}
|
||||||
|
|
||||||
|
bindir = ${exec_prefix}/bin
|
||||||
|
datadir = ${prefix}/share
|
||||||
|
libdir = ${prefix}/lib
|
||||||
|
infodir = ${prefix}/info
|
||||||
|
# DJGPP doesn't have separate man tree, use info instead.
|
||||||
|
mandir = ${prefix}/info
|
||||||
|
includedir = ${prefix}/include
|
||||||
|
oldincludedir = c:/djgpp/include
|
||||||
|
|
||||||
|
pkgdatadir = $(datadir)/make
|
||||||
|
pkglibdir = $(libdir)/make
|
||||||
|
pkgincludedir = $(includedir)/make
|
||||||
|
|
||||||
|
INSTALL = ${bindir}/ginstall -c
|
||||||
|
INSTALL_PROGRAM = ${bindir}/ginstall -c
|
||||||
|
INSTALL_DATA = ${bindir}/ginstall -c -m 644
|
||||||
|
INSTALL_SCRIPT = ${bindir}/ginstall -c
|
||||||
|
transform = s,x,x,
|
||||||
|
|
||||||
|
# This will fail even if they don't have a Unix-like shell (stock DOS
|
||||||
|
# shell doesn't know about `false'). The only difference is that they
|
||||||
|
# get "Error -1" instead of "Error 1".
|
||||||
|
EXIT_FAIL = false
|
||||||
|
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
AR = ar
|
||||||
|
CC = gcc
|
||||||
|
CPP = gcc -E
|
||||||
|
LIBOBJS =
|
||||||
|
MAKEINFO = ${bindir}/makeinfo
|
||||||
|
PACKAGE = make
|
||||||
|
RANLIB = ranlib
|
||||||
|
REMOTE = stub
|
||||||
|
VERSION = %VERSION%
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.2
|
||||||
|
|
||||||
|
bin_PROGRAMS = %PROGRAMS%
|
||||||
|
|
||||||
|
make_SOURCES = %SOURCES%
|
||||||
|
# This should include the glob/ prefix
|
||||||
|
libglob_a_SOURCES = %GLOB_SOURCES%
|
||||||
|
make_LDADD = glob/libglob.a
|
||||||
|
|
||||||
|
info_TEXINFOS = make.texinfo
|
||||||
|
man_MANS = make.1
|
||||||
|
|
||||||
|
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
|
||||||
|
|
||||||
|
BUILT_SOURCES = README build.sh.in
|
||||||
|
|
||||||
|
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
|
||||||
|
|
||||||
|
SUBDIRS = glob
|
||||||
|
mkinstalldirs = ${bindir}/gmkdir -p
|
||||||
|
CONFIG_HEADER = config.h
|
||||||
|
CONFIG_CLEAN_FILES = build.sh
|
||||||
|
PROGRAMS = $(bin_PROGRAMS)
|
||||||
|
|
||||||
|
|
||||||
|
DEFS = -I. -I$(srcdir) -I.
|
||||||
|
CPPFLAGS = -DHAVE_CONFIG_H
|
||||||
|
LDFLAGS =
|
||||||
|
LIBS =
|
||||||
|
make_OBJECTS = %OBJECTS%
|
||||||
|
make_DEPENDENCIES = glob/libglob.a
|
||||||
|
make_LDFLAGS =
|
||||||
|
libglob_a_LIBADD =
|
||||||
|
libglob_a_OBJECTS = %GLOB_OBJECTS%
|
||||||
|
noinst_LIBRARIES = glob/libglob.a
|
||||||
|
CFLAGS = -O2 -g
|
||||||
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||||
|
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||||
|
TEXI2DVI = texi2dvi
|
||||||
|
TEXINFO_TEX = $(srcdir)/texinfo.tex
|
||||||
|
INFO_DEPS = make.info
|
||||||
|
DVIS = make.dvi
|
||||||
|
TEXINFOS = make.texinfo
|
||||||
|
man1dir = $(mandir)/man1
|
||||||
|
MANS = $(man_MANS)
|
||||||
|
|
||||||
|
NROFF = nroff
|
||||||
|
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in configure configure.in getloadavg.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex
|
||||||
|
|
||||||
|
|
||||||
|
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
TAR = gtar
|
||||||
|
GZIP = --best
|
||||||
|
SOURCES = $(make_SOURCES)
|
||||||
|
OBJECTS = $(make_OBJECTS)
|
||||||
|
HEADERS = $(wildcard $(srcdir)/*.h)
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .c .dvi .info .o .ps .texi .texinfo
|
||||||
|
|
||||||
|
distclean-hdr:
|
||||||
|
-rm -f config.h
|
||||||
|
|
||||||
|
maintainer-clean-hdr:
|
||||||
|
|
||||||
|
mostlyclean-binPROGRAMS:
|
||||||
|
|
||||||
|
clean-binPROGRAMS:
|
||||||
|
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||||
|
|
||||||
|
distclean-binPROGRAMS:
|
||||||
|
|
||||||
|
maintainer-clean-binPROGRAMS:
|
||||||
|
|
||||||
|
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||||
|
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
||||||
|
|
||||||
|
uninstall-binPROGRAMS:
|
||||||
|
$(NORMAL_UNINSTALL)
|
||||||
|
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`; done
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
$(COMPILE) -c $<
|
||||||
|
|
||||||
|
clean-noinstLIBRARIES:
|
||||||
|
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||||
|
|
||||||
|
mostlyclean-compile:
|
||||||
|
-rm -f *.o *.exe make.new core
|
||||||
|
|
||||||
|
clean-compile:
|
||||||
|
|
||||||
|
distclean-compile:
|
||||||
|
-rm -f *.tab.c
|
||||||
|
|
||||||
|
maintainer-clean-compile:
|
||||||
|
|
||||||
|
make: $(make_OBJECTS) $(make_DEPENDENCIES)
|
||||||
|
@command.com /c if exist make del make
|
||||||
|
@command.com /c if exist make.exe del make.exe
|
||||||
|
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
||||||
|
|
||||||
|
make.info: make.texinfo
|
||||||
|
make.dvi: make.texinfo
|
||||||
|
|
||||||
|
|
||||||
|
DVIPS = dvips
|
||||||
|
|
||||||
|
.texi.info:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texi.dvi:
|
||||||
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.texi:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo.info:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo.dvi:
|
||||||
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.dvi.ps:
|
||||||
|
$(DVIPS) $< -o $@
|
||||||
|
|
||||||
|
install-info-am: $(INFO_DEPS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||||
|
@for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi; done; done
|
||||||
|
@$(POST_INSTALL)
|
||||||
|
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :; done; else : ; fi
|
||||||
|
|
||||||
|
uninstall-info:
|
||||||
|
$(PRE_UNINSTALL)
|
||||||
|
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done
|
||||||
|
$(NORMAL_UNINSTALL)
|
||||||
|
for file in $(INFO_DEPS) make.i; do (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done
|
||||||
|
|
||||||
|
dist-info: $(INFO_DEPS)
|
||||||
|
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
|
||||||
|
|
||||||
|
mostlyclean-aminfo:
|
||||||
|
rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.kys make.ps make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv make.cn
|
||||||
|
|
||||||
|
clean-aminfo:
|
||||||
|
|
||||||
|
distclean-aminfo:
|
||||||
|
|
||||||
|
maintainer-clean-aminfo:
|
||||||
|
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
|
||||||
|
|
||||||
|
install-man1:
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||||
|
@list='$(man1_MANS)'; \
|
||||||
|
l2='$(man_MANS)'; for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||||
|
else file=$$i; fi; \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-man1:
|
||||||
|
@list='$(man1_MANS)'; \
|
||||||
|
l2='$(man_MANS)'; for i in $$l2; do \
|
||||||
|
case "$$i" in \
|
||||||
|
*.1*) list="$$list $$i" ;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
for i in $$list; do \
|
||||||
|
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||||
|
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||||
|
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||||
|
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||||
|
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||||
|
done
|
||||||
|
install-man: $(MANS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(MAKE) install-man1
|
||||||
|
uninstall-man:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
$(MAKE) uninstall-man1
|
||||||
|
|
||||||
|
# Assume that the only thing to do in glob is to build libglob.a,
|
||||||
|
# but do a sanity check: if $SUBDIRS will ever have more than
|
||||||
|
# a single directory, yell bloody murder.
|
||||||
|
all-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
@command.com /c if not exist glob\\nul md glob
|
||||||
|
@echo Making all in $(SUBDIRS)
|
||||||
|
$(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(SUBDIRS):
|
||||||
|
command.com /c md $@
|
||||||
|
|
||||||
|
libglob.a: $(libglob_a_OBJECTS)
|
||||||
|
command.com /c if exist libglob.a del libglob.a
|
||||||
|
$(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
|
||||||
|
$(RANLIB) libglob.a
|
||||||
|
|
||||||
|
mostlyclean-recursive clean-recursive distclean-recursive maintainer-clean-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
|
||||||
|
$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tags-in-glob: $(libglob_a_SOURCES)
|
||||||
|
etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
|
||||||
|
|
||||||
|
tags-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
$(MAKE) tags-in-glob
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES)
|
||||||
|
mkid $(srcdir)/$(SOURCES) $(srcdir)/$(libglob_a_SOURCES) ./config.h $(HEADERS)
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(srcdir)/$(SOURCES) config.h $(TAGS_DEPENDENCIES)
|
||||||
|
etags -i ./glob/TAGS $(ETAGS_ARGS) $(srcdir)/$(SOURCES) ./config.h $(HEADERS)
|
||||||
|
|
||||||
|
mostlyclean-tags:
|
||||||
|
|
||||||
|
clean-tags:
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID
|
||||||
|
|
||||||
|
maintainer-clean-tags:
|
||||||
|
|
||||||
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
top_distdir = $(distdir)
|
||||||
|
|
||||||
|
# This target untars the dist file and tries a VPATH configuration. Then
|
||||||
|
# it guarantees that the distribution is self-contained by making another
|
||||||
|
# tarfile.
|
||||||
|
distcheck: dist
|
||||||
|
rm -rf $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||||
|
mkdir $(distdir)/=build
|
||||||
|
mkdir $(distdir)/=inst
|
||||||
|
dc_install_base=`cd $(distdir)/=inst && pwd`; cd $(distdir)/=build && ../configure --srcdir=.. --prefix=$$dc_install_base && $(MAKE) && $(MAKE) dvi && $(MAKE) check && $(MAKE) install && $(MAKE) installcheck && $(MAKE) dist
|
||||||
|
rm -rf $(distdir)
|
||||||
|
@echo "========================"; echo "$(distdir).tar.gz is ready for distribution"; echo "========================"
|
||||||
|
dist: distdir
|
||||||
|
-chmod -R a+r $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
dist-all: distdir
|
||||||
|
-chmod -R a+r $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
mkdir $(distdir)
|
||||||
|
-chmod 777 $(distdir)
|
||||||
|
@for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
|
||||||
|
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||||
|
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
|
||||||
|
|
||||||
|
info: $(INFO_DEPS) info-recursive
|
||||||
|
dvi: $(DVIS) dvi-recursive
|
||||||
|
check: all-am
|
||||||
|
$(MAKE) check-recursive check-local
|
||||||
|
installcheck: installcheck-recursive
|
||||||
|
all-recursive-am: config.h
|
||||||
|
$(MAKE) all-recursive
|
||||||
|
|
||||||
|
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h
|
||||||
|
|
||||||
|
install-exec-am: install-binPROGRAMS
|
||||||
|
|
||||||
|
install-data-am: install-info-am
|
||||||
|
|
||||||
|
uninstall-am: uninstall-binPROGRAMS uninstall-info
|
||||||
|
|
||||||
|
install-exec: install-exec-recursive install-exec-am
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
|
||||||
|
install-data: install-data-recursive install-data-am
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
|
||||||
|
install: install-recursive install-exec-am install-data-am
|
||||||
|
@:
|
||||||
|
|
||||||
|
uninstall: uninstall-recursive uninstall-am
|
||||||
|
|
||||||
|
all: all-recursive-am all-am
|
||||||
|
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||||
|
installdirs: installdirs-recursive
|
||||||
|
$(mkinstalldirs) $(bindir) $(infodir)
|
||||||
|
|
||||||
|
|
||||||
|
mostlyclean-generic:
|
||||||
|
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-rm -f Makefile $(DISTCLEANFILES)
|
||||||
|
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||||
|
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||||
|
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
|
||||||
|
|
||||||
|
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am
|
||||||
|
|
||||||
|
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile distclean-aminfo distclean-tags distclean-generic clean-am
|
||||||
|
|
||||||
|
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS maintainer-clean-compile maintainer-clean-aminfo maintainer-clean-tags maintainer-clean-generic distclean-am
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive mostlyclean-am
|
||||||
|
|
||||||
|
clean: clean-noinstLIBRARIES clean-recursive clean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive distclean-am
|
||||||
|
rm -f config.status
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||||
|
@echo "This command is intended for maintainers to use;"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
rm -f config.status
|
||||||
|
|
||||||
|
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
||||||
|
maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
|
||||||
|
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
|
||||||
|
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
|
||||||
|
maintainer-clean-compile install-info-am uninstall-info \
|
||||||
|
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
||||||
|
maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
|
||||||
|
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||||
|
uninstalldirs-recursive all-recursive check-recursive \
|
||||||
|
installcheck-recursive info-recursive dvi-recursive \
|
||||||
|
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||||
|
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||||
|
distclean-tags clean-tags maintainer-clean-tags distdir \
|
||||||
|
mostlyclean-depend distclean-depend clean-depend \
|
||||||
|
maintainer-clean-depend info dvi check-local installcheck \
|
||||||
|
all-recursive-am all-am install-exec-am install-data-am uninstall-am \
|
||||||
|
install-exec install-data install uninstall all installdirs \
|
||||||
|
mostlyclean-generic distclean-generic clean-generic \
|
||||||
|
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
|
# Install the w32 subdirectory
|
||||||
|
#
|
||||||
|
dist-hook:
|
||||||
|
(cd $(srcdir); \
|
||||||
|
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
|
||||||
|
tar chf - $$w32) \
|
||||||
|
| (cd $(distdir); tar xfBp -)
|
||||||
|
|
||||||
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
|
check-local: check-loadavg check-regression
|
||||||
|
.PHONY: check-loadavg check-regression
|
||||||
|
|
||||||
|
# > check-loadavg
|
||||||
|
#
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
@rm -f loadavg
|
||||||
|
$(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||||
|
# We copy getloadavg.c into a different file rather than compiling it
|
||||||
|
# directly because some compilers clobber getloadavg.o in the process.
|
||||||
|
loadavg.c: getloadavg.c
|
||||||
|
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||||
|
cp $(srcdir)/getloadavg.c loadavg.c
|
||||||
|
check-loadavg: loadavg
|
||||||
|
@echo The system uptime program believes the load average to be:
|
||||||
|
-uptime
|
||||||
|
@echo The GNU load average checking code believes:
|
||||||
|
-./loadavg
|
||||||
|
|
||||||
|
# > check-regression
|
||||||
|
#
|
||||||
|
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||||
|
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||||
|
# parents.
|
||||||
|
#
|
||||||
|
check-regression:
|
||||||
|
here=`pwd`; testdir=""; \
|
||||||
|
case "$(MAKE_TEST)" in "") \
|
||||||
|
for d1 in $$here $(srcdir); do \
|
||||||
|
for d2 in ../.. .. .; do \
|
||||||
|
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||||
|
case "$$all" in \
|
||||||
|
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||||
|
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||||
|
testdir=`dirname $$try` ;; esac; \
|
||||||
|
done; done ;; \
|
||||||
|
*) testdir="$(MAKE_TEST)" ;; \
|
||||||
|
esac; \
|
||||||
|
case "$$testdir" in \
|
||||||
|
"") echo "Couldn't find make-test-* test suite."; exit 0;; \
|
||||||
|
esac; \
|
||||||
|
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
|
||||||
|
cd $$testdir && ./run_make_tests -make_path $$here/make
|
||||||
|
|
||||||
|
# --------------- Maintainer's Section
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
134
Makefile.am
Normal file
134
Makefile.am
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.3
|
||||||
|
|
||||||
|
bin_PROGRAMS = make
|
||||||
|
|
||||||
|
make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
|
||||||
|
rule.c implicit.c default.c variable.c expand.c function.c \
|
||||||
|
vpath.c version.c ar.c arscan.c remote-$(REMOTE).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
|
||||||
|
|
||||||
|
info_TEXINFOS = make.texinfo
|
||||||
|
man_MANS = make.1
|
||||||
|
|
||||||
|
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||||
|
|
||||||
|
BUILT_SOURCES = README build.sh.in
|
||||||
|
|
||||||
|
EXTRA_DIST = $(BUILT_SOURCES) $(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\
|
||||||
|
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat\
|
||||||
|
readme.vms makefile.vms makefile.com config.h-vms vmsdir.h\
|
||||||
|
vmsfunctions.c vmsify.c
|
||||||
|
|
||||||
|
SUBDIRS = glob
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES = loadavg.c
|
||||||
|
CLEANFILES = loadavg
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local INSTALL Section
|
||||||
|
|
||||||
|
# If necessary, change the gid of the app and turn on the setgid flag.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Whether or not make needs to be installed setgid.
|
||||||
|
# The value should be either `true' or `false'.
|
||||||
|
# On many systems, the getloadavg function (used to implement the `-l'
|
||||||
|
# switch) will not work unless make is installed setgid kmem.
|
||||||
|
#
|
||||||
|
inst_setgid = @NEED_SETGID@
|
||||||
|
|
||||||
|
# Install make setgid to this group so it can get the load average.
|
||||||
|
#
|
||||||
|
inst_group = @KMEM_GROUP@
|
||||||
|
|
||||||
|
install-exec-local:
|
||||||
|
@if $(inst_setgid); then \
|
||||||
|
app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
||||||
|
if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
||||||
|
echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
||||||
|
else \
|
||||||
|
echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
||||||
|
echo "otherwise the \`-l' option will probably not work."; \
|
||||||
|
echo "You may need special privileges to complete the installation"; \
|
||||||
|
echo "of $$app."; \
|
||||||
|
fi; \
|
||||||
|
else true; fi
|
||||||
|
|
||||||
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
|
# Install the w32 subdirectory
|
||||||
|
#
|
||||||
|
dist-hook:
|
||||||
|
(cd $(srcdir); \
|
||||||
|
w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
|
||||||
|
tar chf - $$w32) \
|
||||||
|
| (cd $(distdir); tar xfBp -)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
|
check-local: check-loadavg check-regression
|
||||||
|
.PHONY: check-loadavg check-regression
|
||||||
|
|
||||||
|
# > check-loadavg
|
||||||
|
#
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
@rm -f loadavg
|
||||||
|
$(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||||
|
|
||||||
|
# We copy getloadavg.c into a different file rather than compiling it
|
||||||
|
# directly because some compilers clobber getloadavg.o in the process.
|
||||||
|
#
|
||||||
|
loadavg.c: getloadavg.c
|
||||||
|
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||||
|
cp $(srcdir)/getloadavg.c loadavg.c
|
||||||
|
|
||||||
|
check-loadavg: loadavg
|
||||||
|
@echo The system uptime program believes the load average to be:
|
||||||
|
-uptime
|
||||||
|
@echo The GNU load average checking code believes:
|
||||||
|
-./loadavg
|
||||||
|
|
||||||
|
# > check-regression
|
||||||
|
#
|
||||||
|
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||||
|
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||||
|
# parents.
|
||||||
|
#
|
||||||
|
MAKETESTFLAGS =
|
||||||
|
|
||||||
|
check-regression: all
|
||||||
|
@here=`pwd`; testdir=""; \
|
||||||
|
case "$(MAKE_TEST)" in "") \
|
||||||
|
for d1 in $$here $(srcdir); do \
|
||||||
|
for d2 in ../.. .. .; do \
|
||||||
|
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||||
|
case "$$all" in \
|
||||||
|
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||||
|
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||||
|
testdir=`dirname $$try` ;; esac; \
|
||||||
|
done; done ;; \
|
||||||
|
*) testdir="$(MAKE_TEST)" ;; \
|
||||||
|
esac; \
|
||||||
|
case "$$testdir" in \
|
||||||
|
"") echo "Couldn't find make-test-* regression test suite."; exit 0;; \
|
||||||
|
esac; \
|
||||||
|
echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \
|
||||||
|
cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- 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
|
||||||
@@ -22,11 +22,6 @@
|
|||||||
# Makefile for GNU Make
|
# Makefile for GNU Make
|
||||||
#
|
#
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = /make-3.74/
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = /make-3.74/
|
|
||||||
|
|
||||||
CC = sc
|
CC = sc
|
||||||
RM = delete
|
RM = delete
|
||||||
|
|
||||||
@@ -250,7 +245,7 @@ clean: glob-clean
|
|||||||
-$(RM) make loadavg "#?.o" core make.dvi
|
-$(RM) make loadavg "#?.o" core make.dvi
|
||||||
|
|
||||||
distclean: clean glob-realclean
|
distclean: clean glob-realclean
|
||||||
-$(RM) Makefile config.h config.status build.sh stamp-config
|
-$(RM) Makefile config.h config.status build.sh
|
||||||
-$(RM) config.log config.cache
|
-$(RM) config.log config.cache
|
||||||
-$(RM) TAGS tags
|
-$(RM) TAGS tags
|
||||||
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
||||||
|
|||||||
308
Makefile.in
308
Makefile.in
@@ -1,308 +0,0 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
|
||||||
# `build.sh' instead.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1988,89,91,92,93,94,95,96 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.
|
|
||||||
|
|
||||||
#
|
|
||||||
# Makefile for GNU Make
|
|
||||||
#
|
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = @srcdir@
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = @srcdir@
|
|
||||||
|
|
||||||
CC = @CC@
|
|
||||||
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
|
|
||||||
# Define these for your system as follows:
|
|
||||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
|
||||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
|
||||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
|
||||||
# Some compilers apparently accept this
|
|
||||||
# without complaint but produce losing code,
|
|
||||||
# so beware.
|
|
||||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
|
||||||
# See also `config.h'.
|
|
||||||
defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
|
||||||
|
|
||||||
# Which flavor of remote job execution support to use.
|
|
||||||
# The code is found in `remote-$(REMOTE).c'.
|
|
||||||
REMOTE = @REMOTE@
|
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
|
||||||
ALLOCA = @ALLOCA@
|
|
||||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
|
||||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
|
||||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
|
||||||
# alloca.c instead on those machines.
|
|
||||||
LOADLIBES = @LIBS@
|
|
||||||
|
|
||||||
# Any extra object files your system needs.
|
|
||||||
extras = @LIBOBJS@
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix = @prefix@
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
# Directory to install `make' in.
|
|
||||||
bindir = $(exec_prefix)/bin
|
|
||||||
# Directory to find libraries in for `-lXXX'.
|
|
||||||
libdir = $(exec_prefix)/lib
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir = $(prefix)/include
|
|
||||||
# Directory to install the Info files in.
|
|
||||||
infodir = $(prefix)/info
|
|
||||||
# Directory to install the man page in.
|
|
||||||
mandir = $(prefix)/man/man$(manext)
|
|
||||||
# Number to put on the man page filename.
|
|
||||||
manext = 1
|
|
||||||
# Prefix to put on installed `make' binary file name.
|
|
||||||
binprefix =
|
|
||||||
# Prefix to put on installed `make' man page file name.
|
|
||||||
manprefix = $(binprefix)
|
|
||||||
|
|
||||||
# Whether or not make needs to be installed setgid.
|
|
||||||
# The value should be either `true' or `false'.
|
|
||||||
# On many systems, the getloadavg function (used to implement the `-l'
|
|
||||||
# switch) will not work unless make is installed setgid kmem.
|
|
||||||
install_setgid = @NEED_SETGID@
|
|
||||||
# Install make setgid to this group so it can read /dev/kmem.
|
|
||||||
group = @KMEM_GROUP@
|
|
||||||
|
|
||||||
# Program to install `make'.
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
# Program to install the man page.
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
# Generic install program.
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
|
|
||||||
# Program to format Texinfo source into Info files.
|
|
||||||
MAKEINFO = makeinfo
|
|
||||||
# Program to format Texinfo source into DVI files.
|
|
||||||
TEXI2DVI = texi2dvi
|
|
||||||
|
|
||||||
# Programs to make tags files.
|
|
||||||
ETAGS = etags -w
|
|
||||||
CTAGS = ctags -w
|
|
||||||
|
|
||||||
GLOB = glob/libglob.a
|
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
|
||||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
|
||||||
getopt.o getopt1.o \
|
|
||||||
$(GLOB) $(ALLOCA) $(extras)
|
|
||||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
|
||||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
|
||||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
|
||||||
$(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \
|
|
||||||
$(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \
|
|
||||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
|
||||||
$(srcdir)/remote-$(REMOTE).c \
|
|
||||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
|
||||||
$(srcdir)/signame.c $(srcdir)/signame.h \
|
|
||||||
$(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h \
|
|
||||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/filedef.h \
|
|
||||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
|
||||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
|
||||||
|
|
||||||
all: make
|
|
||||||
info: make.info
|
|
||||||
dvi: make.dvi
|
|
||||||
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
|
||||||
.PHONY: all check info dvi
|
|
||||||
|
|
||||||
make.info: make.texinfo
|
|
||||||
$(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
|
|
||||||
|
|
||||||
make.dvi: make.texinfo
|
|
||||||
$(TEXI2DVI) $(srcdir)/make.texinfo
|
|
||||||
|
|
||||||
make.ps: make.dvi
|
|
||||||
dvi2ps make.dvi > make.ps
|
|
||||||
|
|
||||||
make: $(objs)
|
|
||||||
$(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
|
|
||||||
mv -f make.new make
|
|
||||||
|
|
||||||
# -I. is needed to find config.h in the build directory.
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
|
|
||||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
# For some losing Unix makes.
|
|
||||||
SHELL = /bin/sh
|
|
||||||
@SET_MAKE@
|
|
||||||
|
|
||||||
$(GLOB): FORCE config.h
|
|
||||||
cd glob; $(MAKE) libglob.a
|
|
||||||
FORCE:
|
|
||||||
|
|
||||||
tagsrcs = $(srcs) $(srcdir)/remote-*.c
|
|
||||||
TAGS: $(tagsrcs)
|
|
||||||
$(ETAGS) $(tagsrcs)
|
|
||||||
tags: $(tagsrcs)
|
|
||||||
$(CTAGS) $(tagsrcs)
|
|
||||||
|
|
||||||
.PHONY: install installdirs
|
|
||||||
install: installdirs \
|
|
||||||
$(bindir)/$(binprefix)make $(infodir)/make.info \
|
|
||||||
$(mandir)/$(manprefix)make.$(manext)
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
|
||||||
|
|
||||||
$(bindir)/$(binprefix)make: make
|
|
||||||
$(INSTALL_PROGRAM) make $@.new
|
|
||||||
@if $(install_setgid); then \
|
|
||||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
|
||||||
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
|
||||||
else \
|
|
||||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
|
||||||
echo "otherwise the \`-l' option will probably not work."; \
|
|
||||||
echo "You may need special privileges to install $@."; \
|
|
||||||
fi; \
|
|
||||||
else true; fi
|
|
||||||
# Some systems can't deal with renaming onto a running binary.
|
|
||||||
-rm -f $@.old
|
|
||||||
-mv $@ $@.old
|
|
||||||
mv $@.new $@
|
|
||||||
|
|
||||||
$(infodir)/make.info: make.info
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
for file in $${dir}/make.info*; do \
|
|
||||||
name="`basename $$file`"; \
|
|
||||||
$(INSTALL_DATA) $$file \
|
|
||||||
`echo $@ | sed "s,make.info\$$,$$name,"`; \
|
|
||||||
done
|
|
||||||
# Run install-info only if it exists.
|
|
||||||
# Use `if' instead of just prepending `-' to the
|
|
||||||
# line so we notice real errors from install-info.
|
|
||||||
# We use `$(SHELL) -c' because some shells do not
|
|
||||||
# fail gracefully when there is an unknown command.
|
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
install-info --info-dir=$(infodir) $$dir/make.info; \
|
|
||||||
else true; fi
|
|
||||||
|
|
||||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
|
||||||
$(INSTALL_DATA) $(srcdir)/make.man $@
|
|
||||||
|
|
||||||
|
|
||||||
loadavg: loadavg.c config.h
|
|
||||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
|
||||||
loadavg.c $(LOADLIBES) -o $@
|
|
||||||
# We copy getloadavg.c into a different file rather than compiling it
|
|
||||||
# directly because some compilers clobber getloadavg.o in the process.
|
|
||||||
loadavg.c: getloadavg.c
|
|
||||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
|
||||||
cp $(srcdir)/getloadavg.c loadavg.c
|
|
||||||
check-loadavg: loadavg
|
|
||||||
@echo The system uptime program believes the load average to be:
|
|
||||||
-uptime
|
|
||||||
@echo The GNU load average checking code believes:
|
|
||||||
./loadavg
|
|
||||||
check: check-loadavg
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean realclean distclean mostlyclean
|
|
||||||
clean: glob-clean
|
|
||||||
-rm -f make loadavg *.o core make.dvi
|
|
||||||
distclean: clean glob-realclean
|
|
||||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
|
||||||
-rm -f config.log config.cache
|
|
||||||
-rm -f TAGS tags
|
|
||||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
|
||||||
-rm -f loadavg.c
|
|
||||||
realclean: distclean
|
|
||||||
-rm -f make.info*
|
|
||||||
mostlyclean: clean
|
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
|
||||||
glob-clean glob-realclean:
|
|
||||||
cd glob; $(MAKE) $@
|
|
||||||
|
|
||||||
Makefile: config.status $(srcdir)/Makefile.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
config.h: stamp-config ;
|
|
||||||
stamp-config: config.status $(srcdir)/config.h.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
touch stamp-config
|
|
||||||
|
|
||||||
#configure: configure.in aclocal.m4
|
|
||||||
# cd $(srcdir) && autoconf $(ACFLAGS)
|
|
||||||
#config.h.in: configure.in aclocal.m4
|
|
||||||
# cd $(srcdir) && autoheader $(ACFLAGS)
|
|
||||||
|
|
||||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# The automatically generated dependencies below may omit config.h
|
|
||||||
# because it is included with ``#include <config.h>'' rather than
|
|
||||||
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
|
||||||
$(objs): config.h
|
|
||||||
|
|
||||||
# Automatically generated dependencies will be put at the end of the file.
|
|
||||||
|
|
||||||
# Automatically generated dependencies.
|
|
||||||
commands.o: commands.c make.h signame.h dep.h filedef.h variable.h \
|
|
||||||
job.h commands.h
|
|
||||||
job.o: job.c make.h signame.h job.h filedef.h commands.h variable.h
|
|
||||||
dir.o: dir.c make.h signame.h
|
|
||||||
file.o: file.c make.h signame.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
misc.o: misc.c make.h signame.h dep.h
|
|
||||||
main.o: main.c make.h signame.h dep.h filedef.h variable.h job.h \
|
|
||||||
commands.h getopt.h
|
|
||||||
read.o: read.c make.h signame.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h glob/glob.h
|
|
||||||
remake.o: remake.c make.h signame.h filedef.h job.h commands.h dep.h
|
|
||||||
rule.o: rule.c make.h signame.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h rule.h
|
|
||||||
implicit.o: implicit.c make.h signame.h rule.h dep.h filedef.h
|
|
||||||
default.o: default.c make.h signame.h rule.h dep.h filedef.h job.h \
|
|
||||||
commands.h variable.h
|
|
||||||
variable.o: variable.c make.h signame.h dep.h filedef.h job.h \
|
|
||||||
commands.h variable.h
|
|
||||||
expand.o: expand.c make.h signame.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
function.o: function.c make.h signame.h filedef.h variable.h dep.h \
|
|
||||||
job.h commands.h
|
|
||||||
vpath.o: vpath.c make.h signame.h filedef.h variable.h
|
|
||||||
version.o: version.c
|
|
||||||
ar.o: ar.c make.h signame.h filedef.h dep.h
|
|
||||||
arscan.o: arscan.c make.h signame.h
|
|
||||||
signame.o: signame.c signame.h
|
|
||||||
remote-stub.o: remote-stub.c make.h signame.h filedef.h job.h \
|
|
||||||
commands.h
|
|
||||||
getopt.o: getopt.c getopt.h
|
|
||||||
getopt1.o: getopt1.c getopt.h
|
|
||||||
getloadavg.o: getloadavg.c
|
|
||||||
69
NEWS
69
NEWS
@@ -1,14 +1,67 @@
|
|||||||
GNU make NEWS -*-indented-text-*-
|
GNU make NEWS -*-indented-text-*-
|
||||||
History of user-visible changes.
|
History of user-visible changes.
|
||||||
06 Apr 1996
|
19 May 1998
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
Copyright (C) 1992,1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc.
|
||||||
See the end for copying conditions.
|
See the end for copying conditions.
|
||||||
|
|
||||||
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
Please send GNU make bug reports to bug-make@gnu.org.
|
||||||
|
|
||||||
|
Version 3.77
|
||||||
|
|
||||||
|
* Implement BSD make's "?=" variable assignment operator. The variable
|
||||||
|
is assigned the specified value only if that variable is not already
|
||||||
|
defined.
|
||||||
|
|
||||||
|
* Make defines a new variable, "CURDIR", to contain the current working
|
||||||
|
directory (after the -C option, if any, has been processed).
|
||||||
|
Modifying this variable has no effect on the operation of make.
|
||||||
|
|
||||||
|
* Make defines a new default RCS rule, for new-style master file
|
||||||
|
storage: ``% :: RCS/%'' (note no ``,v'' suffix).
|
||||||
|
|
||||||
|
Make defines new default rules for DOS-style C++ file naming
|
||||||
|
conventions, with ``.cpp'' suffixes. All the same rules as for
|
||||||
|
``.cc'' and ``.C'' suffixes are provided, along with LINK.cpp and
|
||||||
|
COMPILE.cpp macros (which default to the same value as LINK.cc and
|
||||||
|
COMPILE.cc). Note CPPFLAGS is still C preprocessor flags! You should
|
||||||
|
use CXXFLAGS to change C++ compiler flags.
|
||||||
|
|
||||||
|
* A new feature, "target-specific variable values", has been added.
|
||||||
|
This is a large change so please see the appropriate sections of the
|
||||||
|
manual for full details. Briefly, syntax like this:
|
||||||
|
|
||||||
|
TARGET: VARIABLE = VALUE
|
||||||
|
|
||||||
|
defines VARIABLE as VALUE within the context of TARGET. This is
|
||||||
|
similar to SunOS make's "TARGET := VARIABLE = VALUE" feature. Note
|
||||||
|
that the assignment may be of any type, not just recursive, and that
|
||||||
|
the override keyword is available.
|
||||||
|
|
||||||
|
COMPATIBILITY: This new syntax means that if you have any rules where
|
||||||
|
the first or second dependency has an equal sign (=) in its name,
|
||||||
|
you'll have to escape them with a backslash: "foo : bar\=baz".
|
||||||
|
Further, if you have any dependencies which already contain "\=",
|
||||||
|
you'll have to escape both of them: "foo : bar\\\=baz".
|
||||||
|
|
||||||
|
* A new appendix listing the most common error and warning messages
|
||||||
|
generated by GNU make, with some explanation, has been added to the
|
||||||
|
GNU make User's Manual.
|
||||||
|
|
||||||
|
* Updates to the GNU make Customs library support (see README.customs).
|
||||||
|
|
||||||
|
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
|
||||||
|
and to the DOS port from Eli Zaretski (see README.DOS).
|
||||||
|
|
||||||
|
Version 3.76.1
|
||||||
|
|
||||||
|
* Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
|
||||||
|
|
||||||
Version 3.76
|
Version 3.76
|
||||||
|
|
||||||
|
* GNU make now uses automake to control Makefile.in generation. This
|
||||||
|
should make it more consistent with the GNU standards.
|
||||||
|
|
||||||
* VPATH functionality has been changed to incorporate the VPATH+ patch,
|
* VPATH functionality has been changed to incorporate the VPATH+ patch,
|
||||||
previously maintained by Paul Smith <psmith@baynetworks.com>. See the
|
previously maintained by Paul Smith <psmith@baynetworks.com>. See the
|
||||||
manual.
|
manual.
|
||||||
@@ -21,7 +74,8 @@ Version 3.76
|
|||||||
list of words from number S to number E (inclusive) of TEXT.
|
list of words from number S to number E (inclusive) of TEXT.
|
||||||
|
|
||||||
* Instead of an error, detection of future modification times gives a
|
* Instead of an error, detection of future modification times gives a
|
||||||
warning and continues.
|
warning and continues. The warning is repeated just before GNU make
|
||||||
|
exits, so it is less likely to be lost.
|
||||||
|
|
||||||
* Fix the $(basename) and $(suffix) functions so they only operate on
|
* Fix the $(basename) and $(suffix) functions so they only operate on
|
||||||
the last filename, not the entire string:
|
the last filename, not the entire string:
|
||||||
@@ -33,6 +87,11 @@ Version 3.76
|
|||||||
$(suffix a.b) b b
|
$(suffix a.b) b b
|
||||||
$(suffix a.b/c) b/c <empty>
|
$(suffix a.b/c) b/c <empty>
|
||||||
|
|
||||||
|
* The $(strip) function now removes newlines as well as TABs and spaces.
|
||||||
|
|
||||||
|
* The $(shell) function now changes CRLF (\r\n) pairs to a space as well
|
||||||
|
as newlines (\n).
|
||||||
|
|
||||||
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
|
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
|
||||||
|
|
||||||
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
|
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
|
||||||
@@ -40,6 +99,8 @@ Version 3.76
|
|||||||
and utilities. See README.DOS for details, and direct all questions
|
and utilities. See README.DOS for details, and direct all questions
|
||||||
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
||||||
Delorie <dj@delorie.com>.
|
Delorie <dj@delorie.com>.
|
||||||
|
|
||||||
|
* John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||||
|
|
||||||
Version 3.75
|
Version 3.75
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
# `build_w32.bat' instead.
|
# `build_w32.bat' instead.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -29,8 +29,8 @@ OUTDIR=.
|
|||||||
MAKEFILE=NMakefile
|
MAKEFILE=NMakefile
|
||||||
SUBPROC_MAKEFILE=NMakefile
|
SUBPROC_MAKEFILE=NMakefile
|
||||||
|
|
||||||
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D 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 /D NO_ARCHIVES
|
||||||
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
||||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||||
|
|
||||||
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||||
@@ -50,18 +50,21 @@ all: config.h subproc Release Debug
|
|||||||
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
||||||
|
|
||||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||||
subproc.bat $(SUBPROC_MAKEFILE)
|
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
|
||||||
|
|
||||||
config.h: config.h.W32
|
config.h: config.h.W32
|
||||||
copy $? $@
|
copy $? $@
|
||||||
|
|
||||||
Release:
|
Release:
|
||||||
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
||||||
Debug:
|
Debug:
|
||||||
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rmdir /s /q WinDebug WinRel
|
rmdir /s /q WinDebug WinRel
|
||||||
|
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
|
||||||
|
erase config.h
|
||||||
|
erase *.pdb
|
||||||
|
|
||||||
$(OUTDIR):
|
$(OUTDIR):
|
||||||
if not exist .\$@\nul mkdir .\$@
|
if not exist .\$@\nul mkdir .\$@
|
||||||
@@ -105,29 +108,6 @@ $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
|||||||
.c{$(OUTDIR)}.obj:
|
.c{$(OUTDIR)}.obj:
|
||||||
$(CC) $(CFLAGS) /c $<
|
$(CC) $(CFLAGS) /c $<
|
||||||
|
|
||||||
$(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h
|
|
||||||
$(OUTDIR)/arscan.obj : arscan.c make.h
|
|
||||||
$(OUTDIR)/commands.obj : commands.c
|
|
||||||
$(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/dir.obj : dir.c make.h
|
|
||||||
$(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h
|
|
||||||
$(OUTDIR)/getloadavg.obj : getloadavg.c
|
|
||||||
$(OUTDIR)/getopt.obj : getopt.c
|
|
||||||
$(OUTDIR)/getopt1.obj : getopt1.c getopt.h
|
|
||||||
$(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h filedef.h
|
|
||||||
$(OUTDIR)/job.obj : job.c make.h job.h filedef.h commands.h variable.h
|
|
||||||
$(OUTDIR)/main.obj : main.c make.h dep.h filedef.h variable.h job.h commands.h getopt.h
|
|
||||||
$(OUTDIR)/misc.obj : misc.c make.h dep.h
|
|
||||||
$(OUTDIR)/read.obj : read.c make.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
|
|
||||||
$(OUTDIR)/remake.obj : remake.c make.h filedef.h job.h commands.h dep.h
|
|
||||||
$(OUTDIR)/remote-stub.obj : remote-stub.c make.h filedef.h job.h commands.h
|
|
||||||
$(OUTDIR)/rule.obj : rule.c make.h dep.h filedef.h job.h commands.h variable.h rule.h
|
|
||||||
$(OUTDIR)/signame.obj : signame.c signame.h
|
|
||||||
$(OUTDIR)/variable.obj : variable.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
$(OUTDIR)/version.obj : version.c
|
|
||||||
$(OUTDIR)/vpath.obj : vpath.c make.h filedef.h variable.h
|
|
||||||
$(OUTDIR)/glob.obj : glob/glob.c
|
$(OUTDIR)/glob.obj : glob/glob.c
|
||||||
$(CC) $(CFLAGS) /c $?
|
$(CC) $(CFLAGS) /c $?
|
||||||
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
||||||
@@ -136,4 +116,3 @@ $(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
|||||||
$(CC) $(CFLAGS) /c $?
|
$(CC) $(CFLAGS) /c $?
|
||||||
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
||||||
$(CC) $(CFLAGS) /c $?
|
$(CC) $(CFLAGS) /c $?
|
||||||
|
|
||||||
|
|||||||
37
README
37
README
@@ -1,37 +0,0 @@
|
|||||||
This directory contains the 3.75.1 test release of GNU Make.
|
|
||||||
All bugs reported for previous test 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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
See README.W32 for details about GNU Make on Windows NT or 95.
|
|
||||||
See README.Amiga for details about GNU Make on AmigaDOS.
|
|
||||||
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
|
||||||
WWW page http://www.delorie.com/djgpp/ for more information.
|
|
||||||
|
|
||||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
|
||||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
|
||||||
It is said that using `cc' without `-O' does work.
|
|
||||||
|
|
||||||
One area that is often a problem in configuration and porting is the code
|
|
||||||
to check the system's current load average. To make it easier to test and
|
|
||||||
debug this code, you can do `make check-loadavg' to see if it works
|
|
||||||
properly on your system. (You must run `configure' beforehand, but you
|
|
||||||
need not build Make itself to run this test.)
|
|
||||||
|
|
||||||
See the file NEWS for what has changed since previous releases.
|
|
||||||
|
|
||||||
GNU Make is fully documented in make.texinfo. See the section entitled
|
|
||||||
`Problems and Bugs' for information on submitting bug reports.
|
|
||||||
|
|
||||||
GNU Make is free software. See the file COPYING for copying conditions.
|
|
||||||
@@ -3,7 +3,7 @@ Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
|||||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||||
Type: dev/c
|
Type: dev/c
|
||||||
|
|
||||||
This is a pure Amiga port of GNU make 3.74. It needs no extra libraries or
|
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
||||||
anything. It has the following features (in addition to any features of
|
anything. It has the following features (in addition to any features of
|
||||||
GNU make):
|
GNU make):
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ New (since 3.74) DOS-specific features:
|
|||||||
|
|
||||||
8. Can be built without (a previous version of) Make.
|
8. Can be built without (a previous version of) Make.
|
||||||
|
|
||||||
|
9. The build process requires only standard tools. (Optional
|
||||||
|
targets like "install:" and "clean:" still need additional
|
||||||
|
programs, though, see below.)
|
||||||
|
|
||||||
|
|
||||||
To build:
|
To build:
|
||||||
|
|
||||||
@@ -33,32 +37,67 @@ To build:
|
|||||||
if you use PKUNZIP). If you build Make on Windows 95, use an
|
if you use PKUNZIP). If you build Make on Windows 95, use an
|
||||||
unzip program that supports long filenames in zip files.
|
unzip program that supports long filenames in zip files.
|
||||||
|
|
||||||
|
If you are unpacking an official GNU source distribution, use
|
||||||
|
either DJTAR (which is part of the DJGPP development
|
||||||
|
environment), or the DJGPP port of GNU Tar.
|
||||||
|
|
||||||
2. Invoke the `configure.bat' batch file.
|
2. Invoke the `configure.bat' batch file.
|
||||||
|
|
||||||
If it doesn't find a working Make, it will suggest to use the
|
If you are building Make in-place, i.e. in the same directory
|
||||||
`dosbuild.bat' batch file to build Make. Either do as it
|
where its sources are kept, just type "configure.bat" and press
|
||||||
suggests or install another Make program (a pre-compiled binary
|
[Enter]. Otherwise, you need to supply the path to the source
|
||||||
should be available from the usual DJGPP sites).
|
directory as an argument to the batch file, like this:
|
||||||
|
|
||||||
3. If you have Make, the configure script will need a Unix-style
|
configure.bat c:/djgpp/gnu/make-%VERSION%
|
||||||
Sed program. If you don't have that installed, you can find one
|
|
||||||
on one of the DJGPP mirror sites.
|
Note the forward slashes: you MUST use them here.
|
||||||
|
|
||||||
|
3. If configure.bat doesn't find a working Make, it will suggest to
|
||||||
|
use the `dosbuild.bat' batch file to build Make. Either do as it
|
||||||
|
suggests or install another Make program (a pre-compiled binary
|
||||||
|
should be available from the usual DJGPP sites) and rerun
|
||||||
|
configure.bat.
|
||||||
|
|
||||||
4. If you will need to run Make on machines without an FPU, you
|
4. If you will need to run Make on machines without an FPU, you
|
||||||
might consider building a version of Make which doesn't issue
|
might consider building a version of Make which doesn't issue
|
||||||
floating-point instructions (they don't help much on MSDOS
|
floating-point instructions (they don't help much on MSDOS
|
||||||
anyway). To this end, invoke the configure batch file like so:
|
anyway). To this end, edit the Makefile created by
|
||||||
|
configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
|
||||||
configure no-float
|
|
||||||
|
|
||||||
5. Invoke Make.
|
5. Invoke Make.
|
||||||
|
|
||||||
6. If you have a Unix-style shell installed, you can use the
|
If you are building from outside of the source directory, you
|
||||||
`install' target. You will also need GNU Fileutils and GNU
|
need to tell Make where the sources are, like this:
|
||||||
Sh-utils for this (they should be available from the DJGPP
|
|
||||||
sites).
|
|
||||||
|
|
||||||
7. The `clean' targets require Unix-style `rm' program.
|
make srcdir=c:/djgpp/gnu/make-%VERSION%
|
||||||
|
|
||||||
|
(configure.bat will tell you this when it finishes). You MUST
|
||||||
|
use a full, not relative, name of the source directory here, or
|
||||||
|
else Make might fail.
|
||||||
|
|
||||||
|
6. After Make finishes, if you have a Unix-style shell installed,
|
||||||
|
you can use the `install' target to install the package. You
|
||||||
|
will also need GNU Fileutils and GNU Sed for this (they should
|
||||||
|
be available from the DJGPP sites).
|
||||||
|
|
||||||
|
Without a Unix-style shell, you will have to install programs
|
||||||
|
and the docs manually. Copy make.exe to a directory on your
|
||||||
|
PATH, make.i* info files to your Info directory, and update the
|
||||||
|
file `dir' in your Info directory by adding the following item
|
||||||
|
to the main menu:
|
||||||
|
|
||||||
|
* Make: (make.info). The GNU make utility.
|
||||||
|
|
||||||
|
If you have the `install-info' program (from the GNU Texinfo
|
||||||
|
package), it will do that for you if you invoke it like this:
|
||||||
|
|
||||||
|
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
||||||
|
|
||||||
|
(If your Info directory is other than C:\DJGPP\INFO, change this
|
||||||
|
command accordingly.)
|
||||||
|
|
||||||
|
7. The `clean' targets also require Unix-style shell, and GNU Sed
|
||||||
|
and `rm' programs (the latter from Fileutils).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +106,8 @@ Notes:
|
|||||||
|
|
||||||
1. The shell issue.
|
1. The shell issue.
|
||||||
|
|
||||||
This is probably the most significant improvement in this port.
|
This is probably the most significant improvement, first
|
||||||
|
introduced in the port of GNU Make 3.75.
|
||||||
|
|
||||||
The original behavior of GNU Make is to invoke commands
|
The original behavior of GNU Make is to invoke commands
|
||||||
directly, as long as they don't include characters special to
|
directly, as long as they don't include characters special to
|
||||||
@@ -75,10 +115,10 @@ Notes:
|
|||||||
When shell features like redirection or filename wildcards are
|
When shell features like redirection or filename wildcards are
|
||||||
involved, Make calls the shell.
|
involved, Make calls the shell.
|
||||||
|
|
||||||
This port supports both DOS shells (the stock COMMAND.COM and
|
This port supports both DOS shells (the stock COMMAND.COM and its
|
||||||
its 4DOS/NDOS replacements), and Unix-style shells (tested with
|
4DOS/NDOS replacements), and Unix-style shells (tested with the
|
||||||
the venerable Stewartson's `ms_sh' 2.3 and the recent DJGPP port
|
venerable Stewartson's `ms_sh' 2.3 and the DJGPP port of `bash' by
|
||||||
of `bash' by Daisuke Aoyama <jack@st.rim.or.jp>).
|
Daisuke Aoyama <jack@st.rim.or.jp>).
|
||||||
|
|
||||||
When the $SHELL variable points to a Unix-style shell, Make
|
When the $SHELL variable points to a Unix-style shell, Make
|
||||||
works just like you'd expect on Unix, calling the shell for any
|
works just like you'd expect on Unix, calling the shell for any
|
||||||
@@ -204,8 +244,7 @@ Notes:
|
|||||||
doesn't include characters illegal on MSDOS FAT filesystems,
|
doesn't include characters illegal on MSDOS FAT filesystems,
|
||||||
will be automatically down-cased.) User reports that I have
|
will be automatically down-cased.) User reports that I have
|
||||||
indicate that this default behavior is generally what you'd
|
indicate that this default behavior is generally what you'd
|
||||||
expect; however, since this is the first DJGPP port of Make that
|
expect; however, your input is most welcome.
|
||||||
supports long filenames, your input is most welcome.
|
|
||||||
|
|
||||||
In any case, if you hit a situation where you must force Make to
|
In any case, if you hit a situation where you must force Make to
|
||||||
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
||||||
@@ -218,7 +257,7 @@ Notes:
|
|||||||
make implicit assumptions about the pathname syntax. In
|
make implicit assumptions about the pathname syntax. In
|
||||||
particular, the directories are assumed to be separated by `/',
|
particular, the directories are assumed to be separated by `/',
|
||||||
and any pathname which doesn't begin with a `/' is assumed to be
|
and any pathname which doesn't begin with a `/' is assumed to be
|
||||||
releative to the current directory. This port attempts to
|
relative to the current directory. This port attempts to
|
||||||
support DOS-style pathnames which might include the drive letter
|
support DOS-style pathnames which might include the drive letter
|
||||||
and use backslashes instead of forward slashes. However, this
|
and use backslashes instead of forward slashes. However, this
|
||||||
support is not complete; I feel that pursuing this support too
|
support is not complete; I feel that pursuing this support too
|
||||||
@@ -247,8 +286,8 @@ Bug reports:
|
|||||||
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
||||||
post to Usenet groups, write to the DJGPP mailing list,
|
post to Usenet groups, write to the DJGPP mailing list,
|
||||||
<djgpp@delorie.com>, which is an email gateway into the above news
|
<djgpp@delorie.com>, which is an email gateway into the above news
|
||||||
group). For other bugs, please follow the the procedure explained
|
group). For other bugs, please follow the procedure explained in
|
||||||
in the "Bugs" chapter of the Info docs. If you don't have an Info
|
the "Bugs" chapter of the Info docs. If you don't have an Info
|
||||||
reader, look up that chapter in the `make.i1' file with any text
|
reader, look up that chapter in the `make.i1' file with any text
|
||||||
browser/editor.
|
browser/editor.
|
||||||
|
|
||||||
|
|||||||
117
README.W32
117
README.W32
@@ -38,7 +38,7 @@ GNU make and sh.exe:
|
|||||||
|
|
||||||
There are very few true ports of Bourne shell for NT right now.
|
There are very few true ports of Bourne shell for NT right now.
|
||||||
There is a version of GNU bash available from Cygnus gnu-win32
|
There is a version of GNU bash available from Cygnus gnu-win32
|
||||||
porting effort. Other possibilites are to get the MKS version
|
porting effort. Other possibilities are to get the MKS version
|
||||||
of sh.exe or to build your own with a package like
|
of sh.exe or to build your own with a package like
|
||||||
NutCracker (DataFocus) or Portage (Consensys).
|
NutCracker (DataFocus) or Portage (Consensys).
|
||||||
|
|
||||||
@@ -46,6 +46,75 @@ GNU make and sh.exe:
|
|||||||
freely available. It may be available someday, but I am not in control
|
freely available. It may be available someday, but I am not in control
|
||||||
of this decision nor do I influence it. Sorry!
|
of this decision nor do I influence it. Sorry!
|
||||||
|
|
||||||
|
GNU make and Cygnus GNU WIN32 tools (BATCH_MODE_ONLY_SHELL)
|
||||||
|
|
||||||
|
GNU make now has support for the Cygnus GNU WIN32 toolset. The
|
||||||
|
GNU WIN32 version of Bourne shell does not behave well when
|
||||||
|
invoked as 'sh -c' from CreateProcess(). The main problem is it
|
||||||
|
seems to have a hard time handling quoted strings correctly. This
|
||||||
|
problem goes away when invoking the Cygnus shell on a shell script.
|
||||||
|
|
||||||
|
To work around this difficulty, this version of make supports
|
||||||
|
a new batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
|
||||||
|
time, make forces all command lines to be executed via script
|
||||||
|
files instead of by command line.
|
||||||
|
|
||||||
|
A native WIN32 system with no Bourne shell will also run
|
||||||
|
in batch mode. All command lines will be put into batch files
|
||||||
|
and executed via $(COMSPEC) (%COMSPEC%).
|
||||||
|
|
||||||
|
If you wish to use Cygnus' GNUWIN32 shell, be sure you define
|
||||||
|
BATCH_MODE_ONLY_SHELL in the config.h.W32 prior to building make.
|
||||||
|
The new feataure was tested with the b18 version of the Cygnus
|
||||||
|
user tools.
|
||||||
|
|
||||||
|
GNU make and MKS shell
|
||||||
|
|
||||||
|
There is now semi-official support for the MKS shell. To turn this
|
||||||
|
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||||
|
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||||
|
on HAVE_MKS_SHELL.
|
||||||
|
|
||||||
|
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||||
|
|
||||||
|
There is a caveat that should be noted with respect to handling
|
||||||
|
single character pathnames on Windows systems. When colon is
|
||||||
|
used in PATH variables, make tries to be smart about knowing when
|
||||||
|
you are using colon as a separator versus colon as a drive
|
||||||
|
letter. Unfortunately, something as simple as the string 'x:/'
|
||||||
|
could be interpreted 2 ways: (x and /) or (x:/).
|
||||||
|
|
||||||
|
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||||
|
drive letter pathname. If it is necessary to use single
|
||||||
|
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||||
|
user must do one of two things:
|
||||||
|
|
||||||
|
a. Use semicolon as the separator to disambiguate colon. For
|
||||||
|
example use 'x;/' if you want to say 'x' and '/' are
|
||||||
|
separate components.
|
||||||
|
|
||||||
|
b. Qualify the directory name so that there is more than
|
||||||
|
one character in the path(s) used. For example, none
|
||||||
|
of these settings are ambiguous:
|
||||||
|
|
||||||
|
./x:./y
|
||||||
|
/some/path/x:/some/path/y
|
||||||
|
x:/some/path/x:x:/some/path/y
|
||||||
|
|
||||||
|
These caveats affect Windows systems only (Windows NT and
|
||||||
|
Windows 95) and can be ignored for other platforms.
|
||||||
|
|
||||||
|
Please note that you are free to mix colon and semi-colon in the
|
||||||
|
specification of paths. Make is able to figure out the intended
|
||||||
|
result and convert the paths internally to the format needed
|
||||||
|
when interacting with the operating system.
|
||||||
|
|
||||||
|
You are encouraged to use colon as the separator character.
|
||||||
|
This should ease the pain of deciding how to handle various path
|
||||||
|
problems which exist between platforms. If colon is used on
|
||||||
|
both Unix and Windows systems, then no ifdef'ing will be
|
||||||
|
necessary in the makefile source.
|
||||||
|
|
||||||
GNU make test suite:
|
GNU make test suite:
|
||||||
|
|
||||||
I verified all functionality with a slightly modified version
|
I verified all functionality with a slightly modified version
|
||||||
@@ -87,6 +156,38 @@ Pathnames and white space:
|
|||||||
and you are free to take a crack at making this work. The code
|
and you are free to take a crack at making this work. The code
|
||||||
in w32/pathstuff.c and vpath.c would be the places to start.
|
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||||
|
|
||||||
|
Pathnames and Case insensitivity:
|
||||||
|
|
||||||
|
Unlike Unix, Windows 95/NT systems are case insensitive but case
|
||||||
|
preserving. For example if you tell the file system to create a
|
||||||
|
file named "Target", it will preserve the case. Subsequent access to
|
||||||
|
the file with other case permutations will succeed (i.e. opening a
|
||||||
|
file named "target" or "TARGET" will open the file "Target").
|
||||||
|
|
||||||
|
By default, GNU make retains its case sensitivity when comparing
|
||||||
|
target names and existing files or directories. It can be
|
||||||
|
configured, however, into a case preserving and case insensitive
|
||||||
|
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||||
|
config.h.W32.
|
||||||
|
|
||||||
|
For example, the following makefile will create a file named
|
||||||
|
Target in the directory subdir which will subsequently be used
|
||||||
|
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
|
||||||
|
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
|
||||||
|
will not be made:
|
||||||
|
|
||||||
|
subdir/Target:
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
SUBDIR/DepTarget: SubDir/TARGET
|
||||||
|
cp $^ $@
|
||||||
|
|
||||||
|
Reliance on this behavior also eliminates the ability of GNU make
|
||||||
|
to use case in comparison of matching rules. For example, it is
|
||||||
|
not possible to set up a C++ rule using %.C that is different
|
||||||
|
than a C rule using %.c. GNU make will consider these to be the
|
||||||
|
same rule and will issue a warning.
|
||||||
|
|
||||||
SAMBA/NTFS/VFAT:
|
SAMBA/NTFS/VFAT:
|
||||||
|
|
||||||
I have not had any success building the debug version of this
|
I have not had any success building the debug version of this
|
||||||
@@ -105,17 +206,17 @@ SAMBA/NTFS/VFAT:
|
|||||||
under VFAT. VFAT users may wish to be aware that this port
|
under VFAT. VFAT users may wish to be aware that this port
|
||||||
of make does respect case sensitivity.
|
of make does respect case sensitivity.
|
||||||
|
|
||||||
Version 3.76 contains some preliminary support for FAT.
|
Version 3.76 contains some preliminary support for FAT. Make
|
||||||
Make now tries to work around some difficulties with stat'ing of
|
now tries to work around some difficulties with stat'ing of
|
||||||
files and caching of filenames and directories internally.
|
files and caching of filenames and directories internally.
|
||||||
There is still a known problem with filenames sometimes being found
|
There is still a known problem with filenames sometimes being
|
||||||
to have modification dates in the future which cause make to
|
found to have modification dates in the future which cause make
|
||||||
complain about the file and exit (remake.c).
|
to complain about the file and exit (remake.c).
|
||||||
|
|
||||||
Bug reports:
|
Bug reports:
|
||||||
|
|
||||||
Please submit bugs via the normal bug reporting mechanism
|
Please submit bugs via the normal bug reporting mechanism
|
||||||
which is described in one of the texinfo files. If you don't
|
which is described in one of the Texinfo files. If you don't
|
||||||
have texinfo for Windows NT or Windows 95, these files are simple
|
have Texinfo for Windows NT or Windows 95, these files are simple
|
||||||
text files and can be read with a text editor.
|
text files and can be read with a text editor.
|
||||||
|
|
||||||
|
|||||||
73
README.customs
Normal file
73
README.customs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
-*-indented-text-*-
|
||||||
|
|
||||||
|
GNU make can utilize the Customs library, distributed with Pmake, to
|
||||||
|
provide builds distributed across multiple hosts.
|
||||||
|
|
||||||
|
In order to utilize this capability, you must first download and build
|
||||||
|
the Customs library. It is contained in the Pmake distribution, which
|
||||||
|
can be obtained at:
|
||||||
|
|
||||||
|
ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/
|
||||||
|
|
||||||
|
This integration was tested (superficially) with Pmake 2.1.33.
|
||||||
|
|
||||||
|
|
||||||
|
BUILDING CUSTOMS
|
||||||
|
----------------
|
||||||
|
|
||||||
|
First, build pmake and Customs. You need to build pmake first, because
|
||||||
|
Customs require pmake to build. Unfortunately, this is not trivial;
|
||||||
|
please see the pmake and Customs documentation for details. The best
|
||||||
|
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
||||||
|
|
||||||
|
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||||
|
GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||||
|
patches are based on GNU make 3.75 (there are patches for earlier
|
||||||
|
versions of GNU make, also). The parts of this patchfile which relate
|
||||||
|
directly to Customs support have already been incorporated into this
|
||||||
|
version of GNU make, so you should _NOT_ apply the patch file.
|
||||||
|
|
||||||
|
However, there are a few non-Customs specific (as far as I could tell)
|
||||||
|
changes here which are not incorporated (for example, the modification
|
||||||
|
to try expanding -lfoo to libfoo.so). If you rely on these changes
|
||||||
|
you'll need to re-apply them by hand.
|
||||||
|
|
||||||
|
Install the Customs library and header files according to the
|
||||||
|
documentation. You should also install the man pages (contrary to
|
||||||
|
comments in the documentation, they weren't installed automatically for
|
||||||
|
me; I had to cd to the ``pmake-2.1.33/doc'' directory and run ``pmake
|
||||||
|
install'' there directly).
|
||||||
|
|
||||||
|
|
||||||
|
BUILDING GNU MAKE
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Once you've installed Customs, you can build GNU make to use it. When
|
||||||
|
configuring GNU make, merely use the ``--with-customs=DIR'' option.
|
||||||
|
Provide the directory containing the ``lib'' and ``include/customs''
|
||||||
|
subdirectories as DIR. For example, if you installed the customs
|
||||||
|
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||||
|
then you'd pass ``--with-customs=/usr/local'' as an option to configure.
|
||||||
|
|
||||||
|
Run make (or use build.sh) normally to build GNU make as described in
|
||||||
|
the INSTALL file.
|
||||||
|
|
||||||
|
See the documentation for Customs for information on starting and
|
||||||
|
configuring Customs.
|
||||||
|
|
||||||
|
|
||||||
|
PROBLEMS
|
||||||
|
--------
|
||||||
|
|
||||||
|
SunOS 4.1.x:
|
||||||
|
The customs/sprite.h header file #includes the <malloc.h> header
|
||||||
|
files; this conflicts with GNU make's configuration so you'll get a
|
||||||
|
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||||
|
|
||||||
|
I commented out the #include in sprite.h:107:
|
||||||
|
|
||||||
|
#if defined(sun) || defined(ultrix) || defined(hpux) || defined(sgi)
|
||||||
|
/* #include <malloc.h> */
|
||||||
|
#else
|
||||||
|
|
||||||
|
YMMV.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
This directory contains the VERSION test release of GNU Make.
|
This directory contains the %VERSION% release of GNU Make.
|
||||||
All bugs reported for previous test releases have been fixed.
|
All bugs reported for previous releases have been fixed.
|
||||||
Some bugs surely remain.
|
Some bugs surely remain.
|
||||||
|
|
||||||
For general building and installation instructions, see the file INSTALL.
|
For general building and installation instructions, see the file INSTALL.
|
||||||
@@ -14,10 +14,19 @@ Some systems' Make programs are broken and cannot process the Makefile for
|
|||||||
GNU Make. If you get errors from your system's Make when building GNU
|
GNU Make. If you get errors from your system's Make when building GNU
|
||||||
Make, try using `build.sh' instead.
|
Make, try using `build.sh' instead.
|
||||||
|
|
||||||
See README.W32 for details about GNU Make on Windows NT or 95.
|
- See README.customs for details on integrating GNU make with the
|
||||||
See README.Amiga for details about GNU Make on AmigaDOS.
|
Customs distributed build environment from the Pmake distribution.
|
||||||
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
|
||||||
WWW page http://www.delorie.com/djgpp/ for more information.
|
- See README.W32 for details about GNU Make on Windows NT or 95.
|
||||||
|
|
||||||
|
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||||
|
|
||||||
|
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||||
|
using DJGPP tools.
|
||||||
|
|
||||||
|
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||||
|
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||||
|
information.
|
||||||
|
|
||||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ clean: glob-clean
|
|||||||
-$(RM) -f make loadavg *.o core make.dvi
|
-$(RM) -f make loadavg *.o core make.dvi
|
||||||
|
|
||||||
distclean: clean glob-realclean
|
distclean: clean glob-realclean
|
||||||
-$(RM) -f Makefile config.h config.status build.sh stamp-config
|
-$(RM) -f Makefile config.h config.status build.sh
|
||||||
-$(RM) -f config.log config.cache
|
-$(RM) -f config.log config.cache
|
||||||
-$(RM) -f TAGS tags
|
-$(RM) -f TAGS tags
|
||||||
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
||||||
@@ -210,67 +210,3 @@ glob-clean glob-realclean:
|
|||||||
cd glob
|
cd glob
|
||||||
smake $@
|
smake $@
|
||||||
<
|
<
|
||||||
|
|
||||||
# The automatically generated dependencies below may omit config.h
|
|
||||||
# because it is included with ``#include <config.h>'' rather than
|
|
||||||
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
|
||||||
$(objs): config.h
|
|
||||||
|
|
||||||
# Automatically generated dependencies will be put at the end of the file.
|
|
||||||
|
|
||||||
# Automatically generated dependencies.
|
|
||||||
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
|
||||||
commands.h
|
|
||||||
|
|
||||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
|
||||||
|
|
||||||
dir.o: dir.c make.h
|
|
||||||
|
|
||||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
|
|
||||||
misc.o: misc.c make.h dep.h
|
|
||||||
|
|
||||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
|
||||||
getopt.h
|
|
||||||
|
|
||||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
glob/glob.h
|
|
||||||
|
|
||||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
|
||||||
|
|
||||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
rule.h
|
|
||||||
|
|
||||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
|
||||||
|
|
||||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
|
|
||||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
|
|
||||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
|
||||||
|
|
||||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
|
||||||
commands.h amiga.h
|
|
||||||
|
|
||||||
vpath.o: vpath.c make.h filedef.h variable.h
|
|
||||||
|
|
||||||
version.o: version.c
|
|
||||||
|
|
||||||
ar.o: ar.c make.h filedef.h dep.h
|
|
||||||
|
|
||||||
arscan.o: arscan.c make.h
|
|
||||||
|
|
||||||
signame.o: signame.c signame.h
|
|
||||||
|
|
||||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
|
||||||
|
|
||||||
getopt.o: getopt.c
|
|
||||||
|
|
||||||
getopt1.o : getopt1.c getopt.h
|
|
||||||
|
|
||||||
getloadavg.o: getloadavg.c
|
|
||||||
|
|
||||||
amiga.o: amiga.c make.h variable.h amiga.h
|
|
||||||
|
|
||||||
|
|||||||
51
TODO.private
Normal file
51
TODO.private
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
-*-Indented-Text-*-
|
||||||
|
GNU Make TODO List
|
||||||
|
------------------
|
||||||
|
|
||||||
|
This list comes both from the authors and from users of GNU make.
|
||||||
|
|
||||||
|
They are listed in no particular order!
|
||||||
|
|
||||||
|
Also, I don't gaurantee that all of them will be ultimately deemed "good
|
||||||
|
ideas" and implemented. These are just the ones that, at first blush,
|
||||||
|
seem to have some merit (and that I can remember).
|
||||||
|
|
||||||
|
However, if you see something here you really, really want, speak up.
|
||||||
|
All other things being equal, I will tend to implement things that seem
|
||||||
|
to maximize user satisfaction.
|
||||||
|
|
||||||
|
Also, this list doesn't include things which I'm pretty sure would
|
||||||
|
require serious, fundamental change to GNU make; those things belong on
|
||||||
|
the mythical "Make 4.0" list. I admit, that line can be somewhat fuzzy :)
|
||||||
|
|
||||||
|
|
||||||
|
* Per-target variable definitions (a la SunOS make's ":=" feature, but
|
||||||
|
note the syntax here will definitely be different!)
|
||||||
|
|
||||||
|
* Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o, etc.)
|
||||||
|
|
||||||
|
* More robust clock skew detection algorithm.
|
||||||
|
|
||||||
|
* Provide MAKETARGETS and MAKEVARIABLES variables, containing the
|
||||||
|
names of the targets and variables defined in the makefile.
|
||||||
|
|
||||||
|
* If the user asks for parallelization, rebuild any "include"'d files
|
||||||
|
in parallel as well (helps esp. when there are many .d files to be
|
||||||
|
built).
|
||||||
|
|
||||||
|
* Allow variables/functions to expand to other make rules which are
|
||||||
|
then interpreted, with newlines handled correctly.
|
||||||
|
|
||||||
|
* More intelligent submake handling when doing parallel makes:
|
||||||
|
currently each submake gets a "-j 1" option. It would be good if
|
||||||
|
make was smart enough to give some/all its slots to the submake
|
||||||
|
(esp. if there is no other rule that can be run by the parent in
|
||||||
|
parallel, a common situation). Doing this perfectly might be too
|
||||||
|
hard, but something less than perfect is certainly possible.
|
||||||
|
|
||||||
|
* Option to check more than timestamps to determine if targets have
|
||||||
|
changed (MD5 checksumming?)
|
||||||
|
|
||||||
|
* Some sort of operating-system independent way of handling paths
|
||||||
|
would be outstanding, so makefiles can be written for UNIX, VMS,
|
||||||
|
DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#undef SCCS_GET
|
#undef SCCS_GET
|
||||||
|
|
||||||
|
|||||||
131
acinclude.m4
Normal file
131
acinclude.m4
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||||
|
dnl
|
||||||
|
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||||
|
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Got this from the lynx 2.8 distribution.
|
||||||
|
dnl by T.E.Dickey <dickey@clark.net>
|
||||||
|
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
|
||||||
|
dnl and Philippe De Muyter <phdm@macqel.be>
|
||||||
|
dnl
|
||||||
|
dnl Created: 1997/1/28
|
||||||
|
dnl Updated: 1997/12/23
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl After checking for functions in the default $LIBS, make a further check
|
||||||
|
dnl for the functions that are netlib-related (these aren't always in the
|
||||||
|
dnl libc, etc., and have to be handled specially because there are conflicting
|
||||||
|
dnl and broken implementations.
|
||||||
|
dnl Common library requirements (in order):
|
||||||
|
dnl -lresolv -lsocket -lnsl
|
||||||
|
dnl -lnsl -lsocket
|
||||||
|
dnl -lsocket
|
||||||
|
dnl -lbsd
|
||||||
|
AC_DEFUN([CF_NETLIBS],[
|
||||||
|
cf_test_netlibs=no
|
||||||
|
AC_MSG_CHECKING(for network libraries)
|
||||||
|
AC_CACHE_VAL(cf_cv_netlibs,[
|
||||||
|
AC_MSG_RESULT(working...)
|
||||||
|
cf_cv_netlibs=""
|
||||||
|
cf_test_netlibs=yes
|
||||||
|
AC_CHECK_FUNCS(gethostname,,[
|
||||||
|
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
|
||||||
|
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
|
||||||
|
#
|
||||||
|
# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
|
||||||
|
# I don't know the entrypoints - 97/7/22 TD
|
||||||
|
AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
|
||||||
|
#
|
||||||
|
if test "$ac_cv_func_lsocket" != no ; then
|
||||||
|
AC_CHECK_FUNCS(socket,,[
|
||||||
|
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
|
||||||
|
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
AC_CHECK_FUNCS(gethostbyname,,[
|
||||||
|
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
|
||||||
|
#
|
||||||
|
AC_CHECK_FUNCS(strcasecmp,,[
|
||||||
|
CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
|
||||||
|
])
|
||||||
|
LIBS="$LIBS $cf_cv_netlibs"
|
||||||
|
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
|
||||||
|
])dnl
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Re-check on a function to see if we can pick it up by adding a library.
|
||||||
|
dnl $1 = function to check
|
||||||
|
dnl $2 = library to check in
|
||||||
|
dnl $3 = environment to update (e.g., $LIBS)
|
||||||
|
dnl $4 = what to do if this fails
|
||||||
|
dnl
|
||||||
|
dnl This uses 'unset' if the shell happens to support it, but leaves the
|
||||||
|
dnl configuration variable set to 'unknown' if not. This is a little better
|
||||||
|
dnl than the normal autoconf test, which gives misleading results if a test
|
||||||
|
dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
|
||||||
|
dnl used (autoconf does not distinguish between a null token and one that is
|
||||||
|
dnl set to 'no').
|
||||||
|
AC_DEFUN([CF_RECHECK_FUNC],[
|
||||||
|
AC_CHECK_LIB($2,$1,[
|
||||||
|
CF_UPPER(cf_tr_func,$1)
|
||||||
|
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func)
|
||||||
|
ac_cv_func_$1=yes
|
||||||
|
$3="-l$2 [$]$3"],[
|
||||||
|
ac_cv_func_$1=unknown
|
||||||
|
unset ac_cv_func_$1 2>/dev/null
|
||||||
|
$4],
|
||||||
|
[[$]$3])
|
||||||
|
])dnl
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Make an uppercase version of a variable
|
||||||
|
dnl $1=uppercase($2)
|
||||||
|
AC_DEFUN([CF_UPPER],
|
||||||
|
[
|
||||||
|
changequote(,)dnl
|
||||||
|
$1=`echo $2 | tr '[a-z]' '[A-Z]'`
|
||||||
|
changequote([,])dnl
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl Got this from the GNU fileutils 3.16r distribution
|
||||||
|
dnl by Paul Eggert <egger@twinsun.com>
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
dnl The problem is that the default compilation flags in Solaris 2.6 won't
|
||||||
|
dnl let programs access large files; you need to tell the compiler that
|
||||||
|
dnl you actually want your programs to work on large files. For more
|
||||||
|
dnl details about this brain damage please see:
|
||||||
|
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||||
|
|
||||||
|
AC_DEFUN(AC_LFS,
|
||||||
|
[dnl
|
||||||
|
# If available, prefer support for large files unless the user specified
|
||||||
|
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
|
||||||
|
AC_MSG_CHECKING(whether large file support needs explicit enabling)
|
||||||
|
ac_getconfs=''
|
||||||
|
ac_result=yes
|
||||||
|
ac_set=''
|
||||||
|
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
|
||||||
|
for ac_shellvar in $ac_shellvars; do
|
||||||
|
case $ac_shellvar in
|
||||||
|
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
|
||||||
|
*) ac_lfsvar=LFS_$ac_shellvar ;;
|
||||||
|
esac
|
||||||
|
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
|
||||||
|
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
|
||||||
|
ac_getconf=`getconf $ac_lfsvar`
|
||||||
|
ac_getconfs=$ac_getconfs$ac_getconf
|
||||||
|
eval ac_test_$ac_shellvar=\$ac_getconf
|
||||||
|
done
|
||||||
|
case "$ac_result$ac_getconfs" in
|
||||||
|
yes) ac_result=no ;;
|
||||||
|
esac
|
||||||
|
case "$ac_result$ac_set" in
|
||||||
|
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
|
||||||
|
esac
|
||||||
|
AC_MSG_RESULT($ac_result)
|
||||||
|
case $ac_result in
|
||||||
|
yes)
|
||||||
|
for ac_shellvar in $ac_shellvars; do
|
||||||
|
eval $ac_shellvar=\$ac_test_$ac_shellvar
|
||||||
|
done ;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
19
aclocal.m4
vendored
19
aclocal.m4
vendored
@@ -1,19 +0,0 @@
|
|||||||
dnl
|
|
||||||
dnl Check for a symbol
|
|
||||||
dnl
|
|
||||||
AC_DEFUN(AC_CHECK_SYMBOL, [dnl
|
|
||||||
AC_MSG_CHECKING(for $1)
|
|
||||||
AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
|
|
||||||
AC_TRY_LINK(,
|
|
||||||
changequote(,)dnl
|
|
||||||
extern char *$1[]; puts(*$1);,
|
|
||||||
changequote([,])dnl
|
|
||||||
ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
|
|
||||||
if test "$ac_cv_check_symbol_$1" = yes; then
|
|
||||||
changequote(,)dnl
|
|
||||||
ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
|
|
||||||
changequote([,])dnl
|
|
||||||
AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
|
||||||
dnl
|
|
||||||
112
ar.c
112
ar.c
@@ -1,5 +1,5 @@
|
|||||||
/* Interface to `ar' archives for GNU Make.
|
/* Interface to `ar' archives for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -26,9 +26,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
/* Defined in arscan.c. */
|
/* Defined in arscan.c. */
|
||||||
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
||||||
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
|
||||||
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
||||||
|
#ifndef VMS
|
||||||
|
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
||||||
An archive-member reference is a name like `lib(member)'.
|
An archive-member reference is a name like `lib(member)'.
|
||||||
@@ -67,110 +68,6 @@ ar_parse_name (name, arname_p, memname_p)
|
|||||||
if (memname_p != 0)
|
if (memname_p != 0)
|
||||||
*memname_p = savestring (p + 1, end - (p + 1));
|
*memname_p = savestring (p + 1, end - (p + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
#include <lbrdef.h>
|
|
||||||
#include <mhddef.h>
|
|
||||||
#include <credef.h>
|
|
||||||
#include <descrip.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#if __DECC
|
|
||||||
#include <lbr$routines.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
|
||||||
|
|
||||||
#define LBR$_KEYNOTFND 2527330 /* This isn't in any .h file anywhere so I got it from a MACRO library */
|
|
||||||
|
|
||||||
time_t
|
|
||||||
ar_member_date (name)
|
|
||||||
char *name;
|
|
||||||
{
|
|
||||||
static char *arname;
|
|
||||||
static char *memname;
|
|
||||||
char *p,*q;
|
|
||||||
long int val;
|
|
||||||
static struct {
|
|
||||||
struct mhddef mhd;
|
|
||||||
struct credef cre;
|
|
||||||
char garbage[256];
|
|
||||||
} buf;
|
|
||||||
int func=LBR$C_READ,
|
|
||||||
type=LBR$C_TYP_OBJ,
|
|
||||||
rfa[2],
|
|
||||||
lidx,
|
|
||||||
status;
|
|
||||||
$DESCRIPTOR(bufdesc,(char *)&buf);
|
|
||||||
$DESCRIPTOR(libdesc,arname);
|
|
||||||
$DESCRIPTOR(moddesc,memname);
|
|
||||||
|
|
||||||
/* This "file" is an archive member. */
|
|
||||||
p = index (name, '(');
|
|
||||||
arname = savestring (name, p - name);
|
|
||||||
val = strlen (p) - 2;
|
|
||||||
/*
|
|
||||||
if (val > 15)
|
|
||||||
val = 15;
|
|
||||||
*/
|
|
||||||
memname = savestring (p + 1, val);
|
|
||||||
#ifdef OLDWAY
|
|
||||||
p = rindex (memname, ')');
|
|
||||||
if (p != 0) {
|
|
||||||
q = rindex(p,'.');
|
|
||||||
if (q)
|
|
||||||
*q = '\0'; /* to get rid of extension */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
q = rindex(memname,'.');
|
|
||||||
if (q)
|
|
||||||
*q = '\0'; /* to get rid of extension */
|
|
||||||
|
|
||||||
uppercasify(memname);
|
|
||||||
|
|
||||||
/* Make sure we know the modtime of the archive itself because
|
|
||||||
we are likely to be called just before commands to remake a
|
|
||||||
member are run, and they will change the archive itself. */
|
|
||||||
(void) f_mtime (enter_file (arname));
|
|
||||||
|
|
||||||
libdesc.dsc$a_pointer = arname;
|
|
||||||
libdesc.dsc$w_length = strlen(arname);
|
|
||||||
moddesc.dsc$a_pointer = memname;
|
|
||||||
moddesc.dsc$w_length = strlen(memname);
|
|
||||||
|
|
||||||
if (!((status = lbr$ini_control(&lidx,&func,&type,0)) & 1)) {
|
|
||||||
printf("Error in lbr$ini_control, %d\n",status);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((status = lbr$open(&lidx,&libdesc,0,0,0,0,0)) & 1)) {
|
|
||||||
printf("Error opening library %s to lookup member %s, %d\n",arname, memname ,status);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((status = lbr$lookup_key(&lidx,&moddesc,rfa)) & 1)) {
|
|
||||||
if (status != LBR$_KEYNOTFND)
|
|
||||||
printf("Error looking up module %s in library %s, %d\n",memname, arname ,status);
|
|
||||||
lbr$close(&lidx);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((status = lbr$set_module(&lidx,rfa,&bufdesc,&bufdesc,0)) & 1)) {
|
|
||||||
printf("Error getting module info, %d\n",status);
|
|
||||||
lbr$close(&lidx);
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
lbr$close(&lidx);
|
|
||||||
|
|
||||||
val = SHELL$FIX_TIME(&buf.mhd.mhd$l_datim);
|
|
||||||
|
|
||||||
free (arname);
|
|
||||||
free (memname);
|
|
||||||
return (val <= 0 ? (time_t) -1 : (time_t) val);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
||||||
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
||||||
@@ -232,7 +129,6 @@ ar_member_date_1 (desc, mem, truncated,
|
|||||||
{
|
{
|
||||||
return ar_name_equal (name, mem, truncated) ? date : 0;
|
return ar_name_equal (name, mem, truncated) ? date : 0;
|
||||||
}
|
}
|
||||||
#endif /* !VMS */
|
|
||||||
|
|
||||||
/* Set the archive-member NAME's modtime to now. */
|
/* Set the archive-member NAME's modtime to now. */
|
||||||
|
|
||||||
|
|||||||
204
arscan.c
204
arscan.c
@@ -1,19 +1,19 @@
|
|||||||
/* Library function for scanning an archive file.
|
/* Library function for scanning an archive file.
|
||||||
Copyright (C) 1987, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
Copyright (C) 1987,89,91,92,93,94,95,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
any later version.
|
any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
|
||||||
@@ -25,6 +25,171 @@
|
|||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
#include <lbrdef.h>
|
||||||
|
#include <mhddef.h>
|
||||||
|
#include <credef.h>
|
||||||
|
#include <descrip.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#if __DECC
|
||||||
|
#include <unixlib.h>
|
||||||
|
#include <lbr$routines.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
||||||
|
|
||||||
|
static void *VMS_lib_idx;
|
||||||
|
|
||||||
|
static char *VMS_saved_memname;
|
||||||
|
|
||||||
|
static time_t VMS_member_date;
|
||||||
|
|
||||||
|
static long int (*VMS_function) ();
|
||||||
|
|
||||||
|
static int
|
||||||
|
VMS_get_member_info (module, rfa)
|
||||||
|
struct dsc$descriptor_s *module;
|
||||||
|
unsigned long *rfa;
|
||||||
|
{
|
||||||
|
int status, i;
|
||||||
|
long int fnval;
|
||||||
|
|
||||||
|
time_t val;
|
||||||
|
|
||||||
|
static struct dsc$descriptor_s bufdesc =
|
||||||
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||||
|
|
||||||
|
struct mhddef *mhd;
|
||||||
|
char filename[128];
|
||||||
|
|
||||||
|
bufdesc.dsc$a_pointer = filename;
|
||||||
|
bufdesc.dsc$w_length = sizeof (filename);
|
||||||
|
|
||||||
|
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
|
||||||
|
&bufdesc.dsc$w_length, 0);
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("lbr$set_module failed to extract module info, status = %d",
|
||||||
|
status);
|
||||||
|
|
||||||
|
lbr$close (&VMS_lib_idx);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mhd = (struct mhddef *) filename;
|
||||||
|
|
||||||
|
val = decc$fix_time (&mhd->mhd$l_datim);
|
||||||
|
|
||||||
|
for (i = 0; i < module->dsc$w_length; i++)
|
||||||
|
filename[i] = _tolower (module->dsc$a_pointer[i]);
|
||||||
|
|
||||||
|
filename[i] = '\0';
|
||||||
|
|
||||||
|
VMS_member_date = (time_t) -1;
|
||||||
|
|
||||||
|
fnval =
|
||||||
|
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
|
||||||
|
VMS_saved_memname);
|
||||||
|
|
||||||
|
if (fnval)
|
||||||
|
{
|
||||||
|
VMS_member_date = fnval;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||||
|
|
||||||
|
Open the archive named ARCHIVE, find its members one by one,
|
||||||
|
and for each one call FUNCTION with the following arguments:
|
||||||
|
archive file descriptor for reading the data,
|
||||||
|
member name,
|
||||||
|
member name might be truncated flag,
|
||||||
|
member header position in file,
|
||||||
|
member data position in file,
|
||||||
|
member data size,
|
||||||
|
member date,
|
||||||
|
member uid,
|
||||||
|
member gid,
|
||||||
|
member protection mode,
|
||||||
|
ARG.
|
||||||
|
|
||||||
|
NOTE: on VMS systems, only name, date, and arg are meaningful!
|
||||||
|
|
||||||
|
The descriptor is poised to read the data of the member
|
||||||
|
when FUNCTION is called. It does not matter how much
|
||||||
|
data FUNCTION reads.
|
||||||
|
|
||||||
|
If FUNCTION returns nonzero, we immediately return
|
||||||
|
what FUNCTION returned.
|
||||||
|
|
||||||
|
Returns -1 if archive does not exist,
|
||||||
|
Returns -2 if archive has invalid format.
|
||||||
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
|
long int
|
||||||
|
ar_scan (archive, function, arg)
|
||||||
|
char *archive;
|
||||||
|
long int (*function) ();
|
||||||
|
long int arg;
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
static struct dsc$descriptor_s libdesc =
|
||||||
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||||
|
|
||||||
|
unsigned long func = LBR$C_READ;
|
||||||
|
unsigned long type = LBR$C_TYP_UNK;
|
||||||
|
unsigned long index = 1;
|
||||||
|
|
||||||
|
int status;
|
||||||
|
|
||||||
|
status = lbr$ini_control (&VMS_lib_idx, &func, &type, 0);
|
||||||
|
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("lbr$ini_control failed with status = %d",status);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
libdesc.dsc$a_pointer = archive;
|
||||||
|
libdesc.dsc$w_length = strlen (archive);
|
||||||
|
|
||||||
|
status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("unable to open library `%s' to lookup member `%s'",
|
||||||
|
archive, (char *)arg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
VMS_saved_memname = (char *)arg;
|
||||||
|
|
||||||
|
/* For comparison, delete .obj from arg name. */
|
||||||
|
|
||||||
|
p = rindex (VMS_saved_memname, '.');
|
||||||
|
if (p)
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
VMS_function = function;
|
||||||
|
|
||||||
|
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
|
||||||
|
|
||||||
|
/* Undo the damage. */
|
||||||
|
if (p)
|
||||||
|
*p = '.';
|
||||||
|
|
||||||
|
lbr$close (&VMS_lib_idx);
|
||||||
|
|
||||||
|
return VMS_member_date > 0 ? VMS_member_date : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* !VMS */
|
||||||
|
|
||||||
/* SCO Unix's compiler defines both of these. */
|
/* SCO Unix's compiler defines both of these. */
|
||||||
#ifdef M_UNIX
|
#ifdef M_UNIX
|
||||||
#undef M_XENIX
|
#undef M_XENIX
|
||||||
@@ -379,6 +544,7 @@ ar_scan (archive, function, arg)
|
|||||||
close (desc);
|
close (desc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
/* Return nonzero iff NAME matches MEM.
|
/* Return nonzero iff NAME matches MEM.
|
||||||
If TRUNCATED is nonzero, MEM may be truncated to
|
If TRUNCATED is nonzero, MEM may be truncated to
|
||||||
@@ -426,7 +592,7 @@ ar_name_equal (name, mem, truncated)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* AIX or APOLLO. */
|
#else /* AIX or APOLLO. */
|
||||||
|
#ifndef VMS
|
||||||
if (truncated)
|
if (truncated)
|
||||||
{
|
{
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
@@ -434,22 +600,21 @@ ar_name_equal (name, mem, truncated)
|
|||||||
abort ();
|
abort ();
|
||||||
#else
|
#else
|
||||||
struct ar_hdr hdr;
|
struct ar_hdr hdr;
|
||||||
return !strncmp (name, mem,
|
|
||||||
sizeof (hdr.ar_name) -
|
|
||||||
#if !defined (__hpux) && !defined (cray)
|
#if !defined (__hpux) && !defined (cray)
|
||||||
1
|
return !strncmp (name, mem, sizeof(hdr.ar_name) - 1);
|
||||||
#else
|
#else
|
||||||
2
|
return !strncmp (name, mem, sizeof(hdr.ar_name) - 2);
|
||||||
#endif /* !__hpux && !cray */
|
#endif /* !__hpux && !cray */
|
||||||
);
|
#endif /* !AIAMAG */
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
return !strcmp (name, mem);
|
return !strcmp (name, mem);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef VMS
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static long int
|
||||||
ar_member_pos (desc, mem, truncated,
|
ar_member_pos (desc, mem, truncated,
|
||||||
@@ -532,6 +697,7 @@ ar_member_touch (arname, memname)
|
|||||||
errno = i;
|
errno = i;
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
|
|||||||
69
build.sh.in
69
build.sh.in
@@ -1,69 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Shell script to build GNU Make in the absence of any `make' program.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1993, 1994 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.
|
|
||||||
|
|
||||||
# See Makefile.in for comments describing these variables.
|
|
||||||
|
|
||||||
srcdir='@srcdir@'
|
|
||||||
CC='@CC@'
|
|
||||||
CFLAGS='@CFLAGS@'
|
|
||||||
CPPFLAGS='@CPPFLAGS@'
|
|
||||||
LDFLAGS='@LDFLAGS@'
|
|
||||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
|
||||||
ALLOCA='@ALLOCA@'
|
|
||||||
LOADLIBES='@LIBS@'
|
|
||||||
extras='@LIBOBJS@'
|
|
||||||
REMOTE='@REMOTE@'
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix='@prefix@'
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix='@exec_prefix@'
|
|
||||||
# Directory to find libraries in for `-lXXX'.
|
|
||||||
libdir=${exec_prefix}/lib
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir=${prefix}/include
|
|
||||||
|
|
||||||
# Exit as soon as any command fails.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# These are all the objects we need to link together.
|
|
||||||
objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
|
||||||
|
|
||||||
# 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
|
|
||||||
done
|
|
||||||
|
|
||||||
# The object files were actually all put in the current directory.
|
|
||||||
# Remove the source directory names from the list.
|
|
||||||
srcobjs="$objs"
|
|
||||||
objs=
|
|
||||||
for obj in $srcobjs; do
|
|
||||||
objs="$objs `basename $obj`"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Link all the objects together.
|
|
||||||
echo linking make...
|
|
||||||
$CC $LDFLAGS $objs $LOADLIBES -o make.new
|
|
||||||
echo done
|
|
||||||
mv -f make.new make
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Shell script to build GNU Make in the absence of any `make' program.
|
# Shell script to build GNU Make in the absence of any `make' program.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
# Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
108
build_w32.bat
108
build_w32.bat
@@ -10,59 +10,59 @@ echo off
|
|||||||
echo "Creating GNU make for Windows 95/NT"
|
echo "Creating GNU make for Windows 95/NT"
|
||||||
echo on
|
echo on
|
||||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
|
||||||
echo WinDebug\variable.obj >>link.dbg
|
echo WinDebug\variable.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
|
||||||
echo WinDebug\rule.obj >>link.dbg
|
echo WinDebug\rule.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
|
||||||
echo WinDebug\remote-stub.obj >>link.dbg
|
echo WinDebug\remote-stub.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
|
||||||
echo WinDebug\commands.obj >>link.dbg
|
echo WinDebug\commands.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
|
||||||
echo WinDebug\file.obj >>link.dbg
|
echo WinDebug\file.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
|
||||||
echo WinDebug\getloadavg.obj >>link.dbg
|
echo WinDebug\getloadavg.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
|
||||||
echo WinDebug\default.obj >>link.dbg
|
echo WinDebug\default.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
|
||||||
echo WinDebug\signame.obj >>link.dbg
|
echo WinDebug\signame.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
|
||||||
echo WinDebug\expand.obj >>link.dbg
|
echo WinDebug\expand.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
|
||||||
echo WinDebug\dir.obj >>link.dbg
|
echo WinDebug\dir.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
|
||||||
echo WinDebug\main.obj >>link.dbg
|
echo WinDebug\main.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
|
||||||
echo WinDebug\getopt1.obj >>link.dbg
|
echo WinDebug\getopt1.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
|
||||||
echo WinDebug\job.obj >>link.dbg
|
echo WinDebug\job.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
|
||||||
echo WinDebug\read.obj >>link.dbg
|
echo WinDebug\read.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
|
||||||
echo WinDebug\version.obj >>link.dbg
|
echo WinDebug\version.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
|
||||||
echo WinDebug\getopt.obj >>link.dbg
|
echo WinDebug\getopt.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
|
||||||
echo WinDebug\arscan.obj >>link.dbg
|
echo WinDebug\arscan.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
|
||||||
echo WinDebug\remake.obj >>link.dbg
|
echo WinDebug\remake.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
|
||||||
echo WinDebug\misc.obj >>link.dbg
|
echo WinDebug\misc.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
|
||||||
echo WinDebug\ar.obj >>link.dbg
|
echo WinDebug\ar.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
|
||||||
echo WinDebug\function.obj >>link.dbg
|
echo WinDebug\function.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
|
||||||
echo WinDebug\vpath.obj >>link.dbg
|
echo WinDebug\vpath.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
|
||||||
echo WinDebug\implicit.obj >>link.dbg
|
echo WinDebug\implicit.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
|
||||||
echo WinDebug\dirent.obj >>link.dbg
|
echo WinDebug\dirent.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
|
||||||
echo WinDebug\glob.obj >>link.dbg
|
echo WinDebug\glob.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
|
||||||
echo WinDebug\fnmatch.obj >>link.dbg
|
echo WinDebug\fnmatch.obj >>link.dbg
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
|
||||||
echo WinDebug\pathstuff.obj >>link.dbg
|
echo WinDebug\pathstuff.obj >>link.dbg
|
||||||
echo off
|
echo off
|
||||||
echo "Linking WinDebug/%make%.exe"
|
echo "Linking WinDebug/%make%.exe"
|
||||||
@@ -73,59 +73,59 @@ if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
|
|||||||
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
|
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
|
||||||
if not exist .\WinRel\nul mkdir .\WinRel
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
echo on
|
echo on
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
|
||||||
echo WinRel\variable.obj >>link.rel
|
echo WinRel\variable.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
|
||||||
echo WinRel\rule.obj >>link.rel
|
echo WinRel\rule.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
|
||||||
echo WinRel\remote-stub.obj >>link.rel
|
echo WinRel\remote-stub.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
|
||||||
echo WinRel\commands.obj >>link.rel
|
echo WinRel\commands.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
|
||||||
echo WinRel\file.obj >>link.rel
|
echo WinRel\file.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
|
||||||
echo WinRel\getloadavg.obj >>link.rel
|
echo WinRel\getloadavg.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
|
||||||
echo WinRel\default.obj >>link.rel
|
echo WinRel\default.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
|
||||||
echo WinRel\signame.obj >>link.rel
|
echo WinRel\signame.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
|
||||||
echo WinRel\expand.obj >>link.rel
|
echo WinRel\expand.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
|
||||||
echo WinRel\dir.obj >>link.rel
|
echo WinRel\dir.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
|
||||||
echo WinRel\main.obj >>link.rel
|
echo WinRel\main.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
|
||||||
echo WinRel\getopt1.obj >>link.rel
|
echo WinRel\getopt1.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
|
||||||
echo WinRel\job.obj >>link.rel
|
echo WinRel\job.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
|
||||||
echo WinRel\read.obj >>link.rel
|
echo WinRel\read.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
|
||||||
echo WinRel\version.obj >>link.rel
|
echo WinRel\version.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
|
||||||
echo WinRel\getopt.obj >>link.rel
|
echo WinRel\getopt.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
|
||||||
echo WinRel\arscan.obj >>link.rel
|
echo WinRel\arscan.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
|
||||||
echo WinRel\remake.obj >>link.rel
|
echo WinRel\remake.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
|
||||||
echo WinRel\misc.obj >>link.rel
|
echo WinRel\misc.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
|
||||||
echo WinRel\ar.obj >>link.rel
|
echo WinRel\ar.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
|
||||||
echo WinRel\function.obj >>link.rel
|
echo WinRel\function.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
|
||||||
echo WinRel\vpath.obj >>link.rel
|
echo WinRel\vpath.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
|
||||||
echo WinRel\implicit.obj >>link.rel
|
echo WinRel\implicit.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
||||||
echo WinRel\dirent.obj >>link.rel
|
echo WinRel\dirent.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
|
||||||
echo WinRel\glob.obj >>link.rel
|
echo WinRel\glob.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
||||||
echo WinRel\fnmatch.obj >>link.rel
|
echo WinRel\fnmatch.obj >>link.rel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D _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 /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
||||||
echo WinRel\pathstuff.obj >>link.rel
|
echo WinRel\pathstuff.obj >>link.rel
|
||||||
echo off
|
echo off
|
||||||
echo "Linking WinRel/%make%.exe"
|
echo "Linking WinRel/%make%.exe"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Command processing for GNU Make.
|
/* Command processing for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
274
compatMakefile
274
compatMakefile
@@ -1,274 +0,0 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
|
||||||
# `build.sh' instead.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1988,89,91,92,93,94,95,96 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.
|
|
||||||
|
|
||||||
#
|
|
||||||
# Makefile for GNU Make
|
|
||||||
#
|
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = @srcdir@
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = @srcdir@
|
|
||||||
|
|
||||||
CC = @CC@
|
|
||||||
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
|
|
||||||
# Define these for your system as follows:
|
|
||||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
|
||||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
|
||||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
|
||||||
# Some compilers apparently accept this
|
|
||||||
# without complaint but produce losing code,
|
|
||||||
# so beware.
|
|
||||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
|
||||||
# See also `config.h'.
|
|
||||||
defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
|
||||||
|
|
||||||
# Which flavor of remote job execution support to use.
|
|
||||||
# The code is found in `remote-$(REMOTE).c'.
|
|
||||||
REMOTE = @REMOTE@
|
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
|
||||||
ALLOCA = @ALLOCA@
|
|
||||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
|
||||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
|
||||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
|
||||||
# alloca.c instead on those machines.
|
|
||||||
LOADLIBES = @LIBS@
|
|
||||||
|
|
||||||
# Any extra object files your system needs.
|
|
||||||
extras = @LIBOBJS@
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix = @prefix@
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
# Directory to install `make' in.
|
|
||||||
bindir = $(exec_prefix)/bin
|
|
||||||
# Directory to find libraries in for `-lXXX'.
|
|
||||||
libdir = $(exec_prefix)/lib
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir = $(prefix)/include
|
|
||||||
# Directory to install the Info files in.
|
|
||||||
infodir = $(prefix)/info
|
|
||||||
# Directory to install the man page in.
|
|
||||||
mandir = $(prefix)/man/man$(manext)
|
|
||||||
# Number to put on the man page filename.
|
|
||||||
manext = 1
|
|
||||||
# Prefix to put on installed `make' binary file name.
|
|
||||||
binprefix =
|
|
||||||
# Prefix to put on installed `make' man page file name.
|
|
||||||
manprefix = $(binprefix)
|
|
||||||
|
|
||||||
# Whether or not make needs to be installed setgid.
|
|
||||||
# The value should be either `true' or `false'.
|
|
||||||
# On many systems, the getloadavg function (used to implement the `-l'
|
|
||||||
# switch) will not work unless make is installed setgid kmem.
|
|
||||||
install_setgid = @NEED_SETGID@
|
|
||||||
# Install make setgid to this group so it can read /dev/kmem.
|
|
||||||
group = @KMEM_GROUP@
|
|
||||||
|
|
||||||
# Program to install `make'.
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
# Program to install the man page.
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
# Generic install program.
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
|
|
||||||
# Program to format Texinfo source into Info files.
|
|
||||||
MAKEINFO = makeinfo
|
|
||||||
# Program to format Texinfo source into DVI files.
|
|
||||||
TEXI2DVI = texi2dvi
|
|
||||||
|
|
||||||
# Programs to make tags files.
|
|
||||||
ETAGS = etags -w
|
|
||||||
CTAGS = ctags -w
|
|
||||||
|
|
||||||
GLOB = glob/libglob.a
|
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
|
||||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
|
||||||
getopt.o getopt1.o \
|
|
||||||
$(GLOB) $(ALLOCA) $(extras)
|
|
||||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
|
||||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
|
||||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
|
||||||
$(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \
|
|
||||||
$(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \
|
|
||||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
|
||||||
$(srcdir)/remote-$(REMOTE).c \
|
|
||||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
|
||||||
$(srcdir)/signame.c $(srcdir)/signame.h \
|
|
||||||
$(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h \
|
|
||||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/filedef.h \
|
|
||||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
|
||||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
|
||||||
|
|
||||||
all: make
|
|
||||||
info: make.info
|
|
||||||
dvi: make.dvi
|
|
||||||
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
|
||||||
.PHONY: all check info dvi
|
|
||||||
|
|
||||||
make.info: make.texinfo
|
|
||||||
$(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
|
|
||||||
|
|
||||||
make.dvi: make.texinfo
|
|
||||||
$(TEXI2DVI) $(srcdir)/make.texinfo
|
|
||||||
|
|
||||||
make.ps: make.dvi
|
|
||||||
dvi2ps make.dvi > make.ps
|
|
||||||
|
|
||||||
make: $(objs)
|
|
||||||
$(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
|
|
||||||
mv -f make.new make
|
|
||||||
|
|
||||||
# -I. is needed to find config.h in the build directory.
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
|
|
||||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
# For some losing Unix makes.
|
|
||||||
SHELL = /bin/sh
|
|
||||||
MAKE = make
|
|
||||||
|
|
||||||
$(GLOB): FORCE config.h
|
|
||||||
cd glob; $(MAKE) libglob.a
|
|
||||||
FORCE:
|
|
||||||
|
|
||||||
tagsrcs = $(srcs) $(srcdir)/remote-*.c
|
|
||||||
TAGS: $(tagsrcs)
|
|
||||||
$(ETAGS) $(tagsrcs)
|
|
||||||
tags: $(tagsrcs)
|
|
||||||
$(CTAGS) $(tagsrcs)
|
|
||||||
|
|
||||||
.PHONY: install installdirs
|
|
||||||
install: installdirs \
|
|
||||||
$(bindir)/$(binprefix)make $(infodir)/make.info \
|
|
||||||
$(mandir)/$(manprefix)make.$(manext)
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
|
||||||
|
|
||||||
$(bindir)/$(binprefix)make: make
|
|
||||||
$(INSTALL_PROGRAM) make $@.new
|
|
||||||
@if $(install_setgid); then \
|
|
||||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
|
||||||
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
|
||||||
else \
|
|
||||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
|
||||||
echo "otherwise the \`-l' option will probably not work."; \
|
|
||||||
echo "You may need special privileges to install $@."; \
|
|
||||||
fi; \
|
|
||||||
else true; fi
|
|
||||||
# Some systems can't deal with renaming onto a running binary.
|
|
||||||
-rm -f $@.old
|
|
||||||
-mv $@ $@.old
|
|
||||||
mv $@.new $@
|
|
||||||
|
|
||||||
$(infodir)/make.info: make.info
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
for file in $${dir}/make.info*; do \
|
|
||||||
name="`basename $$file`"; \
|
|
||||||
$(INSTALL_DATA) $$file \
|
|
||||||
`echo $@ | sed "s,make.info\$$,$$name,"`; \
|
|
||||||
done
|
|
||||||
# Run install-info only if it exists.
|
|
||||||
# Use `if' instead of just prepending `-' to the
|
|
||||||
# line so we notice real errors from install-info.
|
|
||||||
# We use `$(SHELL) -c' because some shells do not
|
|
||||||
# fail gracefully when there is an unknown command.
|
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
install-info --info-dir=$(infodir) $$dir/make.info; \
|
|
||||||
else true; fi
|
|
||||||
|
|
||||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
|
||||||
$(INSTALL_DATA) $(srcdir)/make.man $@
|
|
||||||
|
|
||||||
|
|
||||||
loadavg: loadavg.c config.h
|
|
||||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
|
||||||
loadavg.c $(LOADLIBES) -o $@
|
|
||||||
# We copy getloadavg.c into a different file rather than compiling it
|
|
||||||
# directly because some compilers clobber getloadavg.o in the process.
|
|
||||||
loadavg.c: getloadavg.c
|
|
||||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
|
||||||
cp $(srcdir)/getloadavg.c loadavg.c
|
|
||||||
check-loadavg: loadavg
|
|
||||||
@echo The system uptime program believes the load average to be:
|
|
||||||
-uptime
|
|
||||||
@echo The GNU load average checking code believes:
|
|
||||||
./loadavg
|
|
||||||
check: check-loadavg
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean realclean distclean mostlyclean
|
|
||||||
clean: glob-clean
|
|
||||||
-rm -f make loadavg *.o core make.dvi
|
|
||||||
distclean: clean glob-realclean
|
|
||||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
|
||||||
-rm -f config.log config.cache
|
|
||||||
-rm -f TAGS tags
|
|
||||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
|
||||||
-rm -f loadavg.c
|
|
||||||
realclean: distclean
|
|
||||||
-rm -f make.info*
|
|
||||||
mostlyclean: clean
|
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
|
||||||
glob-clean glob-realclean:
|
|
||||||
cd glob; $(MAKE) $@
|
|
||||||
|
|
||||||
Makefile: config.status $(srcdir)/Makefile.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
config.h: stamp-config ;
|
|
||||||
stamp-config: config.status $(srcdir)/config.h.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
touch stamp-config
|
|
||||||
|
|
||||||
#configure: configure.in aclocal.m4
|
|
||||||
# cd $(srcdir) && autoconf $(ACFLAGS)
|
|
||||||
#config.h.in: configure.in aclocal.m4
|
|
||||||
# cd $(srcdir) && autoheader $(ACFLAGS)
|
|
||||||
|
|
||||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# The automatically generated dependencies below may omit config.h
|
|
||||||
# because it is included with ``#include <config.h>'' rather than
|
|
||||||
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
|
||||||
$(objs): config.h
|
|
||||||
|
|
||||||
# Automatically generated dependencies will be put at the end of the file.
|
|
||||||
|
|
||||||
@@ -162,6 +162,12 @@
|
|||||||
/* Define vfork as fork if vfork does not work. */
|
/* Define vfork as fork if vfork does not work. */
|
||||||
#undef vfork
|
#undef vfork
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|
||||||
@@ -272,3 +278,6 @@
|
|||||||
|
|
||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
#undef HAVE_LIBSUN
|
#undef HAVE_LIBSUN
|
||||||
|
|
||||||
|
/* Define for Case Insensitve behavior */
|
||||||
|
#define HAVE_CASE_INSENSITIVE_FS
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
/* #undef NO_MINUS_C_MINUS_O */
|
/* #undef NO_MINUS_C_MINUS_O */
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
#define pid_t int
|
/* #undef pid_t */
|
||||||
|
|
||||||
/* Define if the system does not provide POSIX.1 features except
|
/* Define if the system does not provide POSIX.1 features except
|
||||||
with this defined. */
|
with this defined. */
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
/* #undef SYS_SIGLIST_DECLARED */
|
/* #undef SYS_SIGLIST_DECLARED */
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
#define uid_t int
|
/* #undef uid_t */
|
||||||
|
|
||||||
/* Define for Encore UMAX. */
|
/* Define for Encore UMAX. */
|
||||||
/* #undef UMAX */
|
/* #undef UMAX */
|
||||||
@@ -162,6 +162,12 @@
|
|||||||
instead of <sys/cpustats.h>. */
|
instead of <sys/cpustats.h>. */
|
||||||
/* #undef UMAX4_3 */
|
/* #undef UMAX4_3 */
|
||||||
|
|
||||||
|
/* 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. */
|
/* Define vfork as fork if vfork does not work. */
|
||||||
/* #undef vfork */
|
/* #undef vfork */
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
/* Define if you have alloca, as a function or macro. */
|
/* Define if you have alloca, as a function or macro. */
|
||||||
#undef HAVE_ALLOCA
|
#undef HAVE_ALLOCA
|
||||||
#define HAVE_ALLOCA
|
#define HAVE_ALLOCA 1
|
||||||
|
|
||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
#undef HAVE_ALLOCA_H
|
#undef HAVE_ALLOCA_H
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
/* Define if you support file names longer than 14 characters. */
|
/* Define if you support file names longer than 14 characters. */
|
||||||
#undef HAVE_LONG_FILE_NAMES
|
#undef HAVE_LONG_FILE_NAMES
|
||||||
#define HAVE_LONG_FILE_NAMES
|
#define HAVE_LONG_FILE_NAMES 1
|
||||||
|
|
||||||
/* Define if you have a working `mmap' system call. */
|
/* Define if you have a working `mmap' system call. */
|
||||||
#undef HAVE_MMAP
|
#undef HAVE_MMAP
|
||||||
@@ -69,15 +69,15 @@
|
|||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
/* Define if you have the strcoll function and it is properly defined. */
|
||||||
#undef HAVE_STRCOLL
|
#undef HAVE_STRCOLL
|
||||||
#define HAVE_STRCOLL
|
#define HAVE_STRCOLL 1
|
||||||
|
|
||||||
/* Define if your struct stat has st_rdev. */
|
/* Define if your struct stat has st_rdev. */
|
||||||
#undef HAVE_ST_RDEV
|
#undef HAVE_ST_RDEV
|
||||||
#define HAVE_ST_RDEV
|
#define HAVE_ST_RDEV 1
|
||||||
|
|
||||||
/* Define if you have the strftime function. */
|
/* Define if you have the strftime function. */
|
||||||
#undef HAVE_STRFTIME
|
#undef HAVE_STRFTIME
|
||||||
#define HAVE_STRFTIME
|
#define HAVE_STRFTIME 1
|
||||||
|
|
||||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
#undef HAVE_SYS_WAIT_H
|
#undef HAVE_SYS_WAIT_H
|
||||||
@@ -88,21 +88,21 @@
|
|||||||
/* Define if you don't have tm_zone but do have the external array
|
/* Define if you don't have tm_zone but do have the external array
|
||||||
tzname. */
|
tzname. */
|
||||||
#undef HAVE_TZNAME
|
#undef HAVE_TZNAME
|
||||||
#define HAVE_TZNAME
|
#define HAVE_TZNAME 1
|
||||||
|
|
||||||
/* Define if you have <unistd.h>. */
|
/* Define if you have <unistd.h>. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
#undef HAVE_UTIME_NULL
|
#undef HAVE_UTIME_NULL
|
||||||
#define HAVE_UTIME_NULL
|
#define HAVE_UTIME_NULL 1
|
||||||
|
|
||||||
/* Define if you have <vfork.h>. */
|
/* Define if you have <vfork.h>. */
|
||||||
#undef HAVE_VFORK_H
|
#undef HAVE_VFORK_H
|
||||||
|
|
||||||
/* Define if you have the vprintf function. */
|
/* Define if you have the vprintf function. */
|
||||||
#undef HAVE_VPRINTF
|
#undef HAVE_VPRINTF
|
||||||
#define HAVE_VPRINTF
|
#define HAVE_VPRINTF 1
|
||||||
|
|
||||||
/* Define if you have the wait3 system call. */
|
/* Define if you have the wait3 system call. */
|
||||||
#undef HAVE_WAIT3
|
#undef HAVE_WAIT3
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
/* Define if you need to in order for stat and other things to work. */
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
#undef _POSIX_SOURCE
|
#undef _POSIX_SOURCE
|
||||||
#define _POSIX_SOURCE
|
#define _POSIX_SOURCE 1
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
#undef RETSIGTYPE
|
#undef RETSIGTYPE
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
/* Define if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
#define STDC_HEADERS
|
#define STDC_HEADERS 1
|
||||||
|
|
||||||
/* Define on System V Release 4. */
|
/* Define on System V Release 4. */
|
||||||
#undef SVR4
|
#undef SVR4
|
||||||
@@ -176,6 +176,12 @@
|
|||||||
/* Define vfork as fork if vfork does not work. */
|
/* Define vfork as fork if vfork does not work. */
|
||||||
#undef vfork
|
#undef vfork
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#undef SCCS_GET
|
#undef SCCS_GET
|
||||||
#define SCCS_GET "echo no sccs get"
|
#define SCCS_GET "echo no sccs get"
|
||||||
@@ -194,18 +200,18 @@
|
|||||||
|
|
||||||
/* Define if you have the dup2 function. */
|
/* Define if you have the dup2 function. */
|
||||||
#undef HAVE_DUP2
|
#undef HAVE_DUP2
|
||||||
#define HAVE_DUP2
|
#define HAVE_DUP2 1
|
||||||
|
|
||||||
/* Define if you have the getcwd function. */
|
/* Define if you have the getcwd function. */
|
||||||
#undef HAVE_GETCWD
|
#undef HAVE_GETCWD
|
||||||
#define HAVE_GETCWD
|
#define HAVE_GETCWD 1
|
||||||
|
|
||||||
/* Define if you have the getgroups function. */
|
/* Define if you have the getgroups function. */
|
||||||
#undef HAVE_GETGROUPS
|
#undef HAVE_GETGROUPS
|
||||||
|
|
||||||
/* Define if you have the mktemp function. */
|
/* Define if you have the mktemp function. */
|
||||||
#undef HAVE_MKTEMP
|
#undef HAVE_MKTEMP
|
||||||
#define HAVE_MKTEMP
|
#define HAVE_MKTEMP 1
|
||||||
|
|
||||||
/* Define if you have the psignal function. */
|
/* Define if you have the psignal function. */
|
||||||
#undef HAVE_PSIGNAL
|
#undef HAVE_PSIGNAL
|
||||||
@@ -230,7 +236,7 @@
|
|||||||
|
|
||||||
/* Define if you have the strerror function. */
|
/* Define if you have the strerror function. */
|
||||||
#undef HAVE_STRERROR
|
#undef HAVE_STRERROR
|
||||||
#define HAVE_STRERROR
|
#define HAVE_STRERROR 1
|
||||||
|
|
||||||
/* Define if you have the strsignal function. */
|
/* Define if you have the strsignal function. */
|
||||||
#undef HAVE_STRSIGNAL
|
#undef HAVE_STRSIGNAL
|
||||||
@@ -243,29 +249,29 @@
|
|||||||
|
|
||||||
/* Define if you have the <dirent.h> header file. */
|
/* Define if you have the <dirent.h> header file. */
|
||||||
#undef HAVE_DIRENT_H
|
#undef HAVE_DIRENT_H
|
||||||
#define HAVE_DIRENT_H
|
#define HAVE_DIRENT_H 1
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
#undef HAVE_FCNTL_H
|
#undef HAVE_FCNTL_H
|
||||||
#define HAVE_FCNTL_H
|
#define HAVE_FCNTL_H 1
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
/* Define if you have the <limits.h> header file. */
|
||||||
#undef HAVE_LIMITS_H
|
#undef HAVE_LIMITS_H
|
||||||
#define HAVE_LIMITS_H
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
/* Define if you have the <mach/mach.h> header file. */
|
/* Define if you have the <mach/mach.h> header file. */
|
||||||
#undef HAVE_MACH_MACH_H
|
#undef HAVE_MACH_MACH_H
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#undef HAVE_MEMORY_H
|
#undef HAVE_MEMORY_H
|
||||||
#define HAVE_MEMORY_H
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
/* Define if you have the <ndir.h> header file. */
|
/* Define if you have the <ndir.h> header file. */
|
||||||
#undef HAVE_NDIR_H
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
/* Define if you have the <string.h> header file. */
|
||||||
#undef HAVE_STRING_H
|
#undef HAVE_STRING_H
|
||||||
#define HAVE_STRING_H
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
/* Define if you have the <sys/dir.h> header file. */
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
#undef HAVE_SYS_DIR_H
|
#undef HAVE_SYS_DIR_H
|
||||||
@@ -278,7 +284,7 @@
|
|||||||
|
|
||||||
/* Define if you have the <sys/timeb.h> header file. */
|
/* Define if you have the <sys/timeb.h> header file. */
|
||||||
#undef HAVE_SYS_TIMEB_H
|
#undef HAVE_SYS_TIMEB_H
|
||||||
#define HAVE_SYS_TIMEB_H
|
#define HAVE_SYS_TIMEB_H 1
|
||||||
|
|
||||||
/* Define if you have the <sys/wait.h> header file. */
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
#undef HAVE_SYS_WAIT_H
|
#undef HAVE_SYS_WAIT_H
|
||||||
@@ -291,3 +297,22 @@
|
|||||||
|
|
||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
#undef HAVE_LIBSUN
|
#undef HAVE_LIBSUN
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Refer to README.W32 for info on the following settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Define if you have the Cygnus GNU WIN32 tool set or a shell
|
||||||
|
that does not grok 'sh -c quoted-command-line' correctly.
|
||||||
|
*/
|
||||||
|
#undef BATCH_MODE_ONLY_SHELL
|
||||||
|
|
||||||
|
/*
|
||||||
|
Define if you have the MKS tool set or shell. Do NOT define
|
||||||
|
BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
|
||||||
|
*/
|
||||||
|
#undef HAVE_MKS_SHELL
|
||||||
|
|
||||||
|
/* Define if you prefer Case Insensitve behavior */
|
||||||
|
#undef HAVE_CASE_INSENSITIVE_FS
|
||||||
|
|||||||
276
config.h.in
276
config.h.in
@@ -1,276 +0,0 @@
|
|||||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define if on AIX 3.
|
|
||||||
System headers sometimes define this.
|
|
||||||
We just want to avoid a redefinition error message. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
#undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define if using alloca.c. */
|
|
||||||
#undef C_ALLOCA
|
|
||||||
|
|
||||||
/* Define to empty if the keyword does not work. */
|
|
||||||
#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
|
|
||||||
|
|
||||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
|
||||||
#undef DGUX
|
|
||||||
|
|
||||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
|
||||||
#undef GETLOADAVG_PRIVILEGED
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef gid_t
|
|
||||||
|
|
||||||
/* Define if you have alloca, as a function or macro. */
|
|
||||||
#undef HAVE_ALLOCA
|
|
||||||
|
|
||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
|
||||||
#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
|
|
||||||
|
|
||||||
/* Define if you have the getmntent function. */
|
|
||||||
#undef HAVE_GETMNTENT
|
|
||||||
|
|
||||||
/* Define if the `long double' type works. */
|
|
||||||
#undef HAVE_LONG_DOUBLE
|
|
||||||
|
|
||||||
/* Define if you support file names longer than 14 characters. */
|
|
||||||
#undef HAVE_LONG_FILE_NAMES
|
|
||||||
|
|
||||||
/* Define if you have a working `mmap' system call. */
|
|
||||||
#undef HAVE_MMAP
|
|
||||||
|
|
||||||
/* Define if system calls automatically restart after interruption
|
|
||||||
by a signal. */
|
|
||||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
|
||||||
|
|
||||||
/* Define if your struct stat has st_blksize. */
|
|
||||||
#undef HAVE_ST_BLKSIZE
|
|
||||||
|
|
||||||
/* Define if your struct stat has st_blocks. */
|
|
||||||
#undef HAVE_ST_BLOCKS
|
|
||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
|
||||||
#undef HAVE_STRCOLL
|
|
||||||
|
|
||||||
/* Define if your struct stat has 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
|
|
||||||
|
|
||||||
/* Define if your struct tm has tm_zone. */
|
|
||||||
#undef HAVE_TM_ZONE
|
|
||||||
|
|
||||||
/* Define if you don't have tm_zone but do have the external array
|
|
||||||
tzname. */
|
|
||||||
#undef HAVE_TZNAME
|
|
||||||
|
|
||||||
/* Define if you have <unistd.h>. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
|
||||||
#undef HAVE_UTIME_NULL
|
|
||||||
|
|
||||||
/* Define if you have <vfork.h>. */
|
|
||||||
#undef HAVE_VFORK_H
|
|
||||||
|
|
||||||
/* Define if you have the vprintf function. */
|
|
||||||
#undef HAVE_VPRINTF
|
|
||||||
|
|
||||||
/* Define if you have the wait3 system call. */
|
|
||||||
#undef HAVE_WAIT3
|
|
||||||
|
|
||||||
/* Define if on MINIX. */
|
|
||||||
#undef _MINIX
|
|
||||||
|
|
||||||
/* Define if your struct nlist has an n_un member. */
|
|
||||||
#undef NLIST_NAME_UNION
|
|
||||||
|
|
||||||
/* Define if you have <nlist.h>. */
|
|
||||||
#undef NLIST_STRUCT
|
|
||||||
|
|
||||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
|
||||||
#undef NO_MINUS_C_MINUS_O
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef pid_t
|
|
||||||
|
|
||||||
/* Define if the system does not provide POSIX.1 features except
|
|
||||||
with this defined. */
|
|
||||||
#undef _POSIX_1_SOURCE
|
|
||||||
|
|
||||||
/* Define if you need to in order for stat and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#undef RETSIGTYPE
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* If using the C implementation of alloca, define if you know the
|
|
||||||
direction of stack growth for your system; otherwise it will be
|
|
||||||
automatically deduced at run-time.
|
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown
|
|
||||||
*/
|
|
||||||
#undef STACK_DIRECTION
|
|
||||||
|
|
||||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
|
||||||
#undef STAT_MACROS_BROKEN
|
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Define on System V Release 4. */
|
|
||||||
#undef SVR4
|
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
|
||||||
#undef SYS_SIGLIST_DECLARED
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef uid_t
|
|
||||||
|
|
||||||
/* Define for Encore UMAX. */
|
|
||||||
#undef UMAX
|
|
||||||
|
|
||||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
|
||||||
instead of <sys/cpustats.h>. */
|
|
||||||
#undef UMAX4_3
|
|
||||||
|
|
||||||
/* Define vfork as fork if vfork does not work. */
|
|
||||||
#undef vfork
|
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
|
||||||
#undef SCCS_GET
|
|
||||||
|
|
||||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
|
||||||
#undef SCCS_GET_MINUS_G
|
|
||||||
|
|
||||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
|
||||||
#undef HAVE_SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
|
||||||
#undef HAVE__SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
|
||||||
#undef HAVE_UNION_WAIT
|
|
||||||
|
|
||||||
/* Define if you have the dup2 function. */
|
|
||||||
#undef HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have the getcwd function. */
|
|
||||||
#undef HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have the getgroups function. */
|
|
||||||
#undef HAVE_GETGROUPS
|
|
||||||
|
|
||||||
/* Define if you have the getloadavg function. */
|
|
||||||
#undef HAVE_GETLOADAVG
|
|
||||||
|
|
||||||
/* Define if you have the memmove function. */
|
|
||||||
#undef HAVE_MEMMOVE
|
|
||||||
|
|
||||||
/* Define if you have the mktemp function. */
|
|
||||||
#undef HAVE_MKTEMP
|
|
||||||
|
|
||||||
/* Define if you have the psignal function. */
|
|
||||||
#undef HAVE_PSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have the setegid function. */
|
|
||||||
#undef HAVE_SETEGID
|
|
||||||
|
|
||||||
/* Define if you have the seteuid function. */
|
|
||||||
#undef HAVE_SETEUID
|
|
||||||
|
|
||||||
/* Define if you have the setlinebuf function. */
|
|
||||||
#undef HAVE_SETLINEBUF
|
|
||||||
|
|
||||||
/* Define if you have the setregid function. */
|
|
||||||
#undef HAVE_SETREGID
|
|
||||||
|
|
||||||
/* Define if you have the setreuid function. */
|
|
||||||
#undef HAVE_SETREUID
|
|
||||||
|
|
||||||
/* Define if you have the sigsetmask function. */
|
|
||||||
#undef HAVE_SIGSETMASK
|
|
||||||
|
|
||||||
/* Define if you have the strerror function. */
|
|
||||||
#undef HAVE_STRERROR
|
|
||||||
|
|
||||||
/* Define if you have the strsignal function. */
|
|
||||||
#undef HAVE_STRSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have the wait3 function. */
|
|
||||||
#undef HAVE_WAIT3
|
|
||||||
|
|
||||||
/* Define if you have the waitpid function. */
|
|
||||||
#undef HAVE_WAITPID
|
|
||||||
|
|
||||||
/* Define if you have the <dirent.h> header file. */
|
|
||||||
#undef HAVE_DIRENT_H
|
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
|
||||||
#undef HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#undef HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define if you have the <mach/mach.h> header file. */
|
|
||||||
#undef HAVE_MACH_MACH_H
|
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define if you have the <ndir.h> header file. */
|
|
||||||
#undef HAVE_NDIR_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/dir.h> header file. */
|
|
||||||
#undef HAVE_SYS_DIR_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/ndir.h> header file. */
|
|
||||||
#undef HAVE_SYS_NDIR_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
|
||||||
#undef HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/timeb.h> header file. */
|
|
||||||
#undef HAVE_SYS_TIMEB_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/wait.h> header file. */
|
|
||||||
#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
|
|
||||||
@@ -1,80 +1,24 @@
|
|||||||
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
||||||
|
|
||||||
#define INCLUDEDIR "c:/djgpp/include"
|
/* Many things are defined already by a system header. */
|
||||||
#define LIBDIR "c:/djgpp/lib"
|
#include <sys/config.h>
|
||||||
|
|
||||||
/* Define if you have dirent.h. */
|
/* Name of this package (needed by automake) */
|
||||||
#define HAVE_DIRENT_H
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
/* Version of this package (needed by automake) */
|
||||||
#define HAVE_STRCOLL
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define if you have unistd.h. */
|
|
||||||
#define HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
|
||||||
#ifndef STDC_HEADERS
|
|
||||||
#define STDC_HEADERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
|
||||||
#undef SYS_SIGLIST_DECLARED
|
|
||||||
|
|
||||||
/* Define if you have sys_siglist. */
|
|
||||||
#undef HAVE_SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define if you have _sys_siglist. */
|
|
||||||
#undef HAVE__SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define if you have psignal. */
|
|
||||||
#define HAVE_PSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have strsignal. */
|
|
||||||
#undef HAVE_STRSIGNAL
|
|
||||||
|
|
||||||
/* Define NSIG. */
|
/* Define NSIG. */
|
||||||
#define NSIG SIGMAX
|
#define NSIG SIGMAX
|
||||||
|
|
||||||
/* Define if you have getdtablesize. */
|
|
||||||
#define HAVE_GETDTABLESIZE
|
|
||||||
|
|
||||||
/* Define if you have dup2. */
|
|
||||||
#define HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have getcwd. */
|
|
||||||
#define HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have sigsetmask. */
|
/* Define if you have sigsetmask. */
|
||||||
#define HAVE_SIGSETMASK
|
#define HAVE_SIGSETMASK 1
|
||||||
|
|
||||||
/* Define if you have setlinebuf. */
|
|
||||||
#define HAVE_SETLINEBUF
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#define HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
|
||||||
#undef HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
|
||||||
#define HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
/* Define if you have the memmove function. */
|
/* Define if you have the memmove function. */
|
||||||
#define HAVE_MEMMOVE
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
/* Define if you have the `strerror' function. */
|
|
||||||
#define HAVE_STRERROR
|
|
||||||
|
|
||||||
/* Define if you have the <sys/wait.h> header file. */
|
|
||||||
#define HAVE_SYS_WAIT_H
|
|
||||||
|
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Configuring MAKE for DJGPP
|
echo Configuring MAKE for DJGPP
|
||||||
rem This batch file assumes a unix-type "sed" program
|
|
||||||
|
|
||||||
update configh.dos config.h
|
rem The SmallEnv trick protects against too small environment block,
|
||||||
|
rem in which case the values will be truncated and the whole thing
|
||||||
|
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
||||||
|
rem many people don't care, so we force them to care by refusing to go.
|
||||||
|
|
||||||
|
rem Where is the srcdir?
|
||||||
|
set XSRC=.
|
||||||
|
if not "%XSRC%"=="." goto SmallEnv
|
||||||
|
if "%1%"=="" goto SrcDone
|
||||||
|
set XSRC=%1
|
||||||
|
if not "%XSRC%"=="%1" goto SmallEnv
|
||||||
|
|
||||||
|
:SrcDone
|
||||||
|
|
||||||
|
update %XSRC%/configh.dos ./config.h
|
||||||
|
|
||||||
rem Do they have Make?
|
rem Do they have Make?
|
||||||
redir -o junk.$$$ -eo make -n -f NUL
|
redir -o junk.$$$ -eo make -n -f NUL
|
||||||
@@ -15,69 +28,17 @@ if exist junk.$$$ del junk.$$$
|
|||||||
echo No Make program found--use DOSBUILD.BAT to build Make.
|
echo No Make program found--use DOSBUILD.BAT to build Make.
|
||||||
goto End
|
goto End
|
||||||
|
|
||||||
rem They do have Make. Generate Makefiles.
|
rem They do have Make. Generate the Makefile.
|
||||||
|
|
||||||
:MakeOk
|
:MakeOk
|
||||||
del junk.$$$
|
del junk.$$$
|
||||||
echo # Makefile generated for DJGPP by "configure.bat"> Makefile
|
update %XSRC%/Makefile.DOS ./Makefile
|
||||||
|
echo Done.
|
||||||
if exist config.sed del config.sed
|
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
|
||||||
|
|
||||||
echo ": try_sl ">> config.sed
|
|
||||||
echo "/\\$/ { ">> config.sed
|
|
||||||
echo " N ">> config.sed
|
|
||||||
echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
|
|
||||||
echo " b try_sl ">> config.sed
|
|
||||||
echo "} ">> config.sed
|
|
||||||
|
|
||||||
echo "s/@srcdir@/./ ">> config.sed
|
|
||||||
echo "s/@exec_prefix@/$(DJDIR)/ ">> config.sed
|
|
||||||
echo "s/@prefix@/$(DJDIR)/ ">> config.sed
|
|
||||||
echo "s/@CC@/gcc/ ">> config.sed
|
|
||||||
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
|
||||||
if "%1"=="no-float" goto nofloat
|
|
||||||
if "%1"=="NO-FLOAT" goto nofloat
|
|
||||||
if "%1"=="NO_FLOAT" goto nofloat
|
|
||||||
if "%1"=="no_float" goto nofloat
|
|
||||||
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
|
|
||||||
goto floatdone
|
|
||||||
:nofloat
|
|
||||||
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -DNO_FLOAT/ ">> config.sed
|
|
||||||
:floatdone
|
|
||||||
echo "s/@LDFLAGS@// ">> config.sed
|
|
||||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
|
||||||
echo "s/@DEFS@// ">> config.sed
|
|
||||||
echo "s/@REMOTE@/stub/ ">> config.sed
|
|
||||||
echo "s/@ALLOCA@// ">> config.sed
|
|
||||||
echo "s/@LIBS@// ">> config.sed
|
|
||||||
echo "s/@LIBOBJS@// ">> config.sed
|
|
||||||
echo "s/@SET_MAKE@// ">> config.sed
|
|
||||||
echo "s/@NEED_SETGID@/false/ ">> config.sed
|
|
||||||
echo "s/@INSTALL_PROGRAM@/install/ ">> config.sed
|
|
||||||
echo "s/@INSTALL_DATA@/install -m 644/ ">> config.sed
|
|
||||||
echo "s/@INSTALL@/install/ ">> config.sed
|
|
||||||
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
|
||||||
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
|
||||||
echo "s/^defines *=.*$/defines =/ ">> config.sed
|
|
||||||
echo "/mv -f make.new make/d ">> config.sed
|
|
||||||
|
|
||||||
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
|
|
||||||
|
|
||||||
echo "/^tagsrcs *=/s/\$(srcs)/$(srcs:.h.in=.h)/ ">> config.sed
|
|
||||||
|
|
||||||
echo "s/\*.o/*.o *.exe make.new/ ">> config.sed
|
|
||||||
echo "s/\.info\*/.i*/g ">> config.sed
|
|
||||||
|
|
||||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
|
||||||
if exist config2.sed goto SedOk
|
|
||||||
echo To configure Make you need a Unix-style Sed program!
|
|
||||||
goto End
|
goto End
|
||||||
:SedOk
|
|
||||||
sed -f config2.sed Makefile.in >> Makefile
|
|
||||||
del config.sed
|
|
||||||
del config2.sed
|
|
||||||
|
|
||||||
cd glob
|
:SmallEnv
|
||||||
call configure
|
echo Your environment is too small. Please enlarge it and run me again.
|
||||||
cd ..
|
|
||||||
:End
|
:End
|
||||||
|
set XRSC=
|
||||||
|
|||||||
67
configure.in
67
configure.in
@@ -1,17 +1,30 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_REVISION([$Id$])
|
AC_REVISION([$Id$])
|
||||||
AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
|
AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required.
|
||||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||||
AC_CONFIG_HEADER(config.h)
|
|
||||||
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
|
AM_INIT_AUTOMAKE(make, 3.77)
|
||||||
|
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_MAKE_SET
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_CPP dnl Later checks need this.
|
AC_PROG_CPP dnl Later checks need this.
|
||||||
|
dnl AC_ARG_PROGRAM -- implied by AM_INIT_AUTOMAKE; gives errors if run twice.
|
||||||
AC_AIX
|
AC_AIX
|
||||||
AC_ISC_POSIX
|
AC_ISC_POSIX
|
||||||
AC_MINIX
|
AC_MINIX
|
||||||
|
|
||||||
|
dnl This test must come as early as possible after the compiler configuration
|
||||||
|
dnl tests, because the choice of the file model can (in principle) affect
|
||||||
|
dnl whether functions and headers are available, whether they work, etc.
|
||||||
|
AC_LFS
|
||||||
|
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_TYPE_UID_T dnl Also does gid_t.
|
AC_TYPE_UID_T dnl Also does gid_t.
|
||||||
@@ -38,7 +51,7 @@ changequote([,])dnl
|
|||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||||
|
|
||||||
AC_CHECK_FUNCS(memmove psignal mktemp \
|
AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
|
||||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||||
seteuid setegid setreuid setregid strerror strsignal)
|
seteuid setegid setreuid setregid strerror strsignal)
|
||||||
AC_CHECK_SYMBOL(sys_siglist)
|
AC_CHECK_SYMBOL(sys_siglist)
|
||||||
@@ -84,8 +97,25 @@ AC_DECL_SYS_SIGLIST
|
|||||||
AC_CHECK_LIB(sun, getpwnam)
|
AC_CHECK_LIB(sun, getpwnam)
|
||||||
|
|
||||||
AC_SUBST(REMOTE) REMOTE=stub
|
AC_SUBST(REMOTE) REMOTE=stub
|
||||||
AC_ARG_WITH(customs, [export jobs with the Customs daemon (NOT SUPPORTED)],
|
make_try_customs=no
|
||||||
[REMOTE=cstms LIBS="$LIBS libcustoms.a"])
|
AC_ARG_WITH(customs,
|
||||||
|
[ --with-customs=DIR Enable remote jobs via Customs--see README.customs],
|
||||||
|
[case "$withval" in
|
||||||
|
n|no) ;;
|
||||||
|
*) make_cppflags="$CPPFLAGS"
|
||||||
|
case "$withval" in
|
||||||
|
y|ye|yes) ;;
|
||||||
|
*) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
|
||||||
|
make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
|
||||||
|
esac
|
||||||
|
CF_NETLIBS
|
||||||
|
AC_CHECK_HEADER(customs.h,
|
||||||
|
REMOTE=cstms
|
||||||
|
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
|
||||||
|
with_customs=no
|
||||||
|
CPPFLAGS="$make_cppflags" make_badcust=yes)
|
||||||
|
;;
|
||||||
|
esac])
|
||||||
|
|
||||||
echo checking for location of SCCS get command
|
echo checking for location of SCCS get command
|
||||||
if test -f /usr/sccs/get; then
|
if test -f /usr/sccs/get; then
|
||||||
@@ -107,10 +137,27 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
|
|||||||
fi
|
fi
|
||||||
rm -f s.conftest conftoast
|
rm -f s.conftest conftoast
|
||||||
|
|
||||||
AC_OUTPUT(Makefile build.sh, [
|
AC_OUTPUT(Makefile build.sh)
|
||||||
# Makefile uses this timestamp file to know when to remake Makefile,
|
|
||||||
# build.sh, and glob/Makefile.
|
case "$make_badcust" in
|
||||||
touch stamp-config])
|
yes) echo
|
||||||
|
echo "WARNING: --with-customs specified but no customs.h could be found;"
|
||||||
|
echo " disabling Customs support."
|
||||||
|
echo ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$with_customs" in
|
||||||
|
""|n|no|y|ye|yes) ;;
|
||||||
|
*) if test -f "$with_customs/lib/libcustoms.a"; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "WARNING: \`$with_customs/lib' does not appear to contain the"
|
||||||
|
echo " Customs library. You must build and install Customs"
|
||||||
|
echo " before compiling GNU make."
|
||||||
|
echo
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
|
||||||
dnl Local Variables:
|
dnl Local Variables:
|
||||||
dnl comment-start: "dnl "
|
dnl comment-start: "dnl "
|
||||||
|
|||||||
10
default.c
10
default.c
@@ -41,7 +41,7 @@ static char default_suffixes[]
|
|||||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||||
.w .ch .cweb .web .com .sh .elc .el";
|
.w .ch .cweb .web .com .sh .elc .el";
|
||||||
#else
|
#else
|
||||||
= ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \
|
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
|
||||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||||
.w .ch .web .sh .elc .el";
|
.w .ch .web .sh .elc .el";
|
||||||
#endif
|
#endif
|
||||||
@@ -91,6 +91,8 @@ static struct pspec default_terminal_rules[] =
|
|||||||
"$(CHECKOUT,v)" },
|
"$(CHECKOUT,v)" },
|
||||||
{ "%", "RCS/%,v",
|
{ "%", "RCS/%,v",
|
||||||
"$(CHECKOUT,v)" },
|
"$(CHECKOUT,v)" },
|
||||||
|
{ "%", "RCS/%",
|
||||||
|
"$(CHECKOUT,v)" },
|
||||||
|
|
||||||
/* SCCS. */
|
/* SCCS. */
|
||||||
{ "%", "s.%",
|
{ "%", "s.%",
|
||||||
@@ -156,6 +158,8 @@ static char *default_suffix_rules[] =
|
|||||||
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".C",
|
".C",
|
||||||
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
|
".cpp",
|
||||||
|
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".f",
|
".f",
|
||||||
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".p",
|
".p",
|
||||||
@@ -183,6 +187,8 @@ static char *default_suffix_rules[] =
|
|||||||
"$(COMPILE.cc) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.cc) $< $(OUTPUT_OPTION)",
|
||||||
".C.o",
|
".C.o",
|
||||||
"$(COMPILE.C) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.C) $< $(OUTPUT_OPTION)",
|
||||||
|
".cpp.o",
|
||||||
|
"$(COMPILE.cpp) $< $(OUTPUT_OPTION)",
|
||||||
".f.o",
|
".f.o",
|
||||||
"$(COMPILE.f) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.f) $< $(OUTPUT_OPTION)",
|
||||||
".p.o",
|
".p.o",
|
||||||
@@ -386,8 +392,10 @@ static char *default_variables[] =
|
|||||||
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
||||||
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||||
"COMPILE.C", "$(COMPILE.cc)",
|
"COMPILE.C", "$(COMPILE.cc)",
|
||||||
|
"COMPILE.cpp", "$(COMPILE.cc)",
|
||||||
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
||||||
"LINK.C", "$(LINK.cc)",
|
"LINK.C", "$(LINK.cc)",
|
||||||
|
"LINK.cpp", "$(LINK.cc)",
|
||||||
"YACC.y", "$(YACC) $(YFLAGS)",
|
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||||
"LEX.l", "$(LEX) $(LFLAGS) -t",
|
"LEX.l", "$(LEX) $(LFLAGS) -t",
|
||||||
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
|
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
|
||||||
|
|||||||
91
dir.c
91
dir.c
@@ -1,5 +1,5 @@
|
|||||||
/* Directory hashing for GNU Make.
|
/* Directory hashing for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -111,19 +111,25 @@ dosify (filename)
|
|||||||
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
static char *
|
static char *
|
||||||
amigafy (filename)
|
downcase (filename)
|
||||||
char *filename;
|
char *filename;
|
||||||
{
|
{
|
||||||
static char amiga_filename[136];
|
#ifdef _AMIGA
|
||||||
|
static char new_filename[136];
|
||||||
|
#else
|
||||||
|
static char new_filename[PATH_MAX];
|
||||||
|
#endif
|
||||||
char *df;
|
char *df;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (filename == 0)
|
if (filename == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
df = amiga_filename;
|
df = new_filename;
|
||||||
|
|
||||||
/* First, transform the name part. */
|
/* First, transform the name part. */
|
||||||
for (i = 0; *filename != '\0'; ++i)
|
for (i = 0; *filename != '\0'; ++i)
|
||||||
@@ -134,9 +140,9 @@ amigafy (filename)
|
|||||||
|
|
||||||
*df = 0;
|
*df = 0;
|
||||||
|
|
||||||
return amiga_filename;
|
return new_filename;
|
||||||
}
|
}
|
||||||
#endif /* _AMIGA */
|
#endif /* HAVE_CASE_INSENSITIVE_FS */
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
|
|
||||||
@@ -179,13 +185,16 @@ vmsstat_dir (name, st)
|
|||||||
{
|
{
|
||||||
*s++ = 0;
|
*s++ = 0;
|
||||||
st->st_dev = (char *)vms_hash (name);
|
st->st_dev = (char *)vms_hash (name);
|
||||||
|
h = vms_hash (s);
|
||||||
|
*(s-1) = ':';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
st->st_dev = 0;
|
st->st_dev = 0;
|
||||||
s = name;
|
s = name;
|
||||||
}
|
|
||||||
h = vms_hash (s);
|
h = vms_hash (s);
|
||||||
|
}
|
||||||
|
|
||||||
st->st_ino[0] = h & 0xff;
|
st->st_ino[0] = h & 0xff;
|
||||||
st->st_ino[1] = h & 0xff00;
|
st->st_ino[1] = h & 0xff00;
|
||||||
st->st_ino[2] = h >> 16;
|
st->st_ino[2] = h >> 16;
|
||||||
@@ -352,7 +361,7 @@ find_directory (name)
|
|||||||
|
|
||||||
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
if (!strcmp(dc->path_key, w32_path))
|
if (strieq(dc->path_key, w32_path))
|
||||||
#else
|
#else
|
||||||
if (dc->dev == st.st_dev
|
if (dc->dev == st.st_dev
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
@@ -465,8 +474,8 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
filename = dosify (filename);
|
filename = dosify (filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _AMIGA
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
filename = amigafy (filename);
|
filename = downcase (filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
@@ -610,6 +619,7 @@ file_exists_p (name)
|
|||||||
{
|
{
|
||||||
char *dirend;
|
char *dirend;
|
||||||
char *dirname;
|
char *dirname;
|
||||||
|
char *slash;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (ar_name (name))
|
if (ar_name (name))
|
||||||
@@ -629,8 +639,9 @@ file_exists_p (name)
|
|||||||
char *bslash = rindex(name, '\\');
|
char *bslash = rindex(name, '\\');
|
||||||
if (!dirend || bslash > dirend)
|
if (!dirend || bslash > dirend)
|
||||||
dirend = bslash;
|
dirend = bslash;
|
||||||
/* The case of "d:file" is unhandled. But I don't think
|
/* The case of "d:file". */
|
||||||
such names can happen here. */
|
if (!dirend && name[0] && name[1] == ':')
|
||||||
|
dirend = name + 1;
|
||||||
}
|
}
|
||||||
#endif /* WINDOWS32 || __MSDOS__ */
|
#endif /* WINDOWS32 || __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
@@ -641,15 +652,22 @@ file_exists_p (name)
|
|||||||
#endif /* AMIGA */
|
#endif /* AMIGA */
|
||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
|
|
||||||
|
slash = dirend;
|
||||||
if (dirend == name)
|
if (dirend == name)
|
||||||
dirname = "/";
|
dirname = "/";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* d:/ and d: are *very* different... */
|
||||||
|
if (dirend < name + 3 && name[1] == ':' &&
|
||||||
|
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||||
|
dirend++;
|
||||||
|
#endif
|
||||||
dirname = (char *) alloca (dirend - name + 1);
|
dirname = (char *) alloca (dirend - name + 1);
|
||||||
bcopy (name, dirname, dirend - name);
|
bcopy (name, dirname, dirend - name);
|
||||||
dirname[dirend - name] = '\0';
|
dirname[dirend - name] = '\0';
|
||||||
}
|
}
|
||||||
return dir_file_exists_p (dirname, dirend + 1);
|
return dir_file_exists_p (dirname, slash + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark FILENAME as `impossible' for `file_impossible_p'.
|
/* Mark FILENAME as `impossible' for `file_impossible_p'.
|
||||||
@@ -679,8 +697,9 @@ file_impossible (filename)
|
|||||||
char *bslash = rindex(p, '\\');
|
char *bslash = rindex(p, '\\');
|
||||||
if (!dirend || bslash > dirend)
|
if (!dirend || bslash > dirend)
|
||||||
dirend = bslash;
|
dirend = bslash;
|
||||||
/* The case of "d:file" is unhandled. But I don't think
|
/* The case of "d:file". */
|
||||||
such names can happen here. */
|
if (!dirend && p[0] && p[1] == ':')
|
||||||
|
dirend = p + 1;
|
||||||
}
|
}
|
||||||
#endif /* WINDOWS32 or __MSDOS__ */
|
#endif /* WINDOWS32 or __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
@@ -693,16 +712,23 @@ file_impossible (filename)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname;
|
char *dirname;
|
||||||
|
char *slash = dirend;
|
||||||
if (dirend == p)
|
if (dirend == p)
|
||||||
dirname = "/";
|
dirname = "/";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* d:/ and d: are *very* different... */
|
||||||
|
if (dirend < p + 3 && p[1] == ':' &&
|
||||||
|
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||||
|
dirend++;
|
||||||
|
#endif
|
||||||
dirname = (char *) alloca (dirend - p + 1);
|
dirname = (char *) alloca (dirend - p + 1);
|
||||||
bcopy (p, dirname, dirend - p);
|
bcopy (p, dirname, dirend - p);
|
||||||
dirname[dirend - p] = '\0';
|
dirname[dirend - p] = '\0';
|
||||||
}
|
}
|
||||||
dir = find_directory (dirname);
|
dir = find_directory (dirname);
|
||||||
filename = p = dirend + 1;
|
filename = p = slash + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (hash = 0; *p != '\0'; ++p)
|
for (hash = 0; *p != '\0'; ++p)
|
||||||
@@ -773,8 +799,9 @@ file_impossible_p (filename)
|
|||||||
char *bslash = rindex(filename, '\\');
|
char *bslash = rindex(filename, '\\');
|
||||||
if (!dirend || bslash > dirend)
|
if (!dirend || bslash > dirend)
|
||||||
dirend = bslash;
|
dirend = bslash;
|
||||||
/* The case of "d:file" is unhandled. But I don't think
|
/* The case of "d:file". */
|
||||||
such names can happen here. */
|
if (!dirend && filename[0] && filename[1] == ':')
|
||||||
|
dirend = filename + 1;
|
||||||
}
|
}
|
||||||
#endif /* WINDOWS32 || __MSDOS__ */
|
#endif /* WINDOWS32 || __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
@@ -787,16 +814,23 @@ file_impossible_p (filename)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname;
|
char *dirname;
|
||||||
|
char *slash = dirend;
|
||||||
if (dirend == filename)
|
if (dirend == filename)
|
||||||
dirname = "/";
|
dirname = "/";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* d:/ and d: are *very* different... */
|
||||||
|
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||||
|
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||||
|
dirend++;
|
||||||
|
#endif
|
||||||
dirname = (char *) alloca (dirend - filename + 1);
|
dirname = (char *) alloca (dirend - filename + 1);
|
||||||
bcopy (p, dirname, dirend - p);
|
bcopy (p, dirname, dirend - p);
|
||||||
dirname[dirend - p] = '\0';
|
dirname[dirend - p] = '\0';
|
||||||
}
|
}
|
||||||
dir = find_directory (dirname)->contents;
|
dir = find_directory (dirname)->contents;
|
||||||
p = filename = dirend + 1;
|
p = filename = slash + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir == 0 || dir->files == 0)
|
if (dir == 0 || dir->files == 0)
|
||||||
@@ -806,8 +840,8 @@ file_impossible_p (filename)
|
|||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
p = filename = dosify (p);
|
p = filename = dosify (p);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _AMIGA
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
p = filename = amigafy (p);
|
p = filename = downcase (p);
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
p = filename = vmsify (p, 1);
|
p = filename = vmsify (p, 1);
|
||||||
@@ -888,8 +922,9 @@ print_dir_data_base ()
|
|||||||
dir->contents->ino[0], dir->contents->ino[1],
|
dir->contents->ino[0], dir->contents->ino[1],
|
||||||
dir->contents->ino[2]);
|
dir->contents->ino[2]);
|
||||||
#else
|
#else
|
||||||
printf ("# %s (device %d, inode %d): ",
|
printf ("# %s (device %ld, inode %ld): ",
|
||||||
dir->name, dir->contents->dev, dir->contents->ino);
|
dir->name,
|
||||||
|
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
@@ -1013,6 +1048,14 @@ read_dirstream (stream)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ansi_free(p)
|
||||||
|
void *p;
|
||||||
|
{
|
||||||
|
if (p)
|
||||||
|
free(p);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
dir_setup_glob (gl)
|
dir_setup_glob (gl)
|
||||||
glob_t *gl;
|
glob_t *gl;
|
||||||
@@ -1022,7 +1065,7 @@ dir_setup_glob (gl)
|
|||||||
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
||||||
gl->gl_opendir = open_dirstream;
|
gl->gl_opendir = open_dirstream;
|
||||||
gl->gl_readdir = read_dirstream;
|
gl->gl_readdir = read_dirstream;
|
||||||
gl->gl_closedir = free;
|
gl->gl_closedir = ansi_free;
|
||||||
gl->gl_stat = stat;
|
gl->gl_stat = stat;
|
||||||
/* We don't bother setting gl_lstat, since glob never calls it.
|
/* We don't bother setting gl_lstat, since glob never calls it.
|
||||||
The slot is only there for compatibility with 4.4 BSD. */
|
The slot is only there for compatibility with 4.4 BSD. */
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
|||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
||||||
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g read.c -o read.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remake.c -o remake.o
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
||||||
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
||||||
|
|
||||||
|
|||||||
83
expand.c
83
expand.c
@@ -21,15 +21,24 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
#include "rule.h"
|
||||||
|
|
||||||
/* The next two describe the variable output buffer.
|
/* The next two describe the variable output buffer.
|
||||||
This buffer is used to hold the variable-expansion of a line of the
|
This buffer is used to hold the variable-expansion of a line of the
|
||||||
makefile. It is made bigger with realloc whenever it is too small.
|
makefile. It is made bigger with realloc whenever it is too small.
|
||||||
variable_buffer_length is the size currently allocated.
|
variable_buffer_length is the size currently allocated.
|
||||||
variable_buffer is the address of the buffer. */
|
variable_buffer is the address of the buffer.
|
||||||
|
|
||||||
|
For efficiency, it's guaranteed that the buffer will always have
|
||||||
|
VARIABLE_BUFFER_ZONE extra bytes allocated. This allows you to add a few
|
||||||
|
extra chars without having to call a function. Note you should never use
|
||||||
|
these bytes unless you're _sure_ you have room (you know when the buffer
|
||||||
|
length was last checked. */
|
||||||
|
|
||||||
|
#define VARIABLE_BUFFER_ZONE 5
|
||||||
|
|
||||||
static unsigned int variable_buffer_length;
|
static unsigned int variable_buffer_length;
|
||||||
static char *variable_buffer;
|
char *variable_buffer;
|
||||||
|
|
||||||
/* Subroutine of variable_expand and friends:
|
/* Subroutine of variable_expand and friends:
|
||||||
The text to add is LENGTH chars starting at STRING to the variable_buffer.
|
The text to add is LENGTH chars starting at STRING to the variable_buffer.
|
||||||
@@ -45,7 +54,7 @@ variable_buffer_output (ptr, string, length)
|
|||||||
{
|
{
|
||||||
register unsigned int newlen = length + (ptr - variable_buffer);
|
register unsigned int newlen = length + (ptr - variable_buffer);
|
||||||
|
|
||||||
if (newlen > variable_buffer_length)
|
if ((newlen + VARIABLE_BUFFER_ZONE) > variable_buffer_length)
|
||||||
{
|
{
|
||||||
unsigned int offset = ptr - variable_buffer;
|
unsigned int offset = ptr - variable_buffer;
|
||||||
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
|
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
|
||||||
@@ -153,20 +162,38 @@ reference_variable (o, name, length)
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan LINE for variable references and expansion-function calls.
|
/* Scan STRING for variable references and expansion-function calls. Only
|
||||||
Build in `variable_buffer' the result of expanding the references and calls.
|
LENGTH bytes of STRING are actually scanned. If LENGTH is -1, scan until
|
||||||
Return the address of the resulting string, which is null-terminated
|
a null byte is found.
|
||||||
and is valid only until the next time this function is called. */
|
|
||||||
|
Write the results to LINE, which must point into `variable_buffer'. If
|
||||||
|
LINE is NULL, start at the beginning of the buffer.
|
||||||
|
Return a pointer to LINE, or to the beginning of the buffer if LINE is
|
||||||
|
NULL. */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
variable_expand (line)
|
variable_expand_string (line, string, length)
|
||||||
register char *line;
|
register char *line;
|
||||||
|
char *string;
|
||||||
|
long length;
|
||||||
{
|
{
|
||||||
register struct variable *v;
|
register struct variable *v;
|
||||||
register char *p, *o, *p1;
|
register char *p, *o, *p1;
|
||||||
|
char save_char = '\0';
|
||||||
|
unsigned int line_offset;
|
||||||
|
|
||||||
p = line;
|
if (!line)
|
||||||
o = initialize_variable_output ();
|
line = initialize_variable_output();
|
||||||
|
|
||||||
|
p = string;
|
||||||
|
o = line;
|
||||||
|
line_offset = line - variable_buffer;
|
||||||
|
|
||||||
|
if (length >= 0)
|
||||||
|
{
|
||||||
|
save_char = string[length];
|
||||||
|
string[length] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -374,8 +401,23 @@ variable_expand (line)
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) variable_buffer_output (o, "", 1);
|
if (save_char)
|
||||||
return initialize_variable_output ();
|
string[length] = save_char;
|
||||||
|
|
||||||
|
(void)variable_buffer_output (o, "", 1);
|
||||||
|
return (variable_buffer + line_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Scan LINE for variable references and expansion-function calls.
|
||||||
|
Build in `variable_buffer' the result of expanding the references and calls.
|
||||||
|
Return the address of the resulting string, which is null-terminated
|
||||||
|
and is valid only until the next time this function is called. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
variable_expand (line)
|
||||||
|
char *line;
|
||||||
|
{
|
||||||
|
return variable_expand_string(NULL, line, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Expand an argument for an expansion function.
|
/* Expand an argument for an expansion function.
|
||||||
@@ -405,13 +447,13 @@ expand_argument (str, end)
|
|||||||
/* Expand LINE for FILE. Error messages refer to the file and line where
|
/* Expand LINE for FILE. Error messages refer to the file and line where
|
||||||
FILE's commands were found. Expansion uses FILE's variable set list. */
|
FILE's commands were found. Expansion uses FILE's variable set list. */
|
||||||
|
|
||||||
char *
|
static char *
|
||||||
variable_expand_for_file (line, file)
|
variable_expand_for_file (line, file)
|
||||||
char *line;
|
char *line;
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
struct variable_set_list *save;
|
struct variable_set_list *save, *fnext;
|
||||||
|
|
||||||
if (file == 0)
|
if (file == 0)
|
||||||
return variable_expand (line);
|
return variable_expand (line);
|
||||||
@@ -420,10 +462,23 @@ variable_expand_for_file (line, file)
|
|||||||
current_variable_set_list = file->variables;
|
current_variable_set_list = file->variables;
|
||||||
reading_filename = file->cmds->filename;
|
reading_filename = file->cmds->filename;
|
||||||
reading_lineno_ptr = &file->cmds->lineno;
|
reading_lineno_ptr = &file->cmds->lineno;
|
||||||
|
fnext = file->variables->next;
|
||||||
|
/* See if there's a pattern-specific variable struct for this target. */
|
||||||
|
if (!file->pat_searched)
|
||||||
|
{
|
||||||
|
file->patvar = lookup_pattern_var(file->name);
|
||||||
|
file->pat_searched = 1;
|
||||||
|
}
|
||||||
|
if (file->patvar != 0)
|
||||||
|
{
|
||||||
|
file->patvar->vars->next = fnext;
|
||||||
|
file->variables->next = file->patvar->vars;
|
||||||
|
}
|
||||||
result = variable_expand (line);
|
result = variable_expand (line);
|
||||||
current_variable_set_list = save;
|
current_variable_set_list = save;
|
||||||
reading_filename = 0;
|
reading_filename = 0;
|
||||||
reading_lineno_ptr = 0;
|
reading_lineno_ptr = 0;
|
||||||
|
file->variables->next = fnext;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
47
file.c
47
file.c
@@ -1,5 +1,5 @@
|
|||||||
/* Target file hash table management for GNU Make.
|
/* Target file hash table management for GNU Make.
|
||||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -49,6 +49,9 @@ lookup_file (name)
|
|||||||
register struct file *f;
|
register struct file *f;
|
||||||
register char *n;
|
register char *n;
|
||||||
register unsigned int hashval;
|
register unsigned int hashval;
|
||||||
|
#ifdef VMS
|
||||||
|
register char *lname, *ln;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (*name == '\0')
|
if (*name == '\0')
|
||||||
abort ();
|
abort ();
|
||||||
@@ -57,6 +60,12 @@ lookup_file (name)
|
|||||||
for names read from makefiles. It is here for names passed
|
for names read from makefiles. It is here for names passed
|
||||||
on the command line. */
|
on the command line. */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
|
lname = (char *)malloc(strlen(name) + 1);
|
||||||
|
for (n=name, ln=lname; *n != '\0'; ++n, ++ln)
|
||||||
|
*ln = isupper(*n) ? tolower(*n) : *n;
|
||||||
|
*ln = '\0';
|
||||||
|
name = lname;
|
||||||
|
|
||||||
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
||||||
name += 2;
|
name += 2;
|
||||||
#endif
|
#endif
|
||||||
@@ -89,9 +98,15 @@ lookup_file (name)
|
|||||||
{
|
{
|
||||||
if (strieq (f->hname, name))
|
if (strieq (f->hname, name))
|
||||||
{
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
free (lname);
|
||||||
|
#endif
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef VMS
|
||||||
|
free (lname);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,6 +202,23 @@ rehash_file (file, name)
|
|||||||
file_hash_enter (file, name, oldhash, file->name);
|
file_hash_enter (file, name, oldhash, file->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rename FILE to NAME. This is not as simple as resetting
|
||||||
|
the `name' member, since it must be put in a new hash bucket,
|
||||||
|
and possibly merged with an existing file called NAME. */
|
||||||
|
|
||||||
|
void
|
||||||
|
rename_file (file, name)
|
||||||
|
register struct file *file;
|
||||||
|
char *name;
|
||||||
|
{
|
||||||
|
rehash_file(file, name);
|
||||||
|
while (file)
|
||||||
|
{
|
||||||
|
file->name = file->hname;
|
||||||
|
file = file->prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
file_hash_enter (file, name, oldhash, oldname)
|
file_hash_enter (file, name, oldhash, oldname)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
@@ -524,9 +556,7 @@ print_file (f)
|
|||||||
struct file *f;
|
struct file *f;
|
||||||
{
|
{
|
||||||
register struct dep *d;
|
register struct dep *d;
|
||||||
#ifdef VMS
|
|
||||||
extern char *cvt_time PARAMS ((unsigned long));
|
|
||||||
#endif
|
|
||||||
putchar ('\n');
|
putchar ('\n');
|
||||||
if (!f->is_target)
|
if (!f->is_target)
|
||||||
puts ("# Not a target:");
|
puts ("# Not a target:");
|
||||||
@@ -562,13 +592,8 @@ print_file (f)
|
|||||||
else if (f->last_mtime == (time_t) -1)
|
else if (f->last_mtime == (time_t) -1)
|
||||||
puts ("# File does not exist.");
|
puts ("# File does not exist.");
|
||||||
else
|
else
|
||||||
#ifdef VMS
|
|
||||||
printf ("# Last modified %.24s (%0lx)\n",
|
|
||||||
cvt_time(f->last_mtime), (unsigned long) f->last_mtime);
|
|
||||||
#else
|
|
||||||
printf ("# Last modified %.24s (%ld)\n",
|
printf ("# Last modified %.24s (%ld)\n",
|
||||||
ctime (&f->last_mtime), (long int) f->last_mtime);
|
ctime (&f->last_mtime), (long int) f->last_mtime);
|
||||||
#endif
|
|
||||||
printf ("# File has%s been updated.\n",
|
printf ("# File has%s been updated.\n",
|
||||||
f->updated ? "" : " not");
|
f->updated ? "" : " not");
|
||||||
switch (f->command_state)
|
switch (f->command_state)
|
||||||
@@ -650,8 +675,8 @@ print_file_data_base ()
|
|||||||
{
|
{
|
||||||
printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS);
|
printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS);
|
||||||
#ifndef NO_FLOAT
|
#ifndef NO_FLOAT
|
||||||
printf ("# average %.1f files per bucket, max %u files in one bucket.\n",
|
printf ("# average %.3f files per bucket, max %u files in one bucket.\n",
|
||||||
((double) nfiles) / ((double) FILE_BUCKETS) * 100.0, per_bucket);
|
((double) nfiles) / ((double) FILE_BUCKETS), per_bucket);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
filedef.h
20
filedef.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definition of target file data structures for GNU Make.
|
/* Definition of target file data structures for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 97 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -52,6 +52,10 @@ struct file
|
|||||||
the same file. Otherwise this is null. */
|
the same file. Otherwise this is null. */
|
||||||
struct file *double_colon;
|
struct file *double_colon;
|
||||||
|
|
||||||
|
/* Pattern-specific variable reference for this target, or null if there
|
||||||
|
isn't one. Also see the pat_searched flag, below. */
|
||||||
|
struct pattern_var *patvar;
|
||||||
|
|
||||||
short int update_status; /* Status of the last attempt to update,
|
short int update_status; /* Status of the last attempt to update,
|
||||||
or -1 if none has been made. */
|
or -1 if none has been made. */
|
||||||
|
|
||||||
@@ -79,7 +83,10 @@ struct file
|
|||||||
unsigned int secondary:1;
|
unsigned int secondary:1;
|
||||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||||
this target cannot be remade. */
|
this target cannot be remade. */
|
||||||
|
unsigned int shownerror:1; /* Nonzero if we printed an error */
|
||||||
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */
|
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 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Number of intermediate files entered. */
|
/* Number of intermediate files entered. */
|
||||||
@@ -91,7 +98,7 @@ extern struct file *default_goal_file, *suffix_file, *default_file;
|
|||||||
|
|
||||||
extern struct file *lookup_file (), *enter_file ();
|
extern struct file *lookup_file (), *enter_file ();
|
||||||
extern void remove_intermediates (), snap_deps ();
|
extern void remove_intermediates (), snap_deps ();
|
||||||
extern void rehash_file (), file_hash_enter ();
|
extern void rename_file (), rehash_file (), file_hash_enter ();
|
||||||
extern void set_command_state ();
|
extern void set_command_state ();
|
||||||
|
|
||||||
|
|
||||||
@@ -112,9 +119,14 @@ extern time_t f_mtime ();
|
|||||||
trouble when the machine running make and the machine holding a file have
|
trouble when the machine running make and the machine holding a file have
|
||||||
different ideas about what time it is; and can also lose for `force'
|
different ideas about what time it is; and can also lose for `force'
|
||||||
targets, which need to be considered newer than anything that depends on
|
targets, which need to be considered newer than anything that depends on
|
||||||
them, even if said dependents' modtimes are in the future. */
|
them, even if said dependents' modtimes are in the future.
|
||||||
#define NEW_MTIME INTEGER_TYPE_MAXIMUM (time_t)
|
|
||||||
|
|
||||||
|
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. */
|
||||||
|
#define NEW_MTIME \
|
||||||
|
(INTEGER_TYPE_SIGNED (time_t) \
|
||||||
|
? INTEGER_TYPE_MAXIMUM (time_t) \
|
||||||
|
: (INTEGER_TYPE_MAXIMUM (time_t) - 1))
|
||||||
|
|
||||||
#define check_renamed(file) \
|
#define check_renamed(file) \
|
||||||
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
||||||
|
|||||||
79
function.c
79
function.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable function expansion for GNU Make.
|
/* Variable function expansion for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -119,7 +119,7 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
|||||||
register char *pattern_percent, *replace_percent;
|
register char *pattern_percent, *replace_percent;
|
||||||
{
|
{
|
||||||
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
||||||
unsigned int replace_prepercent_len, replace_postpercent_len;
|
unsigned int replace_prepercent_len, replace_postpercent_len = 0;
|
||||||
char *t;
|
char *t;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
@@ -282,13 +282,13 @@ static struct
|
|||||||
{ 0, 0, function_invalid }
|
{ 0, 0, function_invalid }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Return 1 if PATTERN matches WORD, 0 if not. */
|
/* Return 1 if PATTERN matches STR, 0 if not. */
|
||||||
|
|
||||||
int
|
int
|
||||||
pattern_matches (pattern, percent, word)
|
pattern_matches (pattern, percent, str)
|
||||||
register char *pattern, *percent, *word;
|
register char *pattern, *percent, *str;
|
||||||
{
|
{
|
||||||
unsigned int sfxlen, wordlen;
|
unsigned int sfxlen, strlength;
|
||||||
|
|
||||||
if (percent == 0)
|
if (percent == 0)
|
||||||
{
|
{
|
||||||
@@ -298,17 +298,17 @@ pattern_matches (pattern, percent, word)
|
|||||||
pattern = new;
|
pattern = new;
|
||||||
percent = find_percent (pattern);
|
percent = find_percent (pattern);
|
||||||
if (percent == 0)
|
if (percent == 0)
|
||||||
return streq (pattern, word);
|
return streq (pattern, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
sfxlen = strlen (percent + 1);
|
sfxlen = strlen (percent + 1);
|
||||||
wordlen = strlen (word);
|
strlength = strlen (str);
|
||||||
|
|
||||||
if (wordlen < (percent - pattern) + sfxlen
|
if (strlength < (percent - pattern) + sfxlen
|
||||||
|| strncmp (pattern, word, percent - pattern))
|
|| strncmp (pattern, str, percent - pattern))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return !strcmp (percent + 1, word + (wordlen - sfxlen));
|
return !strcmp (percent + 1, str + (strlength - sfxlen));
|
||||||
}
|
}
|
||||||
|
|
||||||
int shell_function_pid = 0, shell_function_completed;
|
int shell_function_pid = 0, shell_function_completed;
|
||||||
@@ -318,13 +318,13 @@ int shell_function_pid = 0, shell_function_completed;
|
|||||||
The output is written into VARIABLE_BUFFER starting at O. */
|
The output is written into VARIABLE_BUFFER starting at O. */
|
||||||
|
|
||||||
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
||||||
#define BADARGS(func) \
|
#define BADARGS(func) do { \
|
||||||
if (reading_filename != 0) \
|
if (reading_filename != 0) \
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
||||||
"insufficient arguments to function `%s'", \
|
"insufficient arguments to function `%s'", \
|
||||||
func); \
|
func); \
|
||||||
else \
|
else \
|
||||||
fatal ("insufficient arguments to function `%s'", func)
|
fatal ("insufficient arguments to function `%s'", func); } while (0)
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
expand_function (o, function, text, end)
|
expand_function (o, function, text, end)
|
||||||
@@ -348,6 +348,7 @@ expand_function (o, function, text, end)
|
|||||||
#ifndef VMS /* not supported for vms yet */
|
#ifndef VMS /* not supported for vms yet */
|
||||||
case function_shell:
|
case function_shell:
|
||||||
{
|
{
|
||||||
|
char* batch_filename = NULL;
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
SECURITY_ATTRIBUTES saAttr;
|
SECURITY_ATTRIBUTES saAttr;
|
||||||
HANDLE hIn;
|
HANDLE hIn;
|
||||||
@@ -373,7 +374,7 @@ expand_function (o, function, text, end)
|
|||||||
#ifndef __MSDOS__
|
#ifndef __MSDOS__
|
||||||
/* Construct the argument list. */
|
/* Construct the argument list. */
|
||||||
argv = construct_command_argv (text,
|
argv = construct_command_argv (text,
|
||||||
(char **) NULL, (struct file *) 0);
|
(char **) NULL, (struct file *) 0, &batch_filename);
|
||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@@ -584,6 +585,12 @@ expand_function (o, function, text, end)
|
|||||||
while (shell_function_completed == 0)
|
while (shell_function_completed == 0)
|
||||||
reap_children (1, 0);
|
reap_children (1, 0);
|
||||||
|
|
||||||
|
if (batch_filename) {
|
||||||
|
if (debug_flag)
|
||||||
|
printf("Cleaning up temporary batch file %s\n", batch_filename);
|
||||||
|
remove(batch_filename);
|
||||||
|
free(batch_filename);
|
||||||
|
}
|
||||||
shell_function_pid = 0;
|
shell_function_pid = 0;
|
||||||
|
|
||||||
/* The child_handler function will set shell_function_completed
|
/* The child_handler function will set shell_function_completed
|
||||||
@@ -606,12 +613,25 @@ expand_function (o, function, text, end)
|
|||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
if (buffer[i - 1] == '\n')
|
if (buffer[i - 1] == '\n')
|
||||||
|
{
|
||||||
|
if (i > 1 && buffer[i - 2] == '\r')
|
||||||
|
--i;
|
||||||
buffer[--i] = '\0';
|
buffer[--i] = '\0';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
buffer[i] = '\0';
|
buffer[i] = '\0';
|
||||||
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
while ((p = index (p, '\n')) != 0)
|
for (p2=p; *p != '\0'; ++p)
|
||||||
*p++ = ' ';
|
{
|
||||||
|
if (p[0] == '\r' && p[1] == '\n')
|
||||||
|
continue;
|
||||||
|
if (*p == '\n')
|
||||||
|
*p2++ = ' ';
|
||||||
|
else
|
||||||
|
*p2++ = *p;
|
||||||
|
}
|
||||||
|
*p2 = '\0';
|
||||||
o = variable_buffer_output (o, buffer, i);
|
o = variable_buffer_output (o, buffer, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -839,6 +859,8 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
push_new_variable_scope ();
|
push_new_variable_scope ();
|
||||||
v = define_variable (var, strlen (var), "", o_automatic, 0);
|
v = define_variable (var, strlen (var), "", o_automatic, 0);
|
||||||
|
free (v->value);
|
||||||
|
v->value = 0;
|
||||||
p3 = list;
|
p3 = list;
|
||||||
while ((p = find_next_token (&p3, &len)) != 0)
|
while ((p = find_next_token (&p3, &len)) != 0)
|
||||||
{
|
{
|
||||||
@@ -869,10 +891,10 @@ expand_function (o, function, text, end)
|
|||||||
case function_filter:
|
case function_filter:
|
||||||
case function_filter_out:
|
case function_filter_out:
|
||||||
{
|
{
|
||||||
struct word
|
struct a_word
|
||||||
{
|
{
|
||||||
struct word *next;
|
struct a_word *next;
|
||||||
char *word;
|
char *str;
|
||||||
int matched;
|
int matched;
|
||||||
} *words, *wordtail, *wp;
|
} *words, *wordtail, *wp;
|
||||||
|
|
||||||
@@ -898,7 +920,7 @@ expand_function (o, function, text, end)
|
|||||||
p3 = text;
|
p3 = text;
|
||||||
while ((p = find_next_token (&p3, &len)) != 0)
|
while ((p = find_next_token (&p3, &len)) != 0)
|
||||||
{
|
{
|
||||||
struct word *w = (struct word *) alloca (sizeof (struct word));
|
struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word));
|
||||||
if (words == 0)
|
if (words == 0)
|
||||||
words = w;
|
words = w;
|
||||||
else
|
else
|
||||||
@@ -908,7 +930,7 @@ expand_function (o, function, text, end)
|
|||||||
if (*p3 != '\0')
|
if (*p3 != '\0')
|
||||||
++p3;
|
++p3;
|
||||||
p[len] = '\0';
|
p[len] = '\0';
|
||||||
w->word = p;
|
w->str = p;
|
||||||
w->matched = 0;
|
w->matched = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -926,8 +948,8 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
percent = find_percent (p);
|
percent = find_percent (p);
|
||||||
for (wp = words; wp != 0; wp = wp->next)
|
for (wp = words; wp != 0; wp = wp->next)
|
||||||
wp->matched |= (percent == 0 ? streq (p, wp->word)
|
wp->matched |= (percent == 0 ? streq (p, wp->str)
|
||||||
: pattern_matches (p, percent, wp->word));
|
: pattern_matches (p, percent, wp->str));
|
||||||
|
|
||||||
p[len] = save;
|
p[len] = save;
|
||||||
}
|
}
|
||||||
@@ -936,7 +958,7 @@ expand_function (o, function, text, end)
|
|||||||
for (wp = words; wp != 0; wp = wp->next)
|
for (wp = words; wp != 0; wp = wp->next)
|
||||||
if (function == function_filter ? wp->matched : !wp->matched)
|
if (function == function_filter ? wp->matched : !wp->matched)
|
||||||
{
|
{
|
||||||
o = variable_buffer_output (o, wp->word, strlen (wp->word));
|
o = variable_buffer_output (o, wp->str, strlen (wp->str));
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
doneany = 1;
|
doneany = 1;
|
||||||
}
|
}
|
||||||
@@ -1049,8 +1071,15 @@ expand_function (o, function, text, end)
|
|||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
p2 = text;
|
p2 = text;
|
||||||
while ((p = find_next_token (&p2, &i)) != 0)
|
while (*p2 != '\0')
|
||||||
{
|
{
|
||||||
|
while (isspace(*p2))
|
||||||
|
++p2;
|
||||||
|
p = p2;
|
||||||
|
for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
|
||||||
|
{}
|
||||||
|
if (!i)
|
||||||
|
break;
|
||||||
o = variable_buffer_output (o, p, i);
|
o = variable_buffer_output (o, p, i);
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
doneany = 1;
|
doneany = 1;
|
||||||
|
|||||||
14
getloadavg.c
14
getloadavg.c
@@ -35,6 +35,7 @@
|
|||||||
LOAD_AVE_TYPE Type of the load average array in the kernel.
|
LOAD_AVE_TYPE Type of the load average array in the kernel.
|
||||||
Must be defined unless one of
|
Must be defined unless one of
|
||||||
apollo, DGUX, NeXT, or UMAX is defined;
|
apollo, DGUX, NeXT, or UMAX is defined;
|
||||||
|
or we have libkstat;
|
||||||
otherwise, no load average is available.
|
otherwise, no load average is available.
|
||||||
NLIST_STRUCT Include nlist.h, not a.out.h, and
|
NLIST_STRUCT Include nlist.h, not a.out.h, and
|
||||||
the nlist n_name element is a pointer,
|
the nlist n_name element is a pointer,
|
||||||
@@ -500,6 +501,7 @@ extern int errno;
|
|||||||
# include <sys/file.h>
|
# include <sys/file.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
/* Avoid static vars inside a function since in HPUX they dump as pure. */
|
/* Avoid static vars inside a function since in HPUX they dump as pure. */
|
||||||
|
|
||||||
# ifdef NeXT
|
# ifdef NeXT
|
||||||
@@ -516,7 +518,7 @@ static unsigned int samples;
|
|||||||
static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
|
static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
|
||||||
# endif /* DGUX */
|
# endif /* DGUX */
|
||||||
|
|
||||||
# ifdef LOAD_AVE_TYPE
|
#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE)
|
||||||
/* File descriptor open to /dev/kmem or VMS load ave driver. */
|
/* File descriptor open to /dev/kmem or VMS load ave driver. */
|
||||||
static int channel;
|
static int channel;
|
||||||
/* Nonzero iff channel is valid. */
|
/* Nonzero iff channel is valid. */
|
||||||
@@ -524,15 +526,15 @@ static int getloadavg_initialized;
|
|||||||
/* Offset in kmem to seek to read load average, or 0 means invalid. */
|
/* Offset in kmem to seek to read load average, or 0 means invalid. */
|
||||||
static long offset;
|
static long offset;
|
||||||
|
|
||||||
# if !defined(VMS) && !defined(sgi) && !defined(__linux__)
|
#if !defined(VMS) && !defined(sgi) && !defined(__linux__)
|
||||||
static struct nlist nl[2];
|
static struct nlist nl[2];
|
||||||
# endif /* Not VMS or sgi */
|
#endif
|
||||||
|
|
||||||
# ifdef SUNOS_5
|
#ifdef SUNOS_5
|
||||||
static kvm_t *kd;
|
static kvm_t *kd;
|
||||||
# endif /* SUNOS_5 */
|
#endif /* SUNOS_5 */
|
||||||
|
|
||||||
# endif /* LOAD_AVE_TYPE */
|
# endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */
|
||||||
|
|
||||||
/* Put the 1 minute, 5 minute and 15 minute load averages
|
/* Put the 1 minute, 5 minute and 15 minute load averages
|
||||||
into the first NELEM elements of LOADAVG.
|
into the first NELEM elements of LOADAVG.
|
||||||
|
|||||||
95
getopt.c
95
getopt.c
@@ -1,13 +1,13 @@
|
|||||||
/* Getopt for GNU.
|
/* Getopt for GNU.
|
||||||
NOTE: getopt is now part of the C library, so if you don't know what
|
NOTE: getopt is now part of the C library, so if you don't know what
|
||||||
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
|
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||||
before changing it!
|
before changing it!
|
||||||
|
|
||||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
|
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
This program is free software; you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published by the
|
under the terms of the GNU General Public License as published by the
|
||||||
@@ -27,19 +27,19 @@
|
|||||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||||
#ifndef _NO_PROTO
|
#ifndef _NO_PROTO
|
||||||
#define _NO_PROTO
|
# define _NO_PROTO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined (__STDC__) || !__STDC__
|
#if !defined __STDC__ || !__STDC__
|
||||||
/* This is a separate conditional since some stdc systems
|
/* This is a separate conditional since some stdc systems
|
||||||
reject `defined (const)'. */
|
reject `defined (const)'. */
|
||||||
#ifndef const
|
# ifndef const
|
||||||
#define const
|
# define const
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -53,11 +53,11 @@
|
|||||||
it is simpler to just do this in the source for each such file. */
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
#define GETOPT_INTERFACE_VERSION 2
|
#define GETOPT_INTERFACE_VERSION 2
|
||||||
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
|
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
|
||||||
#include <gnu-versions.h>
|
# include <gnu-versions.h>
|
||||||
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||||
#define ELIDE_CODE
|
# define ELIDE_CODE
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ELIDE_CODE
|
#ifndef ELIDE_CODE
|
||||||
@@ -68,32 +68,26 @@
|
|||||||
#ifdef __GNU_LIBRARY__
|
#ifdef __GNU_LIBRARY__
|
||||||
/* Don't include stdlib.h for non-GNU C libraries because some of them
|
/* Don't include stdlib.h for non-GNU C libraries because some of them
|
||||||
contain conflicting prototypes for getopt. */
|
contain conflicting prototypes for getopt. */
|
||||||
#include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif /* GNU C library. */
|
#endif /* GNU C library. */
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
#include <unixlib.h>
|
# include <unixlib.h>
|
||||||
#if HAVE_STRING_H - 0
|
# if HAVE_STRING_H - 0
|
||||||
#include <string.h>
|
# include <string.h>
|
||||||
#endif
|
# endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (WIN32) && !defined (__CYGWIN32__)
|
|
||||||
/* It's not Unix, really. See? Capital letters. */
|
|
||||||
#include <windows.h>
|
|
||||||
#define getpid() GetCurrentProcessId()
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _
|
#ifndef _
|
||||||
/* This is for other GNU distributions with internationalized messages.
|
/* This is for other GNU distributions with internationalized messages.
|
||||||
When compiling libc, the _ macro is predefined. */
|
When compiling libc, the _ macro is predefined. */
|
||||||
#ifdef HAVE_LIBINTL_H
|
# ifdef HAVE_LIBINTL_H
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
# define _(msgid) gettext (msgid)
|
# define _(msgid) gettext (msgid)
|
||||||
#else
|
# else
|
||||||
# define _(msgid) (msgid)
|
# define _(msgid) (msgid)
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
||||||
@@ -203,14 +197,22 @@ static char *posixly_correct;
|
|||||||
because there are many ways it can cause trouble.
|
because there are many ways it can cause trouble.
|
||||||
On some systems, it contains special magic macros that don't work
|
On some systems, it contains special magic macros that don't work
|
||||||
in GCC. */
|
in GCC. */
|
||||||
#include <string.h>
|
# include <string.h>
|
||||||
#define my_index strchr
|
# define my_index strchr
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
# if HAVE_STRING_H
|
||||||
|
# include <string.h>
|
||||||
|
# else
|
||||||
|
# include <strings.h>
|
||||||
|
# endif
|
||||||
|
|
||||||
/* Avoid depending on library functions or files
|
/* Avoid depending on library functions or files
|
||||||
whose names are inconsistent. */
|
whose names are inconsistent. */
|
||||||
|
|
||||||
char *getenv ();
|
#ifndef getenv
|
||||||
|
extern char *getenv ();
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
my_index (str, chr)
|
my_index (str, chr)
|
||||||
@@ -231,11 +233,11 @@ my_index (str, chr)
|
|||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
|
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
|
||||||
That was relevant to code that was here before. */
|
That was relevant to code that was here before. */
|
||||||
#if !defined (__STDC__) || !__STDC__
|
# if (!defined __STDC__ || !__STDC__) && !defined strlen
|
||||||
/* gcc with -traditional declares the built-in strlen to return int,
|
/* gcc with -traditional declares the built-in strlen to return int,
|
||||||
and has done so at least since version 2.4.5. -- rms. */
|
and has done so at least since version 2.4.5. -- rms. */
|
||||||
extern int strlen (const char *);
|
extern int strlen (const char *);
|
||||||
#endif /* not __STDC__ */
|
# endif /* not __STDC__ */
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#endif /* not __GNU_LIBRARY__ */
|
#endif /* not __GNU_LIBRARY__ */
|
||||||
@@ -262,8 +264,6 @@ static int nonoption_flags_len;
|
|||||||
static int original_argc;
|
static int original_argc;
|
||||||
static char *const *original_argv;
|
static char *const *original_argv;
|
||||||
|
|
||||||
extern pid_t __libc_pid;
|
|
||||||
|
|
||||||
/* Make sure the environment variable bash 2.0 puts in the environment
|
/* Make sure the environment variable bash 2.0 puts in the environment
|
||||||
is valid for the getopt call we must make sure that the ARGV passed
|
is valid for the getopt call we must make sure that the ARGV passed
|
||||||
to getopt is that one passed to the process. */
|
to getopt is that one passed to the process. */
|
||||||
@@ -276,7 +276,9 @@ store_args_and_env (int argc, char *const *argv)
|
|||||||
original_argc = argc;
|
original_argc = argc;
|
||||||
original_argv = argv;
|
original_argv = argv;
|
||||||
}
|
}
|
||||||
|
# ifdef text_set_element
|
||||||
text_set_element (__libc_subinit, store_args_and_env);
|
text_set_element (__libc_subinit, store_args_and_env);
|
||||||
|
# endif /* text_set_element */
|
||||||
|
|
||||||
# define SWAP_FLAGS(ch1, ch2) \
|
# define SWAP_FLAGS(ch1, ch2) \
|
||||||
if (nonoption_flags_len > 0) \
|
if (nonoption_flags_len > 0) \
|
||||||
@@ -298,7 +300,7 @@ text_set_element (__libc_subinit, store_args_and_env);
|
|||||||
`first_nonopt' and `last_nonopt' are relocated so that they describe
|
`first_nonopt' and `last_nonopt' are relocated so that they describe
|
||||||
the new indices of the non-options in ARGV after they are moved. */
|
the new indices of the non-options in ARGV after they are moved. */
|
||||||
|
|
||||||
#if defined (__STDC__) && __STDC__
|
#if defined __STDC__ && __STDC__
|
||||||
static void exchange (char **);
|
static void exchange (char **);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -329,9 +331,9 @@ exchange (argv)
|
|||||||
nonoption_flags_len = nonoption_flags_max_len = 0;
|
nonoption_flags_len = nonoption_flags_max_len = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
|
memset (__mempcpy (new_str, __getopt_nonoption_flags,
|
||||||
memset (&new_str[nonoption_flags_max_len], '\0',
|
nonoption_flags_max_len),
|
||||||
top + 1 - nonoption_flags_max_len);
|
'\0', top + 1 - nonoption_flags_max_len);
|
||||||
nonoption_flags_max_len = top + 1;
|
nonoption_flags_max_len = top + 1;
|
||||||
__getopt_nonoption_flags = new_str;
|
__getopt_nonoption_flags = new_str;
|
||||||
}
|
}
|
||||||
@@ -384,7 +386,7 @@ exchange (argv)
|
|||||||
|
|
||||||
/* Initialize the internal data when the first call is made. */
|
/* Initialize the internal data when the first call is made. */
|
||||||
|
|
||||||
#if defined (__STDC__) && __STDC__
|
#if defined __STDC__ && __STDC__
|
||||||
static const char *_getopt_initialize (int, char *const *, const char *);
|
static const char *_getopt_initialize (int, char *const *, const char *);
|
||||||
#endif
|
#endif
|
||||||
static const char *
|
static const char *
|
||||||
@@ -440,11 +442,8 @@ _getopt_initialize (argc, argv, optstring)
|
|||||||
if (__getopt_nonoption_flags == NULL)
|
if (__getopt_nonoption_flags == NULL)
|
||||||
nonoption_flags_max_len = -1;
|
nonoption_flags_max_len = -1;
|
||||||
else
|
else
|
||||||
{
|
memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
|
||||||
memcpy (__getopt_nonoption_flags, orig_str, len);
|
'\0', nonoption_flags_max_len - len);
|
||||||
memset (&__getopt_nonoption_flags[len], '\0',
|
|
||||||
nonoption_flags_max_len - len);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nonoption_flags_len = nonoption_flags_max_len;
|
nonoption_flags_len = nonoption_flags_max_len;
|
||||||
@@ -536,11 +535,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
from the shell indicating it is not an option. The later information
|
from the shell indicating it is not an option. The later information
|
||||||
is only used when the used in the GNU libc. */
|
is only used when the used in the GNU libc. */
|
||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
||||||
|| (optind < nonoption_flags_len \
|
|| (optind < nonoption_flags_len \
|
||||||
&& __getopt_nonoption_flags[optind] == '1'))
|
&& __getopt_nonoption_flags[optind] == '1'))
|
||||||
#else
|
#else
|
||||||
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
|
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (nextchar == NULL || *nextchar == '\0')
|
if (nextchar == NULL || *nextchar == '\0')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
@@ -25,7 +26,7 @@
|
|||||||
|
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
|
||||||
#if !defined (__STDC__) || !__STDC__
|
#if !defined __STDC__ || !__STDC__
|
||||||
/* This is a separate conditional since some stdc systems
|
/* This is a separate conditional since some stdc systems
|
||||||
reject `defined (const)'. */
|
reject `defined (const)'. */
|
||||||
#ifndef const
|
#ifndef const
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
it is simpler to just do this in the source for each such file. */
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
#define GETOPT_INTERFACE_VERSION 2
|
#define GETOPT_INTERFACE_VERSION 2
|
||||||
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
|
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
|
||||||
#include <gnu-versions.h>
|
#include <gnu-versions.h>
|
||||||
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||||
#define ELIDE_CODE
|
#define ELIDE_CODE
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,72 @@
|
|||||||
|
1998-07-29 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich
|
||||||
|
Drepper). Fixes a bug reported by Eli Zaretski. Integrates
|
||||||
|
DOS/Windows32 support.
|
||||||
|
|
||||||
|
1998-07-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* glob.c (glob): Cast away const on assignment of pattern to dirname.
|
||||||
|
Cast the return type of __alloca() for traditional C compilers.
|
||||||
|
|
||||||
|
1998-07-23 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* glob.c, fnmatch.c: New versions of these files from the GLIBC
|
||||||
|
folks (Ulrich Drepper). Had to re-integrate some DOS/Windows
|
||||||
|
code.
|
||||||
|
|
||||||
|
1998-07-10 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* glob.c (glob_in_dir): If no meta chars exist in PATTERN and
|
||||||
|
GLOB_NOCHECK is present, don't look for the file--whether it's
|
||||||
|
found or not, we'll always return it, so why bother searching?
|
||||||
|
|
||||||
|
Also, if we are searching and there are no meta chars, don't
|
||||||
|
bother trying fnmatch() if the strcmp() fails.
|
||||||
|
|
||||||
|
1998-05-30 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* glob.c (glob) [__MSDOS__, WINDOWS32]: Compute the directory and
|
||||||
|
filename parts of the pattern correctly when it includes a drive
|
||||||
|
spec. Disallow wildcards in the drive spec. Prevent recursion
|
||||||
|
when dirname is of the form "d:/" or "d:".
|
||||||
|
(prefix_array) [__MSDOS__, WINDOWS32]: Don't append a slash to
|
||||||
|
"d:/" and "d:".
|
||||||
|
|
||||||
|
1998-05-13 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* SMakefile, Makefile.ami, glob.c, glob.h, fnmatch.c: Updated from
|
||||||
|
the latest glibc version.
|
||||||
|
|
||||||
|
1998-04-17 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* configure.in: Create a config.h file instead of setting things
|
||||||
|
on the compile line. This is because when build.sh runs it merely
|
||||||
|
passes -DHAVE_CONFIG_H to the glob files, just as it does to the
|
||||||
|
make files.
|
||||||
|
* config.h.in: Created by autoheader.
|
||||||
|
|
||||||
|
Tue Aug 12 10:52:34 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* configure.in: Require autoconf 2.12.
|
||||||
|
|
||||||
|
* glob: Updates from latest GNU libc glob code.
|
||||||
|
|
||||||
|
* glob.c,glob.h,fnmatch.h: Change all WIN32 references to WINDOWS32.
|
||||||
|
|
||||||
|
* glob.h: OSF4 defines macros in such a way that GLOB_ALTDIRFUNC
|
||||||
|
is not defined. Added a test to the #if which defines it if
|
||||||
|
_GNU_SOURCE is defined; that's set by both glob.c and GNU make.
|
||||||
|
|
||||||
|
* glob.c: SunOS4 w/ cc needs #include <stdio.h>, since assert.h
|
||||||
|
requires stderr but doesn't include stdio.h :-/.
|
||||||
|
(next_brace_sub): De-protoize function definition.
|
||||||
|
(glob): Cast __alloca(); on SunOS4 it uses the default return type
|
||||||
|
of int.
|
||||||
|
(glob): Irix defines getlogin_r() to return a char*; move the
|
||||||
|
extern for that into the _LIBC area since it isn't used except in
|
||||||
|
LIBC anyway. Likewise, move extern getlogin() into the "else".
|
||||||
|
|
||||||
Sat Jul 20 21:55:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
Sat Jul 20 21:55:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
Win32 hacks from <Rob_Tulloh@tivoli.com>.
|
Win32 hacks from <Rob_Tulloh@tivoli.com>.
|
||||||
|
|||||||
10
glob/Makefile.am
Normal file
10
glob/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.3 foreign
|
||||||
|
|
||||||
|
noinst_LIBRARIES = libglob.a
|
||||||
|
|
||||||
|
libglob_a_SOURCES = glob.c glob.h fnmatch.c fnmatch.h
|
||||||
|
|
||||||
|
EXTRA_DIST = COPYING.LIB Makefile.ami SCOPTIONS SMakefile \
|
||||||
|
configure.bat
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
|
||||||
# This file is part of the GNU C Library.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
# You should have received a copy of the GNU Library General Public
|
||||||
# License along with this library; see the file COPYING.LIB. If
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
# not, write to the Free Software Foundation, Inc.,
|
||||||
# Cambridge, MA 02139, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
VPATH = /glob/
|
VPATH = /glob/
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
|
||||||
|
|
||||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
|
||||||
# This file is part of the GNU C Library.
|
|
||||||
|
|
||||||
# This library is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU Library General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2 of
|
|
||||||
# the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
# This library 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
|
|
||||||
# Library General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this library; see the file COPYING.LIB. If
|
|
||||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
|
||||||
# Cambridge, MA 02139, USA.
|
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = @srcdir@
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = @srcdir@
|
|
||||||
|
|
||||||
CC = @CC@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
|
|
||||||
# Information determined by configure.
|
|
||||||
DEFS = @DEFS@
|
|
||||||
|
|
||||||
# How to invoke ar.
|
|
||||||
AR = @AR@
|
|
||||||
ARFLAGS = rv
|
|
||||||
|
|
||||||
# How to invoke ranlib.
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: libglob.a
|
|
||||||
|
|
||||||
libglob.a: glob.o fnmatch.o
|
|
||||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
# For some reason, Unix make wants the dependencies on the source files.
|
|
||||||
# Otherwise it refuses to use an implicit rule!
|
|
||||||
# And, get this: it doesn't work to use $(srcdir)/foo.c!!
|
|
||||||
glob.o: $(srcdir)/glob.h $(srcdir)/fnmatch.h glob.c
|
|
||||||
fnmatch.o: $(srcdir)/fnmatch.h fnmatch.c
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
$(CC) -I. -I$(srcdir) -c \
|
|
||||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
|
||||||
clean glob-clean:
|
|
||||||
-rm -f libglob.a *.o core
|
|
||||||
distclean glob-realclean: clean
|
|
||||||
-rm -f TAGS tags Makefile config.status config.h config.log
|
|
||||||
realcean: distclean
|
|
||||||
|
|
||||||
# For inside the C library.
|
|
||||||
glob.tar glob.tar.Z:
|
|
||||||
$(MAKE) -C .. $@
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
|
||||||
# This file is part of the GNU C Library.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
# You should have received a copy of the GNU Library General Public
|
||||||
# License along with this library; see the file COPYING.LIB. If
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
# not, write to the Free Software Foundation, Inc.,
|
||||||
# Cambridge, MA 02139, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
VPATH = /glob/
|
VPATH = /glob/
|
||||||
|
|||||||
1664
glob/configure
vendored
1664
glob/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,10 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
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_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
|
||||||
AC_PREREQ(2.1) dnl Minimum Autoconf version required.
|
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_PROG_CC
|
||||||
AC_CHECK_PROG(AR, ar, ar, ar)
|
AC_CHECK_PROG(AR, ar, ar, ar)
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|||||||
183
glob/fnmatch.c
183
glob/fnmatch.c
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
@@ -29,6 +29,23 @@
|
|||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#if HAVE_STRING_H
|
||||||
|
# include <string.h>
|
||||||
|
#else
|
||||||
|
# include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined STDC_HEADERS || defined _LIBC
|
||||||
|
# include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For platform which support the ISO C amendement 1 functionality we
|
||||||
|
support user defined character classes. */
|
||||||
|
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
||||||
|
# include <wchar.h>
|
||||||
|
# include <wctype.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
actually compiling the library itself. This code is part of the GNU C
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
@@ -47,8 +64,64 @@
|
|||||||
# define ISASCII(c) isascii(c)
|
# define ISASCII(c) isascii(c)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define ISUPPER(c) (ISASCII (c) && isupper (c))
|
#ifdef isblank
|
||||||
|
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||||
|
#else
|
||||||
|
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||||
|
#endif
|
||||||
|
#ifdef isgraph
|
||||||
|
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||||
|
#else
|
||||||
|
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||||
|
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||||
|
#define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||||
|
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||||
|
#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
|
||||||
|
#define ISLOWER(c) (ISASCII (c) && islower (c))
|
||||||
|
#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
|
||||||
|
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||||
|
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||||
|
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||||
|
|
||||||
|
# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
|
||||||
|
|
||||||
|
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
/* The GNU C library provides support for user-defined character classes
|
||||||
|
and the functions from ISO C amendement 1. */
|
||||||
|
# ifdef CHARCLASS_NAME_MAX
|
||||||
|
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
||||||
|
# else
|
||||||
|
/* This shouldn't happen but some implementation might still have this
|
||||||
|
problem. Use a reasonable default value. */
|
||||||
|
# define CHAR_CLASS_MAX_LENGTH 256
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef _LIBC
|
||||||
|
# define IS_CHAR_CLASS(string) __wctype (string)
|
||||||
|
# else
|
||||||
|
# define IS_CHAR_CLASS(string) wctype (string)
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
||||||
|
|
||||||
|
# define IS_CHAR_CLASS(string) \
|
||||||
|
(STREQ (string, "alpha") || STREQ (string, "upper") \
|
||||||
|
|| STREQ (string, "lower") || STREQ (string, "digit") \
|
||||||
|
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|
||||||
|
|| STREQ (string, "space") || STREQ (string, "print") \
|
||||||
|
|| STREQ (string, "punct") || STREQ (string, "graph") \
|
||||||
|
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Avoid depending on library functions or files
|
||||||
|
whose names are inconsistent. */
|
||||||
|
|
||||||
|
# if !defined _LIBC && !defined getenv
|
||||||
|
extern char *getenv ();
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifndef errno
|
# ifndef errno
|
||||||
extern int errno;
|
extern int errno;
|
||||||
@@ -66,7 +139,11 @@ fnmatch (pattern, string, flags)
|
|||||||
register char c;
|
register char c;
|
||||||
|
|
||||||
/* Note that this evaluates C many times. */
|
/* Note that this evaluates C many times. */
|
||||||
|
# ifdef _LIBC
|
||||||
|
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
||||||
|
# else
|
||||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||||
|
# endif
|
||||||
|
|
||||||
while ((c = *p++) != '\0')
|
while ((c = *p++) != '\0')
|
||||||
{
|
{
|
||||||
@@ -137,67 +214,124 @@ fnmatch (pattern, string, flags)
|
|||||||
case '[':
|
case '[':
|
||||||
{
|
{
|
||||||
/* Nonzero if the sense of the character class is inverted. */
|
/* Nonzero if the sense of the character class is inverted. */
|
||||||
|
static int posixly_correct;
|
||||||
register int not;
|
register int not;
|
||||||
|
char cold;
|
||||||
|
|
||||||
|
if (posixly_correct == 0)
|
||||||
|
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
|
||||||
|
|
||||||
if (*n == '\0')
|
if (*n == '\0')
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
if (*n == '.' && (flags & FNM_PERIOD) &&
|
||||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
not = (*p == '!' || *p == '^');
|
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||||
|
/* `/' cannot be matched. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
|
||||||
if (not)
|
if (not)
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
c = *p++;
|
c = *p++;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
register char cstart = c, cend = c;
|
int fn = FOLD (*n);
|
||||||
|
|
||||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||||
{
|
{
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
cstart = cend = *p++;
|
c = FOLD (*p++);
|
||||||
|
|
||||||
|
if (c == fn)
|
||||||
|
goto matched;
|
||||||
}
|
}
|
||||||
|
else if (c == '[' && *p == ':')
|
||||||
|
{
|
||||||
|
/* Leave room for the null. */
|
||||||
|
char str[CHAR_CLASS_MAX_LENGTH + 1];
|
||||||
|
size_t c1 = 0;
|
||||||
|
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
wctype_t wt;
|
||||||
|
# endif
|
||||||
|
|
||||||
cstart = cend = FOLD (cstart);
|
for (;;)
|
||||||
|
{
|
||||||
|
if (c1 == CHAR_CLASS_MAX_LENGTH)
|
||||||
|
/* The name is too long and therefore the pattern
|
||||||
|
is ill-formed. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
if (c == '\0')
|
c = *++p;
|
||||||
|
if (c == ':' && p[1] == ']')
|
||||||
|
{
|
||||||
|
p += 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
str[c1++] = 'c';
|
||||||
|
}
|
||||||
|
str[c1] = '\0';
|
||||||
|
|
||||||
|
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||||
|
wt = IS_CHAR_CLASS (str);
|
||||||
|
if (wt == 0)
|
||||||
|
/* Invalid character class name. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if (__iswctype (__btowc (*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)))
|
||||||
|
goto matched;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
else if (c == '\0')
|
||||||
/* [ (unterminated) loses. */
|
/* [ (unterminated) loses. */
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
else if (FOLD (c) == fn)
|
||||||
|
goto matched;
|
||||||
|
|
||||||
|
cold = c;
|
||||||
c = *p++;
|
c = *p++;
|
||||||
c = FOLD (c);
|
|
||||||
|
|
||||||
if ((flags & FNM_FILE_NAME) && c == '/')
|
|
||||||
/* [/] can never match. */
|
|
||||||
return FNM_NOMATCH;
|
|
||||||
|
|
||||||
if (c == '-' && *p != ']')
|
if (c == '-' && *p != ']')
|
||||||
{
|
{
|
||||||
cend = *p++;
|
/* It is a range. */
|
||||||
|
char cend = *p++;
|
||||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||||
cend = *p++;
|
cend = *p++;
|
||||||
if (cend == '\0')
|
if (cend == '\0')
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
cend = FOLD (cend);
|
|
||||||
|
if (cold <= fn && fn <= FOLD (cend))
|
||||||
|
goto matched;
|
||||||
|
|
||||||
c = *p++;
|
c = *p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
|
|
||||||
goto matched;
|
|
||||||
|
|
||||||
if (c == ']')
|
if (c == ']')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!not)
|
if (!not)
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
matched:;
|
matched:
|
||||||
/* Skip the rest of the [...] that already matched. */
|
/* Skip the rest of the [...] that already matched. */
|
||||||
while (c != ']')
|
while (c != ']')
|
||||||
{
|
{
|
||||||
@@ -213,6 +347,15 @@ fnmatch (pattern, string, flags)
|
|||||||
/* XXX 1003.2d11 is unclear if this is right. */
|
/* XXX 1003.2d11 is unclear if this is right. */
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
else if (c == '[' && *p == ':')
|
||||||
|
{
|
||||||
|
do
|
||||||
|
if (*++p == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
while (*p != ':' || p[1] == ']');
|
||||||
|
p += 2;
|
||||||
|
c = *p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (not)
|
if (not)
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@@ -17,25 +17,30 @@
|
|||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _FNMATCH_H
|
#ifndef _FNMATCH_H
|
||||||
|
|
||||||
#define _FNMATCH_H 1
|
#define _FNMATCH_H 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||||
|| defined (WINDOWS32))
|
# undef __P
|
||||||
#undef __P
|
# define __P(protos) protos
|
||||||
#define __P(protos) protos
|
|
||||||
#else /* Not C++ or ANSI C. */
|
#else /* Not C++ or ANSI C. */
|
||||||
#undef __P
|
# undef __P
|
||||||
#define __P(protos) ()
|
# define __P(protos) ()
|
||||||
/* We can get away without defining `const' here only because in this file
|
/* We can get away without defining `const' here only because in this file
|
||||||
it is used only inside the prototype for `fnmatch', which is elided in
|
it is used only inside the prototype for `fnmatch', which is elided in
|
||||||
non-ANSI C where `const' is problematical. */
|
non-ANSI C where `const' is problematical. */
|
||||||
#endif /* C++ or ANSI C. */
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
#ifndef const
|
||||||
|
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||||
|
# define __const const
|
||||||
|
# else
|
||||||
|
# define __const
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* We #undef these before defining them because some losing systems
|
/* We #undef these before defining them because some losing systems
|
||||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||||
@@ -48,18 +53,26 @@ extern "C" {
|
|||||||
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||||
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||||
|
|
||||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
|
||||||
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||||
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||||
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||||
#define FNM_NOMATCH 1
|
#define FNM_NOMATCH 1
|
||||||
|
|
||||||
|
/* This value is returned if the implementation does not support
|
||||||
|
`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
|
||||||
|
# define FNM_NOSYS (-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Match STRING against the filename pattern PATTERN,
|
/* Match STRING against the filename pattern PATTERN,
|
||||||
returning zero if it matches, FNM_NOMATCH if not. */
|
returning zero if it matches, FNM_NOMATCH if not. */
|
||||||
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
extern int fnmatch __P ((__const char *__pattern, __const char *__string,
|
||||||
int __flags));
|
int __flags));
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
705
glob/glob.c
705
glob/glob.c
File diff suppressed because it is too large
Load Diff
94
glob/glob.h
94
glob/glob.h
@@ -1,7 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU C Library. Its master source is NOT part of
|
|
||||||
the C library, however. The master source lives in /gd/gnu/lib.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
@@ -19,26 +16,27 @@
|
|||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _GLOB_H
|
#ifndef _GLOB_H
|
||||||
|
|
||||||
#define _GLOB_H 1
|
#define _GLOB_H 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef __ptr_t
|
#undef __ptr_t
|
||||||
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||||
|| defined (WINDOWS32))
|
# undef __P
|
||||||
#undef __P
|
# define __P(protos) protos
|
||||||
#define __P(protos) protos
|
# define __ptr_t void *
|
||||||
#define __ptr_t void *
|
# if !defined __GNUC__ || __GNUC__ < 2
|
||||||
|
# undef __const
|
||||||
|
# define __const const
|
||||||
|
# endif
|
||||||
#else /* Not C++ or ANSI C. */
|
#else /* Not C++ or ANSI C. */
|
||||||
#undef __P
|
# undef __P
|
||||||
#define __P(protos) ()
|
# define __P(protos) ()
|
||||||
#undef const
|
# undef __const
|
||||||
#define const
|
# define __const
|
||||||
#define __ptr_t char *
|
# define __ptr_t char *
|
||||||
#endif /* C++ or ANSI C. */
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
/* Bits set in the FLAGS argument to `glob'. */
|
/* Bits set in the FLAGS argument to `glob'. */
|
||||||
@@ -50,26 +48,46 @@ extern "C"
|
|||||||
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
||||||
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||||
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||||
#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
|
||||||
|
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|
||||||
|
|| defined _GNU_SOURCE)
|
||||||
|
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||||
|
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||||
|
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||||
|
# 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_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||||
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||||
GLOB_NOMAGIC|GLOB_TILDE)
|
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR)
|
||||||
|
#else
|
||||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
|
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||||
#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
GLOB_PERIOD)
|
||||||
#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
|
||||||
#define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
|
||||||
#define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Error returns from `glob'. */
|
/* Error returns from `glob'. */
|
||||||
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
||||||
#define GLOB_ABEND 2 /* Read error. */
|
#define GLOB_ABORTED 2 /* Read error. */
|
||||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||||
|
|
||||||
|
#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. */
|
/* Structure describing a globbing run. */
|
||||||
#if !defined (_AMIGA) && !defined (VMS) /* Buggy compiler. */
|
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
|
||||||
struct stat;
|
struct stat;
|
||||||
#endif
|
#endif
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -83,9 +101,9 @@ typedef struct
|
|||||||
are used instead of the normal file access functions. */
|
are used instead of the normal file access functions. */
|
||||||
void (*gl_closedir) __P ((void *));
|
void (*gl_closedir) __P ((void *));
|
||||||
struct dirent *(*gl_readdir) __P ((void *));
|
struct dirent *(*gl_readdir) __P ((void *));
|
||||||
__ptr_t (*gl_opendir) __P ((const char *));
|
__ptr_t (*gl_opendir) __P ((__const char *));
|
||||||
int (*gl_lstat) __P ((const char *, struct stat *));
|
int (*gl_lstat) __P ((__const char *, struct stat *));
|
||||||
int (*gl_stat) __P ((const char *, struct stat *));
|
int (*gl_stat) __P ((__const char *, struct stat *));
|
||||||
} glob_t;
|
} glob_t;
|
||||||
|
|
||||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||||
@@ -96,14 +114,24 @@ typedef struct
|
|||||||
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||||
Otherwise, `glob' returns zero. */
|
Otherwise, `glob' returns zero. */
|
||||||
extern int glob __P ((const char *__pattern, int __flags,
|
extern int glob __P ((__const char *__pattern, int __flags,
|
||||||
int (*__errfunc) __P ((const char *, int)),
|
int (*__errfunc) __P ((__const char *, int)),
|
||||||
glob_t *__pglob));
|
glob_t *__pglob));
|
||||||
|
|
||||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||||
extern void globfree __P ((glob_t *__pglob));
|
extern void globfree __P ((glob_t *__pglob));
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
/* Return nonzero if PATTERN contains any metacharacters.
|
||||||
|
Metacharacters can be quoted with backslashes if QUOTE is nonzero.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Implicit rule searching for GNU Make.
|
/* Implicit rule searching for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -111,14 +111,14 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
/* This buffer records all the dependencies actually found for a rule. */
|
/* This buffer records all the dependencies actually found for a rule. */
|
||||||
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
||||||
/* Number of dep names now in FOUND_FILES. */
|
/* Number of dep names now in FOUND_FILES. */
|
||||||
unsigned int deps_found;
|
unsigned int deps_found = 0;
|
||||||
|
|
||||||
/* Names of possible dependencies are constructed in this buffer. */
|
/* Names of possible dependencies are constructed in this buffer. */
|
||||||
register char *depname = (char *) alloca (namelen + max_pattern_dep_length);
|
register char *depname = (char *) alloca (namelen + max_pattern_dep_length);
|
||||||
|
|
||||||
/* The start and length of the stem of FILENAME for the current rule. */
|
/* The start and length of the stem of FILENAME for the current rule. */
|
||||||
register char *stem;
|
register char *stem = 0;
|
||||||
register unsigned int stemlen;
|
register unsigned int stemlen = 0;
|
||||||
|
|
||||||
/* Buffer in which we store all the rules that are possibly applicable. */
|
/* Buffer in which we store all the rules that are possibly applicable. */
|
||||||
struct rule **tryrules
|
struct rule **tryrules
|
||||||
|
|||||||
264
job.c
264
job.c
@@ -1,6 +1,5 @@
|
|||||||
/* Job execution and handling for GNU Make.
|
/* Job execution and handling for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
Free Software Foundation, Inc.
|
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -28,11 +27,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
char *default_shell = "sh.exe";
|
char *default_shell = "sh.exe";
|
||||||
int no_default_sh_exe = 1;
|
int no_default_sh_exe = 1;
|
||||||
|
int batch_mode_shell = 1;
|
||||||
#else /* WINDOWS32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
char default_shell[] = "";
|
char default_shell[] = "";
|
||||||
extern int MyExecute (char **);
|
extern int MyExecute (char **);
|
||||||
#else
|
#else /* _AMIGA */
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
/* The default shell is a pointer so we can change it if Makefile
|
/* 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
|
says so. It is without an explicit path so we get a chance
|
||||||
@@ -42,6 +42,7 @@ char *default_shell = "command.com";
|
|||||||
#else /* __MSDOS__ */
|
#else /* __MSDOS__ */
|
||||||
char default_shell[] = "/bin/sh";
|
char default_shell[] = "/bin/sh";
|
||||||
#endif /* __MSDOS__ */
|
#endif /* __MSDOS__ */
|
||||||
|
int batch_mode_shell = 0;
|
||||||
#endif /* _AMIGA */
|
#endif /* _AMIGA */
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
@@ -75,11 +76,6 @@ static int amiga_batch_file;
|
|||||||
#include "sub_proc.h"
|
#include "sub_proc.h"
|
||||||
#include "w32err.h"
|
#include "w32err.h"
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
|
|
||||||
/* this stuff used if no sh.exe is around */
|
|
||||||
static char *dos_bname;
|
|
||||||
static char *dos_bename;
|
|
||||||
static int dos_batch_file;
|
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
@@ -169,7 +165,7 @@ extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file
|
|||||||
extern int getloadavg PARAMS ((double loadavg[], int nelem));
|
extern int getloadavg PARAMS ((double loadavg[], int nelem));
|
||||||
extern int start_remote_job PARAMS ((char **argv, char **envp, int stdin_fd,
|
extern int start_remote_job PARAMS ((char **argv, char **envp, int stdin_fd,
|
||||||
int *is_remote, int *id_ptr, int *used_stdin));
|
int *is_remote, int *id_ptr, int *used_stdin));
|
||||||
extern int start_remote_job_p PARAMS ((void));
|
extern int start_remote_job_p PARAMS ((int));
|
||||||
extern int remote_status PARAMS ((int *exit_code_ptr, int *signal_ptr,
|
extern int remote_status PARAMS ((int *exit_code_ptr, int *signal_ptr,
|
||||||
int *coredump_ptr, int block));
|
int *coredump_ptr, int block));
|
||||||
|
|
||||||
@@ -328,9 +324,9 @@ reap_children (block, err)
|
|||||||
any_remote |= c->remote;
|
any_remote |= c->remote;
|
||||||
any_local |= ! c->remote;
|
any_local |= ! c->remote;
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
printf ("Live child 0x%08lx PID %d%s\n",
|
printf ("Live child 0x%08lx PID %ld%s\n",
|
||||||
(unsigned long int) c,
|
(unsigned long int) c,
|
||||||
c->pid, c->remote ? " (remote)" : "");
|
(long) c->pid, c->remote ? " (remote)" : "");
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@@ -444,17 +440,12 @@ reap_children (block, err)
|
|||||||
fprintf(stderr, "make (e=%d): %s",
|
fprintf(stderr, "make (e=%d): %s",
|
||||||
exit_code, map_windows32_error_to_string(exit_code));
|
exit_code, map_windows32_error_to_string(exit_code));
|
||||||
|
|
||||||
|
/* signal */
|
||||||
exit_sig = process_signal(hPID);
|
exit_sig = process_signal(hPID);
|
||||||
|
|
||||||
/* cleanup process */
|
/* cleanup process */
|
||||||
process_cleanup(hPID);
|
process_cleanup(hPID);
|
||||||
|
|
||||||
if (dos_batch_file) {
|
|
||||||
remove (dos_bname);
|
|
||||||
remove (dos_bename);
|
|
||||||
dos_batch_file = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
coredump = 0;
|
coredump = 0;
|
||||||
}
|
}
|
||||||
pid = (int) hPID;
|
pid = (int) hPID;
|
||||||
@@ -499,10 +490,22 @@ reap_children (block, err)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
printf ("Reaping %s child 0x%08lx PID %d%s\n",
|
printf ("Reaping %s child 0x%08lx PID %ld%s\n",
|
||||||
child_failed ? "losing" : "winning",
|
child_failed ? "losing" : "winning",
|
||||||
(unsigned long int) c,
|
(unsigned long int) c,
|
||||||
c->pid, c->remote ? " (remote)" : "");
|
(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);
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
/* If this child had the good stdin, say it is now free. */
|
/* If this child had the good stdin, say it is now free. */
|
||||||
if (c->good_stdin)
|
if (c->good_stdin)
|
||||||
@@ -550,7 +553,7 @@ reap_children (block, err)
|
|||||||
Whether or not we want to changes over time.
|
Whether or not we want to changes over time.
|
||||||
Also, start_remote_job may need state set up
|
Also, start_remote_job may need state set up
|
||||||
by start_remote_job_p. */
|
by start_remote_job_p. */
|
||||||
c->remote = start_remote_job_p ();
|
c->remote = start_remote_job_p (0);
|
||||||
start_job_command (c);
|
start_job_command (c);
|
||||||
/* Fatal signals are left blocked in case we were
|
/* Fatal signals are left blocked in case we were
|
||||||
about to put that child on the chain. But it is
|
about to put that child on the chain. But it is
|
||||||
@@ -587,9 +590,9 @@ reap_children (block, err)
|
|||||||
notice_finished_file (c->file);
|
notice_finished_file (c->file);
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
printf ("Removing child 0x%08lx PID %d%s from chain.\n",
|
printf ("Removing child 0x%08lx PID %ld%s from chain.\n",
|
||||||
(unsigned long int) c,
|
(unsigned long int) c,
|
||||||
c->pid, c->remote ? " (remote)" : "");
|
(long) c->pid, c->remote ? " (remote)" : "");
|
||||||
|
|
||||||
/* Block fatal signals while frobnicating the list, so that
|
/* Block fatal signals while frobnicating the list, so that
|
||||||
children and job_slots_used are always consistent. Otherwise
|
children and job_slots_used are always consistent. Otherwise
|
||||||
@@ -741,7 +744,7 @@ start_job_command (child)
|
|||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
argv = p;
|
argv = p;
|
||||||
#else
|
#else
|
||||||
argv = construct_command_argv (p, &end, child->file);
|
argv = construct_command_argv (p, &end, child->file, &child->sh_batch_file);
|
||||||
#endif
|
#endif
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
child->command_ptr = NULL;
|
child->command_ptr = NULL;
|
||||||
@@ -766,6 +769,9 @@ start_job_command (child)
|
|||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
{
|
{
|
||||||
next_command:
|
next_command:
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
execute_by_shell = 0; /* in case construct_command_argv sets it */
|
||||||
|
#endif
|
||||||
/* This line has no commands. Go to the next. */
|
/* This line has no commands. Go to the next. */
|
||||||
if (job_next_command (child))
|
if (job_next_command (child))
|
||||||
start_job_command (child);
|
start_job_command (child);
|
||||||
@@ -785,6 +791,25 @@ start_job_command (child)
|
|||||||
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
|
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
|
||||||
? "%s" : (char *) 0, p);
|
? "%s" : (char *) 0, p);
|
||||||
|
|
||||||
|
/* Optimize an empty command. People use this for timestamp rules,
|
||||||
|
and forking a useless shell all the time leads to inefficiency. */
|
||||||
|
|
||||||
|
#if !defined(VMS) && !defined(_AMIGA)
|
||||||
|
if (
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
unixy_shell /* the test is complicated and we already did it */
|
||||||
|
#else
|
||||||
|
(argv[0] && !strcmp(argv[0], "/bin/sh"))
|
||||||
|
#endif
|
||||||
|
&& (argv[1] && !strcmp(argv[1], "-c"))
|
||||||
|
&& (argv[2] && !strcmp(argv[2], ":"))
|
||||||
|
&& argv[3] == NULL)
|
||||||
|
{
|
||||||
|
set_command_state (child->file, cs_running);
|
||||||
|
goto next_command;
|
||||||
|
}
|
||||||
|
#endif /* !VMS && !_AMIGA */
|
||||||
|
|
||||||
/* Tell update_goal_chain that a command has been started on behalf of
|
/* Tell update_goal_chain that a command has been started on behalf of
|
||||||
this target. It is important that this happens here and not in
|
this target. It is important that this happens here and not in
|
||||||
reap_children (where we used to do it), because reap_children might be
|
reap_children (where we used to do it), because reap_children might be
|
||||||
@@ -811,9 +836,7 @@ start_job_command (child)
|
|||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
|
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
#ifndef WINDOWS32
|
#if !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
|
||||||
#ifndef _AMIGA
|
|
||||||
#ifndef __MSDOS__
|
|
||||||
|
|
||||||
/* Set up a bad standard input that reads from a broken pipe. */
|
/* Set up a bad standard input that reads from a broken pipe. */
|
||||||
|
|
||||||
@@ -841,9 +864,7 @@ start_job_command (child)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !AMIGA */
|
#endif /* !WINDOWS32 && !_AMIGA && !__MSDOS__ */
|
||||||
#endif /* !WINDOWS32 */
|
|
||||||
#endif /* !__MSDOS__ */
|
|
||||||
|
|
||||||
/* Decide whether to give this child the `good' standard input
|
/* Decide whether to give this child the `good' standard input
|
||||||
(one that points to the terminal or whatever), or the `bad' one
|
(one that points to the terminal or whatever), or the `bad' one
|
||||||
@@ -853,7 +874,7 @@ start_job_command (child)
|
|||||||
if (child->good_stdin)
|
if (child->good_stdin)
|
||||||
good_stdin_used = 1;
|
good_stdin_used = 1;
|
||||||
|
|
||||||
#endif /* Not VMS */
|
#endif /* !VMS */
|
||||||
|
|
||||||
child->deleted = 0;
|
child->deleted = 0;
|
||||||
|
|
||||||
@@ -873,7 +894,9 @@ start_job_command (child)
|
|||||||
if (start_remote_job (argv, child->environment,
|
if (start_remote_job (argv, child->environment,
|
||||||
child->good_stdin ? 0 : bad_stdin,
|
child->good_stdin ? 0 : bad_stdin,
|
||||||
&is_remote, &id, &used_stdin))
|
&is_remote, &id, &used_stdin))
|
||||||
goto error;
|
/* Don't give up; remote execution may fail for various reasons. If
|
||||||
|
so, simply run the job locally. */
|
||||||
|
goto run_local;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (child->good_stdin && !used_stdin)
|
if (child->good_stdin && !used_stdin)
|
||||||
@@ -892,6 +915,7 @@ start_job_command (child)
|
|||||||
|
|
||||||
char **parent_environ;
|
char **parent_environ;
|
||||||
|
|
||||||
|
run_local:
|
||||||
block_sigs ();
|
block_sigs ();
|
||||||
|
|
||||||
child->remote = 0;
|
child->remote = 0;
|
||||||
@@ -1052,7 +1076,7 @@ start_waiting_job (c)
|
|||||||
the local load average. We record that the job should be started
|
the local load average. We record that the job should be started
|
||||||
remotely in C->remote for start_job_command to test. */
|
remotely in C->remote for start_job_command to test. */
|
||||||
|
|
||||||
c->remote = start_remote_job_p ();
|
c->remote = start_remote_job_p (1);
|
||||||
|
|
||||||
/* If this job is to be started locally, and we are already running
|
/* 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. */
|
some jobs, make this one wait if the load average is too high. */
|
||||||
@@ -1237,6 +1261,7 @@ new_job (file)
|
|||||||
c->command_line = 0;
|
c->command_line = 0;
|
||||||
c->command_ptr = 0;
|
c->command_ptr = 0;
|
||||||
c->environment = 0;
|
c->environment = 0;
|
||||||
|
c->sh_batch_file = NULL;
|
||||||
|
|
||||||
/* Fetch the first command line to be run. */
|
/* Fetch the first command line to be run. */
|
||||||
job_next_command (c);
|
job_next_command (c);
|
||||||
@@ -1465,11 +1490,12 @@ child_execute_job (argv, child)
|
|||||||
}
|
}
|
||||||
*c = *p;
|
*c = *p;
|
||||||
|
|
||||||
/* check for maximum dcl length and create *.com file if neccesary */
|
/* Check for maximum DCL length and create *.com file if neccesary.
|
||||||
|
Also create a .com file if the command is more than one line long. */
|
||||||
|
|
||||||
comname[0] = '\0';
|
comname[0] = '\0';
|
||||||
|
|
||||||
if (strlen (cmd) > MAXCMDLEN)
|
if (strlen (cmd) > MAXCMDLEN || strchr (cmd, '\n'))
|
||||||
{
|
{
|
||||||
FILE *outfile;
|
FILE *outfile;
|
||||||
char tmp;
|
char tmp;
|
||||||
@@ -1591,6 +1617,61 @@ exec_command (argv, envp)
|
|||||||
perror_with_name ("execve: ", argv[0]);
|
perror_with_name ("execve: ", argv[0]);
|
||||||
_exit (EXIT_FAILURE);
|
_exit (EXIT_FAILURE);
|
||||||
#else
|
#else
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
HANDLE hPID;
|
||||||
|
HANDLE hWaitPID;
|
||||||
|
int err = 0;
|
||||||
|
int exit_code = EXIT_FAILURE;
|
||||||
|
|
||||||
|
/* make sure CreateProcess() has Path it needs */
|
||||||
|
sync_Path_environment();
|
||||||
|
|
||||||
|
/* launch command */
|
||||||
|
hPID = process_easy(argv, envp);
|
||||||
|
|
||||||
|
/* make sure launch ok */
|
||||||
|
if (hPID == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
fprintf(stderr,
|
||||||
|
"process_easy() failed failed to launch process (e=%d)\n",
|
||||||
|
process_last_err(hPID));
|
||||||
|
for (i = 0; argv[i]; i++)
|
||||||
|
fprintf(stderr, "%s ", argv[i]);
|
||||||
|
fprintf(stderr, "\nCounted %d args in failed launch\n", i);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wait and reap last child */
|
||||||
|
while (hWaitPID = process_wait_for_any())
|
||||||
|
{
|
||||||
|
/* was an error found on this process? */
|
||||||
|
err = process_last_err(hWaitPID);
|
||||||
|
|
||||||
|
/* get exit data */
|
||||||
|
exit_code = process_exit_code(hWaitPID);
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
fprintf(stderr, "make (e=%d, rc=%d): %s",
|
||||||
|
err, exit_code, map_windows32_error_to_string(err));
|
||||||
|
|
||||||
|
/* cleanup process */
|
||||||
|
process_cleanup(hWaitPID);
|
||||||
|
|
||||||
|
/* expect to find only last pid, warn about other pids reaped */
|
||||||
|
if (hWaitPID == hPID)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
fprintf(stderr,
|
||||||
|
"make reaped child pid %d, still waiting for pid %d\n",
|
||||||
|
hWaitPID, hPID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return child's exit code as our exit code */
|
||||||
|
exit(exit_code);
|
||||||
|
|
||||||
|
#else /* !WINDOWS32 */
|
||||||
|
|
||||||
/* Be the user, permanently. */
|
/* Be the user, permanently. */
|
||||||
child_access ();
|
child_access ();
|
||||||
|
|
||||||
@@ -1642,6 +1723,7 @@ exec_command (argv, envp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_exit (127);
|
_exit (127);
|
||||||
|
#endif /* !WINDOWS32 */
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
}
|
}
|
||||||
#else /* On Amiga */
|
#else /* On Amiga */
|
||||||
@@ -1673,9 +1755,10 @@ void clean_tmp (void)
|
|||||||
IFS is the value of $IFS, or nil (meaning the default). */
|
IFS is the value of $IFS, or nil (meaning the default). */
|
||||||
|
|
||||||
static char **
|
static char **
|
||||||
construct_command_argv_internal (line, restp, shell, ifs)
|
construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
|
||||||
char *line, **restp;
|
char *line, **restp;
|
||||||
char *shell, *ifs;
|
char *shell, *ifs;
|
||||||
|
char **batch_filename_ptr;
|
||||||
{
|
{
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
/* MSDOS supports both the stock DOS shell and ports of Unixy shells.
|
/* MSDOS supports both the stock DOS shell and ports of Unixy shells.
|
||||||
@@ -1740,7 +1823,11 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
"logout", "set", "umask", "wait", "while", "for",
|
"logout", "set", "umask", "wait", "while", "for",
|
||||||
"case", "if", ":", ".", "break", "continue",
|
"case", "if", ":", ".", "break", "continue",
|
||||||
"export", "read", "readonly", "shift", "times",
|
"export", "read", "readonly", "shift", "times",
|
||||||
"trap", "switch", "test", 0 };
|
"trap", "switch", "test",
|
||||||
|
#ifdef BATCH_MODE_ONLY_SHELL
|
||||||
|
"echo",
|
||||||
|
#endif
|
||||||
|
0 };
|
||||||
char* sh_chars;
|
char* sh_chars;
|
||||||
char** sh_cmds;
|
char** sh_cmds;
|
||||||
#else /* WINDOWS32 */
|
#else /* WINDOWS32 */
|
||||||
@@ -1854,7 +1941,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
if (*p == instring)
|
if (*p == instring)
|
||||||
{
|
{
|
||||||
instring = 0;
|
instring = 0;
|
||||||
if (*ap == '\0')
|
if (ap == new_argv[0] || *(ap-1) == '\0')
|
||||||
last_argument_was_empty = 1;
|
last_argument_was_empty = 1;
|
||||||
}
|
}
|
||||||
else if (*p == '\\' && p[1] == '\n')
|
else if (*p == '\\' && p[1] == '\n')
|
||||||
@@ -2074,38 +2161,6 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
++line;
|
++line;
|
||||||
if (*line == '\0')
|
if (*line == '\0')
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* only come here if no sh.exe command
|
|
||||||
*/
|
|
||||||
if (no_default_sh_exe)
|
|
||||||
{
|
|
||||||
FILE *batch;
|
|
||||||
dos_batch_file = 1;
|
|
||||||
if (dos_bname == 0)
|
|
||||||
{
|
|
||||||
dos_bname = tempnam (".", "mk");
|
|
||||||
for (i = 0; dos_bname[i] != '\0'; ++i)
|
|
||||||
if (dos_bname[i] == '/')
|
|
||||||
dos_bname[i] = '\\';
|
|
||||||
dos_bename = (char *) xmalloc (strlen (dos_bname) + 5);
|
|
||||||
strcpy (dos_bename, dos_bname);
|
|
||||||
strcat (dos_bname, ".bat");
|
|
||||||
strcat (dos_bename, ".err");
|
|
||||||
}
|
|
||||||
batch = fopen (dos_bename, "w"); /* Create a file. */
|
|
||||||
if (batch != NULL)
|
|
||||||
fclose (batch);
|
|
||||||
batch = fopen (dos_bname, "w");
|
|
||||||
fputs ("@echo off\n", batch);
|
|
||||||
fputs (line, batch);
|
|
||||||
fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename);
|
|
||||||
fclose (batch);
|
|
||||||
new_argv = (char **) xmalloc(2 * sizeof(char *));
|
|
||||||
new_argv[0] = strdup (dos_bname);
|
|
||||||
new_argv[1] = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
{
|
{
|
||||||
/* SHELL may be a multi-word command. Construct a command line
|
/* SHELL may be a multi-word command. Construct a command line
|
||||||
@@ -2119,12 +2174,14 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
|
|
||||||
char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
|
char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
|
||||||
+ (line_len * 2) + 1);
|
+ (line_len * 2) + 1);
|
||||||
|
char* command_ptr = NULL; /* used for batch_mode_shell mode */
|
||||||
|
|
||||||
ap = new_line;
|
ap = new_line;
|
||||||
bcopy (shell, ap, shell_len);
|
bcopy (shell, ap, shell_len);
|
||||||
ap += shell_len;
|
ap += shell_len;
|
||||||
bcopy (minus_c, ap, sizeof (minus_c) - 1);
|
bcopy (minus_c, ap, sizeof (minus_c) - 1);
|
||||||
ap += sizeof (minus_c) - 1;
|
ap += sizeof (minus_c) - 1;
|
||||||
|
command_ptr = ap;
|
||||||
for (p = line; *p != '\0'; ++p)
|
for (p = line; *p != '\0'; ++p)
|
||||||
{
|
{
|
||||||
if (restp != NULL && *p == '\n')
|
if (restp != NULL && *p == '\n')
|
||||||
@@ -2148,14 +2205,14 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
|
|
||||||
p = next_token (p);
|
p = next_token (p);
|
||||||
--p;
|
--p;
|
||||||
if (unixy_shell)
|
if (unixy_shell && !batch_mode_shell)
|
||||||
*ap++ = '\\';
|
*ap++ = '\\';
|
||||||
*ap++ = ' ';
|
*ap++ = ' ';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DOS shells don't know about backslash-escaping. */
|
/* DOS shells don't know about backslash-escaping. */
|
||||||
if (unixy_shell &&
|
if (unixy_shell && !batch_mode_shell &&
|
||||||
(*p == '\\' || *p == '\'' || *p == '"'
|
(*p == '\\' || *p == '\'' || *p == '"'
|
||||||
|| isspace (*p)
|
|| isspace (*p)
|
||||||
|| index (sh_chars, *p) != 0))
|
|| index (sh_chars, *p) != 0))
|
||||||
@@ -2176,9 +2233,63 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
return 0;
|
return 0;
|
||||||
*ap = '\0';
|
*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.
|
||||||
|
*/
|
||||||
|
if ((no_default_sh_exe || batch_mode_shell) && batch_filename_ptr) {
|
||||||
|
FILE* batch = NULL;
|
||||||
|
int id = GetCurrentProcessId();
|
||||||
|
PATH_VAR(fbuf);
|
||||||
|
char* fname = NULL;
|
||||||
|
|
||||||
|
/* create a file name */
|
||||||
|
sprintf(fbuf, "make%d", id);
|
||||||
|
fname = tempnam(".", fbuf);
|
||||||
|
|
||||||
|
/* create batch file name */
|
||||||
|
*batch_filename_ptr = xmalloc(strlen(fname) + 5);
|
||||||
|
strcpy(*batch_filename_ptr, fname);
|
||||||
|
|
||||||
|
/* make sure path name is in DOS backslash format */
|
||||||
|
if (!unixy_shell) {
|
||||||
|
fname = *batch_filename_ptr;
|
||||||
|
for (i = 0; fname[i] != '\0'; ++i)
|
||||||
|
if (fname[i] == '/')
|
||||||
|
fname[i] = '\\';
|
||||||
|
strcat(*batch_filename_ptr, ".bat");
|
||||||
|
} else {
|
||||||
|
strcat(*batch_filename_ptr, ".sh");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug_flag)
|
||||||
|
printf("Creating temporary batch file %s\n", *batch_filename_ptr);
|
||||||
|
|
||||||
|
/* create batch file to execute command */
|
||||||
|
batch = fopen (*batch_filename_ptr, "w");
|
||||||
|
fputs ("@echo off\n", batch);
|
||||||
|
fputs (command_ptr, batch);
|
||||||
|
fputc ('\n', batch);
|
||||||
|
fclose (batch);
|
||||||
|
|
||||||
|
/* create argv */
|
||||||
|
new_argv = (char **) xmalloc(3 * sizeof(char *));
|
||||||
|
if (unixy_shell) {
|
||||||
|
new_argv[0] = strdup (shell);
|
||||||
|
new_argv[1] = *batch_filename_ptr; /* only argv[0] gets freed later */
|
||||||
|
} else {
|
||||||
|
new_argv[0] = strdup (*batch_filename_ptr);
|
||||||
|
new_argv[1] = NULL;
|
||||||
|
}
|
||||||
|
new_argv[2] = NULL;
|
||||||
|
} else
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
if (unixy_shell)
|
if (unixy_shell)
|
||||||
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
|
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
|
||||||
(char *) 0, (char *) 0);
|
(char *) 0, (char *) 0,
|
||||||
|
(char *) 0);
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2192,6 +2303,10 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
new_line + shell_len + sizeof (minus_c) - 1, line_len);
|
new_line + shell_len + sizeof (minus_c) - 1, line_len);
|
||||||
new_argv[0][line_len] = '\0';
|
new_argv[0][line_len] = '\0';
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
else
|
||||||
|
fatal("%s (line %d) Invalid shell context (!unixy && !batch_mode_shell)\n",
|
||||||
|
__FILE__, __LINE__);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* ! AMIGA */
|
#endif /* ! AMIGA */
|
||||||
@@ -2213,9 +2328,10 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
variable expansion for $(SHELL) and $(IFS). */
|
variable expansion for $(SHELL) and $(IFS). */
|
||||||
|
|
||||||
char **
|
char **
|
||||||
construct_command_argv (line, restp, file)
|
construct_command_argv (line, restp, file, batch_filename_ptr)
|
||||||
char *line, **restp;
|
char *line, **restp;
|
||||||
struct file *file;
|
struct file *file;
|
||||||
|
char** batch_filename_ptr;
|
||||||
{
|
{
|
||||||
char *shell, *ifs;
|
char *shell, *ifs;
|
||||||
char **argv;
|
char **argv;
|
||||||
@@ -2241,7 +2357,7 @@ construct_command_argv (line, restp, file)
|
|||||||
warn_undefined_variables_flag = save;
|
warn_undefined_variables_flag = save;
|
||||||
}
|
}
|
||||||
|
|
||||||
argv = construct_command_argv_internal (line, restp, shell, ifs);
|
argv = construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr);
|
||||||
|
|
||||||
free (shell);
|
free (shell);
|
||||||
free (ifs);
|
free (ifs);
|
||||||
|
|||||||
3
job.h
3
job.h
@@ -44,6 +44,7 @@ struct child
|
|||||||
|
|
||||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
||||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
||||||
|
char* sh_batch_file; /* used to execute shell commands via scripts */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct child *children;
|
extern struct child *children;
|
||||||
@@ -52,7 +53,7 @@ extern void new_job PARAMS ((struct file *file));
|
|||||||
extern void reap_children PARAMS ((int block, int err));
|
extern void reap_children PARAMS ((int block, int err));
|
||||||
extern void start_waiting_jobs PARAMS ((void));
|
extern void start_waiting_jobs PARAMS ((void));
|
||||||
|
|
||||||
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file));
|
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file));
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
||||||
#else
|
#else
|
||||||
|
|||||||
324
main.c
324
main.c
@@ -1,5 +1,5 @@
|
|||||||
/* Argument parsing and main program of GNU Make.
|
/* Argument parsing and main program of GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,94,95,96,97,98 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -180,7 +180,6 @@ int print_version_flag = 0;
|
|||||||
|
|
||||||
static struct stringlist *makefiles = 0;
|
static struct stringlist *makefiles = 0;
|
||||||
|
|
||||||
|
|
||||||
/* Number of job slots (commands that can be run at once). */
|
/* Number of job slots (commands that can be run at once). */
|
||||||
|
|
||||||
unsigned int job_slots = 1;
|
unsigned int job_slots = 1;
|
||||||
@@ -392,6 +391,12 @@ struct file *default_file;
|
|||||||
This turns on pedantic compliance with POSIX.2. */
|
This turns on pedantic compliance with POSIX.2. */
|
||||||
|
|
||||||
int posix_pedantic;
|
int posix_pedantic;
|
||||||
|
|
||||||
|
/* Nonzero if some rule detected clock skew; we keep track so (a) we only
|
||||||
|
print one warning about it during the run, and (b) we can print a final
|
||||||
|
warning at the end of the run. */
|
||||||
|
|
||||||
|
int clock_skew_detected;
|
||||||
|
|
||||||
/* Mask of signals that are being caught with fatal_error_signal. */
|
/* Mask of signals that are being caught with fatal_error_signal. */
|
||||||
|
|
||||||
@@ -526,8 +531,99 @@ handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo )
|
|||||||
return EXCEPTION_CONTINUE_SEARCH;
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
#else
|
#else
|
||||||
exit(255);
|
exit(255);
|
||||||
|
return (255); /* not reached */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On WIN32 systems we don't have the luxury of a /bin directory that
|
||||||
|
* is mapped globally to every drive mounted to the system. Since make could
|
||||||
|
* be invoked from any drive, and we don't want to propogate /bin/sh
|
||||||
|
* to every single drive. Allow ourselves a chance to search for
|
||||||
|
* a value for default shell here (if the default path does not exist).
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
find_and_set_default_shell(char *token)
|
||||||
|
{
|
||||||
|
int sh_found = 0;
|
||||||
|
char* search_token;
|
||||||
|
PATH_VAR(sh_path);
|
||||||
|
extern char *default_shell;
|
||||||
|
|
||||||
|
if (!token)
|
||||||
|
search_token = default_shell;
|
||||||
|
else
|
||||||
|
search_token = token;
|
||||||
|
|
||||||
|
if (!no_default_sh_exe &&
|
||||||
|
(token == NULL || !strcmp(search_token, default_shell))) {
|
||||||
|
/* no new information, path already set or known */
|
||||||
|
sh_found = 1;
|
||||||
|
} 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));
|
||||||
|
if (debug_flag)
|
||||||
|
printf("find_and_set_shell setting default_shell = %s\n", default_shell);
|
||||||
|
sh_found = 1;
|
||||||
|
} else {
|
||||||
|
char *p;
|
||||||
|
struct variable *v = lookup_variable ("Path", 4);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Search Path for shell
|
||||||
|
*/
|
||||||
|
if (v && v->value) {
|
||||||
|
char *ep;
|
||||||
|
|
||||||
|
p = v->value;
|
||||||
|
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
||||||
|
|
||||||
|
while (ep && *ep) {
|
||||||
|
*ep = '\0';
|
||||||
|
|
||||||
|
if (dir_file_exists_p(p, search_token)) {
|
||||||
|
sprintf(sh_path, "%s/%s", p, search_token);
|
||||||
|
default_shell = strdup(w32ify(sh_path,0));
|
||||||
|
sh_found = 1;
|
||||||
|
*ep = PATH_SEPARATOR_CHAR;
|
||||||
|
|
||||||
|
/* terminate loop */
|
||||||
|
p += strlen(p);
|
||||||
|
} else {
|
||||||
|
*ep = PATH_SEPARATOR_CHAR;
|
||||||
|
p = ++ep;
|
||||||
|
}
|
||||||
|
|
||||||
|
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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));
|
||||||
|
sh_found = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug_flag && sh_found)
|
||||||
|
printf("find_and_set_shell path search set default_shell = %s\n", default_shell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* naive test */
|
||||||
|
if (!unixy_shell && sh_found &&
|
||||||
|
(strstr(default_shell, "sh") || strstr(default_shell, "SH"))) {
|
||||||
|
unixy_shell = 1;
|
||||||
|
batch_mode_shell = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BATCH_MODE_ONLY_SHELL
|
||||||
|
batch_mode_shell = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (sh_found);
|
||||||
|
}
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
@@ -550,17 +646,21 @@ main (argc, argv, envp)
|
|||||||
int main (int argc, char ** argv)
|
int main (int argc, char ** argv)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
static char *stdin_nm = 0;
|
||||||
register struct file *f;
|
register struct file *f;
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
char **p;
|
char **p;
|
||||||
struct dep *read_makefiles;
|
struct dep *read_makefiles;
|
||||||
PATH_VAR (current_directory);
|
PATH_VAR (current_directory);
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
extern int no_default_sh_exe;
|
|
||||||
char *unix_path = NULL;
|
char *unix_path = NULL;
|
||||||
char *windows32_path = NULL;
|
char *windows32_path = NULL;
|
||||||
|
|
||||||
SetUnhandledExceptionFilter(handle_runtime_exceptions);
|
SetUnhandledExceptionFilter(handle_runtime_exceptions);
|
||||||
|
|
||||||
|
/* start off assuming we have no shell */
|
||||||
|
unixy_shell = 0;
|
||||||
|
no_default_sh_exe = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default_goal_file = 0;
|
default_goal_file = 0;
|
||||||
@@ -702,18 +802,26 @@ int main (int argc, char ** argv)
|
|||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
for (i = 0; envp[i] != 0; ++i)
|
for (i = 0; envp[i] != 0; ++i)
|
||||||
{
|
{
|
||||||
|
int do_not_define;
|
||||||
register char *ep = envp[i];
|
register char *ep = envp[i];
|
||||||
|
|
||||||
|
/* by default, everything gets defined and exported */
|
||||||
|
do_not_define = 0;
|
||||||
|
|
||||||
while (*ep != '=')
|
while (*ep != '=')
|
||||||
++ep;
|
++ep;
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
if (!unix_path && !strncmp(envp[i], "PATH=", 5))
|
if (!unix_path && !strncmp(envp[i], "PATH=", 5))
|
||||||
unix_path = ep+1;
|
unix_path = ep+1;
|
||||||
if (!windows32_path && !strncmp(envp[i], "Path=", 5))
|
else if (!windows32_path && !strnicmp(envp[i], "Path=", 5)) {
|
||||||
|
do_not_define = 1; /* it gets defined after loop exits */
|
||||||
windows32_path = ep+1;
|
windows32_path = ep+1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
/* The result of pointer arithmetic is cast to unsigned int for
|
/* The result of pointer arithmetic is cast to unsigned int for
|
||||||
machines where ptrdiff_t is a different size that doesn't widen
|
machines where ptrdiff_t is a different size that doesn't widen
|
||||||
the same. */
|
the same. */
|
||||||
|
if (!do_not_define)
|
||||||
define_variable (envp[i], (unsigned int) (ep - envp[i]),
|
define_variable (envp[i], (unsigned int) (ep - envp[i]),
|
||||||
ep + 1, o_env, 1)
|
ep + 1, o_env, 1)
|
||||||
/* Force exportation of every variable culled from the environment.
|
/* Force exportation of every variable culled from the environment.
|
||||||
@@ -724,6 +832,16 @@ int main (int argc, char ** argv)
|
|||||||
->export = v_export;
|
->export = v_export;
|
||||||
}
|
}
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* Make sure that this particular spelling of 'Path' is available
|
||||||
|
*/
|
||||||
|
if (windows32_path)
|
||||||
|
define_variable("Path", 4, windows32_path, o_env, 1)->export = v_export;
|
||||||
|
else if (unix_path)
|
||||||
|
define_variable("Path", 4, unix_path, o_env, 1)->export = v_export;
|
||||||
|
else
|
||||||
|
define_variable("Path", 4, "", o_env, 1)->export = v_export;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PATH defaults to Path iff PATH not found and Path is found.
|
* PATH defaults to Path iff PATH not found and Path is found.
|
||||||
*/
|
*/
|
||||||
@@ -834,7 +952,7 @@ int main (int argc, char ** argv)
|
|||||||
if (! v->recursive)
|
if (! v->recursive)
|
||||||
++len;
|
++len;
|
||||||
++len;
|
++len;
|
||||||
len += 2 * strlen (v->value);
|
len += 3 * strlen (v->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now allocate a buffer big enough and fill it. */
|
/* Now allocate a buffer big enough and fill it. */
|
||||||
@@ -893,68 +1011,8 @@ int main (int argc, char ** argv)
|
|||||||
* lookups to fail because the current directory (.) was pointing
|
* lookups to fail because the current directory (.) was pointing
|
||||||
* at the wrong place when it was first evaluated.
|
* at the wrong place when it was first evaluated.
|
||||||
*/
|
*/
|
||||||
|
no_default_sh_exe = !find_and_set_default_shell(NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* On Windows/NT, we don't have the luxury of a /bin directory that
|
|
||||||
* is mapped globally to every drive mounted to the system. Since make could
|
|
||||||
* be invoked from any drive, and we don't want to propogate /bin/sh
|
|
||||||
* to every single drive. Allow ourselves a chance to search for
|
|
||||||
* a value for default shell here (if the default path does not exist).
|
|
||||||
*
|
|
||||||
* The value of default_shell is set here, but it could get reset after
|
|
||||||
* the Makefiles are read in. See logic below where SHELL is checked
|
|
||||||
* after the call to read_all_makefiles() completes.
|
|
||||||
*
|
|
||||||
* The reason SHELL is set here is so that macros can be safely evaluated
|
|
||||||
* as makefiles are read in (some macros require $SHELL).
|
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
|
||||||
extern char *default_shell;
|
|
||||||
|
|
||||||
if (!file_exists_p(default_shell)) {
|
|
||||||
char *p;
|
|
||||||
struct variable *v = lookup_variable ("Path", 4);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Try and make sure we have a full path to default_shell before
|
|
||||||
* we parse makefiles.
|
|
||||||
*/
|
|
||||||
if (v && v->value) {
|
|
||||||
PATH_VAR(sh_path);
|
|
||||||
char *ep;
|
|
||||||
|
|
||||||
p = v->value;
|
|
||||||
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
|
||||||
|
|
||||||
while (ep && *ep) {
|
|
||||||
*ep = '\0';
|
|
||||||
|
|
||||||
if (dir_file_exists_p(p, default_shell)) {
|
|
||||||
sprintf(sh_path, "%s/%s", p, default_shell);
|
|
||||||
default_shell = strdup(w32ify(sh_path,0));
|
|
||||||
no_default_sh_exe = 0;
|
|
||||||
*ep = PATH_SEPARATOR_CHAR;
|
|
||||||
|
|
||||||
/* terminate loop */
|
|
||||||
p += strlen(p);
|
|
||||||
} else {
|
|
||||||
*ep = PATH_SEPARATOR_CHAR;
|
|
||||||
p = ++ep;
|
|
||||||
}
|
|
||||||
|
|
||||||
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* be sure to check last element of Path */
|
|
||||||
if (p && *p && dir_file_exists_p(p, default_shell)) {
|
|
||||||
sprintf(sh_path, "%s/%s", p, default_shell);
|
|
||||||
default_shell = strdup(w32ify(sh_path,0));
|
|
||||||
no_default_sh_exe = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
/* Figure out the level of recursion. */
|
/* Figure out the level of recursion. */
|
||||||
{
|
{
|
||||||
@@ -1001,6 +1059,8 @@ int main (int argc, char ** argv)
|
|||||||
starting_directory = current_directory;
|
starting_directory = current_directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(void) define_variable ("CURDIR", 6, current_directory, o_default, 0);
|
||||||
|
|
||||||
/* Read any stdin makefiles into temporary files. */
|
/* Read any stdin makefiles into temporary files. */
|
||||||
|
|
||||||
if (makefiles != 0)
|
if (makefiles != 0)
|
||||||
@@ -1028,6 +1088,9 @@ int main (int argc, char ** argv)
|
|||||||
(void) tmpnam (name);
|
(void) tmpnam (name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (stdin_nm)
|
||||||
|
fatal("Makefile from standard input specified twice.");
|
||||||
|
|
||||||
outfile = fopen (name, "w");
|
outfile = fopen (name, "w");
|
||||||
if (outfile == 0)
|
if (outfile == 0)
|
||||||
pfatal_with_name ("fopen (temporary file)");
|
pfatal_with_name ("fopen (temporary file)");
|
||||||
@@ -1038,9 +1101,6 @@ int main (int argc, char ** argv)
|
|||||||
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
|
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
|
||||||
pfatal_with_name ("fwrite (temporary file)");
|
pfatal_with_name ("fwrite (temporary file)");
|
||||||
}
|
}
|
||||||
/* Try to make sure we won't remake the temporary
|
|
||||||
file when we are re-exec'd. Kludge-o-matic! */
|
|
||||||
fprintf (outfile, "%s:;\n", name);
|
|
||||||
(void) fclose (outfile);
|
(void) fclose (outfile);
|
||||||
|
|
||||||
/* Replace the name that read_all_makefiles will
|
/* Replace the name that read_all_makefiles will
|
||||||
@@ -1054,14 +1114,15 @@ int main (int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure the temporary file will not be remade. */
|
/* Make sure the temporary file will not be remade. */
|
||||||
f = enter_file (savestring (name, sizeof name - 1));
|
stdin_nm = savestring (name, sizeof(name) -1);
|
||||||
|
f = enter_file (stdin_nm);
|
||||||
f->updated = 1;
|
f->updated = 1;
|
||||||
f->update_status = 0;
|
f->update_status = 0;
|
||||||
f->command_state = cs_finished;
|
f->command_state = cs_finished;
|
||||||
/* Let it be removed when we're done. */
|
/* Can't be intermediate, or it'll be removed too early for
|
||||||
f->intermediate = 1;
|
make re-exec. */
|
||||||
/* But don't mention it. */
|
f->intermediate = 0;
|
||||||
f->dontcare = 1;
|
f->dontcare = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1101,53 +1162,6 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
define_makeflags (0, 0);
|
define_makeflags (0, 0);
|
||||||
|
|
||||||
#ifdef WINDOWS32
|
|
||||||
/*
|
|
||||||
* Now that makefiles are parsed, see if a Makefile gave a
|
|
||||||
* value for SHELL and use that for default_shell instead if
|
|
||||||
* that filename exists. This should speed up the
|
|
||||||
* construct_argv_internal() function by avoiding unnecessary
|
|
||||||
* recursion.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
struct variable *v = lookup_variable("SHELL", 5);
|
|
||||||
extern char* default_shell;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* to change value:
|
|
||||||
*
|
|
||||||
* SHELL must be found, SHELL must be set, value of SHELL
|
|
||||||
* must be different from current value, and the
|
|
||||||
* specified file must exist. Whew!
|
|
||||||
*/
|
|
||||||
if (v != 0 && *v->value != '\0') {
|
|
||||||
char *fn = recursively_expand(v);
|
|
||||||
|
|
||||||
if (fn && strcmp(fn, default_shell) && file_exists_p(fn)) {
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
default_shell = fn;
|
|
||||||
|
|
||||||
/* if Makefile says SHELL is sh.exe, believe it */
|
|
||||||
if (strstr(default_shell, "sh.exe"))
|
|
||||||
no_default_sh_exe = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert from backslashes to forward slashes so
|
|
||||||
* create_command_line_argv_internal() is not confused.
|
|
||||||
*/
|
|
||||||
for (p = strchr(default_shell, '\\'); p; p = strchr(default_shell, '\\'))
|
|
||||||
*p = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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.");
|
|
||||||
job_slots = 1;
|
|
||||||
}
|
|
||||||
#endif /* WINDOWS32 */
|
|
||||||
|
|
||||||
/* Define the default variables. */
|
/* Define the default variables. */
|
||||||
define_default_variables ();
|
define_default_variables ();
|
||||||
|
|
||||||
@@ -1158,6 +1172,18 @@ int main (int argc, char ** argv)
|
|||||||
read_makefiles
|
read_makefiles
|
||||||
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
|
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/* look one last time after reading all Makefiles */
|
||||||
|
if (no_default_sh_exe)
|
||||||
|
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.");
|
||||||
|
job_slots = 1;
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
/* We need to know what kind of shell we will be using. */
|
/* We need to know what kind of shell we will be using. */
|
||||||
{
|
{
|
||||||
@@ -1250,7 +1276,7 @@ int main (int argc, char ** argv)
|
|||||||
time_t *makefile_mtimes = 0;
|
time_t *makefile_mtimes = 0;
|
||||||
unsigned int mm_idx = 0;
|
unsigned int mm_idx = 0;
|
||||||
char **nargv = argv;
|
char **nargv = argv;
|
||||||
char nargc = argc;
|
int nargc = argc;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
puts ("Updating makefiles....");
|
puts ("Updating makefiles....");
|
||||||
@@ -1289,7 +1315,7 @@ int main (int argc, char ** argv)
|
|||||||
/* Free the storage. */
|
/* Free the storage. */
|
||||||
free ((char *) d);
|
free ((char *) d);
|
||||||
|
|
||||||
d = last == 0 ? 0 : last->next;
|
d = last == 0 ? read_makefiles : last->next;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1410,22 +1436,12 @@ int main (int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add -o options for all makefiles that were remade */
|
/* Add -o option for the stdin temporary file, if necessary. */
|
||||||
|
if (stdin_nm)
|
||||||
{
|
{
|
||||||
register unsigned int i;
|
nargv = (char **)xmalloc((nargc + 2) * sizeof(char *));
|
||||||
struct dep *d;
|
|
||||||
|
|
||||||
for (i = argc+1, d = read_makefiles; d != 0; d = d->next)
|
|
||||||
i += d->file->updated != 0;
|
|
||||||
|
|
||||||
nargv = (char **)xmalloc(i * sizeof(char *));
|
|
||||||
bcopy(argv, nargv, argc * sizeof(char *));
|
bcopy(argv, nargv, argc * sizeof(char *));
|
||||||
|
nargv[nargc++] = concat("-o", stdin_nm, "");
|
||||||
for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next)
|
|
||||||
{
|
|
||||||
if (d->file->updated)
|
|
||||||
nargv[nargc++] = concat("-o", dep_name(d), "");
|
|
||||||
}
|
|
||||||
nargv[nargc] = 0;
|
nargv[nargc] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1501,6 +1517,11 @@ int main (int argc, char ** argv)
|
|||||||
/* Set up `MAKEFLAGS' again for the normal targets. */
|
/* Set up `MAKEFLAGS' again for the normal targets. */
|
||||||
define_makeflags (1, 0);
|
define_makeflags (1, 0);
|
||||||
|
|
||||||
|
/* If there is a temp file from reading a makefile from stdin, get rid of
|
||||||
|
it now. */
|
||||||
|
if (stdin_nm && unlink(stdin_nm) < 0 && errno != ENOENT)
|
||||||
|
perror_with_name("unlink (temporary file): ", stdin_nm);
|
||||||
|
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@@ -1554,6 +1575,10 @@ int main (int argc, char ** argv)
|
|||||||
fatal ("No targets");
|
fatal ("No targets");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we detected some clock skew, generate one last warning */
|
||||||
|
if (clock_skew_detected)
|
||||||
|
error("*** Warning: Clock skew detected. Your build may be incomplete.");
|
||||||
|
|
||||||
/* Exit. */
|
/* Exit. */
|
||||||
die (status);
|
die (status);
|
||||||
}
|
}
|
||||||
@@ -2314,12 +2339,12 @@ print_version ()
|
|||||||
printf ("-%s", remote_description);
|
printf ("-%s", remote_description);
|
||||||
|
|
||||||
printf (", by Richard Stallman and Roland McGrath.\n\
|
printf (", by Richard Stallman and Roland McGrath.\n\
|
||||||
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96\n\
|
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98\n\
|
||||||
%s\tFree Software Foundation, Inc.\n\
|
%s\tFree Software Foundation, Inc.\n\
|
||||||
%sThis is free software; see the source for copying conditions.\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\
|
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||||
%sPARTICULAR PURPOSE.\n\n\
|
%sPARTICULAR PURPOSE.\n\n\
|
||||||
%sReport bugs to <bug-gnu-utils@prep.ai.mit.edu>.\n\n",
|
%sReport bugs to <bug-make@gnu.org>.\n\n",
|
||||||
precede, precede, precede, precede, precede, precede);
|
precede, precede, precede, precede, precede, precede);
|
||||||
|
|
||||||
printed_version = 1;
|
printed_version = 1;
|
||||||
@@ -2363,13 +2388,6 @@ die (status)
|
|||||||
|
|
||||||
dying = 1;
|
dying = 1;
|
||||||
|
|
||||||
/* Try to move back to the original directory. This is essential on
|
|
||||||
MS-DOS (where there is really only one process), and on Unix it
|
|
||||||
puts core files in the original directory instead of the -C
|
|
||||||
directory. */
|
|
||||||
if (directory_before_chdir != 0)
|
|
||||||
chdir (directory_before_chdir);
|
|
||||||
|
|
||||||
if (print_version_flag)
|
if (print_version_flag)
|
||||||
print_version ();
|
print_version ();
|
||||||
|
|
||||||
@@ -2386,6 +2404,14 @@ die (status)
|
|||||||
if (print_data_base_flag)
|
if (print_data_base_flag)
|
||||||
print_data_base ();
|
print_data_base ();
|
||||||
|
|
||||||
|
/* Try to move back to the original directory. This is essential on
|
||||||
|
MS-DOS (where there is really only one process), and on Unix it
|
||||||
|
puts core files in the original directory instead of the -C
|
||||||
|
directory. Must wait until after remove_intermediates(), or unlinks
|
||||||
|
of relative pathnames fail. */
|
||||||
|
if (directory_before_chdir != 0)
|
||||||
|
chdir (directory_before_chdir);
|
||||||
|
|
||||||
log_working_directory (0);
|
log_working_directory (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2400,7 +2426,7 @@ log_working_directory (entering)
|
|||||||
int entering;
|
int entering;
|
||||||
{
|
{
|
||||||
static int entered = 0;
|
static int entered = 0;
|
||||||
char *message = entering ? "Entering" : "Leaving";
|
char *msg = entering ? "Entering" : "Leaving";
|
||||||
|
|
||||||
/* Print nothing without the flag. Don't print the entering message
|
/* Print nothing without the flag. Don't print the entering message
|
||||||
again if we already have. Don't print the leaving message if we
|
again if we already have. Don't print the leaving message if we
|
||||||
@@ -2414,9 +2440,9 @@ log_working_directory (entering)
|
|||||||
fputs ("# ", stdout);
|
fputs ("# ", stdout);
|
||||||
|
|
||||||
if (makelevel == 0)
|
if (makelevel == 0)
|
||||||
printf ("%s: %s ", program, message);
|
printf ("%s: %s ", program, msg);
|
||||||
else
|
else
|
||||||
printf ("%s[%u]: %s ", program, makelevel, message);
|
printf ("%s[%u]: %s ", program, makelevel, msg);
|
||||||
|
|
||||||
if (starting_directory == 0)
|
if (starting_directory == 0)
|
||||||
puts ("an unknown directory");
|
puts ("an unknown directory");
|
||||||
|
|||||||
86
maintMakefile
Normal file
86
maintMakefile
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Find the glob source files... this might be dangerous, but we're maintainers!
|
||||||
|
#
|
||||||
|
globsrc := $(wildcard glob/*.c)
|
||||||
|
globhdr := $(wildcard glob/*.h)
|
||||||
|
|
||||||
|
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
|
||||||
|
MTEMPLATES = Makefile.DOS SMakefile
|
||||||
|
|
||||||
|
# General rule for turning a .template into a regular file.
|
||||||
|
#
|
||||||
|
$(TEMPLATES) : % : %.template configure.in
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||||
|
-e 's@%PACKAGE%@$(PACKAGE)@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
# Construct Makefiles by adding on dependencies, etc.
|
||||||
|
#
|
||||||
|
$(MTEMPLATES) : % : %.template .dep_segment Makefile.am maintMakefile
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||||
|
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \
|
||||||
|
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \
|
||||||
|
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \
|
||||||
|
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \
|
||||||
|
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \
|
||||||
|
$< > $@
|
||||||
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||||
|
cat $(word 2,$^) >>$@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
|
||||||
|
rm -f $@
|
||||||
|
cp $< $@
|
||||||
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||||
|
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
# Construct build.sh.in
|
||||||
|
#
|
||||||
|
build.sh.in: build.template Makefile.am maintMakefile
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
|
||||||
|
$(patsubst %.c,%.o,$(globsrc)))@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w+x $@
|
||||||
|
|
||||||
|
# Use automake to build a dependency list file, for "foreign" makefiles like
|
||||||
|
# Makefile.DOS.
|
||||||
|
#
|
||||||
|
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
||||||
|
$(AUTOMAKE) --generate-deps --build-dir=. --srcdir-name=.
|
||||||
|
|
||||||
|
# We clean everything here. The GNU standards for makefile conventions say
|
||||||
|
# you shouldn't remove configure, etc., but this makefile is only available
|
||||||
|
# in a full development distribution, so they'll only be removed then.
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
|
||||||
|
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
||||||
|
missing build.sh.in .dep_segment
|
||||||
|
|
||||||
|
# Put the alpha distribution files up for anonymous FTP.
|
||||||
|
#
|
||||||
|
ALPHA := ~ftp/gnu
|
||||||
|
TARFILE := $(distdir).tar.gz
|
||||||
|
|
||||||
|
.PHONY: alpha
|
||||||
|
alpha: $(ALPHA) $(TARFILE)
|
||||||
|
@rm -f $(ALPHA)/$(TARFILE)
|
||||||
|
cp -p $(TARFILE) $(ALPHA)
|
||||||
|
|
||||||
|
# This is needed because normal builds with GCC don't compile alloca.c, so
|
||||||
|
# alloca.P doesn't get built :-/.
|
||||||
|
#
|
||||||
|
.deps/alloca.P: alloca.c
|
||||||
|
$(COMPILE) -M -o $@ $<
|
||||||
@@ -209,11 +209,12 @@ don't need to replace them with other programs.
|
|||||||
Each program-name variable should come with an options variable that is
|
Each program-name variable should come with an options variable that is
|
||||||
used to supply options to the program. Append @samp{FLAGS} to the
|
used to supply options to the program. Append @samp{FLAGS} to the
|
||||||
program-name variable name to get the options variable name---for
|
program-name variable name to get the options variable name---for
|
||||||
example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to
|
example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C
|
||||||
this rule, but we keep it because it is standard.) Use @code{CPPFLAGS}
|
compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are
|
||||||
in any compilation command that runs the preprocessor, and use
|
exceptions to this rule, but we keep them because they are standard.)
|
||||||
@code{LDFLAGS} in any compilation command that does linking as well as
|
Use @code{CPPFLAGS} in any compilation command that runs the
|
||||||
in any direct use of @code{ld}.
|
preprocessor, and use @code{LDFLAGS} in any compilation command that
|
||||||
|
does linking as well as in any direct use of @code{ld}.
|
||||||
|
|
||||||
If there are C compiler options that @emph{must} be used for proper
|
If there are C compiler options that @emph{must} be used for proper
|
||||||
compilation of certain files, do not include them in @code{CFLAGS}.
|
compilation of certain files, do not include them in @code{CFLAGS}.
|
||||||
|
|||||||
20
make.1
20
make.1
@@ -5,17 +5,16 @@ make \- GNU make utility to maintain groups of programs
|
|||||||
.B "make "
|
.B "make "
|
||||||
[
|
[
|
||||||
.B \-f
|
.B \-f
|
||||||
makefile ] [ option ] ...
|
.I makefile
|
||||||
|
] [ option ] ...
|
||||||
target ...
|
target ...
|
||||||
.SH WARNING
|
.SH WARNING
|
||||||
This man paage is an extract of the documentation of
|
This man page is an extract of the documentation of
|
||||||
.I GNU make .
|
.I GNU make .
|
||||||
It is updated only occasionally, because the GNU project does not use nroff.
|
It is updated only occasionally, because the GNU project does not use nroff.
|
||||||
For complete, current documentation, refer to the Info file
|
For complete, current documentation, refer to the Info file
|
||||||
.B make
|
.B make.info
|
||||||
or the DVI file
|
which is made from the Texinfo source file
|
||||||
.B make.dvi
|
|
||||||
which are made from the Texinfo source file
|
|
||||||
.BR make.texinfo .
|
.BR make.texinfo .
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.LP
|
.LP
|
||||||
@@ -24,7 +23,7 @@ The purpose of the
|
|||||||
utility is to determine automatically which
|
utility is to determine automatically which
|
||||||
pieces of a large program need to be recompiled, and issue the commands to
|
pieces of a large program need to be recompiled, and issue the commands to
|
||||||
recompile them.
|
recompile them.
|
||||||
This manual describes the GNU implementation of
|
The manual describes the GNU implementation of
|
||||||
.IR make ,
|
.IR make ,
|
||||||
which was written by Richard Stallman and Roland McGrath.
|
which was written by Richard Stallman and Roland McGrath.
|
||||||
Our examples show C programs, since they are most common, but you can use
|
Our examples show C programs, since they are most common, but you can use
|
||||||
@@ -288,12 +287,7 @@ command on the given file before running
|
|||||||
except that the modification time is changed only in the imagination of
|
except that the modification time is changed only in the imagination of
|
||||||
.IR make .
|
.IR make .
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.PD 0
|
.I "The GNU Make Manual"
|
||||||
.TP 2.0i
|
|
||||||
/usr/local/doc/gnumake.dvi
|
|
||||||
.I
|
|
||||||
The GNU Make Manual
|
|
||||||
.PD
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
See the chapter `Problems and Bugs' in
|
See the chapter `Problems and Bugs' in
|
||||||
.I "The GNU Make Manual" .
|
.I "The GNU Make Manual" .
|
||||||
|
|||||||
46
make.h
46
make.h
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -72,7 +72,7 @@ extern int errno;
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
||||||
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
||||||
#if defined (_POSIX_VERSION) && !defined (ultrix)
|
#if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
|
||||||
#define POSIX
|
#define POSIX
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -86,11 +86,11 @@ extern int errno;
|
|||||||
#define POSIX
|
#define POSIX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SIGLIST
|
#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED)
|
||||||
#ifndef SYS_SIGLIST_DECLARED
|
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
|
#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
|
||||||
#include "signame.h"
|
#include "signame.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -241,6 +241,11 @@ extern void bcopy ();
|
|||||||
extern char *strerror PARAMS ((int errnum));
|
extern char *strerror PARAMS ((int errnum));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __attribute__
|
||||||
|
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
||||||
|
# define __attribute__(x)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#undef alloca
|
#undef alloca
|
||||||
@@ -259,7 +264,7 @@ extern char *alloca ();
|
|||||||
#define streq(a, b) \
|
#define streq(a, b) \
|
||||||
((a) == (b) || \
|
((a) == (b) || \
|
||||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||||
#ifdef _AMIGA
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
#define strieq(a, b) \
|
#define strieq(a, b) \
|
||||||
((a) == (b) || \
|
((a) == (b) || \
|
||||||
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
||||||
@@ -277,7 +282,7 @@ extern char *alloca ();
|
|||||||
/* Add to VAR the hashing value of C, one character in a name. */
|
/* Add to VAR the hashing value of C, one character in a name. */
|
||||||
#define HASH(var, c) \
|
#define HASH(var, c) \
|
||||||
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
||||||
#ifdef _AMIGA /* Fold filenames on #amiga */
|
#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */
|
||||||
#define HASHI(var, c) \
|
#define HASHI(var, c) \
|
||||||
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||||
#else
|
#else
|
||||||
@@ -293,8 +298,12 @@ extern char *alloca ();
|
|||||||
#if defined(__MSDOS__) || defined(WINDOWS32)
|
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||||
#define PATH_SEPARATOR_CHAR ';'
|
#define PATH_SEPARATOR_CHAR ';'
|
||||||
#else
|
#else
|
||||||
|
#if defined(VMS)
|
||||||
|
#define PATH_SEPARATOR_CHAR ','
|
||||||
|
#else
|
||||||
#define PATH_SEPARATOR_CHAR ':'
|
#define PATH_SEPARATOR_CHAR ':'
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -306,16 +315,23 @@ extern void sync_Path_environment(void);
|
|||||||
extern int kill(int pid, int sig);
|
extern int kill(int pid, int sig);
|
||||||
extern int safe_stat(char *file, struct stat *sb);
|
extern int safe_stat(char *file, struct stat *sb);
|
||||||
extern char *end_of_token_w32();
|
extern char *end_of_token_w32();
|
||||||
#endif
|
extern int find_and_set_default_shell(char *token);
|
||||||
|
|
||||||
|
/* indicates whether or not we have Bourne shell */
|
||||||
|
extern int no_default_sh_exe;
|
||||||
|
|
||||||
|
/* is default_shell unixy? */
|
||||||
|
extern int unixy_shell;
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
extern void die ();
|
extern void die () __attribute__ ((noreturn));
|
||||||
extern void message ();
|
extern void message ();
|
||||||
extern void fatal ();
|
extern void fatal () __attribute__ ((noreturn));
|
||||||
extern void error ();
|
extern void error ();
|
||||||
extern void log_working_directory ();
|
extern void log_working_directory ();
|
||||||
extern void makefile_error ();
|
extern void makefile_error ();
|
||||||
extern void makefile_fatal ();
|
extern void makefile_fatal () __attribute__ ((noreturn));
|
||||||
extern void pfatal_with_name ();
|
extern void pfatal_with_name () __attribute__ ((noreturn));
|
||||||
extern void perror_with_name ();
|
extern void perror_with_name ();
|
||||||
extern char *savestring ();
|
extern char *savestring ();
|
||||||
extern char *concat ();
|
extern char *concat ();
|
||||||
@@ -376,7 +392,7 @@ extern void child_access ();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||||
because such systems often declare the in header files anyway. */
|
because such systems often declare them in header files anyway. */
|
||||||
|
|
||||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
||||||
|
|
||||||
@@ -407,6 +423,10 @@ extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
|
|||||||
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
||||||
extern int print_directory_flag, warn_undefined_variables_flag;
|
extern int print_directory_flag, warn_undefined_variables_flag;
|
||||||
extern int posix_pedantic;
|
extern int 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 unsigned int job_slots;
|
||||||
#ifndef NO_FLOAT
|
#ifndef NO_FLOAT
|
||||||
|
|||||||
598
make.texinfo
598
make.texinfo
@@ -8,12 +8,12 @@
|
|||||||
@c FSF publishers: format makebook.texi instead of using this file directly.
|
@c FSF publishers: format makebook.texi instead of using this file directly.
|
||||||
|
|
||||||
@set RCSID $Id$
|
@set RCSID $Id$
|
||||||
@set EDITION 0.51
|
@set EDITION 0.52
|
||||||
@set VERSION 3.75 Beta
|
@set VERSION 3.77
|
||||||
@set UPDATED 9 May 1996
|
@set UPDATED 20 May 1998
|
||||||
@set UPDATE-MONTH May 1996
|
@set UPDATE-MONTH May 1998
|
||||||
@comment The ISBN number might need to change on next publication.
|
@comment The ISBN number might need to change on next publication.
|
||||||
@set ISBN 1-882114-78-7 @c CHANGE THIS BEFORE PRINTING AGAIN! --roland 9may96
|
@set ISBN 1-882114-80-9 @c CHANGE THIS BEFORE PRINTING AGAIN! --psmith 16jul98
|
||||||
|
|
||||||
@c finalout
|
@c finalout
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
@ifinfo
|
@ifinfo
|
||||||
@dircategory The GNU make utility
|
@dircategory The GNU make utility
|
||||||
@direntry
|
@direntry
|
||||||
* GNU make: (make.info). The GNU make utility.
|
* Make: (make.info). The GNU make utility.
|
||||||
@end direntry
|
@end direntry
|
||||||
|
|
||||||
This file documents the GNU Make utility, which determines
|
This file documents the GNU Make utility, which determines
|
||||||
@@ -37,7 +37,7 @@ and issues the commands to recompile them.
|
|||||||
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||||
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
||||||
|
|
||||||
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96
|
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to make and distribute verbatim copies of
|
Permission is granted to make and distribute verbatim copies of
|
||||||
@@ -68,12 +68,12 @@ by the Free Software Foundation.
|
|||||||
@titlepage
|
@titlepage
|
||||||
@title GNU Make
|
@title GNU Make
|
||||||
@subtitle A Program for Directing Recompilation
|
@subtitle A Program for Directing Recompilation
|
||||||
@subtitle Edition @value{EDITION}, for @code{make} Version @value{VERSION}.
|
@subtitle GNU @code{make} Version @value{VERSION}.
|
||||||
@subtitle @value{UPDATE-MONTH}
|
@subtitle @value{UPDATE-MONTH}
|
||||||
@author Richard M. Stallman and Roland McGrath
|
@author Richard M. Stallman and Roland McGrath
|
||||||
@page
|
@page
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96 Free Software Foundation, Inc.
|
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free Software Foundation, Inc.
|
||||||
@sp 2
|
@sp 2
|
||||||
Published by the Free Software Foundation @*
|
Published by the Free Software Foundation @*
|
||||||
59 Temple Place -- Suite 330, @*
|
59 Temple Place -- Suite 330, @*
|
||||||
@@ -107,9 +107,9 @@ The GNU @code{make} utility automatically determines which pieces of a
|
|||||||
large program need to be recompiled, and issues the commands to
|
large program need to be recompiled, and issues the commands to
|
||||||
recompile them.@refill
|
recompile them.@refill
|
||||||
|
|
||||||
This is Edition @value{EDITION} of the @cite{GNU Make Manual},
|
This edition of the @cite{GNU Make Manual},
|
||||||
last updated @value{UPDATED}
|
last updated @value{UPDATED},
|
||||||
for @code{make} Version @value{VERSION}.@refill
|
documents GNU @code{make} Version @value{VERSION}.@refill
|
||||||
|
|
||||||
This manual describes @code{make} and contains the following chapters:@refill
|
This manual describes @code{make} and contains the following chapters:@refill
|
||||||
@end ifinfo
|
@end ifinfo
|
||||||
@@ -132,6 +132,7 @@ This manual describes @code{make} and contains the following chapters:@refill
|
|||||||
* Missing:: What GNU @code{make} lacks from other @code{make}s.
|
* Missing:: What GNU @code{make} lacks from other @code{make}s.
|
||||||
* Makefile Conventions:: Conventions for makefiles in GNU programs.
|
* Makefile Conventions:: Conventions for makefiles in GNU programs.
|
||||||
* Quick Reference:: A quick reference for experienced users.
|
* Quick Reference:: A quick reference for experienced users.
|
||||||
|
* Make Errors:: A list of common errors generated by @code{make}.
|
||||||
* Complex Makefile:: A real example of a straightforward,
|
* Complex Makefile:: A real example of a straightforward,
|
||||||
but nontrivial, makefile.
|
but nontrivial, makefile.
|
||||||
* Concept Index:: Index of Concepts
|
* Concept Index:: Index of Concepts
|
||||||
@@ -264,7 +265,7 @@ Functions for Transforming Text
|
|||||||
|
|
||||||
* Syntax of Functions:: How to write a function call.
|
* Syntax of Functions:: How to write a function call.
|
||||||
* Text Functions:: General-purpose text manipulation functions.
|
* Text Functions:: General-purpose text manipulation functions.
|
||||||
* Filename Functions:: Functions for manipulating file names.
|
* File Name Functions:: Functions for manipulating file names.
|
||||||
* Foreach Function:: Repeat some text with controlled variation.
|
* Foreach Function:: Repeat some text with controlled variation.
|
||||||
* Origin Function:: Find where a variable got its value.
|
* Origin Function:: Find where a variable got its value.
|
||||||
* Shell Function:: Substitute the output of a shell command.
|
* Shell Function:: Substitute the output of a shell command.
|
||||||
@@ -425,17 +426,10 @@ send us the makefile and the exact results @code{make} gave you. Also
|
|||||||
say what you expected to occur; this will help us decide whether the
|
say what you expected to occur; this will help us decide whether the
|
||||||
problem was really in the documentation.
|
problem was really in the documentation.
|
||||||
|
|
||||||
Once you've got a precise problem, please send electronic mail either
|
Once you've got a precise problem, please send electronic mail to:
|
||||||
through the Internet or via UUCP:
|
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@group
|
bug-make@@gnu.org
|
||||||
@r{Internet address:}
|
|
||||||
bug-gnu-utils@@prep.ai.mit.edu
|
|
||||||
|
|
||||||
@r{UUCP path:}
|
|
||||||
mit-eddie!prep.ai.mit.edu!bug-gnu-utils
|
|
||||||
@end group
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -1102,6 +1096,8 @@ makefile as has been traditionally done with other versions of
|
|||||||
|
|
||||||
@cindex @code{-I}
|
@cindex @code{-I}
|
||||||
@cindex @code{--include-dir}
|
@cindex @code{--include-dir}
|
||||||
|
@cindex included makefiles, default directries
|
||||||
|
@cindex default directries for included makefiles
|
||||||
@findex /usr/gnu/include
|
@findex /usr/gnu/include
|
||||||
@findex /usr/local/include
|
@findex /usr/local/include
|
||||||
@findex /usr/include
|
@findex /usr/include
|
||||||
@@ -1112,7 +1108,10 @@ First, any directories you have specified with the @samp{-I} or
|
|||||||
(@pxref{Options Summary, ,Summary of Options}).
|
(@pxref{Options Summary, ,Summary of Options}).
|
||||||
Then the following directories (if they exist)
|
Then the following directories (if they exist)
|
||||||
are searched, in this order:
|
are searched, in this order:
|
||||||
@file{@var{prefix}/include} (normally @file{/usr/local/include})
|
@file{@var{prefix}/include} (normally @file{/usr/local/include}
|
||||||
|
@footnote{GNU Make compiled for MS-DOS and MS-Windows behaves as if
|
||||||
|
@var{prefix} has been defined to be the root of the DJGPP tree
|
||||||
|
hierarchy.})
|
||||||
@file{/usr/gnu/include},
|
@file{/usr/gnu/include},
|
||||||
@file{/usr/local/include}, @file{/usr/include}.
|
@file{/usr/local/include}, @file{/usr/include}.
|
||||||
|
|
||||||
@@ -1464,7 +1463,10 @@ significance. If alone, or followed by a slash, it represents your home
|
|||||||
directory. For example @file{~/bin} expands to @file{/home/you/bin}.
|
directory. For example @file{~/bin} expands to @file{/home/you/bin}.
|
||||||
If the @samp{~} is followed by a word, the string represents the home
|
If the @samp{~} is followed by a word, the string represents the home
|
||||||
directory of the user named by that word. For example @file{~john/bin}
|
directory of the user named by that word. For example @file{~john/bin}
|
||||||
expands to @file{/home/john/bin}.@refill
|
expands to @file{/home/john/bin}. On systems which don't have a home
|
||||||
|
directory for each user (such as MS-DOS or MS-Windows), this
|
||||||
|
functionality can be simulated by setting the environment variable
|
||||||
|
@var{HOME}.@refill
|
||||||
|
|
||||||
Wildcard expansion happens automatically in targets, in dependencies,
|
Wildcard expansion happens automatically in targets, in dependencies,
|
||||||
and in commands (where the shell does the expansion). In other
|
and in commands (where the shell does the expansion). In other
|
||||||
@@ -1578,6 +1580,24 @@ expansion, but you need more sophisticated techniques, including the
|
|||||||
These are described in the following section.
|
These are described in the following section.
|
||||||
@end iftex
|
@end iftex
|
||||||
|
|
||||||
|
@cindex wildcards and MS-DOS/MS-Windows backslashes
|
||||||
|
@cindex backslashes in pathnames and wildcard expansion
|
||||||
|
|
||||||
|
Microsoft operating systems (MS-DOS and MS-Windows) use backslashes to
|
||||||
|
separate directories in pathnames, like so:
|
||||||
|
|
||||||
|
@example
|
||||||
|
c:\foo\bar\baz.c
|
||||||
|
@end example
|
||||||
|
|
||||||
|
This is equivalent to the Unix-style @file{c:/foo/bar/baz.c} (the
|
||||||
|
@file{c:} part is the so-called drive letter). When @code{make} runs on
|
||||||
|
these systems, it supports backslashes as well as the Unix-style forward
|
||||||
|
slashes in pathnames. However, this support does @emph{not} include the
|
||||||
|
wildcard expansion, where backslash is a quote character. Therefore,
|
||||||
|
you @emph{must} use Unix-style slashes in these cases.
|
||||||
|
|
||||||
|
|
||||||
@node Wildcard Function, , Wildcard Pitfall, Wildcards
|
@node Wildcard Function, , Wildcard Pitfall, Wildcards
|
||||||
@subsection The Function @code{wildcard}
|
@subsection The Function @code{wildcard}
|
||||||
@findex wildcard
|
@findex wildcard
|
||||||
@@ -1676,13 +1696,15 @@ Thus, if a file that is listed as a target or dependency does not exist
|
|||||||
in the current directory, @code{make} searches the directories listed in
|
in the current directory, @code{make} searches the directories listed in
|
||||||
@code{VPATH} for a file with that name. If a file is found in one of
|
@code{VPATH} for a file with that name. If a file is found in one of
|
||||||
them, that file may become the dependency (see below). Rules may then
|
them, that file may become the dependency (see below). Rules may then
|
||||||
specify the names of source files in the dependencies as if they all
|
specify the names of files in the dependency list as if they all
|
||||||
existed in the current directory. @xref{Commands/Search, ,Writing Shell
|
existed in the current directory. @xref{Commands/Search, ,Writing Shell
|
||||||
Commands with Directory Search}.
|
Commands with Directory Search}.
|
||||||
|
|
||||||
In the @code{VPATH} variable, directory names are separated by colons or
|
In the @code{VPATH} variable, directory names are separated by colons or
|
||||||
blanks. The order in which directories are listed is the order followed
|
blanks. The order in which directories are listed is the order followed
|
||||||
by @code{make} in its search.
|
by @code{make} in its search. (On MS-DOS and MS-Windows, semi-colons
|
||||||
|
are used as separators of directory names in @code{VPATH}, since the
|
||||||
|
colon can be used in the pathname itself, after the drive letter.)
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
@@ -1715,11 +1737,12 @@ is found in the directory @file{src}.
|
|||||||
@subsection The @code{vpath} Directive
|
@subsection The @code{vpath} Directive
|
||||||
@findex vpath
|
@findex vpath
|
||||||
|
|
||||||
Similar to the @code{VPATH} variable but more selective is the @code{vpath}
|
Similar to the @code{VPATH} variable, but more selective, is the
|
||||||
directive (note lower case), which allows you to specify a search path for a particular class
|
@code{vpath} directive (note lower case), which allows you to specify a
|
||||||
of file names, those that match a particular pattern. Thus you can supply
|
search path for a particular class of file names: those that match a
|
||||||
certain search directories for one class of file names and other directories
|
particular pattern. Thus you can supply certain search directories for
|
||||||
(or none) for other file names.
|
one class of file names and other directories (or none) for other file
|
||||||
|
names.
|
||||||
|
|
||||||
There are three forms of the @code{vpath} directive:
|
There are three forms of the @code{vpath} directive:
|
||||||
|
|
||||||
@@ -1729,8 +1752,8 @@ Specify the search path @var{directories} for file names that match
|
|||||||
@var{pattern}.
|
@var{pattern}.
|
||||||
|
|
||||||
The search path, @var{directories}, is a list of directories to be
|
The search path, @var{directories}, is a list of directories to be
|
||||||
searched, separated by colons or blanks, just like the search path used
|
searched, separated by colons (semi-colons on MS-DOS and MS-Windows) or
|
||||||
in the @code{VPATH} variable.
|
blanks, just like the search path used in the @code{VPATH} variable.
|
||||||
|
|
||||||
@item vpath @var{pattern}
|
@item vpath @var{pattern}
|
||||||
Clear out the search path associated with @var{pattern}.
|
Clear out the search path associated with @var{pattern}.
|
||||||
@@ -1817,7 +1840,7 @@ will look for a file ending in @samp{.c} in @file{foo}, then
|
|||||||
|
|
||||||
When a dependency is found through directory search, regardless of type
|
When a dependency is found through directory search, regardless of type
|
||||||
(general or selective), the pathname located may not be the one that
|
(general or selective), the pathname located may not be the one that
|
||||||
@code{make} actually provides you in the dependency list. Sometimes,
|
@code{make} actually provides you in the dependency list. Sometimes
|
||||||
the path discovered through directory search is thrown away.
|
the path discovered through directory search is thrown away.
|
||||||
|
|
||||||
The algorithm @code{make} uses to decide whether to keep or abandon a
|
The algorithm @code{make} uses to decide whether to keep or abandon a
|
||||||
@@ -1829,7 +1852,7 @@ If a target file does not exist at the path specified in the makefile,
|
|||||||
directory search is performed.
|
directory search is performed.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
If the directory search is successful that path is kept, and this file
|
If the directory search is successful, that path is kept and this file
|
||||||
is tentatively stored as the target.
|
is tentatively stored as the target.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@@ -1843,17 +1866,20 @@ rebuilt:
|
|||||||
@item
|
@item
|
||||||
If the target does @emph{not} need to be rebuilt, the path to the file
|
If the target does @emph{not} need to be rebuilt, the path to the file
|
||||||
found during directory search is used for any dependency lists which
|
found during directory search is used for any dependency lists which
|
||||||
contain this target.
|
contain this target. In short, if @code{make} doesn't need to rebuild
|
||||||
|
the target then you use the path found via directory search.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
If the target @emph{does} need to be rebuilt (is out-of-date), the
|
If the target @emph{does} need to be rebuilt (is out-of-date), the
|
||||||
pathname found during directory search is @emph{thrown away}, and the
|
pathname found during directory search is @emph{thrown away}, and the
|
||||||
target is rebuilt using the filename specified in the makefile.
|
target is rebuilt using the file name specified in the makefile. In
|
||||||
|
short, if @code{make} must rebuild, then the target is rebuilt locally,
|
||||||
|
not in the directory found via directory search.
|
||||||
@end enumerate
|
@end enumerate
|
||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
This may seem overly complex, but in fact it is almost always exactly
|
This algorithm may seem complex, but in practice it is quite often
|
||||||
what you want.
|
exactly what you want.
|
||||||
|
|
||||||
@cindex traditional directory search
|
@cindex traditional directory search
|
||||||
@cindex directory search, traditional
|
@cindex directory search, traditional
|
||||||
@@ -1958,7 +1984,9 @@ handles it specially by searching for the file @file{lib@var{name}.a} in
|
|||||||
the current directory, in directories specified by matching @code{vpath}
|
the current directory, in directories specified by matching @code{vpath}
|
||||||
search paths and the @code{VPATH} search path, and then in the
|
search paths and the @code{VPATH} search path, and then in the
|
||||||
directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
|
directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
|
||||||
(normally @file{/usr/local/lib}).
|
(normally @file{/usr/local/lib}, but MS-DOS/MS-Windows versions of
|
||||||
|
@code{make} behave as if @var{prefix} is defined to be the root of the
|
||||||
|
DJGPP installation tree).
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
@@ -2834,13 +2862,15 @@ by making a new subshell for each line. (In practice, @code{make} may
|
|||||||
take shortcuts that do not affect the results.)
|
take shortcuts that do not affect the results.)
|
||||||
|
|
||||||
@cindex @code{cd} (shell command)
|
@cindex @code{cd} (shell command)
|
||||||
@strong{Please note:} this implies that shell commands such as
|
@strong{Please note:} this implies that shell commands such as @code{cd}
|
||||||
@code{cd} that set variables local to each process will not affect the
|
that set variables local to each process will not affect the following
|
||||||
following command lines. If you want to use @code{cd} to affect the
|
command lines. @footnote{On MS-DOS, the value of current working
|
||||||
next command, put the two on a single line with a semicolon between
|
directory is @strong{global}, so changing it @emph{will} affect the
|
||||||
them. Then @code{make} will consider them a single command and pass
|
following command lines on those systems.} If you want to use @code{cd}
|
||||||
them, together, to a shell which will execute them in sequence. For
|
to affect the next command, put the two on a single line with a
|
||||||
example:
|
semicolon between them. Then @code{make} will consider them a single
|
||||||
|
command and pass them, together, to a shell which will execute them in
|
||||||
|
sequence. For example:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
foo : bar/lose
|
foo : bar/lose
|
||||||
@@ -2871,13 +2901,75 @@ foo : bar/lose
|
|||||||
The program used as the shell is taken from the variable @code{SHELL}.
|
The program used as the shell is taken from the variable @code{SHELL}.
|
||||||
By default, the program @file{/bin/sh} is used.
|
By default, the program @file{/bin/sh} is used.
|
||||||
|
|
||||||
|
@vindex COMSPEC
|
||||||
|
On MS-DOS, if @code{SHELL} is not set, the value of the variable
|
||||||
|
@code{COMSPEC} (which is always set) is used instead.
|
||||||
|
|
||||||
|
@cindex @code{SHELL}, MS-DOS specifics
|
||||||
|
The processing of lines that set the variable @code{SHELL} in Makefiles
|
||||||
|
is different on MS-DOS. The stock shell, @file{command.com}, is
|
||||||
|
ridiculously limited in its functionality and many users of @code{make}
|
||||||
|
tend to install a replacement shell. Therefore, on MS-DOS, @code{make}
|
||||||
|
examines the value of @code{SHELL}, and changes its behavior based on
|
||||||
|
whether it points to a Unix-style or DOS-style shell. This allows
|
||||||
|
reasonable functionality even if @code{SHELL} points to
|
||||||
|
@file{command.com}.
|
||||||
|
|
||||||
|
If @code{SHELL} points to a Unix-style shell, @code{make} on MS-DOS
|
||||||
|
additionally checks whether that shell can indeed be found; if not, it
|
||||||
|
ignores the line that sets @code{SHELL}. In MS-DOS, GNU @code{make}
|
||||||
|
searches for the shell in the following places:
|
||||||
|
|
||||||
|
@enumerate
|
||||||
|
@item
|
||||||
|
In the precise place pointed to by the value of @code{SHELL}. For
|
||||||
|
example, if the makefile specifies @samp{SHELL = /bin/sh}, @code{make}
|
||||||
|
will look in the directory @file{/bin} on the current drive.
|
||||||
|
|
||||||
|
@item
|
||||||
|
In the current directory.
|
||||||
|
|
||||||
|
@item
|
||||||
|
In each of the directories in the @code{PATH} variable, in order.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
In every directory it examines, @code{make} will first look for the
|
||||||
|
specific file (@file{sh} in the example above). If this is not found,
|
||||||
|
it will also look in that directory for that file with one of the known
|
||||||
|
extensions which identify executable files. For example @file{.exe},
|
||||||
|
@file{.com}, @file{.bat}, @file{.btm}, @file{.sh}, and some others.
|
||||||
|
|
||||||
|
If any of these attempts is successful, the value of @code{SHELL} will
|
||||||
|
be set to the full pathname of the shell as found. However, if none of
|
||||||
|
these is found, the value of @code{SHELL} will not be changed, and thus
|
||||||
|
the line that sets it will be effectively ignored. This is so
|
||||||
|
@code{make} will only support features specific to a Unix-style shell if
|
||||||
|
such a shell is actually installed on the system where @code{make} runs.
|
||||||
|
|
||||||
|
Note that this extended search for the shell is limited to the cases
|
||||||
|
where @code{SHELL} is set from the Makefile; if it is set in the
|
||||||
|
environment or command line, you are expected to set it to the full
|
||||||
|
pathname of the shell, exactly as things are on Unix.
|
||||||
|
|
||||||
|
The effect of the above DOS-specific processing is that a Makefile that
|
||||||
|
says @samp{SHELL = /bin/sh} (as many Unix makefiles do), will work
|
||||||
|
on MS-DOS unaltered if you have e.g. @file{sh.exe} installed in some
|
||||||
|
directory along your @code{PATH}.
|
||||||
|
|
||||||
@cindex environment, @code{SHELL} in
|
@cindex environment, @code{SHELL} in
|
||||||
Unlike most variables, the variable @code{SHELL} is never set from the
|
Unlike most variables, the variable @code{SHELL} is never set from the
|
||||||
environment. This is because the @code{SHELL} environment variable is
|
environment. This is because the @code{SHELL} environment variable is
|
||||||
used to specify your personal choice of shell program for interactive
|
used to specify your personal choice of shell program for interactive
|
||||||
use. It would be very bad for personal choices like this to affect
|
use. It would be very bad for personal choices like this to affect the
|
||||||
the functioning of makefiles. @xref{Environment, ,Variables from the
|
functioning of makefiles. @xref{Environment, ,Variables from the
|
||||||
Environment}.
|
Environment}. However, on MS-DOS and MS-Windows the value of
|
||||||
|
@code{SHELL} in the environment @strong{is} used, since on those systems
|
||||||
|
most users do not set this variable, and therefore it is most likely set
|
||||||
|
specifically to be used by @code{make}. On MS-DOS, if the setting of
|
||||||
|
@code{SHELL} is not suitable for @code{make}, you can set the variable
|
||||||
|
@code{MAKESHELL} to the shell that @code{make} should use; this will
|
||||||
|
override the value of @code{SHELL}.
|
||||||
|
|
||||||
@node Parallel, Errors, Execution, Commands
|
@node Parallel, Errors, Execution, Commands
|
||||||
@section Parallel Execution
|
@section Parallel Execution
|
||||||
@@ -2894,6 +2986,9 @@ for it to finish before executing the next. However, the @samp{-j} or
|
|||||||
@samp{--jobs} option tells @code{make} to execute many commands
|
@samp{--jobs} option tells @code{make} to execute many commands
|
||||||
simultaneously.@refill
|
simultaneously.@refill
|
||||||
|
|
||||||
|
On MS-DOS, the @samp{-j} option has no effect, since that system doesn't
|
||||||
|
support multi-processing.
|
||||||
|
|
||||||
If the @samp{-j} option is followed by an integer, this is the number of
|
If the @samp{-j} option is followed by an integer, this is the number of
|
||||||
commands to execute at once; this is called the number of @dfn{job slots}.
|
commands to execute at once; this is called the number of @dfn{job slots}.
|
||||||
If there is nothing looking like an integer after the @samp{-j} option,
|
If there is nothing looking like an integer after the @samp{-j} option,
|
||||||
@@ -3110,7 +3205,7 @@ subdirectory. You can do it by writing this:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE)
|
cd subdir && $(MAKE)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -3127,6 +3222,14 @@ You can write recursive @code{make} commands just by copying this example,
|
|||||||
but there are many things to know about how they work and why, and about
|
but there are many things to know about how they work and why, and about
|
||||||
how the sub-@code{make} relates to the top-level @code{make}.
|
how the sub-@code{make} relates to the top-level @code{make}.
|
||||||
|
|
||||||
|
For your convenience, GNU @code{make} sets the variable @code{CURDIR} to
|
||||||
|
the pathname of the current working directory for you. If @code{-C} is
|
||||||
|
in effect, it will contain the path of the new directory, not the
|
||||||
|
original. The value has the same precedence it would have if it were
|
||||||
|
set in the makefile (by default, an environment variable @code{CURDIR}
|
||||||
|
will not override this value). Note that setting this variable has no
|
||||||
|
effect on the operation of @code{make}
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* MAKE Variable:: The special effects of using @samp{$(MAKE)}.
|
* MAKE Variable:: The special effects of using @samp{$(MAKE)}.
|
||||||
* Variables/Recursion:: How to communicate variables to a sub-@code{make}.
|
* Variables/Recursion:: How to communicate variables to a sub-@code{make}.
|
||||||
@@ -3146,13 +3249,13 @@ not the explicit command name @samp{make}, as shown here:
|
|||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE)
|
cd subdir && $(MAKE)
|
||||||
@end group
|
@end group
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The value of this variable is the file name with which @code{make} was
|
The value of this variable is the file name with which @code{make} was
|
||||||
invoked. If this file name was @file{/bin/make}, then the command executed
|
invoked. If this file name was @file{/bin/make}, then the command executed
|
||||||
is @samp{cd subdir; /bin/make}. If you use a special version of
|
is @samp{cd subdir && /bin/make}. If you use a special version of
|
||||||
@code{make} to run the top-level makefile, the same special version will be
|
@code{make} to run the top-level makefile, the same special version will be
|
||||||
executed for recursive invocations.
|
executed for recursive invocations.
|
||||||
@cindex @code{cd} (shell command)
|
@cindex @code{cd} (shell command)
|
||||||
@@ -3169,7 +3272,7 @@ Consider the command @samp{make -t} in the above example. (The
|
|||||||
any commands; see @ref{Instead of Execution}.) Following the usual
|
any commands; see @ref{Instead of Execution}.) Following the usual
|
||||||
definition of @samp{-t}, a @samp{make -t} command in the example would
|
definition of @samp{-t}, a @samp{make -t} command in the example would
|
||||||
create a file named @file{subsystem} and do nothing else. What you
|
create a file named @file{subsystem} and do nothing else. What you
|
||||||
really want it to do is run @samp{@w{cd subdir;} @w{make -t}}; but that would
|
really want it to do is run @samp{@w{cd subdir &&} @w{make -t}}; but that would
|
||||||
require executing the command, and @samp{-t} says not to execute
|
require executing the command, and @samp{-t} says not to execute
|
||||||
commands.@refill
|
commands.@refill
|
||||||
@cindex @code{-t}, and recursion
|
@cindex @code{-t}, and recursion
|
||||||
@@ -3420,7 +3523,7 @@ value of @code{MAKEFLAGS}, like this:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE) MAKEFLAGS=
|
cd subdir && $(MAKE) MAKEFLAGS=
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@vindex MAKEOVERRIDES
|
@vindex MAKEOVERRIDES
|
||||||
@@ -3459,7 +3562,7 @@ this:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE) $(MFLAGS)
|
cd subdir && $(MAKE) $(MFLAGS)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -3727,6 +3830,10 @@ they have particular specialized uses. @xref{Automatic, ,Automatic Variables}.
|
|||||||
* Defining:: An alternate way to set a variable
|
* Defining:: An alternate way to set a variable
|
||||||
to a verbatim string.
|
to a verbatim string.
|
||||||
* Environment:: Variable values can come from the environment.
|
* Environment:: Variable values can come from the environment.
|
||||||
|
* Target-specific:: Variable values can be defined on a per-target
|
||||||
|
basis.
|
||||||
|
* Pattern-specific:: Target-specific variable values can be applied
|
||||||
|
to a group of targets that match a pattern.
|
||||||
* Automatic:: Some special variables have predefined
|
* Automatic:: Some special variables have predefined
|
||||||
meanings for use with implicit rules.
|
meanings for use with implicit rules.
|
||||||
@end menu
|
@end menu
|
||||||
@@ -3955,6 +4062,30 @@ Here the value of the variable @code{dir} is @w{@samp{/foo/bar }}
|
|||||||
(with four trailing spaces), which was probably not the intention.
|
(with four trailing spaces), which was probably not the intention.
|
||||||
(Imagine something like @w{@samp{$(dir)/file}} with this definition!)
|
(Imagine something like @w{@samp{$(dir)/file}} with this definition!)
|
||||||
|
|
||||||
|
@cindex conditional variable assignment
|
||||||
|
@cindex variables, conditional assignment
|
||||||
|
@cindex ?=
|
||||||
|
There is another assignment operator for variables, @samp{?=}. This
|
||||||
|
is called a conditional variable assignment operator, because it only
|
||||||
|
has an effect if the variable is not yet defined. This statement:
|
||||||
|
|
||||||
|
@example
|
||||||
|
FOO ?= bar
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
is exactly equivalent to this
|
||||||
|
(@pxref{Origin Function, ,The @code{origin} Function}):
|
||||||
|
|
||||||
|
@example
|
||||||
|
ifeq ($(origin FOO), undefined)
|
||||||
|
FOO = bar
|
||||||
|
endif
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Note that a variable set to an empty value is still defined, so
|
||||||
|
@samp{?=} will not set that variable.
|
||||||
|
|
||||||
@node Advanced, Values, Flavors, Using Variables
|
@node Advanced, Values, Flavors, Using Variables
|
||||||
@section Advanced Features for Reference to Variables
|
@section Advanced Features for Reference to Variables
|
||||||
@cindex reference to variables
|
@cindex reference to variables
|
||||||
@@ -4252,6 +4383,7 @@ Several variables have constant initial values.
|
|||||||
@cindex variables, setting
|
@cindex variables, setting
|
||||||
@cindex =
|
@cindex =
|
||||||
@cindex :=
|
@cindex :=
|
||||||
|
@cindex ?=
|
||||||
|
|
||||||
To set a variable from the makefile, write a line starting with the
|
To set a variable from the makefile, write a line starting with the
|
||||||
variable name followed by @samp{=} or @samp{:=}. Whatever follows the
|
variable name followed by @samp{=} or @samp{:=}. Whatever follows the
|
||||||
@@ -4288,6 +4420,24 @@ Several special variables are set
|
|||||||
automatically to a new value for each rule; these are called the
|
automatically to a new value for each rule; these are called the
|
||||||
@dfn{automatic} variables (@pxref{Automatic, ,Automatic Variables}).
|
@dfn{automatic} variables (@pxref{Automatic, ,Automatic Variables}).
|
||||||
|
|
||||||
|
If you'd like a variable to be set to a value only if it's not already
|
||||||
|
set, then you can use the shorthand operator @samp{?=} instead of
|
||||||
|
@samp{=}. These two settings of the variable @samp{FOO} are identical
|
||||||
|
(@pxref{Origin Function, ,The @code{origin} Function}):
|
||||||
|
|
||||||
|
@example
|
||||||
|
FOO ?= bar
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
and
|
||||||
|
|
||||||
|
@example
|
||||||
|
ifeq ($(origin FOO), undefined)
|
||||||
|
FOO = bar
|
||||||
|
endif
|
||||||
|
@end example
|
||||||
|
|
||||||
@node Appending, Override Directive, Setting, Using Variables
|
@node Appending, Override Directive, Setting, Using Variables
|
||||||
@section Appending More Text to Variables
|
@section Appending More Text to Variables
|
||||||
@cindex +=
|
@cindex +=
|
||||||
@@ -4545,7 +4695,7 @@ endef
|
|||||||
@noindent
|
@noindent
|
||||||
@xref{Override Directive, ,The @code{override} Directive}.
|
@xref{Override Directive, ,The @code{override} Directive}.
|
||||||
|
|
||||||
@node Environment, , Defining, Using Variables
|
@node Environment, Target-specific, Defining, Using Variables
|
||||||
@section Variables from the Environment
|
@section Variables from the Environment
|
||||||
|
|
||||||
@cindex variables, environment
|
@cindex variables, environment
|
||||||
@@ -4585,7 +4735,116 @@ Such problems would be especially likely with the variable @code{SHELL},
|
|||||||
which is normally present in the environment to specify the user's choice
|
which is normally present in the environment to specify the user's choice
|
||||||
of interactive shell. It would be very undesirable for this choice to
|
of interactive shell. It would be very undesirable for this choice to
|
||||||
affect @code{make}. So @code{make} ignores the environment value of
|
affect @code{make}. So @code{make} ignores the environment value of
|
||||||
@code{SHELL}.@refill
|
@code{SHELL} (except on MS-DOS and MS-Windows, where @code{SHELL} is
|
||||||
|
usually not set. @xref{Execution, ,Special handling of SHELL on
|
||||||
|
MS-DOS}.)@refill
|
||||||
|
|
||||||
|
@node Target-specific, Pattern-specific, Environment, Using Variables
|
||||||
|
@section Target-specific Variable Values
|
||||||
|
@cindex target-specific variables
|
||||||
|
@cindex variables, target-specific
|
||||||
|
|
||||||
|
Variable values in @code{make} are usually global; that is, they are the
|
||||||
|
same regardless of where they are evaluated (unless they're reset, of
|
||||||
|
course). One exception to that is automatic variables
|
||||||
|
(@pxref{Automatic, ,Automatic Variables}).
|
||||||
|
|
||||||
|
The other exception is @dfn{target-specific variable values}. This
|
||||||
|
feature allows you to define different values for the same variable,
|
||||||
|
based on the target that @code{make} is currently building. As with
|
||||||
|
automatic variables, these values are only available within the context
|
||||||
|
of a target's command script (and in other target-specific assignments).
|
||||||
|
|
||||||
|
Set a target-specific variable value like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
@var{target} @dots{} : @var{variable-assignment}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
or like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
@var{target} @dots{} : override @var{variable-assignment}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Multiple @var{target} values create a target-specific variable value for
|
||||||
|
each member of the target list individually.
|
||||||
|
|
||||||
|
The @var{variable-assignment} can be any valid form of assignment;
|
||||||
|
recursive (@samp{=}), static (@samp{:=}), appending (@samp{+=}), or
|
||||||
|
conditional (@samp{?=}). All variables that appear within the
|
||||||
|
@var{variable-assignment} are evaluated within the context of the
|
||||||
|
target: thus, any previously-defined target-specific variable values
|
||||||
|
will be in effect. Note that this variable is actually distinct from
|
||||||
|
any ``global'' value: the two variables do not have to have the same
|
||||||
|
flavor (recursive vs. static).
|
||||||
|
|
||||||
|
Target-specific variables have the same priority as any other makefile
|
||||||
|
variable. Variables provided on the command-line (and in the
|
||||||
|
environment if the @samp{-e} option is in force) will take precedence.
|
||||||
|
Specifying the @code{override} directive will allow the target-specific
|
||||||
|
variable value to be preferred.
|
||||||
|
|
||||||
|
There is one more special feature of target-specific variables: when you
|
||||||
|
define a target-specific variable, that variable value is also in effect
|
||||||
|
for all dependencies of this target (unless those dependencies override
|
||||||
|
it with their own target-specific variable value). So, for example, a
|
||||||
|
statement like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
prog : CFLAGS = -g
|
||||||
|
prog : prog.o foo.o bar.o
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
will set @code{CFLAGS} to @samp{-g} in the command script for
|
||||||
|
@file{prog}, but it will also set @code{CFLAGS} to @samp{-g} in the
|
||||||
|
command scripts that create @file{prog.o}, @file{foo.o}, and
|
||||||
|
@file{bar.o}, and any command scripts which create their dependencies.
|
||||||
|
|
||||||
|
@node Pattern-specific, , Target-specific, Using Variables
|
||||||
|
@section Pattern-specific Variable Values
|
||||||
|
@cindex pattern-specific variables
|
||||||
|
@cindex variables, pattern-specific
|
||||||
|
|
||||||
|
In addition to target-specific variable values (@pxref{Target-specific,
|
||||||
|
,Target-specific Variable Values}), GNU @code{make} supports
|
||||||
|
pattern-specific variable values. In this form, a variable is defined
|
||||||
|
for any target that matches the pattern specified. Variables defined in
|
||||||
|
this way are searched after any target-specific variables defined
|
||||||
|
explicitly for that target, and before target-specific variables defined
|
||||||
|
for the parent target.
|
||||||
|
|
||||||
|
Set a pattern-specific variable value like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
@var{pattern} @dots{} : @var{variable-assignment}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
or like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
@var{pattern} @dots{} : override @var{variable-assignment}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
where @var{pattern} is a %-pattern. As with target-specific variable
|
||||||
|
values, multiple @var{pattern} values create a pattern-specific variable
|
||||||
|
value for each pattern individually. The @var{variable-assignment} can
|
||||||
|
be any valid form of assignment. Any command-line variable setting will
|
||||||
|
take precedence, unless @code{override} is specified.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
@example
|
||||||
|
%.o : CFLAGS = -O
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
will assign @code{CFLAGS} the value of @samp{-O} for all targets
|
||||||
|
matching the pattern @code{%.o}.
|
||||||
|
|
||||||
@node Conditionals, Functions, Using Variables, Top
|
@node Conditionals, Functions, Using Variables, Top
|
||||||
@chapter Conditional Parts of Makefiles
|
@chapter Conditional Parts of Makefiles
|
||||||
@@ -4882,7 +5141,7 @@ call, just as a variable might be substituted.
|
|||||||
@menu
|
@menu
|
||||||
* Syntax of Functions:: How to write a function call.
|
* Syntax of Functions:: How to write a function call.
|
||||||
* Text Functions:: General-purpose text manipulation functions.
|
* Text Functions:: General-purpose text manipulation functions.
|
||||||
* Filename Functions:: Functions for manipulating file names.
|
* File Name Functions:: Functions for manipulating file names.
|
||||||
* Foreach Function:: Repeat some text with controlled variation.
|
* Foreach Function:: Repeat some text with controlled variation.
|
||||||
* Origin Function:: Find where a variable got its value.
|
* Origin Function:: Find where a variable got its value.
|
||||||
* Shell Function:: Substitute the output of a shell command.
|
* Shell Function:: Substitute the output of a shell command.
|
||||||
@@ -4951,7 +5210,7 @@ bar:= $(subst $(space),$(comma),$(foo))
|
|||||||
Here the @code{subst} function replaces each space with a comma, through
|
Here the @code{subst} function replaces each space with a comma, through
|
||||||
the value of @code{foo}, and substitutes the result.
|
the value of @code{foo}, and substitutes the result.
|
||||||
|
|
||||||
@node Text Functions, Filename Functions, Syntax of Functions, Functions
|
@node Text Functions, File Name Functions, Syntax of Functions, Functions
|
||||||
@section Functions for String Substitution and Analysis
|
@section Functions for String Substitution and Analysis
|
||||||
@cindex functions, for text
|
@cindex functions, for text
|
||||||
|
|
||||||
@@ -5215,7 +5474,7 @@ used so that the new value is assigned even if the previous value of
|
|||||||
@code{CFLAGS} was specified with a command argument (@pxref{Override
|
@code{CFLAGS} was specified with a command argument (@pxref{Override
|
||||||
Directive, , The @code{override} Directive}).
|
Directive, , The @code{override} Directive}).
|
||||||
|
|
||||||
@node Filename Functions, Foreach Function, Text Functions, Functions
|
@node File Name Functions, Foreach Function, Text Functions, Functions
|
||||||
@section Functions for File Names
|
@section Functions for File Names
|
||||||
@cindex functions, for file names
|
@cindex functions, for file names
|
||||||
@cindex file name functions
|
@cindex file name functions
|
||||||
@@ -5282,11 +5541,11 @@ file names.
|
|||||||
For example,
|
For example,
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(suffix src/foo.c hacks)
|
$(suffix src/foo.c src-1.0/bar.c hacks)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
produces the result @samp{.c}.
|
produces the result @samp{.c .c}.
|
||||||
|
|
||||||
@item $(basename @var{names}@dots{})
|
@item $(basename @var{names}@dots{})
|
||||||
@findex basename
|
@findex basename
|
||||||
@@ -5294,15 +5553,16 @@ produces the result @samp{.c}.
|
|||||||
@cindex file name, basename of
|
@cindex file name, basename of
|
||||||
Extracts all but the suffix of each file name in @var{names}. If the
|
Extracts all but the suffix of each file name in @var{names}. If the
|
||||||
file name contains a period, the basename is everything starting up to
|
file name contains a period, the basename is everything starting up to
|
||||||
(and not including) the last period. Otherwise, the basename is the
|
(and not including) the last period. Periods in the directory part are
|
||||||
entire file name. For example,
|
ignored. If there is no period, the basename is the entire file name.
|
||||||
|
For example,
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(basename src/foo.c hacks)
|
$(basename src/foo.c src-1.0/bar hacks)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
produces the result @samp{src/foo hacks}.
|
produces the result @samp{src/foo src-1.0/bar hacks}.
|
||||||
|
|
||||||
@c plural convention with dots (be consistent)
|
@c plural convention with dots (be consistent)
|
||||||
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
||||||
@@ -5429,7 +5689,7 @@ that match the pattern.
|
|||||||
@xref{Wildcards, ,Using Wildcard Characters in File Names}.
|
@xref{Wildcards, ,Using Wildcard Characters in File Names}.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Foreach Function, Origin Function, Filename Functions, Functions
|
@node Foreach Function, Origin Function, File Name Functions, Functions
|
||||||
@section The @code{foreach} Function
|
@section The @code{foreach} Function
|
||||||
@findex foreach
|
@findex foreach
|
||||||
@cindex words, iterating over
|
@cindex words, iterating over
|
||||||
@@ -5642,8 +5902,10 @@ The @code{shell} function performs the same function that backquotes
|
|||||||
(@samp{`}) perform in most shells: it does @dfn{command expansion}. This
|
(@samp{`}) perform in most shells: it does @dfn{command expansion}. This
|
||||||
means that it takes an argument that is a shell command and returns the
|
means that it takes an argument that is a shell command and returns the
|
||||||
output of the command. The only processing @code{make} does on the result,
|
output of the command. The only processing @code{make} does on the result,
|
||||||
before substituting it into the surrounding text, is to convert newlines to
|
before substituting it into the surrounding text, is to convert each
|
||||||
spaces.@refill
|
newline or carriage-return / newline pair to a single space. It also
|
||||||
|
removes the trailing (carriage-return and) newline, if it's the last
|
||||||
|
thing in the result.@refill
|
||||||
|
|
||||||
The commands run by calls to the @code{shell} function are run when the
|
The commands run by calls to the @code{shell} function are run when the
|
||||||
function calls are expanded. In most cases, this is when the makefile is
|
function calls are expanded. In most cases, this is when the makefile is
|
||||||
@@ -5752,18 +6014,34 @@ You can specify a different goal or goals with arguments to @code{make}.
|
|||||||
Use the name of the goal as an argument. If you specify several goals,
|
Use the name of the goal as an argument. If you specify several goals,
|
||||||
@code{make} processes each of them in turn, in the order you name them.
|
@code{make} processes each of them in turn, in the order you name them.
|
||||||
|
|
||||||
@cindex @code{MAKECMDGOALS}
|
|
||||||
@vindex MAKECMDGOALS
|
|
||||||
@code{Make} will set the special variable @code{MAKECMDGOALS} to the
|
|
||||||
list of goals you specified on the command line. If no goals were given
|
|
||||||
on the command line, this variable is empty.
|
|
||||||
|
|
||||||
Any target in the makefile may be specified as a goal (unless it
|
Any target in the makefile may be specified as a goal (unless it
|
||||||
starts with @samp{-} or contains an @samp{=}, in which case it will be
|
starts with @samp{-} or contains an @samp{=}, in which case it will be
|
||||||
parsed as a switch or variable definition, respectively). Even
|
parsed as a switch or variable definition, respectively). Even
|
||||||
targets not in the makefile may be specified, if @code{make} can find
|
targets not in the makefile may be specified, if @code{make} can find
|
||||||
implicit rules that say how to make them.
|
implicit rules that say how to make them.
|
||||||
|
|
||||||
|
@cindex @code{MAKECMDGOALS}
|
||||||
|
@vindex MAKECMDGOALS
|
||||||
|
@code{Make} will set the special variable @code{MAKECMDGOALS} to the
|
||||||
|
list of goals you specified on the command line. If no goals were given
|
||||||
|
on the command line, this variable is empty. Note that this variable
|
||||||
|
should be used only in special circumstances.
|
||||||
|
|
||||||
|
An example of appropriate use is to avoid including @file{.d} files
|
||||||
|
during @code{clean} rules (@pxref{Automatic Dependencies}), so
|
||||||
|
@code{make} won't create them only to immediately remove them
|
||||||
|
again:@refill
|
||||||
|
|
||||||
|
@example
|
||||||
|
@group
|
||||||
|
sources = foo.c bar.c
|
||||||
|
|
||||||
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
include $(sources:.c=.d)
|
||||||
|
endif
|
||||||
|
@end group
|
||||||
|
@end example
|
||||||
|
|
||||||
One use of specifying a goal is if you want to compile only a part of
|
One use of specifying a goal is if you want to compile only a part of
|
||||||
the program, or only one of several programs. Specify as a goal each
|
the program, or only one of several programs. Specify as a goal each
|
||||||
file that you wish to remake. For example, consider a directory containing
|
file that you wish to remake. For example, consider a directory containing
|
||||||
@@ -6197,6 +6475,7 @@ argument, @code{make} runs as many jobs simultaneously as possible. If
|
|||||||
there is more than one @samp{-j} option, the last one is effective.
|
there is more than one @samp{-j} option, the last one is effective.
|
||||||
@xref{Parallel, ,Parallel Execution},
|
@xref{Parallel, ,Parallel Execution},
|
||||||
for more information on how commands are run.
|
for more information on how commands are run.
|
||||||
|
Note that this option is ignored on MS-DOS.
|
||||||
|
|
||||||
@item -k
|
@item -k
|
||||||
@cindex @code{-k}
|
@cindex @code{-k}
|
||||||
@@ -6273,7 +6552,10 @@ pattern rules (@pxref{Pattern Rules, ,Defining and Redefining Pattern
|
|||||||
Rules}). The @samp{-r} option also clears out the default list of
|
Rules}). The @samp{-r} option also clears out the default list of
|
||||||
suffixes for suffix rules (@pxref{Suffix Rules, ,Old-Fashioned Suffix
|
suffixes for suffix rules (@pxref{Suffix Rules, ,Old-Fashioned Suffix
|
||||||
Rules}). But you can still define your own suffixes with a rule for
|
Rules}). But you can still define your own suffixes with a rule for
|
||||||
@code{.SUFFIXES}, and then define your own suffix rules.
|
@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}).
|
||||||
|
|
||||||
@item -s
|
@item -s
|
||||||
@cindex @code{-s}
|
@cindex @code{-s}
|
||||||
@@ -7355,7 +7637,7 @@ variants that get just the file's directory name or just the file name
|
|||||||
within the directory. The variant variables' names are formed by
|
within the directory. The variant variables' names are formed by
|
||||||
appending @samp{D} or @samp{F}, respectively. These variants are
|
appending @samp{D} or @samp{F}, respectively. These variants are
|
||||||
semi-obsolete in GNU @code{make} since the functions @code{dir} and
|
semi-obsolete in GNU @code{make} since the functions @code{dir} and
|
||||||
@code{notdir} can be used to get a similar effect (@pxref{Filename
|
@code{notdir} can be used to get a similar effect (@pxref{File Name
|
||||||
Functions, , Functions for File Names}). Note, however, that the
|
Functions, , Functions for File Names}). Note, however, that the
|
||||||
@samp{F} variants all omit the trailing slash which always appears in
|
@samp{F} variants all omit the trailing slash which always appears in
|
||||||
the output of the @code{dir} function. Here is a table of the variants:
|
the output of the @code{dir} function. Here is a table of the variants:
|
||||||
@@ -8423,7 +8705,7 @@ special treatment.
|
|||||||
@comment included by standards.texi.
|
@comment included by standards.texi.
|
||||||
@include make-stds.texi
|
@include make-stds.texi
|
||||||
|
|
||||||
@node Quick Reference, Complex Makefile, Makefile Conventions, Top
|
@node Quick Reference, Make Errors, Makefile Conventions, Top
|
||||||
@appendix Quick Reference
|
@appendix Quick Reference
|
||||||
|
|
||||||
This appendix summarizes the directives, text manipulation functions,
|
This appendix summarizes the directives, text manipulation functions,
|
||||||
@@ -8529,43 +8811,43 @@ Sort the words in @var{list} lexicographically, removing duplicates.@*
|
|||||||
|
|
||||||
@item $(dir @var{names}@dots{})
|
@item $(dir @var{names}@dots{})
|
||||||
Extract the directory part of each file name.@*
|
Extract the directory part of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(notdir @var{names}@dots{})
|
@item $(notdir @var{names}@dots{})
|
||||||
Extract the non-directory part of each file name.@*
|
Extract the non-directory part of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(suffix @var{names}@dots{})
|
@item $(suffix @var{names}@dots{})
|
||||||
Extract the suffix (the last @samp{.} and following characters) of each file name.@*
|
Extract the suffix (the last @samp{.} and following characters) of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(basename @var{names}@dots{})
|
@item $(basename @var{names}@dots{})
|
||||||
Extract the base name (name without suffix) of each file name.@*
|
Extract the base name (name without suffix) of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
||||||
Append @var{suffix} to each word in @var{names}.@*
|
Append @var{suffix} to each word in @var{names}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(addprefix @var{prefix},@var{names}@dots{})
|
@item $(addprefix @var{prefix},@var{names}@dots{})
|
||||||
Prepend @var{prefix} to each word in @var{names}.@*
|
Prepend @var{prefix} to each word in @var{names}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(join @var{list1},@var{list2})
|
@item $(join @var{list1},@var{list2})
|
||||||
Join two parallel lists of words.@*
|
Join two parallel lists of words.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(word @var{n},@var{text})
|
@item $(word @var{n},@var{text})
|
||||||
Extract the @var{n}th word (one-origin) of @var{text}.@*
|
Extract the @var{n}th word (one-origin) of @var{text}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(words @var{text})
|
@item $(words @var{text})
|
||||||
Count the number of words in @var{text}.@*
|
Count the number of words in @var{text}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(firstword @var{names}@dots{})
|
@item $(firstword @var{names}@dots{})
|
||||||
Extract the first word of @var{names}.@*
|
Extract the first word of @var{names}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(wildcard @var{pattern}@dots{})
|
@item $(wildcard @var{pattern}@dots{})
|
||||||
Find file names matching a shell file name pattern (@emph{not} a
|
Find file names matching a shell file name pattern (@emph{not} a
|
||||||
@@ -8669,6 +8951,12 @@ The name of the system default command interpreter, usually @file{/bin/sh}.
|
|||||||
You can set @code{SHELL} in the makefile to change the shell used to run
|
You can set @code{SHELL} in the makefile to change the shell used to run
|
||||||
commands. @xref{Execution, ,Command Execution}.
|
commands. @xref{Execution, ,Command Execution}.
|
||||||
|
|
||||||
|
@item MAKESHELL
|
||||||
|
|
||||||
|
On MS-DOS only, the name of the command interpreter that is to be used
|
||||||
|
by @code{make}. This value takes precedence over the value of
|
||||||
|
@code{SHELL}. @xref{Execution, ,MAKESHELL variable}.
|
||||||
|
|
||||||
@item MAKE
|
@item MAKE
|
||||||
|
|
||||||
The name with which @code{make} was invoked.
|
The name with which @code{make} was invoked.
|
||||||
@@ -8686,12 +8974,142 @@ The flags given to @code{make}. You can set this in the environment or
|
|||||||
a makefile to set flags.@*
|
a makefile to set flags.@*
|
||||||
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
||||||
|
|
||||||
|
@item MAKECMDGOALS
|
||||||
|
|
||||||
|
The targets given to @code{make} on the command line. Setting this
|
||||||
|
variable has no effect on the operation of @code{make}.@*
|
||||||
|
@xref{Goals, ,Arguments to Specify the Goals}.
|
||||||
|
|
||||||
|
@item CURDIR
|
||||||
|
|
||||||
|
Set to the pathname of the current working directory (after all
|
||||||
|
@code{-C} options are processed, if any). Setting this variable has no
|
||||||
|
effect on the operation of @code{make}.@*
|
||||||
|
@xref{Recursion, ,Recursive Use of @code{make}}.
|
||||||
|
|
||||||
@item SUFFIXES
|
@item SUFFIXES
|
||||||
|
|
||||||
The default list of suffixes before @code{make} reads any makefiles.
|
The default list of suffixes before @code{make} reads any makefiles.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Complex Makefile, Concept Index, Quick Reference, Top
|
@node Make Errors, Complex Makefile, Quick Reference, Top
|
||||||
|
@comment node-name, next, previous, up
|
||||||
|
@appendix Errors Generated by Make
|
||||||
|
|
||||||
|
Here is a list of the most common errors you might see generated by
|
||||||
|
@code{make}, and some information about what they mean and how to fix
|
||||||
|
them.
|
||||||
|
|
||||||
|
Sometimes @code{make} errors are not fatal, especially in the presence
|
||||||
|
of a @code{-} prefix on a command script line, or the @code{-k} command
|
||||||
|
line option. Errors that are fatal are prefixed with the string
|
||||||
|
@code{***}.
|
||||||
|
|
||||||
|
Error messages are all either prefixed with the name of the program
|
||||||
|
(usually @samp{make}), or, if the error is found in a makefile, the name
|
||||||
|
of the file and linenumber containing the problem.
|
||||||
|
|
||||||
|
In the table below, these common prefixes are left off.
|
||||||
|
|
||||||
|
@table @samp
|
||||||
|
|
||||||
|
@item [@var{foo}] Error @var{NN}
|
||||||
|
@itemx [@var{foo}] @var{signal description}
|
||||||
|
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).
|
||||||
|
|
||||||
|
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''.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@item commands commence before first target. Stop.
|
||||||
|
@itemx missing rule before commands. Stop.
|
||||||
|
This means the first thing in the makefile seems to be part of a command
|
||||||
|
script: it begins with a TAB character and doesn't appear to be a legal
|
||||||
|
@code{make} command (such as a variable assignment). Command scripts
|
||||||
|
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.
|
||||||
|
|
||||||
|
@item No rule to make target `@var{xxx}'.
|
||||||
|
@itemx No rule to make target `@var{xxx}', needed by `@var{yyy}'.
|
||||||
|
This means that @code{make} decided it needed to build a target, but
|
||||||
|
then couldn't find any instructions in the makefile on how to do that,
|
||||||
|
either explicit or implicit (including in the default rules database).
|
||||||
|
|
||||||
|
If you want that file to be built, you will need to add a rule to your
|
||||||
|
makefile describing how that target can be built. Other possible
|
||||||
|
sources of this problem are typos in the makefile (if that filename is
|
||||||
|
wrong) or a corrupted source tree (if that file is not supposed to be
|
||||||
|
built, but rather only a dependency).
|
||||||
|
|
||||||
|
@item No targets specified and no makefile found. Stop.
|
||||||
|
@itemx No targets. Stop.
|
||||||
|
The former means that you didn't provide any targets to be built on the
|
||||||
|
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.
|
||||||
|
|
||||||
|
@item Makefile `@var{xxx}' was not found.
|
||||||
|
@itemx Included makefile `@var{xxx}' was not found.
|
||||||
|
A makefile specified on the command line (first form) or included
|
||||||
|
(second form) was not found.
|
||||||
|
|
||||||
|
@item warning: overriding commands for target `@var{xxx}'
|
||||||
|
@itemx warning: ignoring old commands for target `@var{xxx}'
|
||||||
|
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.
|
||||||
|
|
||||||
|
@item Circular @var{xxx} <- @var{yyy} dependency dropped.
|
||||||
|
This means that @code{make} detected a loop in the dependency graph:
|
||||||
|
after tracing the dependency @var{yyy} of target @var{xxx}, and its
|
||||||
|
dependencies, etc., one of them depended on @var{xxx} again.
|
||||||
|
|
||||||
|
@item Recursive variable `@var{xxx}' references itself (eventually). Stop.
|
||||||
|
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{+=}).
|
||||||
|
|
||||||
|
@item Unterminated variable reference. Stop.
|
||||||
|
This means you forgot to provide the proper closing parenthesis
|
||||||
|
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.
|
||||||
|
|
||||||
|
@item missing target pattern. Stop.
|
||||||
|
@itemx multiple target patterns. Stop.
|
||||||
|
@itemx target pattern contains no `%'. Stop.
|
||||||
|
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{%}).
|
||||||
|
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@node Complex Makefile, Concept Index, Make Errors, Top
|
||||||
@appendix Complex Makefile Example
|
@appendix Complex Makefile Example
|
||||||
|
|
||||||
Here is the makefile for the GNU @code{tar} program. This is a
|
Here is the makefile for the GNU @code{tar} program. This is a
|
||||||
|
|||||||
48
makefile.com
48
makefile.com
@@ -4,10 +4,37 @@ $!
|
|||||||
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
||||||
$! of the shareable executable
|
$! of the shareable executable
|
||||||
$!
|
$!
|
||||||
$ def/nolog sys sys$library:
|
$! In case of problems with the install you might contact me at
|
||||||
$ filelist = "alloca 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 getopt getopt1"
|
$! zinser@decus.decus.de (preferred) or eurmpz@eur.sas.com
|
||||||
|
$!
|
||||||
|
$! Look for the compiler used
|
||||||
|
$!
|
||||||
|
$ lval = ""
|
||||||
|
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
||||||
|
$ then
|
||||||
|
$ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
|
||||||
|
$ ccopt = ""
|
||||||
|
$ else
|
||||||
|
$ ccopt = "/decc/prefix=all"
|
||||||
|
$ if f$trnlnm("SYS").eqs.""
|
||||||
|
$ 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."" -
|
||||||
|
then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
|
||||||
|
$ 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
|
||||||
|
$ endif
|
||||||
|
$ endif
|
||||||
|
$ 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
|
$ copy config.h-vms config.h
|
||||||
$ n=0
|
$ n=0
|
||||||
|
$ open/write optf make.opt
|
||||||
$ loop:
|
$ loop:
|
||||||
$ cfile = f$elem(n," ",filelist)
|
$ cfile = f$elem(n," ",filelist)
|
||||||
$ if cfile .eqs. " " then goto linkit
|
$ if cfile .eqs. " " then goto linkit
|
||||||
@@ -16,19 +43,18 @@ $ call compileit 'cfile' 'p1'
|
|||||||
$ n = n + 1
|
$ n = n + 1
|
||||||
$ goto loop
|
$ goto loop
|
||||||
$ linkit:
|
$ linkit:
|
||||||
|
$ close optf
|
||||||
$ if p1 .nes. "" then goto link_using_library
|
$ if p1 .nes. "" then goto link_using_library
|
||||||
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
|
$ link/exe=make make.opt/opt
|
||||||
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
|
||||||
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
|
||||||
glob,fnmatch,getopt,getopt1
|
|
||||||
$ exit
|
$ exit
|
||||||
$ link_using_library:
|
$ link_using_library:
|
||||||
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
|
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib
|
||||||
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
|
||||||
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
|
||||||
glob,fnmatch,getopt,getopt1,sys$library:vaxcrtl/lib
|
|
||||||
$!
|
$!
|
||||||
$ compileit : subroutine
|
$ compileit : subroutine
|
||||||
$ cc/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS","NO_ARCHIVES") 'p1'
|
$ ploc = f$locate("]",p1)
|
||||||
|
$ filnam = p1
|
||||||
|
$ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1)
|
||||||
|
$ write optf "''filnam'"
|
||||||
|
$ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
|
||||||
$ exit
|
$ exit
|
||||||
$ endsubroutine : compileit
|
$ endsubroutine : compileit
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 1988, 1989, 1996 Free Software Foundation, Inc.
|
# Copyright (C) 1988, 1989, 1996, 1997 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# VMS extensions from GNU Make 3.60 imported by
|
# VMS extensions from GNU Make 3.60 imported by
|
||||||
@@ -31,13 +31,13 @@ CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
|||||||
#LDFLAGS = /deb
|
#LDFLAGS = /deb
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","NO_ARCHIVES","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
||||||
|
|
||||||
LOAD_AVG = /define="NO_LDAV"
|
LOAD_AVG = /define="NO_LDAV"
|
||||||
|
|
||||||
# If you don't want archive support, comment these out.
|
# If you don't want archive support, comment these out.
|
||||||
#ARCHIVES = ,ar.obj,arscan.obj
|
ARCHIVES = ,ar.obj,arscan.obj
|
||||||
#ARCHIVES_SRC = ar.c arscan.c
|
ARCHIVES_SRC = ar.c arscan.c
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
# System V probably need -lPW for alloca.
|
# System V probably need -lPW for alloca.
|
||||||
|
|||||||
12
misc.c
12
misc.c
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous generic support functions for GNU Make.
|
/* Miscellaneous generic support functions for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -253,6 +253,9 @@ makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
|
|||||||
unsigned int lineno;
|
unsigned int lineno;
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
|
if (!file)
|
||||||
|
fatal(s1, s2, s3, s4, s5, s6);
|
||||||
|
|
||||||
log_working_directory (1);
|
log_working_directory (1);
|
||||||
|
|
||||||
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
||||||
@@ -470,7 +473,7 @@ copy_dep_chain (d)
|
|||||||
{
|
{
|
||||||
register struct dep *c;
|
register struct dep *c;
|
||||||
struct dep *firstnew = 0;
|
struct dep *firstnew = 0;
|
||||||
struct dep *lastnew;
|
struct dep *lastnew = 0;
|
||||||
|
|
||||||
while (d != 0)
|
while (d != 0)
|
||||||
{
|
{
|
||||||
@@ -564,8 +567,9 @@ log_access (flavor)
|
|||||||
but we write this one to stderr because it might be
|
but we write this one to stderr because it might be
|
||||||
run in a child fork whose stdout is piped. */
|
run in a child fork whose stdout is piped. */
|
||||||
|
|
||||||
fprintf (stderr, "%s access: user %d (real %d), group %d (real %d)\n",
|
fprintf (stderr, "%s access: user %lu (real %lu), group %lu (real %lu)\n",
|
||||||
flavor, geteuid (), getuid (), getegid (), getgid ());
|
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
|
||||||
|
(unsigned long) getegid (), (unsigned long) getgid ());
|
||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
599
read.c
599
read.c
@@ -1,5 +1,5 @@
|
|||||||
/* Reading and parsing of makefiles for GNU Make.
|
/* Reading and parsing of makefiles for GNU Make.
|
||||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -16,12 +16,15 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with GNU Make; see the file COPYING. If not, write to
|
along with GNU Make; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
#include "rule.h"
|
||||||
|
|
||||||
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
|
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
|
||||||
#ifdef HAVE_GLOB_H
|
#ifdef HAVE_GLOB_H
|
||||||
@@ -57,6 +60,14 @@ struct linebuffer
|
|||||||
#define freebuffer(lb) free ((lb)->buffer)
|
#define freebuffer(lb) free ((lb)->buffer)
|
||||||
|
|
||||||
|
|
||||||
|
/* Types of "words" that can be read in a makefile. */
|
||||||
|
enum make_word_type
|
||||||
|
{
|
||||||
|
w_bogus, w_eol, w_static, w_variable, w_colon, w_dcolon, w_semicolon,
|
||||||
|
w_comment, w_varassign
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* A `struct conditionals' contains the information describing
|
/* A `struct conditionals' contains the information describing
|
||||||
all the active conditionals in a makefile.
|
all the active conditionals in a makefile.
|
||||||
|
|
||||||
@@ -122,9 +133,14 @@ static unsigned int do_define PARAMS ((char *name, unsigned int namelen, enum va
|
|||||||
unsigned int lineno, FILE *infile, char *filename));
|
unsigned int lineno, FILE *infile, char *filename));
|
||||||
static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno));
|
static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno));
|
||||||
static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent,
|
static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent,
|
||||||
struct dep *deps, unsigned int commands_started, char *commands,
|
struct dep *deps, unsigned int cmds_started, char *commands,
|
||||||
unsigned int commands_idx, int two_colon, char *filename,
|
unsigned int commands_idx, int two_colon, char *filename,
|
||||||
unsigned int lineno, int set_default));
|
unsigned int lineno, 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));
|
||||||
|
static enum make_word_type get_next_mword PARAMS ((char *buffer, char *delim,
|
||||||
|
char **startp, unsigned int *length));
|
||||||
|
|
||||||
/* Read in all the makefiles and return the chain of their names. */
|
/* Read in all the makefiles and return the chain of their names. */
|
||||||
|
|
||||||
@@ -200,7 +216,7 @@ read_all_makefiles (makefiles)
|
|||||||
static char *default_makefiles[] =
|
static char *default_makefiles[] =
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
/* all lower case since readdir() (the vms version) 'lowercasifies' */
|
/* all lower case since readdir() (the vms version) 'lowercasifies' */
|
||||||
{ "makefile.vms", "gnumakefile", "makefile", 0 };
|
{ "makefile.vms", "gnumakefile.", "makefile.", 0 };
|
||||||
#else
|
#else
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
{ "GNUmakefile", "Makefile", "SMakefile", 0 };
|
{ "GNUmakefile", "Makefile", "SMakefile", 0 };
|
||||||
@@ -268,10 +284,10 @@ read_makefile (filename, flags)
|
|||||||
unsigned int commands_len = 200;
|
unsigned int commands_len = 200;
|
||||||
char *commands = (char *) xmalloc (200);
|
char *commands = (char *) xmalloc (200);
|
||||||
unsigned int commands_idx = 0;
|
unsigned int commands_idx = 0;
|
||||||
unsigned int commands_started;
|
unsigned int cmds_started;
|
||||||
register char *p;
|
char *p;
|
||||||
char *p2;
|
char *p2;
|
||||||
int len;
|
int len, reading_target;
|
||||||
int ignoring = 0, in_ignored_define = 0;
|
int ignoring = 0, in_ignored_define = 0;
|
||||||
int no_targets = 0; /* Set when reading a rule without targets. */
|
int no_targets = 0; /* Set when reading a rule without targets. */
|
||||||
char *passed_filename = filename;
|
char *passed_filename = filename;
|
||||||
@@ -280,7 +296,7 @@ read_makefile (filename, flags)
|
|||||||
struct dep *deps;
|
struct dep *deps;
|
||||||
unsigned int lineno = 1;
|
unsigned int lineno = 1;
|
||||||
unsigned int nlines = 0;
|
unsigned int nlines = 0;
|
||||||
int two_colon;
|
int two_colon = 0;
|
||||||
char *pattern = 0, *pattern_percent;
|
char *pattern = 0, *pattern_percent;
|
||||||
|
|
||||||
int makefile_errno;
|
int makefile_errno;
|
||||||
@@ -293,19 +309,16 @@ read_makefile (filename, flags)
|
|||||||
{ \
|
{ \
|
||||||
if (filenames != 0) \
|
if (filenames != 0) \
|
||||||
record_files (filenames, pattern, pattern_percent, deps, \
|
record_files (filenames, pattern, pattern_percent, deps, \
|
||||||
commands_started, commands, commands_idx, \
|
cmds_started, commands, commands_idx, \
|
||||||
two_colon, filename, lineno, \
|
two_colon, filename, lineno, \
|
||||||
!(flags & RM_NO_DEFAULT_GOAL)); \
|
!(flags & RM_NO_DEFAULT_GOAL)); \
|
||||||
filenames = 0; \
|
filenames = 0; \
|
||||||
commands_idx = 0; \
|
commands_idx = 0; \
|
||||||
pattern = 0; \
|
if (pattern) { free(pattern); pattern = 0; } \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#ifdef lint /* Suppress `used before set' messages. */
|
|
||||||
two_colon = 0;
|
|
||||||
#endif
|
|
||||||
pattern_percent = 0;
|
pattern_percent = 0;
|
||||||
commands_started = lineno;
|
cmds_started = lineno;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
{
|
{
|
||||||
@@ -424,7 +437,7 @@ read_makefile (filename, flags)
|
|||||||
/* Append this command line to the line being accumulated. */
|
/* Append this command line to the line being accumulated. */
|
||||||
p = lb.buffer;
|
p = lb.buffer;
|
||||||
if (commands_idx == 0)
|
if (commands_idx == 0)
|
||||||
commands_started = lineno;
|
cmds_started = lineno;
|
||||||
len = strlen (p);
|
len = strlen (p);
|
||||||
if (len + 1 + commands_idx > commands_len)
|
if (len + 1 + commands_idx > commands_len)
|
||||||
{
|
{
|
||||||
@@ -453,7 +466,7 @@ read_makefile (filename, flags)
|
|||||||
collapse_continuations (collapsed);
|
collapse_continuations (collapsed);
|
||||||
remove_comments (collapsed);
|
remove_comments (collapsed);
|
||||||
|
|
||||||
/* strncmp is first to avoid dereferencing out into space. */
|
/* Compare a word, both length and contents. */
|
||||||
#define word1eq(s, l) (len == l && !strncmp (s, p, l))
|
#define word1eq(s, l) (len == l && !strncmp (s, p, l))
|
||||||
p = collapsed;
|
p = collapsed;
|
||||||
while (isspace (*p))
|
while (isspace (*p))
|
||||||
@@ -462,20 +475,27 @@ read_makefile (filename, flags)
|
|||||||
/* This line is completely empty. */
|
/* This line is completely empty. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Find the end of the first token */
|
/* Find the end of the first token. Note we don't need to worry about
|
||||||
|
* ":" here since we compare tokens by length (so "export" will never
|
||||||
|
* be equal to "export:").
|
||||||
|
*/
|
||||||
for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2)
|
for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2)
|
||||||
{}
|
{}
|
||||||
len = p2 - p;
|
len = p2 - p;
|
||||||
|
|
||||||
/* Find the start of the second token. If it's a `:', jump past
|
/* Find the start of the second token. If it's a `:' remember it,
|
||||||
preprocessor stuff since it can't be that--this allows targets named
|
since it can't be a preprocessor token--this allows targets named
|
||||||
`export', etc. */
|
`ifdef', `export', etc. */
|
||||||
|
reading_target = 0;
|
||||||
while (isspace (*p2))
|
while (isspace (*p2))
|
||||||
++p2;
|
++p2;
|
||||||
if (*p2 == '\0')
|
if (*p2 == '\0')
|
||||||
p2 = NULL;
|
p2 = NULL;
|
||||||
else if (*p2 == ':')
|
else if (p2[0] == ':' && p2[1] == '\0')
|
||||||
goto check_var;
|
{
|
||||||
|
reading_target = 1;
|
||||||
|
goto skip_conditionals;
|
||||||
|
}
|
||||||
|
|
||||||
/* We must first check for conditional and `define' directives before
|
/* We must first check for conditional and `define' directives before
|
||||||
ignoring anything, since they control what we will do with
|
ignoring anything, since they control what we will do with
|
||||||
@@ -494,7 +514,8 @@ read_makefile (filename, flags)
|
|||||||
"invalid syntax in conditional");
|
"invalid syntax in conditional");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (word1eq ("endef", 5))
|
|
||||||
|
if (word1eq ("endef", 5))
|
||||||
{
|
{
|
||||||
if (in_ignored_define)
|
if (in_ignored_define)
|
||||||
in_ignored_define = 0;
|
in_ignored_define = 0;
|
||||||
@@ -502,7 +523,8 @@ read_makefile (filename, flags)
|
|||||||
makefile_fatal (filename, lineno, "extraneous `endef'");
|
makefile_fatal (filename, lineno, "extraneous `endef'");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (word1eq ("define", 6))
|
|
||||||
|
if (word1eq ("define", 6))
|
||||||
{
|
{
|
||||||
if (ignoring)
|
if (ignoring)
|
||||||
in_ignored_define = 1;
|
in_ignored_define = 1;
|
||||||
@@ -521,7 +543,8 @@ read_makefile (filename, flags)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (word1eq ("override", 8))
|
|
||||||
|
if (word1eq ("override", 8))
|
||||||
{
|
{
|
||||||
p2 = next_token (p + 8);
|
p2 = next_token (p + 8);
|
||||||
if (p2 == 0)
|
if (p2 == 0)
|
||||||
@@ -551,12 +574,14 @@ read_makefile (filename, flags)
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
skip_conditionals:
|
||||||
|
|
||||||
if (ignoring)
|
if (ignoring)
|
||||||
/* Ignore the line. We continue here so conditionals
|
/* Ignore the line. We continue here so conditionals
|
||||||
can appear in the middle of a rule. */
|
can appear in the middle of a rule. */
|
||||||
continue;
|
continue;
|
||||||
else if (word1eq ("export", 6))
|
|
||||||
|
if (!reading_target && word1eq ("export", 6))
|
||||||
{
|
{
|
||||||
struct variable *v;
|
struct variable *v;
|
||||||
p2 = next_token (p + 6);
|
p2 = next_token (p + 6);
|
||||||
@@ -578,7 +603,7 @@ read_makefile (filename, flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (word1eq ("unexport", 8))
|
else if (!reading_target && word1eq ("unexport", 8))
|
||||||
{
|
{
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
struct variable *v;
|
struct variable *v;
|
||||||
@@ -614,9 +639,7 @@ read_makefile (filename, flags)
|
|||||||
if (pattern != 0)
|
if (pattern != 0)
|
||||||
free (pattern);
|
free (pattern);
|
||||||
}
|
}
|
||||||
else
|
else if (word1eq ("include", 7) || word1eq ("-include", 8)
|
||||||
check_var:
|
|
||||||
if (word1eq ("include", 7) || word1eq ("-include", 8)
|
|
||||||
|| word1eq ("sinclude", 8))
|
|| word1eq ("sinclude", 8))
|
||||||
{
|
{
|
||||||
/* We have found an `include' line specifying a nested
|
/* We have found an `include' line specifying a nested
|
||||||
@@ -627,7 +650,7 @@ read_makefile (filename, flags)
|
|||||||
exist. "sinclude" is an alias for this from SGI. */
|
exist. "sinclude" is an alias for this from SGI. */
|
||||||
int noerror = p[0] != 'i';
|
int noerror = p[0] != 'i';
|
||||||
|
|
||||||
p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8)));
|
p = allocated_variable_expand (next_token (p + (noerror ? 8 : 7)));
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
{
|
{
|
||||||
makefile_error (filename, lineno,
|
makefile_error (filename, lineno,
|
||||||
@@ -667,6 +690,7 @@ read_makefile (filename, flags)
|
|||||||
&& ! noerror)
|
&& ! noerror)
|
||||||
makefile_error (filename, lineno,
|
makefile_error (filename, lineno,
|
||||||
"%s: %s", name, strerror (errno));
|
"%s: %s", name, strerror (errno));
|
||||||
|
free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free any space allocated by conditional_line. */
|
/* Free any space allocated by conditional_line. */
|
||||||
@@ -701,9 +725,20 @@ read_makefile (filename, flags)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This line describes some target files. */
|
/* This line describes some target files. This is complicated by
|
||||||
|
the existence of target-specific variables, because we can't
|
||||||
|
expand the entire line until we know if we have one or not. So
|
||||||
|
we expand the line word by word until we find the first `:',
|
||||||
|
then check to see if it's a target-specific variable.
|
||||||
|
|
||||||
char *cmdleft;
|
In this algorithm, `lb_next' will point to the beginning of the
|
||||||
|
unexpanded parts of the input buffer, while `p2' points to the
|
||||||
|
parts of the expanded buffer we haven't searched yet. */
|
||||||
|
|
||||||
|
enum make_word_type wtype;
|
||||||
|
enum variable_origin v_origin;
|
||||||
|
char *cmdleft, *lb_next;
|
||||||
|
unsigned int len, plen = 0;
|
||||||
|
|
||||||
/* Record the previous rule. */
|
/* Record the previous rule. */
|
||||||
|
|
||||||
@@ -720,25 +755,18 @@ read_makefile (filename, flags)
|
|||||||
}
|
}
|
||||||
else if (cmdleft != 0)
|
else if (cmdleft != 0)
|
||||||
/* Found one. Cut the line short there before expanding it. */
|
/* Found one. Cut the line short there before expanding it. */
|
||||||
*cmdleft = '\0';
|
*(cmdleft++) = '\0';
|
||||||
|
|
||||||
collapse_continuations (lb.buffer);
|
collapse_continuations (lb.buffer);
|
||||||
|
|
||||||
/* Expand variable and function references before doing anything
|
/* We can't expand the entire line, since if it's a per-target
|
||||||
else so that special characters can be inside variables. */
|
variable we don't want to expand it. So, walk from the
|
||||||
p = variable_expand (lb.buffer);
|
beginning, expanding as we go, and looking for "interesting"
|
||||||
|
chars. The first word is always expandable. */
|
||||||
if (cmdleft == 0)
|
wtype = get_next_mword(lb.buffer, NULL, &lb_next, &len);
|
||||||
/* Look for a semicolon in the expanded line. */
|
switch (wtype)
|
||||||
cmdleft = find_char_unquote (p, ";", 0);
|
|
||||||
|
|
||||||
if (cmdleft != 0)
|
|
||||||
/* Cut the line short at the semicolon. */
|
|
||||||
*cmdleft = '\0';
|
|
||||||
|
|
||||||
p2 = next_token (p);
|
|
||||||
if (*p2 == '\0')
|
|
||||||
{
|
{
|
||||||
|
case w_eol:
|
||||||
if (cmdleft != 0)
|
if (cmdleft != 0)
|
||||||
makefile_fatal (filename, lineno,
|
makefile_fatal (filename, lineno,
|
||||||
"missing rule before commands");
|
"missing rule before commands");
|
||||||
@@ -746,29 +774,157 @@ read_makefile (filename, flags)
|
|||||||
/* This line contained a variable reference that
|
/* This line contained a variable reference that
|
||||||
expanded to nothing but whitespace. */
|
expanded to nothing but whitespace. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case w_colon:
|
||||||
|
case w_dcolon:
|
||||||
|
/* We accept and ignore rules without targets for
|
||||||
|
compatibility with SunOS 4 make. */
|
||||||
|
no_targets = 1;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (*p2 == ':')
|
|
||||||
|
p2 = variable_expand_string(NULL, lb_next, len);
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
char *colonp;
|
||||||
|
|
||||||
|
lb_next += len;
|
||||||
|
if (cmdleft == 0)
|
||||||
|
{
|
||||||
|
/* Look for a semicolon in the expanded line. */
|
||||||
|
cmdleft = find_char_unquote (p2, ";", 0);
|
||||||
|
|
||||||
|
if (cmdleft != 0)
|
||||||
|
{
|
||||||
|
unsigned long p2_off = p2 - variable_buffer;
|
||||||
|
unsigned long cmd_off = cmdleft - variable_buffer;
|
||||||
|
char *pend = p2 + strlen(p2);
|
||||||
|
|
||||||
|
/* Append any remnants of lb, then cut the line short
|
||||||
|
at the semicolon. */
|
||||||
|
*cmdleft = '\0';
|
||||||
|
|
||||||
|
/* One school of thought says that you shouldn't expand
|
||||||
|
here, but merely copy, since now you're beyond a ";"
|
||||||
|
and into a command script. However, the old parser
|
||||||
|
expanded the whole line, so we continue that for
|
||||||
|
backwards-compatiblity. Also, it wouldn't be
|
||||||
|
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);
|
||||||
|
lb_next += strlen(lb_next);
|
||||||
|
p2 = variable_buffer + p2_off;
|
||||||
|
cmdleft = variable_buffer + cmd_off + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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'. */
|
||||||
|
while (colonp && (colonp[1] == '/' || colonp[1] == '\\') &&
|
||||||
|
colonp > p2 && isalpha(colonp[-1]) &&
|
||||||
|
(colonp == p2 + 1 || isspace(colonp[-2])))
|
||||||
|
colonp = find_char_unquote(colonp + 1, ":", 0);
|
||||||
|
#endif
|
||||||
|
if (colonp != 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
wtype = get_next_mword(lb_next, NULL, &lb_next, &len);
|
||||||
|
if (wtype == w_eol)
|
||||||
|
makefile_fatal (filename, lineno, "missing separator");
|
||||||
|
|
||||||
|
p2 += strlen(p2);
|
||||||
|
*(p2++) = ' ';
|
||||||
|
p2 = variable_expand_string(p2, lb_next, len);
|
||||||
|
/* We don't need to worry about cmdleft here, because if it was
|
||||||
|
found in the variable_buffer the entire buffer has already
|
||||||
|
been expanded... we'll never get here. */
|
||||||
|
}
|
||||||
|
|
||||||
|
p2 = next_token (variable_buffer);
|
||||||
|
|
||||||
|
filenames = multi_glob (parse_file_seq (&p2, ':',
|
||||||
|
sizeof (struct nameseq),
|
||||||
|
1),
|
||||||
|
sizeof (struct nameseq));
|
||||||
|
|
||||||
|
if (!filenames)
|
||||||
{
|
{
|
||||||
/* We accept and ignore rules without targets for
|
/* We accept and ignore rules without targets for
|
||||||
compatibility with SunOS 4 make. */
|
compatibility with SunOS 4 make. */
|
||||||
no_targets = 1;
|
no_targets = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* This should never be possible; we handled it above. */
|
||||||
|
assert(*p2 != '\0');
|
||||||
|
++p2;
|
||||||
|
|
||||||
filenames = multi_glob (parse_file_seq (&p2, ':',
|
|
||||||
sizeof (struct nameseq),
|
|
||||||
1),
|
|
||||||
sizeof (struct nameseq));
|
|
||||||
if (*p2++ == '\0')
|
|
||||||
makefile_fatal (filename, lineno, "missing separator");
|
|
||||||
/* Is this a one-colon or two-colon entry? */
|
/* Is this a one-colon or two-colon entry? */
|
||||||
two_colon = *p2 == ':';
|
two_colon = *p2 == ':';
|
||||||
if (two_colon)
|
if (two_colon)
|
||||||
p2++;
|
p2++;
|
||||||
|
|
||||||
|
/* Test to see if it's a target-specific variable. Copy the rest
|
||||||
|
of the buffer over, possibly temporarily (we'll expand it later
|
||||||
|
if it's not a target-specific variable). PLEN saves the length
|
||||||
|
of the unparsed section of p2, for later. */
|
||||||
|
if (*lb_next != '\0')
|
||||||
|
{
|
||||||
|
unsigned int l = p2 - variable_buffer;
|
||||||
|
plen = strlen(p2);
|
||||||
|
(void)variable_buffer_output(p2+plen,
|
||||||
|
lb_next, strlen(lb_next)+1);
|
||||||
|
p2 = variable_buffer + l;
|
||||||
|
}
|
||||||
|
wtype = get_next_mword(p2, NULL, &p, &len);
|
||||||
|
v_origin = o_file;
|
||||||
|
if (wtype == w_static && (len == (sizeof("override")-1)
|
||||||
|
&& !strncmp(p, "override", len)))
|
||||||
|
{
|
||||||
|
v_origin = o_override;
|
||||||
|
(void)get_next_mword(p+len, NULL, &p, &len);
|
||||||
|
}
|
||||||
|
else if (wtype != w_eol)
|
||||||
|
wtype = get_next_mword(p+len, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
if (wtype == w_varassign || v_origin == o_override)
|
||||||
|
{
|
||||||
|
record_target_var(filenames, p, two_colon, v_origin,
|
||||||
|
filename, lineno);
|
||||||
|
filenames = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is a normal target, _not_ a target-specific variable.
|
||||||
|
Unquote any = in the dependency list. */
|
||||||
|
find_char_unquote (lb_next, "=", 0);
|
||||||
|
|
||||||
/* We have some targets, so don't ignore the following commands. */
|
/* We have some targets, so don't ignore the following commands. */
|
||||||
no_targets = 0;
|
no_targets = 0;
|
||||||
|
|
||||||
|
/* Expand the dependencies, etc. */
|
||||||
|
if (*lb_next != '\0')
|
||||||
|
{
|
||||||
|
unsigned int l = p2 - variable_buffer;
|
||||||
|
(void)variable_expand_string(p2 + plen, lb_next, -1);
|
||||||
|
p2 = variable_buffer + l;
|
||||||
|
|
||||||
|
/* Look for a semicolon in the expanded line. */
|
||||||
|
if (cmdleft == 0)
|
||||||
|
{
|
||||||
|
cmdleft = find_char_unquote (p2, ";", 0);
|
||||||
|
if (cmdleft != 0)
|
||||||
|
*(cmdleft++) = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Is this a static pattern rule: `target: %targ: %dep; ...'? */
|
/* Is this a static pattern rule: `target: %targ: %dep; ...'? */
|
||||||
p = index (p2, ':');
|
p = index (p2, ':');
|
||||||
while (p != 0 && p[-1] == '\\')
|
while (p != 0 && p[-1] == '\\')
|
||||||
@@ -802,7 +958,8 @@ read_makefile (filename, flags)
|
|||||||
do {
|
do {
|
||||||
check_again = 0;
|
check_again = 0;
|
||||||
/* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */
|
/* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */
|
||||||
if (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) {
|
if (p != 0 && (p[1] == '\\' || p[1] == '/') &&
|
||||||
|
isalpha(p[-1]) && (p == p2 + 1 || index(" \t:", p[-2]) != 0)) {
|
||||||
p = index(p + 1, ':');
|
p = index(p + 1, ':');
|
||||||
check_again = 1;
|
check_again = 1;
|
||||||
}
|
}
|
||||||
@@ -822,6 +979,7 @@ read_makefile (filename, flags)
|
|||||||
if (pattern_percent == 0)
|
if (pattern_percent == 0)
|
||||||
makefile_fatal (filename, lineno,
|
makefile_fatal (filename, lineno,
|
||||||
"target pattern contains no `%%'");
|
"target pattern contains no `%%'");
|
||||||
|
free((char *)target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pattern = 0;
|
pattern = 0;
|
||||||
@@ -835,9 +993,9 @@ read_makefile (filename, flags)
|
|||||||
if (cmdleft != 0)
|
if (cmdleft != 0)
|
||||||
{
|
{
|
||||||
/* Semicolon means rest of line is a command. */
|
/* Semicolon means rest of line is a command. */
|
||||||
unsigned int len = strlen (cmdleft + 1);
|
unsigned int len = strlen (cmdleft);
|
||||||
|
|
||||||
commands_started = lineno;
|
cmds_started = lineno;
|
||||||
|
|
||||||
/* Add this command line to the buffer. */
|
/* Add this command line to the buffer. */
|
||||||
if (len + 2 > commands_len)
|
if (len + 2 > commands_len)
|
||||||
@@ -845,7 +1003,7 @@ read_makefile (filename, flags)
|
|||||||
commands_len = (len + 2) * 2;
|
commands_len = (len + 2) * 2;
|
||||||
commands = (char *) xrealloc (commands, commands_len);
|
commands = (char *) xrealloc (commands, commands_len);
|
||||||
}
|
}
|
||||||
bcopy (cmdleft + 1, commands, len);
|
bcopy (cmdleft, commands, len);
|
||||||
commands_idx += len;
|
commands_idx += len;
|
||||||
commands[commands_idx++] = '\n';
|
commands[commands_idx++] = '\n';
|
||||||
}
|
}
|
||||||
@@ -907,13 +1065,17 @@ do_define (name, namelen, origin, lineno, infile, filename)
|
|||||||
initbuffer (&lb);
|
initbuffer (&lb);
|
||||||
while (!feof (infile))
|
while (!feof (infile))
|
||||||
{
|
{
|
||||||
|
unsigned int len;
|
||||||
|
|
||||||
lineno += nlines;
|
lineno += nlines;
|
||||||
nlines = readline (&lb, infile, filename, lineno);
|
nlines = readline (&lb, infile, filename, lineno);
|
||||||
|
|
||||||
collapse_continuations (lb.buffer);
|
collapse_continuations (lb.buffer);
|
||||||
|
|
||||||
p = next_token (lb.buffer);
|
p = next_token (lb.buffer);
|
||||||
if ((p[5] == '\0' || isblank (p[5])) && !strncmp (p, "endef", 5))
|
len = strlen (p);
|
||||||
|
if ((len == 5 || (len > 5 && isblank (p[5])))
|
||||||
|
&& !strncmp (p, "endef", 5))
|
||||||
{
|
{
|
||||||
p += 5;
|
p += 5;
|
||||||
remove_comments (p);
|
remove_comments (p);
|
||||||
@@ -928,12 +1090,11 @@ do_define (name, namelen, origin, lineno, infile, filename)
|
|||||||
(void) define_variable (var, strlen (var), definition, origin, 1);
|
(void) define_variable (var, strlen (var), definition, origin, 1);
|
||||||
free (definition);
|
free (definition);
|
||||||
freebuffer (&lb);
|
freebuffer (&lb);
|
||||||
return lineno;
|
return (lineno + nlines);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int len = strlen (lb.buffer);
|
len = strlen (lb.buffer);
|
||||||
|
|
||||||
/* Increase the buffer size if necessary. */
|
/* Increase the buffer size if necessary. */
|
||||||
if (idx + len + 1 > length)
|
if (idx + len + 1 > length)
|
||||||
{
|
{
|
||||||
@@ -1213,6 +1374,93 @@ uniquize_deps (chain)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Record target-specific variable values for files FILENAMES.
|
||||||
|
TWO_COLON is nonzero if a double colon was used.
|
||||||
|
|
||||||
|
The links of FILENAMES are freed, and so are any names in it
|
||||||
|
that are not incorporated into other data structures.
|
||||||
|
|
||||||
|
If the target is a pattern, add the variable to the pattern-specific
|
||||||
|
variable value list. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
record_target_var (filenames, defn, two_colon, origin, filename, lineno)
|
||||||
|
struct nameseq *filenames;
|
||||||
|
char *defn;
|
||||||
|
int two_colon;
|
||||||
|
enum variable_origin origin;
|
||||||
|
char *filename;
|
||||||
|
unsigned int lineno;
|
||||||
|
{
|
||||||
|
struct nameseq *nextf;
|
||||||
|
struct variable_set_list *global;
|
||||||
|
|
||||||
|
global = current_variable_set_list;
|
||||||
|
|
||||||
|
for (; filenames != 0; filenames = nextf)
|
||||||
|
{
|
||||||
|
struct variable *v;
|
||||||
|
register char *name = filenames->name;
|
||||||
|
struct variable_set_list *vlist;
|
||||||
|
char *fname;
|
||||||
|
char *percent;
|
||||||
|
|
||||||
|
nextf = filenames->next;
|
||||||
|
free ((char *) filenames);
|
||||||
|
|
||||||
|
/* If it's a pattern target, then add it to the pattern-specific
|
||||||
|
variable list. */
|
||||||
|
percent = find_percent (name);
|
||||||
|
if (percent)
|
||||||
|
{
|
||||||
|
struct pattern_var *p;
|
||||||
|
|
||||||
|
/* Get a reference for this pattern-specific variable struct. */
|
||||||
|
p = create_pattern_var(name, percent);
|
||||||
|
vlist = p->vars;
|
||||||
|
fname = p->target;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct file *f;
|
||||||
|
|
||||||
|
/* Get a file reference for this file, and initialize it. */
|
||||||
|
f = enter_file (name);
|
||||||
|
initialize_file_variables (f);
|
||||||
|
vlist = f->variables;
|
||||||
|
fname = f->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make the new variable context current and define the variable. */
|
||||||
|
current_variable_set_list = vlist;
|
||||||
|
v = try_variable_definition(filename, lineno, defn, origin);
|
||||||
|
if (!v)
|
||||||
|
makefile_error(filename, lineno,
|
||||||
|
"Malformed per-target variable definition");
|
||||||
|
v->per_target = 1;
|
||||||
|
|
||||||
|
/* If it's not an override, check to see if there was a command-line
|
||||||
|
setting. If so, reset the value. */
|
||||||
|
if (origin != o_override)
|
||||||
|
{
|
||||||
|
struct variable *gv;
|
||||||
|
int len = strlen(v->name);
|
||||||
|
|
||||||
|
current_variable_set_list = global;
|
||||||
|
gv = lookup_variable(v->name, len);
|
||||||
|
if (gv && (gv->origin == o_env_override || gv->origin == o_command))
|
||||||
|
define_variable_in_set(v->name, len, gv->value, gv->origin,
|
||||||
|
gv->recursive, vlist->set);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free name if not needed further. */
|
||||||
|
if (name != fname && (name < fname || name > fname + strlen (fname)))
|
||||||
|
free (name);
|
||||||
|
}
|
||||||
|
|
||||||
|
current_variable_set_list = global;
|
||||||
|
}
|
||||||
|
|
||||||
/* Record a description line for files FILENAMES,
|
/* Record a description line for files FILENAMES,
|
||||||
with dependencies DEPS, commands to execute described
|
with dependencies DEPS, commands to execute described
|
||||||
by COMMANDS and COMMANDS_IDX, coming from FILENAME:COMMANDS_STARTED.
|
by COMMANDS and COMMANDS_IDX, coming from FILENAME:COMMANDS_STARTED.
|
||||||
@@ -1225,12 +1473,12 @@ uniquize_deps (chain)
|
|||||||
that are not incorporated into other data structures. */
|
that are not incorporated into other data structures. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
record_files (filenames, pattern, pattern_percent, deps, cmds_started,
|
||||||
commands, commands_idx, two_colon, filename, lineno, set_default)
|
commands, commands_idx, two_colon, filename, lineno, set_default)
|
||||||
struct nameseq *filenames;
|
struct nameseq *filenames;
|
||||||
char *pattern, *pattern_percent;
|
char *pattern, *pattern_percent;
|
||||||
struct dep *deps;
|
struct dep *deps;
|
||||||
unsigned int commands_started;
|
unsigned int cmds_started;
|
||||||
char *commands;
|
char *commands;
|
||||||
unsigned int commands_idx;
|
unsigned int commands_idx;
|
||||||
int two_colon;
|
int two_colon;
|
||||||
@@ -1240,7 +1488,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
{
|
{
|
||||||
struct nameseq *nextf;
|
struct nameseq *nextf;
|
||||||
int implicit = 0;
|
int implicit = 0;
|
||||||
unsigned int max_targets, target_idx;
|
unsigned int max_targets = 0, target_idx = 0;
|
||||||
char **targets = 0, **target_percents = 0;
|
char **targets = 0, **target_percents = 0;
|
||||||
struct commands *cmds;
|
struct commands *cmds;
|
||||||
|
|
||||||
@@ -1248,7 +1496,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
{
|
{
|
||||||
cmds = (struct commands *) xmalloc (sizeof (struct commands));
|
cmds = (struct commands *) xmalloc (sizeof (struct commands));
|
||||||
cmds->filename = filename;
|
cmds->filename = filename;
|
||||||
cmds->lineno = commands_started;
|
cmds->lineno = cmds_started;
|
||||||
cmds->commands = savestring (commands, commands_idx);
|
cmds->commands = savestring (commands, commands_idx);
|
||||||
cmds->command_lines = 0;
|
cmds->command_lines = 0;
|
||||||
}
|
}
|
||||||
@@ -1257,6 +1505,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
|
|
||||||
for (; filenames != 0; filenames = nextf)
|
for (; filenames != 0; filenames = nextf)
|
||||||
{
|
{
|
||||||
|
|
||||||
register char *name = filenames->name;
|
register char *name = filenames->name;
|
||||||
register struct file *f;
|
register struct file *f;
|
||||||
register struct dep *d;
|
register struct dep *d;
|
||||||
@@ -1638,13 +1887,6 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
if (p && *p == ',')
|
if (p && *p == ',')
|
||||||
*p =' ';
|
*p =' ';
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MSDOS__
|
|
||||||
/* For MS-DOS, skip a "C:\..." or a "C:/..." until we find a
|
|
||||||
first colon which isn't followed by a slash or a backslash. */
|
|
||||||
if (stopchar == ':')
|
|
||||||
while (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1]))
|
|
||||||
p = find_char_unquote (p + 1, stopchars, 1);
|
|
||||||
#endif
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
if (stopchar == ':' && p && *p == ':' &&
|
if (stopchar == ':' && p && *p == ':' &&
|
||||||
!(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
!(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||||
@@ -1652,16 +1894,15 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
p = find_char_unquote (p+1, stopchars, 1);
|
p = find_char_unquote (p+1, stopchars, 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WINDOWS32
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
/* For WINDOWS32, skip a "C:\..." or "C:/...". */
|
/* For WINDOWS32, skip a "C:\..." or a "C:/..." until we find the
|
||||||
if (stopchar == ':' &&
|
first colon which isn't followed by a slash or a backslash.
|
||||||
p != 0 &&
|
Note that tokens separated by spaces should be treated as separate
|
||||||
(p[1] == '\\' || p[1] == '/') &&
|
tokens since make doesn't allow path names with spaces */
|
||||||
isalpha (p[-1])) {
|
if (stopchar == ':')
|
||||||
p = end_of_token_w32(++p, ':');
|
while (p != 0 && !isspace(*p) &&
|
||||||
if (*p == '\0' && p[-1] == ':')
|
(p[1] == '\\' || p[1] == '/') && isalpha (p[-1]))
|
||||||
p--;
|
p = find_char_unquote (p + 1, stopchars, 1);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
p = q + strlen (q);
|
p = q + strlen (q);
|
||||||
@@ -1748,7 +1989,7 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
Look back for an elt with an opening `(' but no closing `)'. */
|
Look back for an elt with an opening `(' but no closing `)'. */
|
||||||
|
|
||||||
struct nameseq *n = new1->next, *lastn = new1;
|
struct nameseq *n = new1->next, *lastn = new1;
|
||||||
char *paren;
|
char *paren = 0;
|
||||||
while (n != 0 && (paren = index (n->name, '(')) == 0)
|
while (n != 0 && (paren = index (n->name, '(')) == 0)
|
||||||
{
|
{
|
||||||
lastn = n;
|
lastn = n;
|
||||||
@@ -1941,6 +2182,190 @@ readline (linebuffer, stream, filename, lineno)
|
|||||||
return nlines;
|
return nlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Parse the next "makefile word" from the input buffer, and return info
|
||||||
|
about it.
|
||||||
|
|
||||||
|
A "makefile word" is one of:
|
||||||
|
|
||||||
|
w_bogus Should never happen
|
||||||
|
w_eol End of input
|
||||||
|
w_static A static word; cannot be expanded
|
||||||
|
w_variable A word containing one or more variables/functions
|
||||||
|
w_colon A colon
|
||||||
|
w_dcolon A double-colon
|
||||||
|
w_semicolon A semicolon
|
||||||
|
w_comment A comment character
|
||||||
|
w_varassign A variable assignment operator (=, :=, +=, or ?=)
|
||||||
|
|
||||||
|
Note that this function is only used when reading certain parts of the
|
||||||
|
makefile. Don't use it where special rules hold sway (RHS of a variable,
|
||||||
|
in a command list, etc.) */
|
||||||
|
|
||||||
|
static enum make_word_type
|
||||||
|
get_next_mword (buffer, delim, startp, length)
|
||||||
|
char *buffer;
|
||||||
|
char *delim;
|
||||||
|
char **startp;
|
||||||
|
unsigned int *length;
|
||||||
|
{
|
||||||
|
enum make_word_type wtype = w_bogus;
|
||||||
|
char *p = buffer, *beg;
|
||||||
|
char c;
|
||||||
|
|
||||||
|
/* Skip any leading whitespace. */
|
||||||
|
while (isblank(*p))
|
||||||
|
++p;
|
||||||
|
|
||||||
|
beg = p;
|
||||||
|
c = *(p++);
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '\0':
|
||||||
|
wtype = w_eol;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '#':
|
||||||
|
wtype = w_comment;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ';':
|
||||||
|
wtype = w_semicolon;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '=':
|
||||||
|
wtype = w_varassign;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ':':
|
||||||
|
wtype = w_colon;
|
||||||
|
switch (*p)
|
||||||
|
{
|
||||||
|
case ':':
|
||||||
|
++p;
|
||||||
|
wtype = w_dcolon;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '=':
|
||||||
|
++p;
|
||||||
|
wtype = w_varassign;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '+':
|
||||||
|
case '?':
|
||||||
|
if (*p == '=')
|
||||||
|
{
|
||||||
|
++p;
|
||||||
|
wtype = w_varassign;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (delim && index(delim, c))
|
||||||
|
wtype = w_static;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Did we find something? If so, return now. */
|
||||||
|
if (wtype != w_bogus)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
/* This is some non-operator word. A word consists of the longest
|
||||||
|
string of characters that doesn't contain whitespace, one of [:=#],
|
||||||
|
or [?+]=, or one of the chars in the DELIM string. */
|
||||||
|
|
||||||
|
/* We start out assuming a static word; if we see a variable we'll
|
||||||
|
adjust our assumptions then. */
|
||||||
|
wtype = w_static;
|
||||||
|
|
||||||
|
/* We already found the first value of "c", above. */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
char closeparen;
|
||||||
|
int count;
|
||||||
|
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '\0':
|
||||||
|
case ' ':
|
||||||
|
case '\t':
|
||||||
|
case '=':
|
||||||
|
case '#':
|
||||||
|
goto done_word;
|
||||||
|
|
||||||
|
case ':':
|
||||||
|
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||||
|
/* A word CAN include a colon in its drive spec. */
|
||||||
|
if (!(p - beg == 2 && (*p == '/' || *p == '\\') && isalpha (*beg)))
|
||||||
|
#endif
|
||||||
|
goto done_word;
|
||||||
|
|
||||||
|
case '$':
|
||||||
|
c = *(p++);
|
||||||
|
if (c == '$')
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* This is a variable reference, so note that it's expandable.
|
||||||
|
Then read it to the matching close paren. */
|
||||||
|
wtype = w_variable;
|
||||||
|
|
||||||
|
if (c == '(')
|
||||||
|
closeparen = ')';
|
||||||
|
else if (c == '{')
|
||||||
|
closeparen = '}';
|
||||||
|
else
|
||||||
|
/* This is a single-letter variable reference. */
|
||||||
|
break;
|
||||||
|
|
||||||
|
for (count=0; *p != '\0'; ++p)
|
||||||
|
{
|
||||||
|
if (*p == c)
|
||||||
|
++count;
|
||||||
|
else if (*p == closeparen && --count < 0)
|
||||||
|
{
|
||||||
|
++p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
case '+':
|
||||||
|
if (*p == '=')
|
||||||
|
goto done_word;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\\':
|
||||||
|
switch (*p)
|
||||||
|
{
|
||||||
|
case ';':
|
||||||
|
case '=':
|
||||||
|
case '\\':
|
||||||
|
++p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (delim && index(delim, c))
|
||||||
|
goto done_word;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = *(p++);
|
||||||
|
}
|
||||||
|
done_word:
|
||||||
|
--p;
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (startp)
|
||||||
|
*startp = beg;
|
||||||
|
if (length)
|
||||||
|
*length = p - beg;
|
||||||
|
return wtype;
|
||||||
|
}
|
||||||
|
|
||||||
/* Construct the list of include directories
|
/* Construct the list of include directories
|
||||||
from the arguments and the default list. */
|
from the arguments and the default list. */
|
||||||
|
|
||||||
@@ -2072,11 +2497,11 @@ tilde_expand (name)
|
|||||||
if (home_dir == 0 || home_dir[0] == '\0')
|
if (home_dir == 0 || home_dir[0] == '\0')
|
||||||
{
|
{
|
||||||
extern char *getlogin ();
|
extern char *getlogin ();
|
||||||
char *name = getlogin ();
|
char *logname = getlogin ();
|
||||||
home_dir = 0;
|
home_dir = 0;
|
||||||
if (name != 0)
|
if (logname != 0)
|
||||||
{
|
{
|
||||||
struct passwd *p = getpwnam (name);
|
struct passwd *p = getpwnam (logname);
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
home_dir = p->pw_dir;
|
home_dir = p->pw_dir;
|
||||||
}
|
}
|
||||||
|
|||||||
27
readme.vms
27
readme.vms
@@ -1,21 +1,17 @@
|
|||||||
This is the VMS port of GNU Make version 3.75.
|
This is the VMS port of GNU Make.
|
||||||
|
|
||||||
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
||||||
|
|
||||||
This port was done by Klaus Kämpf (kkaempf@progis.de) of
|
This port was done by Klaus Kämpf <kkaempf@progis.de> of
|
||||||
proGIS Software, Aachen, Germany
|
proGIS Software, Aachen, Germany.
|
||||||
|
|
||||||
To build Make, simply type @makefile. This should compile all the
|
To build Make, simply type @makefile. This should compile all the
|
||||||
necessary files and link Make.
|
necessary files and link Make. There is also a file called
|
||||||
There is also a file called makefile.vms. If you already have GNU
|
makefile.vms. If you already have GNU Make built you can just use
|
||||||
Make 3.74 built you can just use Make with this makefile to rebuild.
|
Make with this makefile to rebuild.
|
||||||
|
|
||||||
Here are some notes about GNU Make for VMS:
|
Here are some notes about GNU Make for VMS:
|
||||||
|
|
||||||
Libraries are not supported. They were in GNU Make 3.60 but somehow I didn't
|
|
||||||
care porting the code. If there is enough interest, I'll do it at some
|
|
||||||
later time.
|
|
||||||
|
|
||||||
The variable $^ separates files with commas instead of spaces (It's the
|
The variable $^ separates files with commas instead of spaces (It's the
|
||||||
natural thing to do for VMS).
|
natural thing to do for VMS).
|
||||||
|
|
||||||
@@ -41,8 +37,6 @@ less than what vms provides. This might be a problem on the faster Alphas.
|
|||||||
You can use a : in a filename only if you preceed it with a backslash ('\').
|
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||||
E.g.- hobbes\:[bogas.files]
|
E.g.- hobbes\:[bogas.files]
|
||||||
|
|
||||||
None of the stuff in vpath.c has been implemented yet.
|
|
||||||
|
|
||||||
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
||||||
But it will stop on -E- and -F- errors. (unless you do something to override
|
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||||
this in your makefile, or whatever).
|
this in your makefile, or whatever).
|
||||||
@@ -53,8 +47,15 @@ Multiple line DCL commands, such as "if" statements, must be put inside
|
|||||||
command files. You can run a command file by using \@.
|
command files. You can run a command file by using \@.
|
||||||
|
|
||||||
|
|
||||||
VMS changes made for 3.74.3
|
Change history:
|
||||||
|
|
||||||
|
3.76.x
|
||||||
|
======
|
||||||
|
Added VMS help version (make.hlp) of the Unix man page. To integrate
|
||||||
|
that with an existing Help library use a command like the following
|
||||||
|
$lib/ins/help sys$help:helplib.hlb make.hlp
|
||||||
|
3.74.3
|
||||||
|
======
|
||||||
Lots of default settings are adapted for VMS. See default.c.
|
Lots of default settings are adapted for VMS. See default.c.
|
||||||
|
|
||||||
Long command lines are now converted to command files.
|
Long command lines are now converted to command files.
|
||||||
|
|||||||
199
remake.c
199
remake.c
@@ -1,5 +1,5 @@
|
|||||||
/* Basic dependency engine for GNU Make.
|
/* Basic dependency engine for GNU Make.
|
||||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -56,10 +56,6 @@ static int library_search PARAMS ((char **lib, time_t *mtime_ptr));
|
|||||||
|
|
||||||
extern time_t f_mtime PARAMS ((struct file *file, int search));
|
extern time_t f_mtime PARAMS ((struct file *file, int search));
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
extern int vms_stat PARAMS ((char *name, struct stat *buf));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
||||||
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
||||||
@@ -95,9 +91,14 @@ update_goal_chain (goals, makefiles)
|
|||||||
g->changed = 0;
|
g->changed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* Only run one job at a time when building makefiles.
|
||||||
|
No one seems to know why this was done, and no one can think of a good
|
||||||
|
reason to do it. Hopefully an obvious one won't appear as soon as we
|
||||||
|
release the next version :-/. */
|
||||||
if (makefiles)
|
if (makefiles)
|
||||||
/* Only run one job at a time. */
|
|
||||||
job_slots = 1;
|
job_slots = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Update all the goals until they are all finished. */
|
/* Update all the goals until they are all finished. */
|
||||||
|
|
||||||
@@ -119,7 +120,7 @@ update_goal_chain (goals, makefiles)
|
|||||||
{
|
{
|
||||||
/* Iterate over all double-colon entries for this file. */
|
/* Iterate over all double-colon entries for this file. */
|
||||||
struct file *file = g->file;
|
struct file *file = g->file;
|
||||||
int stop, any_not_updated = 0;
|
int stop = 0, any_not_updated = 0;
|
||||||
|
|
||||||
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
||||||
file != NULL;
|
file != NULL;
|
||||||
@@ -252,6 +253,38 @@ update_goal_chain (goals, makefiles)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Generate an error/fatal message if no rules are available for the target.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
no_rule_error(file)
|
||||||
|
struct file *file;
|
||||||
|
{
|
||||||
|
static const char msg_noparent[]
|
||||||
|
= "%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 (file->parent == 0)
|
||||||
|
error (msg_noparent, "*** ", file->name, ".");
|
||||||
|
else
|
||||||
|
error (msg_parent, "*** ",
|
||||||
|
file->name, file->parent->name, ".");
|
||||||
|
file->shownerror = 1;
|
||||||
|
}
|
||||||
|
file->update_status = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (file->parent == 0)
|
||||||
|
fatal (msg_noparent, "", file->name, "");
|
||||||
|
else
|
||||||
|
fatal (msg_parent, "", file->name, file->parent->name, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If FILE is not up to date, execute the commands for it.
|
/* If FILE is not up to date, execute the commands for it.
|
||||||
Return 0 if successful, 1 if unsuccessful;
|
Return 0 if successful, 1 if unsuccessful;
|
||||||
but with some flag settings, just call `exit' if unsuccessful.
|
but with some flag settings, just call `exit' if unsuccessful.
|
||||||
@@ -321,6 +354,13 @@ update_file_1 (file, depth)
|
|||||||
if (file->update_status > 0)
|
if (file->update_status > 0)
|
||||||
{
|
{
|
||||||
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
|
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
|
||||||
|
if (!file->shownerror)
|
||||||
|
{
|
||||||
|
int dontcare = file->dontcare;
|
||||||
|
file->dontcare = 0;
|
||||||
|
no_rule_error(file);
|
||||||
|
file->dontcare = dontcare;
|
||||||
|
}
|
||||||
return file->update_status;
|
return file->update_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,18 +438,14 @@ update_file_1 (file, depth)
|
|||||||
{
|
{
|
||||||
error ("Circular %s <- %s dependency dropped.",
|
error ("Circular %s <- %s dependency dropped.",
|
||||||
file->name, d->file->name);
|
file->name, d->file->name);
|
||||||
|
/* We cannot free D here because our the caller will still have
|
||||||
|
a reference to it when we were called recursively via
|
||||||
|
check_dep below. */
|
||||||
if (lastd == 0)
|
if (lastd == 0)
|
||||||
{
|
|
||||||
file->deps = d->next;
|
file->deps = d->next;
|
||||||
free ((char *) d);
|
|
||||||
d = file->deps;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
lastd->next = d->next;
|
lastd->next = d->next;
|
||||||
free ((char *) d);
|
d = d->next;
|
||||||
d = lastd->next;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,25 +633,9 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
DEBUGPR ("Must remake target `%s'.\n");
|
DEBUGPR ("Must remake target `%s'.\n");
|
||||||
|
|
||||||
/* It needs to be remade. If it's VPATH and not GPATH, toss the VPATH */
|
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
|
||||||
|
VPATH. */
|
||||||
if (!streq(file->name, file->hname))
|
if (!streq(file->name, file->hname))
|
||||||
{
|
|
||||||
char *name = file->name;
|
|
||||||
|
|
||||||
if (gpath_search (&name, NULL))
|
|
||||||
{
|
|
||||||
register struct file *fp = file;
|
|
||||||
|
|
||||||
/* Since we found the file on GPATH, convert it to use the
|
|
||||||
VPATH filename. */
|
|
||||||
while (fp)
|
|
||||||
{
|
|
||||||
fp->name = fp->hname;
|
|
||||||
fp = fp->prev;
|
|
||||||
}
|
|
||||||
DEBUGPR (" Using VPATH `%s' due to GPATH.\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
{
|
{
|
||||||
@@ -625,7 +645,6 @@ update_file_1 (file, depth)
|
|||||||
}
|
}
|
||||||
file->ignore_vpath = 1;
|
file->ignore_vpath = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Now, take appropriate actions to remake the file. */
|
/* Now, take appropriate actions to remake the file. */
|
||||||
remake_file (file);
|
remake_file (file);
|
||||||
@@ -799,7 +818,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
|||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
mtime = file_mtime (file);
|
mtime = file_mtime (file);
|
||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
if (mtime > this_mtime)
|
if (mtime != (time_t) -1 && mtime > this_mtime)
|
||||||
*must_make_ptr = 1;
|
*must_make_ptr = 1;
|
||||||
/* Otherwise, update all non-intermediate files we depend on,
|
/* Otherwise, update all non-intermediate files we depend on,
|
||||||
if necessary, and see whether any of them is more
|
if necessary, and see whether any of them is more
|
||||||
@@ -931,32 +950,7 @@ remake_file (file)
|
|||||||
Pretend it was successfully remade. */
|
Pretend it was successfully remade. */
|
||||||
file->update_status = 0;
|
file->update_status = 0;
|
||||||
else
|
else
|
||||||
{
|
no_rule_error(file);
|
||||||
/* This is a dependency file we cannot remake. Fail. */
|
|
||||||
static const char msg_noparent[]
|
|
||||||
= "%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 (file->parent == 0)
|
|
||||||
error (msg_noparent, "*** ", file->name, ".");
|
|
||||||
else
|
|
||||||
error (msg_parent, "*** ",
|
|
||||||
file->name, file->parent->name, ".");
|
|
||||||
}
|
|
||||||
file->update_status = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (file->parent == 0)
|
|
||||||
fatal (msg_noparent, "", file->name, "");
|
|
||||||
else
|
|
||||||
fatal (msg_parent, "", file->name, file->parent->name, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1015,11 +1009,12 @@ f_mtime (file, search)
|
|||||||
}
|
}
|
||||||
mtime = f_mtime (arfile, search);
|
mtime = f_mtime (arfile, search);
|
||||||
check_renamed (arfile);
|
check_renamed (arfile);
|
||||||
if (search && strcmp (arfile->name, arname))
|
if (search && strcmp (arfile->hname, arname))
|
||||||
{
|
{
|
||||||
/* The archive's name has changed.
|
/* The archive's name has changed.
|
||||||
Change the archive-member reference accordingly. */
|
Change the archive-member reference accordingly. */
|
||||||
|
|
||||||
|
char *name;
|
||||||
unsigned int arlen, memlen;
|
unsigned int arlen, memlen;
|
||||||
|
|
||||||
if (!arname_used)
|
if (!arname_used)
|
||||||
@@ -1028,18 +1023,26 @@ f_mtime (file, search)
|
|||||||
arname_used = 1;
|
arname_used = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
arname = arfile->name;
|
arname = arfile->hname;
|
||||||
arlen = strlen (arname);
|
arlen = strlen (arname);
|
||||||
memlen = strlen (memname);
|
memlen = strlen (memname);
|
||||||
|
|
||||||
free (file->name);
|
/* free (file->name); */
|
||||||
|
|
||||||
file->name = (char *) xmalloc (arlen + 1 + memlen + 2);
|
name = (char *) xmalloc (arlen + 1 + memlen + 2);
|
||||||
bcopy (arname, file->name, arlen);
|
bcopy (arname, name, arlen);
|
||||||
file->name[arlen] = '(';
|
name[arlen] = '(';
|
||||||
bcopy (memname, file->name + arlen + 1, memlen);
|
bcopy (memname, name + arlen + 1, memlen);
|
||||||
file->name[arlen + 1 + memlen] = ')';
|
name[arlen + 1 + memlen] = ')';
|
||||||
file->name[arlen + 1 + memlen + 1] = '\0';
|
name[arlen + 1 + memlen + 1] = '\0';
|
||||||
|
|
||||||
|
/* If the archive was found with GPATH, make the change permanent;
|
||||||
|
otherwise defer it until later. */
|
||||||
|
if (arfile->name == arfile->hname)
|
||||||
|
rename_file (file, name);
|
||||||
|
else
|
||||||
|
rehash_file (file, name);
|
||||||
|
check_renamed (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arname_used)
|
if (!arname_used)
|
||||||
@@ -1050,7 +1053,7 @@ f_mtime (file, search)
|
|||||||
/* The archive doesn't exist, so it's members don't exist either. */
|
/* The archive doesn't exist, so it's members don't exist either. */
|
||||||
return (time_t) -1;
|
return (time_t) -1;
|
||||||
|
|
||||||
mtime = ar_member_date (file->name);
|
mtime = ar_member_date (file->hname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -1070,6 +1073,17 @@ f_mtime (file, search)
|
|||||||
/* vpath_search and library_search store zero in MTIME
|
/* vpath_search and library_search store zero in MTIME
|
||||||
if they didn't need to do a stat call for their work. */
|
if they didn't need to do a stat call for their work. */
|
||||||
file->last_mtime = mtime;
|
file->last_mtime = mtime;
|
||||||
|
|
||||||
|
/* If we found it in VPATH, see if it's in GPATH too; if so,
|
||||||
|
change the name right now; if not, defer until after the
|
||||||
|
dependencies are updated. */
|
||||||
|
if (gpath_search (name, strlen(name) - strlen(file->name) - 1))
|
||||||
|
{
|
||||||
|
rename_file (file, name);
|
||||||
|
check_renamed (file);
|
||||||
|
return file_mtime (file);
|
||||||
|
}
|
||||||
|
|
||||||
rehash_file (file, name);
|
rehash_file (file, name);
|
||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
mtime = name_mtime (name);
|
mtime = name_mtime (name);
|
||||||
@@ -1080,25 +1094,42 @@ f_mtime (file, search)
|
|||||||
{
|
{
|
||||||
/* Files can have bogus timestamps that nothing newly made will be
|
/* Files can have bogus timestamps that nothing newly made will be
|
||||||
"newer" than. Updating their dependents could just result in loops.
|
"newer" than. Updating their dependents could just result in loops.
|
||||||
So notify the user of the anomaly with a warning. */
|
So notify the user of the anomaly with a warning.
|
||||||
|
|
||||||
|
We only need to do this once, for now. */
|
||||||
|
|
||||||
static time_t now = 0;
|
static time_t now = 0;
|
||||||
if (mtime != -1 && mtime > now && ! file->updated)
|
if (!clock_skew_detected
|
||||||
|
&& mtime != (time_t)-1 && mtime > now
|
||||||
|
&& !file->updated)
|
||||||
{
|
{
|
||||||
/* This file's time appears to be in the future.
|
/* This file's time appears to be in the future.
|
||||||
Update our concept of the present, and compare again. */
|
Update our concept of the present, and compare again. */
|
||||||
#ifdef VMS
|
|
||||||
/* Handle vms 64bit to 32bit time hack introduced in vms_stat ... */
|
|
||||||
static unsigned long vms_now[2]; /* assumes 32 bit long ! */
|
|
||||||
sys$gettim (vms_now);
|
|
||||||
now = ((vms_now[0]>>24) & 0xff) + ((vms_now[1]<<8) & 0xffffff00);
|
|
||||||
#else
|
|
||||||
extern time_t time ();
|
extern time_t time ();
|
||||||
time (&now);
|
time (&now);
|
||||||
#endif
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* FAT filesystems round time to nearest even second(!). Just
|
||||||
|
* allow for any file (NTFS or FAT) to perhaps suffer from this
|
||||||
|
* braindamage.
|
||||||
|
*/
|
||||||
|
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
|
||||||
|
#else
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Scrupulous testing indicates that some Windows
|
||||||
|
filesystems can set file times up to 3 sec into the future! */
|
||||||
|
if (mtime > now + 3)
|
||||||
|
#else
|
||||||
if (mtime > now)
|
if (mtime > now)
|
||||||
error ("*** Warning: File `%s' has modification time in the future",
|
#endif
|
||||||
file->name);
|
#endif
|
||||||
|
{
|
||||||
|
error("*** Warning: File `%s' has modification time in the future (%ld > %ld)",
|
||||||
|
file->name, mtime, now);
|
||||||
|
clock_skew_detected = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1123,11 +1154,7 @@ name_mtime (name)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
if (vms_stat (name, &st) < 0)
|
|
||||||
#else
|
|
||||||
if (stat (name, &st) < 0)
|
if (stat (name, &st) < 0)
|
||||||
#endif
|
|
||||||
return (time_t) -1;
|
return (time_t) -1;
|
||||||
|
|
||||||
return (time_t) st.st_mtime;
|
return (time_t) st.st_mtime;
|
||||||
|
|||||||
@@ -21,15 +21,15 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "job.h"
|
||||||
|
#include "filedef.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
#define __STRICT_BSD__ /* Don't make conflicting declarations. */
|
|
||||||
#include "customs.h"
|
#include "customs.h"
|
||||||
|
|
||||||
|
|
||||||
char *remote_description = "Customs";
|
char *remote_description = "Customs";
|
||||||
|
|
||||||
/* File name of the Customs `export' client command.
|
/* File name of the Customs `export' client command.
|
||||||
@@ -42,25 +42,47 @@ static ExportPermit permit;
|
|||||||
/* Normalized path name of the current directory. */
|
/* Normalized path name of the current directory. */
|
||||||
static char *normalized_cwd;
|
static char *normalized_cwd;
|
||||||
|
|
||||||
|
/* Call once at startup even if no commands are run. */
|
||||||
|
|
||||||
|
void
|
||||||
|
remote_setup ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Called before exit. */
|
||||||
|
|
||||||
|
void
|
||||||
|
remote_cleanup ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* Return nonzero if the next job should be done remotely. */
|
/* Return nonzero if the next job should be done remotely. */
|
||||||
|
|
||||||
int
|
int
|
||||||
start_remote_job_p ()
|
start_remote_job_p (first_p)
|
||||||
|
int first_p;
|
||||||
{
|
{
|
||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
int status;
|
int status;
|
||||||
|
int njobs;
|
||||||
/* Allow the user to turn off job exportation
|
|
||||||
(useful while he is debugging Customs, for example). */
|
|
||||||
if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!inited)
|
if (!inited)
|
||||||
{
|
{
|
||||||
|
/* Allow the user to turn off job exportation (useful while he is
|
||||||
|
debugging Customs, for example). */
|
||||||
|
if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0)
|
||||||
|
{
|
||||||
|
inited = -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* For secure Customs, make is installed setuid root and
|
/* For secure Customs, make is installed setuid root and
|
||||||
Customs requires a privileged source port be used. */
|
Customs requires a privileged source port be used. */
|
||||||
make_access ();
|
make_access ();
|
||||||
|
|
||||||
|
if (debug_flag)
|
||||||
|
Rpc_Debug(1);
|
||||||
|
|
||||||
/* Ping the daemon once to see if it is there. */
|
/* Ping the daemon once to see if it is there. */
|
||||||
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
|
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
|
||||||
|
|
||||||
@@ -87,6 +109,15 @@ start_remote_job_p ()
|
|||||||
if (inited < 0)
|
if (inited < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
njobs = job_slots_used;
|
||||||
|
if (!first_p)
|
||||||
|
njobs -= 1; /* correction for being called from reap_children() */
|
||||||
|
|
||||||
|
/* the first job should run locally, or, if the -l flag is given, we use
|
||||||
|
that as clue as to how many local jobs should be scheduled locally */
|
||||||
|
if (max_load_average < 0 && njobs == 0 || njobs < max_load_average)
|
||||||
|
return 0;
|
||||||
|
|
||||||
status = Customs_Host (EXPORT_SAME, &permit);
|
status = Customs_Host (EXPORT_SAME, &permit);
|
||||||
if (status != RPC_SUCCESS)
|
if (status != RPC_SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -113,8 +144,8 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
int *id_ptr;
|
int *id_ptr;
|
||||||
int *used_stdin;
|
int *used_stdin;
|
||||||
{
|
{
|
||||||
extern int vfork (), execve ();
|
|
||||||
char waybill[MAX_DATA_SIZE], msg[128];
|
char waybill[MAX_DATA_SIZE], msg[128];
|
||||||
|
struct hostent *host;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
int len;
|
int len;
|
||||||
@@ -150,8 +181,8 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
/* Modify the waybill as if the remote child had done `child_access ()'. */
|
/* Modify the waybill as if the remote child had done `child_access ()'. */
|
||||||
{
|
{
|
||||||
WayBill *wb = (WayBill *) waybill;
|
WayBill *wb = (WayBill *) waybill;
|
||||||
wb->euid = wb->ruid;
|
wb->ruid = wb->euid;
|
||||||
wb->rgid = wb->rgid;
|
wb->rgid = wb->egid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send the request to the server, timing out in 20 seconds. */
|
/* Send the request to the server, timing out in 20 seconds. */
|
||||||
@@ -164,26 +195,31 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
len, (Rpc_Opaque) waybill,
|
len, (Rpc_Opaque) waybill,
|
||||||
sizeof(msg), (Rpc_Opaque) msg,
|
sizeof(msg), (Rpc_Opaque) msg,
|
||||||
1, &timeout);
|
1, &timeout);
|
||||||
|
|
||||||
|
host = gethostbyaddr((char *)&permit.addr, sizeof(permit.addr), AF_INET);
|
||||||
|
|
||||||
if (status != RPC_SUCCESS)
|
if (status != RPC_SUCCESS)
|
||||||
{
|
{
|
||||||
(void) close (retsock);
|
(void) close (retsock);
|
||||||
(void) close (sock);
|
(void) close (sock);
|
||||||
error ("exporting: %s", Rpc_ErrorMessage (status));
|
error ("exporting to %s: %s",
|
||||||
|
host ? host->h_name : inet_ntoa (permit.addr),
|
||||||
|
Rpc_ErrorMessage (status));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
||||||
{
|
{
|
||||||
(void) close (retsock);
|
(void) close (retsock);
|
||||||
(void) close (sock);
|
(void) close (sock);
|
||||||
error ("CUSTOMS_IMPORT: %s", msg);
|
error ("exporting to %s: %s",
|
||||||
|
host ? host->h_name : inet_ntoa (permit.addr),
|
||||||
|
msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (debug_flag)
|
else
|
||||||
{
|
{
|
||||||
struct hostent *host = gethostbyaddr (&permit.addr, sizeof (permit.addr),
|
error ("*** exported to %s (id %u)",
|
||||||
AF_INET);
|
host ? host->h_name : inet_ntoa (permit.addr),
|
||||||
printf ("Job exported to %s ID %u\n",
|
|
||||||
host == 0 ? inet_ntoa (permit.addr) : host->h_name,
|
|
||||||
permit.id);
|
permit.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +261,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
|||||||
(void) close (sock);
|
(void) close (sock);
|
||||||
*is_remote = 0;
|
*is_remote = 0;
|
||||||
*id_ptr = pid;
|
*id_ptr = pid;
|
||||||
|
*used_stdin = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ remote_cleanup ()
|
|||||||
/* Return nonzero if the next job should be done remotely. */
|
/* Return nonzero if the next job should be done remotely. */
|
||||||
|
|
||||||
int
|
int
|
||||||
start_remote_job_p ()
|
start_remote_job_p (first_p)
|
||||||
|
int first_p;
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
102
rule.c
102
rule.c
@@ -50,6 +50,14 @@ unsigned int max_pattern_deps;
|
|||||||
|
|
||||||
unsigned int max_pattern_dep_length;
|
unsigned int max_pattern_dep_length;
|
||||||
|
|
||||||
|
/* Chain of all pattern-specific variables. */
|
||||||
|
|
||||||
|
static struct pattern_var *pattern_vars;
|
||||||
|
|
||||||
|
/* Pointer to last struct in the chain, so we can add onto the end. */
|
||||||
|
|
||||||
|
static struct pattern_var *last_pattern_var;
|
||||||
|
|
||||||
/* Pointer to structure for the file .SUFFIXES
|
/* Pointer to structure for the file .SUFFIXES
|
||||||
whose dependencies are the suffixes to be searched. */
|
whose dependencies are the suffixes to be searched. */
|
||||||
|
|
||||||
@@ -519,6 +527,78 @@ create_pattern_rule (targets, target_percents,
|
|||||||
r->terminal = terminal;
|
r->terminal = terminal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create a new pattern-specific variable struct. */
|
||||||
|
|
||||||
|
struct pattern_var *
|
||||||
|
create_pattern_var (target, suffix)
|
||||||
|
char *target, *suffix;
|
||||||
|
{
|
||||||
|
register struct pattern_var *p = 0;
|
||||||
|
unsigned int len = strlen(target);
|
||||||
|
|
||||||
|
/* Look to see if this pattern already exists in the list. */
|
||||||
|
for (p = pattern_vars; p != NULL; p = p->next)
|
||||||
|
if (p->len == len && !strcmp(p->target, target))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (p == 0)
|
||||||
|
{
|
||||||
|
p = (struct pattern_var *) xmalloc (sizeof (struct pattern_var));
|
||||||
|
if (last_pattern_var != 0)
|
||||||
|
last_pattern_var->next = p;
|
||||||
|
else
|
||||||
|
pattern_vars = p;
|
||||||
|
last_pattern_var = p;
|
||||||
|
p->next = 0;
|
||||||
|
p->target = target;
|
||||||
|
p->len = len;
|
||||||
|
p->suffix = suffix + 1;
|
||||||
|
p->vars = create_new_variable_set();
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Look up a target in the pattern-specific variable list. */
|
||||||
|
|
||||||
|
struct pattern_var *
|
||||||
|
lookup_pattern_var (target)
|
||||||
|
char *target;
|
||||||
|
{
|
||||||
|
struct pattern_var *p;
|
||||||
|
unsigned int targlen = strlen(target);
|
||||||
|
|
||||||
|
for (p = pattern_vars; p != 0; p = p->next)
|
||||||
|
{
|
||||||
|
char *stem;
|
||||||
|
unsigned int stemlen;
|
||||||
|
|
||||||
|
if (p->len > targlen)
|
||||||
|
/* It can't possibly match. */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* From the lengths of the filename and the pattern parts,
|
||||||
|
find the stem: the part of the filename that matches the %. */
|
||||||
|
stem = target + (p->suffix - p->target - 1);
|
||||||
|
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))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Compare the text in the pattern after the stem, if any.
|
||||||
|
We could test simply use streq, but this way we compare the
|
||||||
|
first two characters immediately. This saves time in the very
|
||||||
|
common case where the first character matches because it is a
|
||||||
|
period. */
|
||||||
|
if (*p->suffix == stem[stemlen]
|
||||||
|
&& (*p->suffix == '\0'|| streq (&p->suffix[1], &stem[stemlen+1])))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
/* Print the data base of rules. */
|
/* Print the data base of rules. */
|
||||||
|
|
||||||
static void /* Useful to call from gdb. */
|
static void /* Useful to call from gdb. */
|
||||||
@@ -586,4 +666,26 @@ print_rule_data_base ()
|
|||||||
if (num_pattern_rules != rules)
|
if (num_pattern_rules != rules)
|
||||||
fatal ("BUG: num_pattern_rules wrong! %u != %u",
|
fatal ("BUG: num_pattern_rules wrong! %u != %u",
|
||||||
num_pattern_rules, rules);
|
num_pattern_rules, rules);
|
||||||
|
|
||||||
|
puts ("\n# Pattern-specific variable values");
|
||||||
|
|
||||||
|
{
|
||||||
|
struct pattern_var *p;
|
||||||
|
|
||||||
|
rules = 0;
|
||||||
|
for (p = pattern_vars; p != 0; p = p->next)
|
||||||
|
{
|
||||||
|
++rules;
|
||||||
|
|
||||||
|
printf ("\n%s :\n", p->target);
|
||||||
|
print_variable_set (p->vars->set, "# ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rules == 0)
|
||||||
|
puts ("\n# No pattern-specific variable values.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf ("\n# %u pattern-specific variable values", rules);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
rule.h
11
rule.h
@@ -30,6 +30,15 @@ struct rule
|
|||||||
char in_use; /* If in use by a parent pattern_search. */
|
char in_use; /* If in use by a parent pattern_search. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pattern_var
|
||||||
|
{
|
||||||
|
struct pattern_var *next;
|
||||||
|
char *target;
|
||||||
|
unsigned int len;
|
||||||
|
char *suffix;
|
||||||
|
struct variable_set_list *vars;
|
||||||
|
};
|
||||||
|
|
||||||
/* For calling install_pattern_rule. */
|
/* For calling install_pattern_rule. */
|
||||||
struct pspec
|
struct pspec
|
||||||
{
|
{
|
||||||
@@ -51,3 +60,5 @@ extern unsigned int maxsuffix;
|
|||||||
|
|
||||||
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
||||||
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
||||||
|
extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
|
||||||
|
extern struct pattern_var *lookup_pattern_var PARAMS ((char *target));
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
cd w32\subproc
|
cd w32\subproc
|
||||||
nmake /f %1
|
set MAKE=%2
|
||||||
|
set MAKEFILE=%1
|
||||||
|
if x%2 == x set MAKE=nmake
|
||||||
|
%MAKE% /f %MAKEFILE%
|
||||||
cd ..\..
|
cd ..\..
|
||||||
|
|||||||
1879
texinfo.tex
1879
texinfo.tex
File diff suppressed because it is too large
Load Diff
167
variable.c
167
variable.c
@@ -1,5 +1,5 @@
|
|||||||
/* Internals of variables for GNU Make.
|
/* Internals of variables for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -44,10 +44,8 @@ static struct variable_set_list global_setlist
|
|||||||
= { 0, &global_variable_set };
|
= { 0, &global_variable_set };
|
||||||
struct variable_set_list *current_variable_set_list = &global_setlist;
|
struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||||
|
|
||||||
static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
static struct variable *lookup_variable_in_set PARAMS ((char *name,
|
||||||
char *value, enum variable_origin origin,
|
unsigned int length, struct variable_set *set));
|
||||||
int recursive, struct variable_set *set));
|
|
||||||
|
|
||||||
|
|
||||||
/* Implement variables. */
|
/* Implement variables. */
|
||||||
|
|
||||||
@@ -58,7 +56,7 @@ static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int
|
|||||||
If RECURSIVE is nonzero a flag is set in the variable saying
|
If RECURSIVE is nonzero a flag is set in the variable saying
|
||||||
that it should be recursively re-expanded. */
|
that it should be recursively re-expanded. */
|
||||||
|
|
||||||
static struct variable *
|
struct variable *
|
||||||
define_variable_in_set (name, length, value, origin, recursive, set)
|
define_variable_in_set (name, length, value, origin, recursive, set)
|
||||||
char *name;
|
char *name;
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
@@ -114,6 +112,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
|
|||||||
v->origin = origin;
|
v->origin = origin;
|
||||||
v->recursive = recursive;
|
v->recursive = recursive;
|
||||||
v->expanding = 0;
|
v->expanding = 0;
|
||||||
|
v->per_target = 0;
|
||||||
v->export = v_default;
|
v->export = v_default;
|
||||||
v->next = set->table[hashval];
|
v->next = set->table[hashval];
|
||||||
set->table[hashval] = v;
|
set->table[hashval] = v;
|
||||||
@@ -184,6 +183,34 @@ lookup_variable (name, length)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Lookup a variable whose name is a string starting at NAME
|
||||||
|
and with LENGTH chars in set SET. NAME need not be null-terminated.
|
||||||
|
Returns address of the `struct variable' containing all info
|
||||||
|
on the variable, or nil if no such variable is defined. */
|
||||||
|
|
||||||
|
static struct variable *
|
||||||
|
lookup_variable_in_set (name, length, set)
|
||||||
|
char *name;
|
||||||
|
unsigned int length;
|
||||||
|
struct variable_set *set;
|
||||||
|
{
|
||||||
|
register unsigned int i;
|
||||||
|
register unsigned int hash = 0;
|
||||||
|
register struct variable *v;
|
||||||
|
|
||||||
|
for (i = 0; i < length; ++i)
|
||||||
|
HASH (hash, name[i]);
|
||||||
|
hash %= set->buckets;
|
||||||
|
|
||||||
|
for (v = set->table[hash]; v != 0; v = v->next)
|
||||||
|
if (*v->name == *name
|
||||||
|
&& !strncmp (v->name + 1, name + 1, length - 1)
|
||||||
|
&& v->name[length] == 0)
|
||||||
|
return v;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize FILE's variable set list. If FILE already has a variable set
|
/* Initialize FILE's variable set list. If FILE already has a variable set
|
||||||
list, the topmost variable set is left intact, but the the rest of the
|
list, the topmost variable set is left intact, but the the rest of the
|
||||||
chain is replaced with FILE->parent's setlist. */
|
chain is replaced with FILE->parent's setlist. */
|
||||||
@@ -245,10 +272,8 @@ pop_variable_scope ()
|
|||||||
free ((char *) set);
|
free ((char *) set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new variable set and push it on the current setlist. */
|
struct variable_set_list *
|
||||||
|
create_new_variable_set ()
|
||||||
void
|
|
||||||
push_new_variable_scope ()
|
|
||||||
{
|
{
|
||||||
register struct variable_set_list *setlist;
|
register struct variable_set_list *setlist;
|
||||||
register struct variable_set *set;
|
register struct variable_set *set;
|
||||||
@@ -263,7 +288,16 @@ push_new_variable_scope ()
|
|||||||
xmalloc (sizeof (struct variable_set_list));
|
xmalloc (sizeof (struct variable_set_list));
|
||||||
setlist->set = set;
|
setlist->set = set;
|
||||||
setlist->next = current_variable_set_list;
|
setlist->next = current_variable_set_list;
|
||||||
current_variable_set_list = setlist;
|
|
||||||
|
return setlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a new variable set and push it on the current setlist. */
|
||||||
|
|
||||||
|
struct variable_set_list *
|
||||||
|
push_new_variable_scope ()
|
||||||
|
{
|
||||||
|
return (current_variable_set_list = create_new_variable_set());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Merge SET1 into SET0, freeing unused storage in SET1. */
|
/* Merge SET1 into SET0, freeing unused storage in SET1. */
|
||||||
@@ -333,8 +367,6 @@ merge_variable_set_lists (setlist0, setlist1)
|
|||||||
|
|
||||||
merge_variable_sets (list0->set, next->set);
|
merge_variable_sets (list0->set, next->set);
|
||||||
|
|
||||||
free ((char *) next);
|
|
||||||
|
|
||||||
last0 = list0;
|
last0 = list0;
|
||||||
list0 = list0->next;
|
list0 = list0->next;
|
||||||
}
|
}
|
||||||
@@ -508,6 +540,19 @@ target_environment (file)
|
|||||||
added specially at the end. */
|
added specially at the end. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* If this is a per-target variable and it hasn't been touched
|
||||||
|
already then look up the global version and take its export
|
||||||
|
value. */
|
||||||
|
if (v->per_target && v->export == v_default)
|
||||||
|
{
|
||||||
|
struct variable *gv;
|
||||||
|
|
||||||
|
gv = lookup_variable_in_set(v->name, strlen(v->name),
|
||||||
|
&global_variable_set);
|
||||||
|
if (gv)
|
||||||
|
v->export = gv->export;
|
||||||
|
}
|
||||||
|
|
||||||
switch (v->export)
|
switch (v->export)
|
||||||
{
|
{
|
||||||
case v_default:
|
case v_default:
|
||||||
@@ -526,9 +571,10 @@ target_environment (file)
|
|||||||
for (++p; *p != '\0'; ++p)
|
for (++p; *p != '\0'; ++p)
|
||||||
if (*p != '_' && (*p < 'a' || *p > 'z')
|
if (*p != '_' && (*p < 'a' || *p > 'z')
|
||||||
&& (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9'))
|
&& (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9'))
|
||||||
break;
|
continue;
|
||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
continue;
|
continue;
|
||||||
|
break;
|
||||||
|
|
||||||
case v_export:
|
case v_export:
|
||||||
break;
|
break;
|
||||||
@@ -542,9 +588,22 @@ target_environment (file)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If this was from a different-sized hash table, then
|
||||||
|
recalculate the bucket it goes in. */
|
||||||
|
if (set->buckets != buckets)
|
||||||
|
{
|
||||||
|
register char *np;
|
||||||
|
|
||||||
|
j = 0;
|
||||||
|
for (np = v->name; *np != '\0'; ++np)
|
||||||
|
HASH (j, *np);
|
||||||
|
j %= buckets;
|
||||||
|
}
|
||||||
|
|
||||||
for (ov = table[j]; ov != 0; ov = ov->next)
|
for (ov = table[j]; ov != 0; ov = ov->next)
|
||||||
if (streq (v->name, ov->variable->name))
|
if (streq (v->name, ov->variable->name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (ov == 0)
|
if (ov == 0)
|
||||||
{
|
{
|
||||||
register struct variable_bucket *entry;
|
register struct variable_bucket *entry;
|
||||||
@@ -567,6 +626,7 @@ target_environment (file)
|
|||||||
for (b = table[i]; b != 0; b = b->next)
|
for (b = table[i]; b != 0; b = b->next)
|
||||||
{
|
{
|
||||||
register struct variable *v = b->variable;
|
register struct variable *v = b->variable;
|
||||||
|
|
||||||
/* If V is recursively expanded and didn't come from the environment,
|
/* If V is recursively expanded and didn't come from the environment,
|
||||||
expand its value. If it came from the environment, it should
|
expand its value. If it came from the environment, it should
|
||||||
go back into the environment unchanged. */
|
go back into the environment unchanged. */
|
||||||
@@ -609,14 +669,11 @@ target_environment (file)
|
|||||||
from a makefile, an override directive, the environment with
|
from a makefile, an override directive, the environment with
|
||||||
or without the -e switch, or the command line.
|
or without the -e switch, or the command line.
|
||||||
|
|
||||||
A variable definition has the form "name = value" or "name := value".
|
See the comments for parse_variable_definition().
|
||||||
Any whitespace around the "=" or ":=" is removed. The first form
|
|
||||||
defines a variable that is recursively re-evaluated. The second form
|
|
||||||
defines a variable whose value is variable-expanded at the time of
|
|
||||||
definition and then is evaluated only once at the time of expansion.
|
|
||||||
|
|
||||||
If a variable was defined, a pointer to its `struct variable' is returned.
|
If LINE was recognized as a variable definition, a pointer to its `struct
|
||||||
If not, NULL is returned. */
|
variable' is returned. If LINE is not a variable definition, NULL is
|
||||||
|
returned. */
|
||||||
|
|
||||||
struct variable *
|
struct variable *
|
||||||
try_variable_definition (filename, lineno, line, origin)
|
try_variable_definition (filename, lineno, line, origin)
|
||||||
@@ -629,7 +686,8 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
register char *p = line;
|
register char *p = line;
|
||||||
register char *beg;
|
register char *beg;
|
||||||
register char *end;
|
register char *end;
|
||||||
enum { bogus, simple, recursive, append } flavor = bogus;
|
enum { f_bogus,
|
||||||
|
f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus;
|
||||||
char *name, *expanded_name, *value;
|
char *name, *expanded_name, *value;
|
||||||
struct variable *v;
|
struct variable *v;
|
||||||
|
|
||||||
@@ -641,14 +699,14 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
if (c == '=')
|
if (c == '=')
|
||||||
{
|
{
|
||||||
end = p - 1;
|
end = p - 1;
|
||||||
flavor = recursive;
|
flavor = f_recursive;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (c == ':')
|
else if (c == ':')
|
||||||
if (*p == '=')
|
if (*p == '=')
|
||||||
{
|
{
|
||||||
end = p++ - 1;
|
end = p++ - 1;
|
||||||
flavor = simple;
|
flavor = f_simple;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -657,7 +715,13 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
else if (c == '+' && *p == '=')
|
else if (c == '+' && *p == '=')
|
||||||
{
|
{
|
||||||
end = p++ - 1;
|
end = p++ - 1;
|
||||||
flavor = append;
|
flavor = f_append;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (c == '?' && *p == '=')
|
||||||
|
{
|
||||||
|
end = p++ - 1;
|
||||||
|
flavor = f_conditional;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (c == '$')
|
else if (c == '$')
|
||||||
@@ -702,31 +766,35 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
expanded_name = allocated_variable_expand (name);
|
expanded_name = allocated_variable_expand (name);
|
||||||
|
|
||||||
if (expanded_name[0] == '\0')
|
if (expanded_name[0] == '\0')
|
||||||
{
|
|
||||||
if (filename == 0)
|
|
||||||
fatal ("empty variable name");
|
|
||||||
else
|
|
||||||
makefile_fatal (filename, lineno, "empty variable name");
|
makefile_fatal (filename, lineno, "empty variable name");
|
||||||
}
|
|
||||||
|
|
||||||
/* Calculate the variable's new value in VALUE. */
|
/* Calculate the variable's new value in VALUE. */
|
||||||
|
|
||||||
switch (flavor)
|
switch (flavor)
|
||||||
{
|
{
|
||||||
case bogus:
|
case f_bogus:
|
||||||
/* Should not be possible. */
|
/* Should not be possible. */
|
||||||
abort ();
|
abort ();
|
||||||
return 0;
|
case f_simple:
|
||||||
case simple:
|
|
||||||
/* A simple variable definition "var := value". Expand the value. */
|
/* A simple variable definition "var := value". Expand the value. */
|
||||||
value = variable_expand (p);
|
value = variable_expand (p);
|
||||||
break;
|
break;
|
||||||
case recursive:
|
case f_conditional:
|
||||||
|
/* A conditional variable definition "var ?= value".
|
||||||
|
The value is set IFF the variable is not defined yet. */
|
||||||
|
v = lookup_variable(expanded_name, strlen(expanded_name));
|
||||||
|
if (v)
|
||||||
|
{
|
||||||
|
free(expanded_name);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
/* FALLTHROUGH */
|
||||||
|
case f_recursive:
|
||||||
/* A recursive variable definition "var = value".
|
/* A recursive variable definition "var = value".
|
||||||
The value is used verbatim. */
|
The value is used verbatim. */
|
||||||
value = p;
|
value = p;
|
||||||
break;
|
break;
|
||||||
case append:
|
case f_append:
|
||||||
/* An appending variable definition "var += value".
|
/* An appending variable definition "var += value".
|
||||||
Extract the old value and append the new one. */
|
Extract the old value and append the new one. */
|
||||||
v = lookup_variable (expanded_name, strlen (expanded_name));
|
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||||
@@ -735,7 +803,7 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
/* There was no old value.
|
/* There was no old value.
|
||||||
This becomes a normal recursive definition. */
|
This becomes a normal recursive definition. */
|
||||||
value = p;
|
value = p;
|
||||||
flavor = recursive;
|
flavor = f_recursive;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -746,7 +814,7 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
if (v->recursive)
|
if (v->recursive)
|
||||||
/* The previous definition of the variable was recursive.
|
/* The previous definition of the variable was recursive.
|
||||||
The new value comes from the unexpanded old and new values. */
|
The new value comes from the unexpanded old and new values. */
|
||||||
flavor = recursive;
|
flavor = f_recursive;
|
||||||
else
|
else
|
||||||
/* The previous definition of the variable was simple.
|
/* The previous definition of the variable was simple.
|
||||||
The new value comes from the old value, which was expanded
|
The new value comes from the old value, which was expanded
|
||||||
@@ -793,7 +861,7 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
*p = '/';
|
*p = '/';
|
||||||
}
|
}
|
||||||
v = define_variable (expanded_name, strlen (expanded_name),
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
shellpath, origin, flavor == recursive);
|
shellpath, origin, flavor == f_recursive);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -833,7 +901,7 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
*p = '/';
|
*p = '/';
|
||||||
}
|
}
|
||||||
v = define_variable (expanded_name, strlen (expanded_name),
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
shellpath, origin, flavor == recursive);
|
shellpath, origin, flavor == f_recursive);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
v = lookup_variable (expanded_name, strlen (expanded_name));
|
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||||
@@ -843,9 +911,26 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* __MSDOS__ */
|
#endif /* __MSDOS__ */
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
if (origin == o_file
|
||||||
|
&& strcmp (expanded_name, "SHELL") == 0) {
|
||||||
|
extern char* default_shell;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call shell locator function. If it returns TRUE, then
|
||||||
|
* set no_default_sh_exe to indicate sh was found and
|
||||||
|
* set new value for SHELL variable.
|
||||||
|
*/
|
||||||
|
if (find_and_set_default_shell(value)) {
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
default_shell, origin, flavor == f_recursive);
|
||||||
|
no_default_sh_exe = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
|
||||||
v = define_variable (expanded_name, strlen (expanded_name),
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
value, origin, flavor == recursive);
|
value, origin, flavor == f_recursive);
|
||||||
|
|
||||||
free (expanded_name);
|
free (expanded_name);
|
||||||
|
|
||||||
@@ -925,7 +1010,7 @@ print_variable (v, prefix)
|
|||||||
/* Print all the variables in SET. PREFIX is printed before
|
/* Print all the variables in SET. PREFIX is printed before
|
||||||
the actual variable definitions (everything else is comments). */
|
the actual variable definitions (everything else is comments). */
|
||||||
|
|
||||||
static void
|
void
|
||||||
print_variable_set (set, prefix)
|
print_variable_set (set, prefix)
|
||||||
register struct variable_set *set;
|
register struct variable_set *set;
|
||||||
char *prefix;
|
char *prefix;
|
||||||
|
|||||||
15
variable.h
15
variable.h
@@ -43,7 +43,8 @@ struct variable
|
|||||||
origin ENUM_BITFIELD (3); /* Variable origin. */
|
origin ENUM_BITFIELD (3); /* Variable origin. */
|
||||||
unsigned int recursive:1; /* Gets recursively re-evaluated. */
|
unsigned int recursive:1; /* Gets recursively re-evaluated. */
|
||||||
unsigned int expanding:1; /* Nonzero if currently being expanded. */
|
unsigned int expanding:1; /* Nonzero if currently being expanded. */
|
||||||
enum
|
unsigned int per_target:1; /* Nonzero if a target-specific variable. */
|
||||||
|
enum variable_export
|
||||||
{
|
{
|
||||||
v_export, /* Export this variable. */
|
v_export, /* Export this variable. */
|
||||||
v_noexport, /* Don't export this variable. */
|
v_noexport, /* Don't export this variable. */
|
||||||
@@ -68,20 +69,22 @@ struct variable_set_list
|
|||||||
struct variable_set *set; /* Variable set. */
|
struct variable_set *set; /* Variable set. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern char *variable_buffer;
|
||||||
extern struct variable_set_list *current_variable_set_list;
|
extern struct variable_set_list *current_variable_set_list;
|
||||||
|
|
||||||
/* expand.c */
|
/* expand.c */
|
||||||
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
||||||
extern char *variable_expand PARAMS ((char *line));
|
extern char *variable_expand PARAMS ((char *line));
|
||||||
extern char *variable_expand_for_file PARAMS ((char *line, struct file *file));
|
|
||||||
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||||
#define allocated_variable_expand(line) \
|
#define allocated_variable_expand(line) \
|
||||||
allocated_variable_expand_for_file (line, (struct file *) 0)
|
allocated_variable_expand_for_file (line, (struct file *) 0)
|
||||||
extern char *expand_argument PARAMS ((char *str, char *end));
|
extern char *expand_argument PARAMS ((char *str, char *end));
|
||||||
|
extern char *variable_expand_string PARAMS ((char *line, char *string,
|
||||||
|
long length));
|
||||||
|
|
||||||
/* function.c */
|
/* function.c */
|
||||||
extern int handle_function PARAMS ((char **op, char **stringp));
|
extern int handle_function PARAMS ((char **op, char **stringp));
|
||||||
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *word));
|
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *str));
|
||||||
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
||||||
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
||||||
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
||||||
@@ -91,17 +94,21 @@ extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *
|
|||||||
extern char *recursively_expand PARAMS ((struct variable *v));
|
extern char *recursively_expand PARAMS ((struct variable *v));
|
||||||
|
|
||||||
/* variable.c */
|
/* variable.c */
|
||||||
extern void push_new_variable_scope PARAMS ((void));
|
extern struct variable_set_list *create_new_variable_set PARAMS ((void));
|
||||||
|
extern struct variable_set_list *push_new_variable_scope PARAMS ((void));
|
||||||
extern void pop_variable_scope PARAMS ((void));
|
extern void pop_variable_scope PARAMS ((void));
|
||||||
extern void define_automatic_variables PARAMS ((void));
|
extern void define_automatic_variables PARAMS ((void));
|
||||||
extern void initialize_file_variables PARAMS ((struct file *file));
|
extern void initialize_file_variables PARAMS ((struct file *file));
|
||||||
extern void print_file_variables PARAMS ((struct file *file));
|
extern void print_file_variables PARAMS ((struct file *file));
|
||||||
|
extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix));
|
||||||
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
||||||
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin));
|
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin));
|
||||||
|
|
||||||
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
||||||
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
||||||
enum variable_origin origin, int recursive));
|
enum variable_origin origin, int recursive));
|
||||||
|
extern struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
||||||
|
char *value, enum variable_origin origin, int recursive, struct variable_set *set));
|
||||||
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
||||||
char *value, enum variable_origin origin, int recursive, struct file *file));
|
char *value, enum variable_origin origin, int recursive, struct file *file));
|
||||||
extern char **target_environment PARAMS ((struct file *file));
|
extern char **target_environment PARAMS ((struct file *file));
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
char *version_string = "3.75.1";
|
/* We use <config.h> instead of "config.h" so that a compilation
|
||||||
|
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>
|
||||||
|
|
||||||
|
char *version_string = VERSION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local variables:
|
Local variables:
|
||||||
|
|||||||
2
vmsdir.h
2
vmsdir.h
@@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
#define MAXNAMLEN 255
|
#define MAXNAMLEN 255
|
||||||
|
|
||||||
|
#ifndef __DECC
|
||||||
typedef unsigned long u_long;
|
typedef unsigned long u_long;
|
||||||
typedef unsigned short u_short;
|
typedef unsigned short u_short;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct direct {
|
struct direct {
|
||||||
off_t d_off;
|
off_t d_off;
|
||||||
|
|||||||
222
vmsfunctions.c
222
vmsfunctions.c
@@ -1,7 +1,9 @@
|
|||||||
#define KDEBUG 0
|
|
||||||
/* vmsfunctions.c */
|
/* vmsfunctions.c */
|
||||||
|
|
||||||
|
#define KDEBUG 0
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#ifdef __DECC
|
#ifdef __DECC
|
||||||
#include <starlet.h>
|
#include <starlet.h>
|
||||||
@@ -13,114 +15,147 @@
|
|||||||
#include <fibdef.h>
|
#include <fibdef.h>
|
||||||
#include "vmsdir.h"
|
#include "vmsdir.h"
|
||||||
|
|
||||||
DIR *opendir(char *dspec)
|
#if __VMS_VER < 70000000
|
||||||
|
|
||||||
|
DIR *
|
||||||
|
opendir (dspec)
|
||||||
|
char *dspec;
|
||||||
{
|
{
|
||||||
static struct FAB *dfab;
|
static struct FAB *dfab;
|
||||||
struct NAM *dnam;
|
struct NAM *dnam;
|
||||||
char *searchspec;
|
char *searchspec;
|
||||||
|
|
||||||
if ((dfab = (struct FAB *)xmalloc(sizeof (struct FAB))) == NULL) {
|
dfab = (struct FAB *) xmalloc (sizeof (struct FAB));
|
||||||
printf("Error mallocing for FAB\n");
|
if (! dfab)
|
||||||
return(NULL);
|
{
|
||||||
}
|
printf ("Error mallocing for FAB\n");
|
||||||
if ((dnam = (struct NAM *)xmalloc(sizeof (struct NAM))) == NULL) {
|
return (NULL);
|
||||||
printf("Error mallocing for NAM\n");
|
|
||||||
free(dfab);
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
if ((searchspec = (char *)xmalloc(MAXNAMLEN+1)) == NULL) {
|
|
||||||
printf("Error mallocing for searchspec\n");
|
|
||||||
free(dfab);
|
|
||||||
free(dnam);
|
|
||||||
return(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(searchspec,"%s*.*;",dspec);
|
dnam = (struct NAM *) xmalloc (sizeof (struct NAM));
|
||||||
|
if (! dnam)
|
||||||
|
{
|
||||||
|
printf ("Error mallocing for NAM\n");
|
||||||
|
free (dfab);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
searchspec = (char *) xmalloc (MAXNAMLEN + 1);
|
||||||
|
if (! searchspec)
|
||||||
|
{
|
||||||
|
printf ("Error mallocing for searchspec\n");
|
||||||
|
free (dfab);
|
||||||
|
free (dnam);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf (searchspec, "%s*.*;", dspec);
|
||||||
|
|
||||||
*dfab = cc$rms_fab;
|
*dfab = cc$rms_fab;
|
||||||
dfab->fab$l_fna = searchspec;
|
dfab->fab$l_fna = searchspec;
|
||||||
dfab->fab$b_fns = strlen(searchspec);
|
dfab->fab$b_fns = strlen (searchspec);
|
||||||
dfab->fab$l_nam = dnam;
|
dfab->fab$l_nam = dnam;
|
||||||
|
|
||||||
*dnam = cc$rms_nam;
|
*dnam = cc$rms_nam;
|
||||||
dnam->nam$l_esa = searchspec;
|
dnam->nam$l_esa = searchspec;
|
||||||
dnam->nam$b_ess = MAXNAMLEN;
|
dnam->nam$b_ess = MAXNAMLEN;
|
||||||
|
|
||||||
if (!(sys$parse(dfab) & 1)) {
|
if (! (sys$parse (dfab) & 1))
|
||||||
free(dfab);
|
{
|
||||||
free(dnam);
|
free (dfab);
|
||||||
free(searchspec);
|
free (dnam);
|
||||||
return(NULL);
|
free (searchspec);
|
||||||
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(dfab);
|
return (dfab);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <ctype.h>
|
#define uppercasify(str) \
|
||||||
#define uppercasify(str) { char *tmp; for(tmp = (str); *tmp != '\0'; tmp++) if(islower(*tmp)) *tmp = toupper(*tmp); }
|
do \
|
||||||
|
{ \
|
||||||
|
char *tmp; \
|
||||||
|
for (tmp = (str); *tmp != '\0'; tmp++) \
|
||||||
|
if (islower (*tmp)) \
|
||||||
|
*tmp = toupper (*tmp); \
|
||||||
|
} \
|
||||||
|
while (0)
|
||||||
|
|
||||||
struct direct *readdir(DIR *dfd)
|
struct direct *
|
||||||
|
readdir (dfd)
|
||||||
|
DIR * dfd;
|
||||||
{
|
{
|
||||||
static struct direct *dentry;
|
static struct direct *dentry;
|
||||||
static char resultspec[MAXNAMLEN+1];
|
static char resultspec[MAXNAMLEN + 1];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((dentry = (struct direct *)xmalloc(sizeof (struct direct))) == NULL) {
|
dentry = (struct direct *) xmalloc (sizeof (struct direct));
|
||||||
printf("Error mallocing for direct\n");
|
if (! dentry)
|
||||||
return(NULL);
|
{
|
||||||
|
printf ("Error mallocing for direct\n");
|
||||||
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
||||||
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
printf(".");
|
printf (".");
|
||||||
|
|
||||||
if (!((i = sys$search(dfd)) & 1)) {
|
if (!((i = sys$search (dfd)) & 1))
|
||||||
|
{
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
printf("sys$search failed with %d\n", i);
|
printf ("sys$search failed with %d\n", i);
|
||||||
free(dentry);
|
free (dentry);
|
||||||
return(NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
dentry->d_off = 0;
|
dentry->d_off = 0;
|
||||||
if (dfd->fab$l_nam->nam$w_fid == 0)
|
if (dfd->fab$l_nam->nam$w_fid == 0)
|
||||||
dentry->d_fileno = 1;
|
dentry->d_fileno = 1;
|
||||||
else dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
else
|
||||||
+dfd->fab$l_nam->nam$w_fid[1]<<16;
|
dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
||||||
|
+ dfd->fab$l_nam->nam$w_fid[1] << 16;
|
||||||
dentry->d_reclen = sizeof (struct direct);
|
dentry->d_reclen = sizeof (struct direct);
|
||||||
/*
|
#if 0
|
||||||
if (!strcmp(dfd->fab$l_nam->nam$l_type,".DIR"))
|
if (!strcmp(dfd->fab$l_nam->nam$l_type, ".DIR"))
|
||||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
||||||
else
|
else
|
||||||
*/
|
#endif
|
||||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name+dfd->fab$l_nam->nam$b_type;
|
dentry->d_namlen = dfd->fab$l_nam->nam$b_name + dfd->fab$l_nam->nam$b_type;
|
||||||
strncpy(dentry->d_name,dfd->fab$l_nam->nam$l_name,dentry->d_namlen);
|
strncpy (dentry->d_name, dfd->fab$l_nam->nam$l_name, dentry->d_namlen);
|
||||||
dentry->d_name[dentry->d_namlen] = '\0';
|
dentry->d_name[dentry->d_namlen] = '\0';
|
||||||
uppercasify(dentry->d_name);
|
uppercasify (dentry->d_name);
|
||||||
/* uvUnFixRCSSeparator(dentry->d_name);*/
|
#if 0
|
||||||
|
uvUnFixRCSSeparator(dentry->d_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
return(dentry);
|
return (dentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir(DIR *dfd)
|
closedir (dfd)
|
||||||
|
DIR *dfd;
|
||||||
{
|
{
|
||||||
if (dfd != NULL) {
|
if (dfd)
|
||||||
if (dfd->fab$l_nam != NULL)
|
{
|
||||||
free(dfd->fab$l_nam->nam$l_esa);
|
if (dfd->fab$l_nam)
|
||||||
free(dfd->fab$l_nam);
|
free (dfd->fab$l_nam->nam$l_esa);
|
||||||
free(dfd);
|
free (dfd->fab$l_nam);
|
||||||
|
free (dfd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* compiled for OpenVMS prior to V7.x */
|
||||||
|
|
||||||
char *getwd(char *cwd)
|
char *
|
||||||
|
getwd (cwd)
|
||||||
|
char *cwd;
|
||||||
{
|
{
|
||||||
static char buf[512];
|
static char buf[512];
|
||||||
|
|
||||||
if (cwd)
|
if (cwd)
|
||||||
return(getcwd(cwd,512));
|
return (getcwd (cwd, 512));
|
||||||
else
|
else
|
||||||
return(getcwd(buf,512));
|
return (getcwd (buf, 512));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -135,21 +170,31 @@ vms_stat (name, buf)
|
|||||||
static struct NAM Nam;
|
static struct NAM Nam;
|
||||||
static struct fibdef Fib; /* short fib */
|
static struct fibdef Fib; /* short fib */
|
||||||
static struct dsc$descriptor FibDesc =
|
static struct dsc$descriptor FibDesc =
|
||||||
{sizeof(Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *)&Fib};
|
{ sizeof (Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *) &Fib };
|
||||||
static struct dsc$descriptor_s DevDesc =
|
static struct dsc$descriptor_s DevDesc =
|
||||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1]};
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1] };
|
||||||
static char EName[NAM$C_MAXRSS];
|
static char EName[NAM$C_MAXRSS];
|
||||||
static char RName[NAM$C_MAXRSS];
|
static char RName[NAM$C_MAXRSS];
|
||||||
static struct dsc$descriptor_s FileName =
|
static struct dsc$descriptor_s FileName =
|
||||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
|
||||||
static struct dsc$descriptor_s string =
|
static struct dsc$descriptor_s string =
|
||||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
|
||||||
static unsigned long Rdate[2];
|
static unsigned long Rdate[2];
|
||||||
static unsigned long Cdate[2];
|
static unsigned long Cdate[2];
|
||||||
static struct atrdef Atr[] = {
|
static struct atrdef Atr[] =
|
||||||
{sizeof(Rdate),ATR$C_REVDATE,&Rdate[0]}, /* Revision date */
|
{
|
||||||
{sizeof(Cdate),ATR$C_CREDATE,&Cdate[0]}, /* Creation date */
|
#if defined(VAX)
|
||||||
{0,0,0}
|
/* Revision date */
|
||||||
|
{ sizeof (Rdate), ATR$C_REVDATE, (unsigned int) &Rdate[0] },
|
||||||
|
/* Creation date */
|
||||||
|
{ sizeof (Cdate), ATR$C_CREDATE, (unsigned int) &Cdate[0] },
|
||||||
|
#else
|
||||||
|
/* Revision date */
|
||||||
|
{ sizeof (Rdate), ATR$C_REVDATE, &Rdate[0] },
|
||||||
|
/* Creation date */
|
||||||
|
{ sizeof (Cdate), ATR$C_CREDATE, &Cdate[0]},
|
||||||
|
#endif
|
||||||
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
static short int DevChan;
|
static short int DevChan;
|
||||||
static short int iosb[4];
|
static short int iosb[4];
|
||||||
@@ -158,43 +203,43 @@ vms_stat (name, buf)
|
|||||||
|
|
||||||
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
||||||
Fab = cc$rms_fab;
|
Fab = cc$rms_fab;
|
||||||
Fab.fab$l_fna = name ; /* name of file */
|
Fab.fab$l_fna = name; /* name of file */
|
||||||
Fab.fab$b_fns = strlen(name);
|
Fab.fab$b_fns = strlen (name);
|
||||||
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
||||||
|
|
||||||
Nam = cc$rms_nam;
|
Nam = cc$rms_nam;
|
||||||
Nam.nam$l_esa = EName; /* expanded filename */
|
Nam.nam$l_esa = EName; /* expanded filename */
|
||||||
Nam.nam$b_ess = sizeof(EName);
|
Nam.nam$b_ess = sizeof (EName);
|
||||||
Nam.nam$l_rsa = RName; /* resultant filename */
|
Nam.nam$l_rsa = RName; /* resultant filename */
|
||||||
Nam.nam$b_rss = sizeof(RName);
|
Nam.nam$b_rss = sizeof (RName);
|
||||||
|
|
||||||
/* do $PARSE and $SEARCH here */
|
/* do $PARSE and $SEARCH here */
|
||||||
status = sys$parse(&Fab);
|
status = sys$parse (&Fab);
|
||||||
if (!(status & 1))
|
if (!(status & 1))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
||||||
status = sys$assign(&DevDesc,&DevChan,0,0);
|
status = sys$assign (&DevDesc, &DevChan, 0, 0);
|
||||||
if (!(status & 1))
|
if (!(status & 1))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
FileName.dsc$a_pointer = Nam.nam$l_name;
|
FileName.dsc$a_pointer = Nam.nam$l_name;
|
||||||
FileName.dsc$w_length = Nam.nam$b_name+Nam.nam$b_type+Nam.nam$b_ver;
|
FileName.dsc$w_length = Nam.nam$b_name + Nam.nam$b_type + Nam.nam$b_ver;
|
||||||
|
|
||||||
/* Initialize the FIB */
|
/* Initialize the FIB */
|
||||||
for (i=0;i<3;i++)
|
for (i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
#if __DECC
|
#if __DECC
|
||||||
Fib.fib$w_fid[i]=Nam.nam$w_fid[i];
|
Fib.fib$w_fid[i] = Nam.nam$w_fid[i];
|
||||||
Fib.fib$w_did[i]=Nam.nam$w_did[i];
|
Fib.fib$w_did[i] = Nam.nam$w_did[i];
|
||||||
#else
|
#else
|
||||||
Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i];
|
Fib.fib$r_fid_overlay.fib$w_fid[i] = Nam.nam$w_fid[i];
|
||||||
Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i];
|
Fib.fib$r_did_overlay.fib$w_did[i] = Nam.nam$w_did[i];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
status = sys$qiow(0,DevChan,IO$_ACCESS,&iosb,0,0,
|
status = sys$qiow (0, DevChan, IO$_ACCESS, &iosb, 0, 0,
|
||||||
&FibDesc,&FileName,0,0,&Atr,0);
|
&FibDesc, &FileName, 0, 0, &Atr, 0);
|
||||||
sys$dassgn (DevChan);
|
sys$dassgn (DevChan);
|
||||||
if (!(status & 1))
|
if (!(status & 1))
|
||||||
return -1;
|
return -1;
|
||||||
@@ -206,30 +251,29 @@ vms_stat (name, buf)
|
|||||||
if (status)
|
if (status)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
buf->st_mtime = ((Rdate[0]>>24) & 0xff) + ((Rdate[1]<<8) & 0xffffff00);
|
buf->st_mtime = ((Rdate[0] >> 24) & 0xff) + ((Rdate[1] << 8) & 0xffffff00);
|
||||||
buf->st_ctime = ((Cdate[0]>>24) & 0xff) + ((Cdate[1]<<8) & 0xffffff00);
|
buf->st_ctime = ((Cdate[0] >> 24) & 0xff) + ((Cdate[1] << 8) & 0xffffff00);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
cvt_time(tval)
|
cvt_time (tval)
|
||||||
unsigned long tval;
|
unsigned long tval;
|
||||||
{
|
{
|
||||||
static long int date[2];
|
static long int date[2];
|
||||||
static char str[27];
|
static char str[27];
|
||||||
static struct dsc$descriptor date_str =
|
static struct dsc$descriptor date_str =
|
||||||
{26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str};
|
{ 26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str };
|
||||||
|
|
||||||
date[0] = (tval & 0xff) << 24;
|
date[0] = (tval & 0xff) << 24;
|
||||||
date[1] = ((tval>>8) & 0xffffff);
|
date[1] = ((tval >> 8) & 0xffffff);
|
||||||
|
|
||||||
if ((date[0]==0) && (date[1]==0))
|
if ((date[0] == 0) && (date[1] == 0))
|
||||||
return("never");
|
return ("never");
|
||||||
|
|
||||||
sys$asctim(0,&date_str,date,0);
|
sys$asctim (0, &date_str, date, 0);
|
||||||
str[26]='\0';
|
str[26] = '\0';
|
||||||
|
|
||||||
return(str);
|
return (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
|
||||||
|
|||||||
126
vmsify.c
126
vmsify.c
@@ -330,9 +330,9 @@ vmsify (name, type)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (vptr, "[.");
|
strcpy (vptr, "[.");
|
||||||
nstate = N_DOT;
|
|
||||||
vptr += 2;
|
vptr += 2;
|
||||||
copyto (&vptr, &fptr, '/', 1);
|
copyto (&vptr, &fptr, '/', 1);
|
||||||
|
nstate = N_OPEN;
|
||||||
state = 9;
|
state = 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -727,47 +727,21 @@ vmsify (name, type)
|
|||||||
while (*fptr == '/');
|
while (*fptr == '/');
|
||||||
}
|
}
|
||||||
{ /* got '..' or '../' */
|
{ /* got '..' or '../' */
|
||||||
char cwdbuf[MAXPATHLEN+1];
|
nstate = N_OPEN;
|
||||||
|
*vptr++ = '[';
|
||||||
|
while (count--)
|
||||||
|
*vptr++ = '-';
|
||||||
|
|
||||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
|
||||||
if (s1 == 0)
|
|
||||||
{
|
|
||||||
return ""; /* FIXME, err getcwd */
|
|
||||||
}
|
|
||||||
strcpy (vptr, s1);
|
|
||||||
s = strchr (vptr, ']');
|
|
||||||
if (s != 0)
|
|
||||||
{
|
|
||||||
while (s > vptr)
|
|
||||||
{
|
|
||||||
s--;
|
|
||||||
if (*s == '[')
|
|
||||||
{
|
|
||||||
s++;
|
|
||||||
strcpy (s, "000000]");
|
|
||||||
state = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (*s == '.')
|
|
||||||
{
|
|
||||||
if (--count == 0)
|
|
||||||
{
|
|
||||||
if (*fptr == 0) /* had '..' or '../' */
|
if (*fptr == 0) /* had '..' or '../' */
|
||||||
{
|
{
|
||||||
*s++ = ']';
|
*vptr++ = ']';
|
||||||
state = -1;
|
state = -1;
|
||||||
}
|
}
|
||||||
else /* had '../xxx' */
|
else /* had '../xxx' */
|
||||||
{
|
{
|
||||||
state = 9;
|
state = 9;
|
||||||
}
|
}
|
||||||
*s = 0;
|
*vptr = 0;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vptr += strlen (vptr);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -781,32 +755,84 @@ vmsify (name, type)
|
|||||||
fptr++;
|
fptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*fptr)
|
||||||
|
{
|
||||||
|
state = 9;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
*vptr++ = '[';
|
||||||
|
*vptr++ = ']';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
nstate = N_OPEN;
|
||||||
|
*vptr++ = '[';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (type == 1)
|
||||||
|
{
|
||||||
|
*vptr++ = '[';
|
||||||
|
*vptr++ = ']';
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
char cwdbuf[MAXPATHLEN+1];
|
char cwdbuf[MAXPATHLEN+1];
|
||||||
|
|
||||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||||
if (s1 == 0)
|
if (s1 == 0)
|
||||||
{
|
{
|
||||||
return ""; /*FIXME, err getcwd */
|
return "foo"; /*FIXME, err getcwd */
|
||||||
}
|
}
|
||||||
strcpy (vptr, s1);
|
strcpy (vptr, s1);
|
||||||
if (*fptr == 0)
|
|
||||||
{
|
|
||||||
state = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s = strchr (vptr, ']');
|
|
||||||
if (s == 0)
|
|
||||||
{
|
|
||||||
state = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*s = 0;
|
|
||||||
nstate = N_OPEN;
|
|
||||||
vptr += strlen (vptr);
|
vptr += strlen (vptr);
|
||||||
state = 9;
|
|
||||||
|
if (type == 2)
|
||||||
|
{
|
||||||
|
s = vptr;
|
||||||
|
while (s > vmsname)
|
||||||
|
{
|
||||||
|
if (*s == '.')
|
||||||
|
{
|
||||||
|
*s = ']';
|
||||||
|
vptr--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*s == '[')
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char *t = vptr - 2;
|
||||||
|
while (t > s)
|
||||||
|
{
|
||||||
|
*(t+7) = *t;
|
||||||
|
t--;
|
||||||
|
}
|
||||||
|
s++;
|
||||||
|
for (i = 0; i < 6; i++)
|
||||||
|
*s++ = '0';
|
||||||
|
*s = ']';
|
||||||
|
vptr += 6;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s--;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy (vptr, ".dir");
|
||||||
|
vptr += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
state = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
64
vpath.c
64
vpath.c
@@ -1,5 +1,5 @@
|
|||||||
/* Implementation of pattern-matching file search paths for GNU Make.
|
/* Implementation of pattern-matching file search paths for GNU Make.
|
||||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -145,14 +145,15 @@ build_vpath_lists ()
|
|||||||
variable.
|
variable.
|
||||||
|
|
||||||
If SEARCHPATH is nil, remove all previous listings with the same
|
If SEARCHPATH is nil, remove all previous listings with the same
|
||||||
pattern. If PATTERN is nil, remove all VPATH listings.
|
pattern. If PATTERN is nil, remove all VPATH listings. Existing
|
||||||
Existing and readable directories that are not "." given in the
|
and readable directories that are not "." given in the searchpath
|
||||||
searchpath separated by colons are loaded into the directory hash
|
separated by the path element separator (defined in make.h) are
|
||||||
table if they are not there already and put in the VPATH searchpath
|
loaded into the directory hash table if they are not there already
|
||||||
for the given pattern with trailing slashes stripped off if present
|
and put in the VPATH searchpath for the given pattern with trailing
|
||||||
(and if the directory is not the root, "/").
|
slashes stripped off if present (and if the directory is not the
|
||||||
The length of the longest entry in the list is put in the structure as well.
|
root, "/"). The length of the longest entry in the list is put in
|
||||||
The new entry will be at the head of the VPATHS chain. */
|
the structure as well. The new entry will be at the head of the
|
||||||
|
VPATHS chain. */
|
||||||
|
|
||||||
void
|
void
|
||||||
construct_vpath_list (pattern, dirpath)
|
construct_vpath_list (pattern, dirpath)
|
||||||
@@ -163,7 +164,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
register char **vpath;
|
register char **vpath;
|
||||||
register unsigned int maxvpath;
|
register unsigned int maxvpath;
|
||||||
unsigned int maxelem;
|
unsigned int maxelem;
|
||||||
char *percent;
|
char *percent = NULL;
|
||||||
|
|
||||||
if (pattern != 0)
|
if (pattern != 0)
|
||||||
{
|
{
|
||||||
@@ -213,10 +214,10 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
convert_vpath_to_windows32(dirpath, ';');
|
convert_vpath_to_windows32(dirpath, ';');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Figure out the maximum number of VPATH entries and
|
/* Figure out the maximum number of VPATH entries and put it in
|
||||||
put it in MAXELEM. We start with 2, one before the
|
MAXELEM. We start with 2, one before the first separator and one
|
||||||
first colon and one nil, the list terminator and
|
nil (the list terminator) and increment our estimated number for
|
||||||
increment our estimated number for each colon or blank we find. */
|
each separator or blank we find. */
|
||||||
maxelem = 2;
|
maxelem = 2;
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
while (*p != '\0')
|
while (*p != '\0')
|
||||||
@@ -226,7 +227,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
||||||
maxvpath = 0;
|
maxvpath = 0;
|
||||||
|
|
||||||
/* Skip over any initial colons and blanks. */
|
/* Skip over any initial separators and blanks. */
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
@@ -271,7 +272,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
free (v);
|
free (v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip over colons and blanks between entries. */
|
/* Skip over separators and blanks between entries. */
|
||||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
@@ -310,18 +311,19 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search the GPATH list for a directory where the name pointed to by FILE
|
/* Search the GPATH list for a pathname string that matches the one passed
|
||||||
exists. If it is found, we set *FILE to the newly malloc'd name of the
|
in. If it is found, return 1. Otherwise we return 0. */
|
||||||
existing file, *MTIME_PTR (if MTIME_PTR is not NULL) to its modtime (or
|
|
||||||
zero if no stat call was done), and return 1. Otherwise we return 0. */
|
|
||||||
|
|
||||||
int
|
int
|
||||||
gpath_search (file, mtime_ptr)
|
gpath_search (file, len)
|
||||||
char **file;
|
char *file;
|
||||||
time_t *mtime_ptr;
|
int len;
|
||||||
{
|
{
|
||||||
if (gpaths != 0
|
register char **gp;
|
||||||
&& selective_vpath_search (gpaths, file, mtime_ptr))
|
|
||||||
|
if (gpaths && (len <= gpaths->maxlen))
|
||||||
|
for (gp = gpaths->searchpath; *gp != NULL; ++gp)
|
||||||
|
if (!strncmp(*gp, file, len) && (*gp)[len] == '\0')
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -434,7 +436,9 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
/* Add the directory prefix already in *FILE. */
|
/* Add the directory prefix already in *FILE. */
|
||||||
if (name_dplen > 0)
|
if (name_dplen > 0)
|
||||||
{
|
{
|
||||||
|
#ifndef VMS
|
||||||
*n++ = '/';
|
*n++ = '/';
|
||||||
|
#endif
|
||||||
bcopy (*file, n, name_dplen);
|
bcopy (*file, n, name_dplen);
|
||||||
n += name_dplen;
|
n += name_dplen;
|
||||||
}
|
}
|
||||||
@@ -445,12 +449,14 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
n[-1] = '/';
|
n[-1] = '/';
|
||||||
#endif
|
#endif
|
||||||
/* Now add the name-within-directory at the end of NAME. */
|
/* Now add the name-within-directory at the end of NAME. */
|
||||||
|
#ifndef VMS
|
||||||
if (n != name && n[-1] != '/')
|
if (n != name && n[-1] != '/')
|
||||||
{
|
{
|
||||||
*n = '/';
|
*n = '/';
|
||||||
bcopy (filename, n + 1, flen + 1);
|
bcopy (filename, n + 1, flen + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
bcopy (filename, n, flen + 1);
|
bcopy (filename, n, flen + 1);
|
||||||
|
|
||||||
/* Check if the file is mentioned in a makefile. If *FILE is not
|
/* Check if the file is mentioned in a makefile. If *FILE is not
|
||||||
@@ -463,7 +469,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
inadequately commented change in July 1990; I am not sure off
|
inadequately commented change in July 1990; I am not sure off
|
||||||
hand what problem it fixes.
|
hand what problem it fixes.
|
||||||
|
|
||||||
In December 1993 I loosened of this restriction to allow a file
|
In December 1993 I loosened this restriction to allow a file
|
||||||
to be chosen if it is mentioned as a target in a makefile. This
|
to be chosen if it is mentioned as a target in a makefile. This
|
||||||
seem logical. */
|
seem logical. */
|
||||||
{
|
{
|
||||||
@@ -477,6 +483,9 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
/* That file wasn't mentioned in the makefile.
|
/* That file wasn't mentioned in the makefile.
|
||||||
See if it actually exists. */
|
See if it actually exists. */
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
|
||||||
|
#else
|
||||||
/* Clobber a null into the name at the last slash.
|
/* Clobber a null into the name at the last slash.
|
||||||
Now NAME is the name of the directory to look in. */
|
Now NAME is the name of the directory to look in. */
|
||||||
*n = '\0';
|
*n = '\0';
|
||||||
@@ -485,6 +494,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
construct_vpath_list or the code just above put it there.
|
construct_vpath_list or the code just above put it there.
|
||||||
Does the file we seek exist in it? */
|
Does the file we seek exist in it? */
|
||||||
exists_in_cache = exists = dir_file_exists_p (name, filename);
|
exists_in_cache = exists = dir_file_exists_p (name, filename);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists)
|
if (exists)
|
||||||
@@ -497,8 +507,10 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
|
#ifndef VMS
|
||||||
/* Put the slash back in NAME. */
|
/* Put the slash back in NAME. */
|
||||||
*n = '/';
|
*n = '/';
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
||||||
|| stat (name, &st) == 0) /* Does it really exist? */
|
|| stat (name, &st) == 0) /* Does it really exist? */
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ closedir(DIR *pDir)
|
|||||||
struct dirent *
|
struct dirent *
|
||||||
readdir(DIR* pDir)
|
readdir(DIR* pDir)
|
||||||
{
|
{
|
||||||
WINDOWS32_FIND_DATA wfdFindData;
|
WIN32_FIND_DATA wfdFindData;
|
||||||
|
|
||||||
if (!pDir) {
|
if (!pDir) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
|
|||||||
@@ -9,13 +9,6 @@
|
|||||||
* $Source$
|
* $Source$
|
||||||
*
|
*
|
||||||
* $Revision$
|
* $Revision$
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
*
|
|
||||||
* (C) COPYRIGHT TIVOLI Systems, Inc. 1991-1994
|
|
||||||
* Unpublished Work
|
|
||||||
* All Rights Reserved
|
|
||||||
* Licensed Material - Property of TIVOLI Systems, Inc.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ convert_Path_to_windows32(char *Path, char to_delim)
|
|||||||
etok[0] = to_delim;
|
etok[0] = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
continue; /* ignore empty bucket */
|
continue; /* ignore empty bucket */
|
||||||
} else if (etok = strpbrk(etok+1, ":;")) {
|
} else if (!isalpha(*p)) {
|
||||||
|
/* found one to count, handle things like '.' */
|
||||||
|
*etok = to_delim;
|
||||||
|
p = ++etok;
|
||||||
|
} else if ((*etok == ':') && (etok = strpbrk(etok+1, ":;"))) {
|
||||||
/* found one to count, handle drive letter */
|
/* found one to count, handle drive letter */
|
||||||
*etok = to_delim;
|
*etok = to_delim;
|
||||||
p = ++etok;
|
p = ++etok;
|
||||||
@@ -55,11 +59,6 @@ convert_Path_to_windows32(char *Path, char to_delim)
|
|||||||
p = ++etok;
|
p = ++etok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* convert to backward slashes */
|
|
||||||
for (p = Path, p = strchr(p, '/'); p; p = strchr(p, '/'))
|
|
||||||
*p = '\\';
|
|
||||||
#endif
|
|
||||||
return Path;
|
return Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
# `build.bat' instead.
|
# `build.bat' instead.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc
|
# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -27,7 +27,7 @@ CC = cl
|
|||||||
OUTDIR=.
|
OUTDIR=.
|
||||||
MAKEFILE=NMakefile
|
MAKEFILE=NMakefile
|
||||||
|
|
||||||
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WINDOWS32 /D _WINDOWS -I. -I../include
|
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../..
|
||||||
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
|
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
|
||||||
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
|
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
|
||||||
|
|
||||||
@@ -40,6 +40,7 @@ Debug:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rmdir /s /q WinRel WinDebug
|
rmdir /s /q WinRel WinDebug
|
||||||
|
erase *.pdb
|
||||||
|
|
||||||
$(OUTDIR):
|
$(OUTDIR):
|
||||||
if not exist .\$@\nul mkdir .\$@
|
if not exist .\$@\nul mkdir .\$@
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
|
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
|
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
|
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
|
||||||
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
|
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
|
||||||
if not exist .\WinRel\nul mkdir .\WinRel
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
|
||||||
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
|
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "sub_proc.h"
|
#include "sub_proc.h"
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "w32err.h"
|
#include "w32err.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static char *make_command_line( char *shell_name, char *exec_path, char **argv);
|
static char *make_command_line( char *shell_name, char *exec_path, char **argv);
|
||||||
|
|
||||||
@@ -319,14 +320,10 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
|
|||||||
char *fname;
|
char *fname;
|
||||||
char *ext;
|
char *ext;
|
||||||
|
|
||||||
if ((exec_handle = (HANDLE)OpenFile(exec_path, file_info,
|
|
||||||
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
|
||||||
return(exec_handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
fname = malloc(strlen(exec_path) + 5);
|
fname = malloc(strlen(exec_path) + 5);
|
||||||
strcpy(fname, exec_path);
|
strcpy(fname, exec_path);
|
||||||
ext = fname + strlen(fname);
|
ext = fname + strlen(fname);
|
||||||
|
|
||||||
strcpy(ext, ".exe");
|
strcpy(ext, ".exe");
|
||||||
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
||||||
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
||||||
@@ -334,6 +331,13 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
|
|||||||
return(exec_handle);
|
return(exec_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strcpy(ext, ".cmd");
|
||||||
|
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
||||||
|
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
||||||
|
free(fname);
|
||||||
|
return(exec_handle);
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(ext, ".bat");
|
strcpy(ext, ".bat");
|
||||||
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
||||||
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
||||||
@@ -341,6 +345,13 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
|
|||||||
return(exec_handle);
|
return(exec_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* should .com come before this case? */
|
||||||
|
if ((exec_handle = (HANDLE)OpenFile(exec_path, file_info,
|
||||||
|
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
||||||
|
free(fname);
|
||||||
|
return(exec_handle);
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(ext, ".com");
|
strcpy(ext, ".com");
|
||||||
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
|
||||||
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
|
||||||
@@ -489,14 +500,8 @@ process_begin(
|
|||||||
startInfo.hStdOutput = (HANDLE)pproc->sv_stdout[1];
|
startInfo.hStdOutput = (HANDLE)pproc->sv_stdout[1];
|
||||||
startInfo.hStdError = (HANDLE)pproc->sv_stderr[1];
|
startInfo.hStdError = (HANDLE)pproc->sv_stderr[1];
|
||||||
|
|
||||||
/*
|
|
||||||
* See if we need to setuid to a different user.
|
|
||||||
*/
|
|
||||||
if (as_user) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (as_user) {
|
if (as_user) {
|
||||||
|
if (envblk) free(envblk);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if (CreateProcess(
|
if (CreateProcess(
|
||||||
@@ -514,6 +519,7 @@ process_begin(
|
|||||||
pproc->last_err = GetLastError();
|
pproc->last_err = GetLastError();
|
||||||
pproc->lerrno = E_FORK;
|
pproc->lerrno = E_FORK;
|
||||||
fprintf(stderr, "process_begin: CreateProcess(%s, %s, ...) failed.\n", exec_path, command_line);
|
fprintf(stderr, "process_begin: CreateProcess(%s, %s, ...) failed.\n", exec_path, command_line);
|
||||||
|
if (envblk) free(envblk);
|
||||||
free( command_line );
|
free( command_line );
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
@@ -538,6 +544,7 @@ process_begin(
|
|||||||
}
|
}
|
||||||
|
|
||||||
free( command_line );
|
free( command_line );
|
||||||
|
if (envblk) free(envblk);
|
||||||
pproc->lerrno=0;
|
pproc->lerrno=0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -882,108 +889,6 @@ process_cleanup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Try to protect against WINDOWS32 argument munging. This function takes
|
|
||||||
* an argv vector and outputs a 'protected' string as a return
|
|
||||||
* value. The return code can be safely passed to CreateProcess().
|
|
||||||
*
|
|
||||||
* The caller should free the return value.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define TRACE(x)
|
|
||||||
static char *fix_command_line(char *args[])
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
char *narg;
|
|
||||||
char *nargp;
|
|
||||||
char *p;
|
|
||||||
char *q;
|
|
||||||
int alloc_len = 0;
|
|
||||||
|
|
||||||
for (i = 0; args[i]; i++)
|
|
||||||
alloc_len += ((strlen(args[i]) * 2) + 1);
|
|
||||||
/* account for possible enclosing quotes and null termination */
|
|
||||||
alloc_len += 3;
|
|
||||||
|
|
||||||
nargp = narg = malloc(alloc_len);
|
|
||||||
|
|
||||||
for (i = 0; args[i]; i++) {
|
|
||||||
p = args[i];
|
|
||||||
TRACE(("original arg: %s\n", p));
|
|
||||||
|
|
||||||
if (*p == '\0') {
|
|
||||||
*nargp++ = '"';
|
|
||||||
*nargp++ = '"';
|
|
||||||
*nargp = '\0';
|
|
||||||
TRACE(("empty string arg: %s\n", nargp-2));
|
|
||||||
} else if (strpbrk(p, "\" \t")) {
|
|
||||||
/* point to end of copy buffer */
|
|
||||||
q = narg;
|
|
||||||
q += (alloc_len-1);
|
|
||||||
*q-- = '\0'; /* ensure null terminated string */
|
|
||||||
*q-- = '"'; /* terminating quote of argument */
|
|
||||||
|
|
||||||
/* point to end of the input string */
|
|
||||||
p = args[i];
|
|
||||||
p += strlen(args[i]);
|
|
||||||
p--;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Because arg is quoted, escape any backslashes
|
|
||||||
* that might occur at the end of the string which
|
|
||||||
* proceed the closing quote.
|
|
||||||
* Example:
|
|
||||||
* foo c:\
|
|
||||||
* Becomes:
|
|
||||||
* "foo c:\\"
|
|
||||||
*/
|
|
||||||
while (*p == '\\')
|
|
||||||
*q-- = *p--, *q-- = '\\';
|
|
||||||
|
|
||||||
/* copy the string in reverse */
|
|
||||||
while (p >= args[i]) {
|
|
||||||
/* copy the character */
|
|
||||||
*q-- = *p--;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Escape any double quote found. Also escape
|
|
||||||
* each backslash preceding the double quote.
|
|
||||||
*/
|
|
||||||
if (*(p+1) == '"') {
|
|
||||||
*q-- = '\\';
|
|
||||||
if (p >= args[i] && *p == '\\')
|
|
||||||
while (p >= args[i] && *p == '\\')
|
|
||||||
*q-- = *p--, *q-- = '\\';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* finish quoting arg, q now points to complete arg */
|
|
||||||
*q = '"';
|
|
||||||
|
|
||||||
/* rejustify */
|
|
||||||
memmove(nargp, q, strlen(q) + 1);
|
|
||||||
TRACE(("arg with white space or doublequotes: %s\n", nargp));
|
|
||||||
nargp += strlen(nargp);
|
|
||||||
} else {
|
|
||||||
/* just copy the argument, no protection needed */
|
|
||||||
strcpy(nargp, args[i]);
|
|
||||||
TRACE(("plain arg: %s\n", nargp));
|
|
||||||
nargp += strlen(nargp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* separate arguments with spaces (if more args to gather) */
|
|
||||||
if (args[i+1])
|
|
||||||
*nargp++ = ' ';
|
|
||||||
*nargp = '\0';
|
|
||||||
} /* end for */
|
|
||||||
|
|
||||||
/* NULL terminate the arg list */
|
|
||||||
*nargp = '\0';
|
|
||||||
|
|
||||||
return (narg);
|
|
||||||
}
|
|
||||||
#undef TRACE
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description:
|
* Description:
|
||||||
* Create a command line buffer to pass to CreateProcess
|
* Create a command line buffer to pass to CreateProcess
|
||||||
@@ -998,30 +903,211 @@ static char *fix_command_line(char *args[])
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
make_command_line( char *shell_name, char *exec_path, char **argv)
|
make_command_line( char *shell_name, char *full_exec_path, char **argv)
|
||||||
{
|
{
|
||||||
char** nargv;
|
int argc = 0;
|
||||||
char* buf;
|
char** argvi;
|
||||||
int i;
|
int* enclose_in_quotes = NULL;
|
||||||
|
int* enclose_in_quotes_i;
|
||||||
|
unsigned int bytes_required = 0;
|
||||||
|
char* command_line;
|
||||||
|
char* command_line_i;
|
||||||
|
|
||||||
if (shell_name) {
|
if (shell_name && full_exec_path) {
|
||||||
for (i = 0; argv[i]; i++);
|
bytes_required
|
||||||
i += 2;
|
= strlen(shell_name) + 1 + strlen(full_exec_path);
|
||||||
nargv = (char **) malloc(i * sizeof (char *));
|
/*
|
||||||
nargv[0] = shell_name;
|
* Skip argv[0] if any, when shell_name is given.
|
||||||
for (i = 1; argv[i-1]; i++)
|
*/
|
||||||
nargv[i] = argv[i-1];
|
if (*argv) argv++;
|
||||||
nargv[i] = NULL;
|
/*
|
||||||
} else
|
* Add one for the intervening space.
|
||||||
nargv = argv;
|
*/
|
||||||
|
if (*argv) bytes_required++;
|
||||||
|
}
|
||||||
|
|
||||||
/* create string suitable for CreateProcess() */
|
argvi = argv;
|
||||||
buf = fix_command_line(nargv);
|
while (*(argvi++)) argc++;
|
||||||
|
|
||||||
if (shell_name)
|
if (argc) {
|
||||||
free(nargv);
|
enclose_in_quotes = (int*) calloc(1, argc * sizeof(int));
|
||||||
|
|
||||||
return buf;
|
if (!enclose_in_quotes) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We have to make one pass through each argv[i] to see if we need
|
||||||
|
* to enclose it in ", so we might as well figure out how much
|
||||||
|
* memory we'll need on the same pass.
|
||||||
|
*/
|
||||||
|
|
||||||
|
argvi = argv;
|
||||||
|
enclose_in_quotes_i = enclose_in_quotes;
|
||||||
|
while(*argvi) {
|
||||||
|
char* p = *argvi;
|
||||||
|
unsigned int backslash_count = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We have to enclose empty arguments in ".
|
||||||
|
*/
|
||||||
|
if (!(*p)) *enclose_in_quotes_i = 1;
|
||||||
|
|
||||||
|
while(*p) {
|
||||||
|
switch (*p) {
|
||||||
|
case '\"':
|
||||||
|
/*
|
||||||
|
* We have to insert a backslash for each "
|
||||||
|
* and each \ that precedes the ".
|
||||||
|
*/
|
||||||
|
bytes_required += (backslash_count + 1);
|
||||||
|
backslash_count = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\\':
|
||||||
|
backslash_count++;
|
||||||
|
break;
|
||||||
|
/*
|
||||||
|
* At one time we set *enclose_in_quotes_i for '*' or '?' to suppress
|
||||||
|
* wildcard expansion in programs linked with MSVC's SETARGV.OBJ so
|
||||||
|
* that argv in always equals argv out. This was removed. Say you have
|
||||||
|
* such a program named glob.exe. You enter
|
||||||
|
* glob '*'
|
||||||
|
* at the sh command prompt. Obviously the intent is to make glob do the
|
||||||
|
* wildcarding instead of sh. If we set *enclose_in_quotes_i for '*' or '?',
|
||||||
|
* then the command line that glob would see would be
|
||||||
|
* glob "*"
|
||||||
|
* and the _setargv in SETARGV.OBJ would _not_ expand the *.
|
||||||
|
*/
|
||||||
|
case ' ':
|
||||||
|
case '\t':
|
||||||
|
*enclose_in_quotes_i = 1;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
default:
|
||||||
|
backslash_count = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add one for each character in argv[i].
|
||||||
|
*/
|
||||||
|
bytes_required++;
|
||||||
|
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*enclose_in_quotes_i) {
|
||||||
|
/*
|
||||||
|
* Add one for each enclosing ",
|
||||||
|
* and one for each \ that precedes the
|
||||||
|
* closing ".
|
||||||
|
*/
|
||||||
|
bytes_required += (backslash_count + 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add one for the intervening space.
|
||||||
|
*/
|
||||||
|
if (*(++argvi)) bytes_required++;
|
||||||
|
enclose_in_quotes_i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add one for the terminating NULL.
|
||||||
|
*/
|
||||||
|
bytes_required++;
|
||||||
|
|
||||||
|
command_line = (char*) malloc(bytes_required);
|
||||||
|
|
||||||
|
if (!command_line) {
|
||||||
|
if (enclose_in_quotes) free(enclose_in_quotes);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
command_line_i = command_line;
|
||||||
|
|
||||||
|
if (shell_name && full_exec_path) {
|
||||||
|
while(*shell_name) {
|
||||||
|
*(command_line_i++) = *(shell_name++);
|
||||||
|
}
|
||||||
|
|
||||||
|
*(command_line_i++) = ' ';
|
||||||
|
|
||||||
|
while(*full_exec_path) {
|
||||||
|
*(command_line_i++) = *(full_exec_path++);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*argv) {
|
||||||
|
*(command_line_i++) = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
argvi = argv;
|
||||||
|
enclose_in_quotes_i = enclose_in_quotes;
|
||||||
|
|
||||||
|
while(*argvi) {
|
||||||
|
char* p = *argvi;
|
||||||
|
unsigned int backslash_count = 0;
|
||||||
|
|
||||||
|
if (*enclose_in_quotes_i) {
|
||||||
|
*(command_line_i++) = '\"';
|
||||||
|
}
|
||||||
|
|
||||||
|
while(*p) {
|
||||||
|
if (*p == '\"') {
|
||||||
|
/*
|
||||||
|
* We have to insert a backslash for the "
|
||||||
|
* and each \ that precedes the ".
|
||||||
|
*/
|
||||||
|
backslash_count++;
|
||||||
|
|
||||||
|
while(backslash_count) {
|
||||||
|
*(command_line_i++) = '\\';
|
||||||
|
backslash_count--;
|
||||||
|
};
|
||||||
|
|
||||||
|
} else if (*p == '\\') {
|
||||||
|
backslash_count++;
|
||||||
|
} else {
|
||||||
|
backslash_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copy the character.
|
||||||
|
*/
|
||||||
|
*(command_line_i++) = *(p++);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*enclose_in_quotes_i) {
|
||||||
|
/*
|
||||||
|
* Add one \ for each \ that precedes the
|
||||||
|
* closing ".
|
||||||
|
*/
|
||||||
|
while(backslash_count--) {
|
||||||
|
*(command_line_i++) = '\\';
|
||||||
|
};
|
||||||
|
|
||||||
|
*(command_line_i++) = '\"';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Append an intervening space.
|
||||||
|
*/
|
||||||
|
if (*(++argvi)) {
|
||||||
|
*(command_line_i++) = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
enclose_in_quotes_i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Append the terminating NULL.
|
||||||
|
*/
|
||||||
|
*command_line_i = '\0';
|
||||||
|
|
||||||
|
if (enclose_in_quotes) free(enclose_in_quotes);
|
||||||
|
return command_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user