Compare commits

..

103 Commits

Author SHA1 Message Date
Paul Smith
3e12cad198 Quick changes for make 3.76.1. 1997-09-19 19:47:55 +00:00
Paul Smith
e2ffc653aa Minor tweaks for 3.76. 1997-09-16 18:08:59 +00:00
Paul Smith
4e58a6ca4c Changes for GNU make 3.76 1997-09-16 14:19:43 +00:00
Paul Smith
41dcca8426 Changes for GNU make 3.76 1997-09-16 14:17:23 +00:00
Paul Eggert
161a026602 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Ulrich Drepper
e244062995 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Paul Eggert
24fec5cb53 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Ulrich Drepper
b903988475 automatically generated from GPLed version 1997-09-11 18:13:19 +00:00
Paul Smith
6ea87be73b Changes for GNU make 3.75.93. 1997-09-05 21:01:49 +00:00
Paul Smith
f6490d62cf GNU make 3.75.92 1997-08-27 21:14:44 +00:00
Paul Smith
480ad62713 New glob.h to understand __const 1997-08-27 20:43:43 +00:00
Paul Smith
acd666ce50 Updated for GNU make 3.75.92. 1997-08-27 20:36:31 +00:00
Paul Smith
be3fb0ae6d Updates for GNU make 3.75.92. 1997-08-27 20:30:54 +00:00
Paul Smith
dd0c939e78 Last minute 3.75.91 changes. 1997-08-18 20:14:30 +00:00
Paul Smith
fff468765c e the global copy of this lib. 1997-08-18 19:31:49 +00:00
Paul Smith
63dff1e0bc Bug fixes and automake changes. 1997-08-18 18:11:04 +00:00
Paul Smith
e746a9c951 Removed files that are no longer needed now that we use automake. 1997-08-18 16:48:45 +00:00
Paul Smith
74d4418f1c Removed files that are no longer needed now that we use automake. 1997-08-18 15:19:04 +00:00
Miles Bader
062e5f6aae automatically generated from GPLed version 1997-08-14 02:25:35 +00:00
Paul Eggert
c495345f7c automatically generated from GPLed version 1997-08-14 02:16:15 +00:00
Paul Smith
f0239bb0af Final update for 3.75.1. 1997-08-01 06:31:21 +00:00
Karl Berry
2d29a55137 (\email): Let to \uref instead of \code, as a second optional argument
makes sense for this, too.
1997-07-26 19:12:35 +00:00
Richard M. Stallman
806c7aa46c Test __unix' along with unix'. 1997-07-22 21:35:43 +00:00
Jim Meyering
47daa6787e Add comment describing HAVE_PSTAT_GETDYNAMIC. 1997-07-15 13:21:56 +00:00
Karl Berry
eb4d510a74 (\indexdummies): Add \value. 1997-07-14 17:43:41 +00:00
Karl Berry
c86587fb9b (\authorrm): Must use \def instead of \let, as \secrm is not yet
defined.
1997-07-10 17:34:25 +00:00
Richard M. Stallman
fd688f6e9c (\titlefont): Define again, using \titlefonts. 1997-07-10 01:23:38 +00:00
Karl Berry
f96ef9a409 (\startcontents): Leave ^ catcode as other. 1997-07-09 20:45:27 +00:00
Richard M. Stallman
09616e5837 Declare how to hyphenate "whitespace". 1997-07-09 19:40:16 +00:00
Richard M. Stallman
cf9aa5b70b [OSF_ALPHA]: Include sys/mbuf.h, sys/socket.h, net/route.h. 1997-07-06 23:43:39 +00:00
Karl Berry
9033f1a656 (\titlefonts): New macro to set title font styles, so italic etc. work
in @title.
(\titlefont): No longer needed.
(\titlepage): Call \titlefonts instead of \titlefont.
(\chapsf, \ssecsy, \ssecttsl): Correct magstep values.
From: Stephen Gildea <gildea@intouchsys.com>.
1997-07-05 21:51:30 +00:00
Karl Berry
ccfe89b829 (\onepageout): Back up to 2\baselineskip per Stephen.
(\kbdinputstyle): New command.
1997-07-05 21:16:39 +00:00
Richard M. Stallman
35f1bbbe23 [__GNU__]: Test for not NeXT. 1997-07-04 04:45:19 +00:00
gnu
9f88582943 fix TeX overfills -len 1997-07-04 04:42:36 +00:00
Richard M. Stallman
b38d9d2ae9 (\kbdfont, \kbdexamplefont): New macros, parms that
tell @kbd what to do.
(\setkbdinputdistinct, \setkbdinputexample): New commands set them.
(\kbd): Use those parms.
1997-07-04 00:07:28 +00:00
Karl Berry
132e0eda6c (\onepageout): Leave only one line space above the footline, to be more
like plain.  Suggested by Stephen Gildea.
(\evenfootline): Left one too many line spaces here, so reduce by two.

(\ifnottex): Another ignore command.
(\ifnothtml,\ifnotinfo): New commands.
(\doignore): Ignore brace characters, so mismatched braces in ignored
text do not cause complaints.
1997-07-03 20:52:37 +00:00
Karl Berry
c297b2fbd5 (\image): New definition for new @image command. 1997-06-27 19:09:14 +00:00
Richard M. Stallman
ec08feae97 Update FSF address in second place. 1997-06-26 20:56:18 +00:00
Ulrich Drepper
8c7887ac02 update from main archive 970623 1997-06-23 22:48:40 +00:00
Ulrich Drepper
08cf536bfb automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Paul Eggert
b48b02c7f4 automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Ulrich Drepper
e7a0e14a43 automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Paul Eggert
6413a1d08e automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Miles Bader
8f34c48e3f automatically generated from GPLed version 1997-06-21 04:31:18 +00:00
Paul Eggert
818bb8940c automatically generated from GPLed version 1997-06-21 03:24:49 +00:00
Karl Berry
cc4d91d751 (\oddfootingxxx),
(\onepageout): Leave space for the footline if present.
(\everyfootingxxx, \everyheadingxxx): Call \oddfootingxxx and
\evenfootingxxx instead of repeating their code.
From: Stephen Gildea <gildea@intouchsys.com>.

(\setfilename): Read texinfo.cnf if present.

(\indexdummies, \indexnofonts): No-op additional commands @result @equiv
@expansion @print @error @point.
From: Dave Bodenstab <imdave@ais.net> (for texi2www doc).
1997-06-18 19:58:18 +00:00
Ulrich Drepper
36d804bd51 Undo last change. 1997-06-13 23:19:09 +00:00
Ulrich Drepper
f95d071efc update from main archive 970612 1997-06-12 23:56:51 +00:00
Karl Berry
c0deecf9ee (\setmultitablespacing): Restore bad typing mistake from yesterday. 1997-06-06 14:31:32 +00:00
Karl Berry
dd63648825 (\uref): Write real definition, taking one mandatory argument and one
optional one.
1997-06-05 22:04:25 +00:00
Karl Berry
229ba33d0e * texinfo.tex (\mainmagstep): Define this as a \count variable
instead of with \let, to make changing to \magstep1 more transparent.
 	From: HERBERT@boevm4.vnet.ibm.com.
	(\uref): New command a la \url.
1997-06-04 21:47:40 +00:00
Paul Eggert
ccbe33db90 automatically generated from GPLed version 1997-05-27 03:15:15 +00:00
Paul Eggert
32efbf8dc3 automatically generated from GPLed version 1997-05-27 03:15:15 +00:00
Paul Eggert
6e3b0629f1 automatically generated from GPLed version 1997-05-27 03:15:15 +00:00
Karl Berry
51659ed000 (\deftypemethod, \deftypemethodheader): New macros to implement
new commands @deftypemethod and @deftypemethodx.
Suggestion from: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise).
1997-05-24 22:06:39 +00:00
Karl Berry
7827f1bde8 (\opnr, \clnr): Increment/decrement \parencount, for
* texinfo.tex (\opnr, \clnr): Increment/decrement \parencount, for
   	  @defun lines with nested parens.  From Bill Schelter
 	  <wfs@fireant.ma.utexas.edu>.
	(\itemizeitem): Correct \errmessage.
1997-05-23 17:02:00 +00:00
Karl Berry
922730c406 (\codeunder): Use \_ and \ifusingtt to avoid dotaccent from _ in roman
fonts, e.g., @deftypefn.
(\tex): Remove spurious spaces at the end of subdefinitions.
From: "John W. Eaton" <jwe@bevo.che.wisc.edu>.
(\url, \email): \let to \code; no quotes or angle brackets.
1997-05-19 21:34:38 +00:00
Richard M. Stallman
5e91041347 Explain which commands should use CFLAGS. 1997-05-17 19:07:42 +00:00
Karl Berry
9f7ba4a505 (\onepageout): \ifcropmarks, center the page body.
Lost this when merged \croppageout with \onepageout.
Found by Arnold.

(\doprintindex): Do not bother to go into double column mode unless
there actually is a non-empty index.

(\begindoublecolumns): Include any existing \partialpage in the new one,
lest we lose a whole page of output.
Found by M J Morley <mjm@scs.leeds.ac.uk>.

(\chapternofonts): Remove spurious spaces, both in the definitions that
get output to the aux file(s) and in this macro.

Fix comments and rationalize whitespace in various other places.
1997-05-05 21:06:33 +00:00
Karl Berry
2745ed943b Avoid expansion in node titles.
Merge cropmarks code into main output routine.
1997-04-27 19:40:44 +00:00
Paul Eggert
0cb72b4a51 automatically generated from GPLed version 1997-04-18 00:47:55 +00:00
Paul Smith
73fcfdbe24 Last-minute changed for 3.75.1 1997-04-07 18:02:17 +00:00
Paul Smith
0ada207e2d Changes for make 3.75.1 1997-04-07 07:21:16 +00:00
Paul Smith
7bb7ba7849 New file for DJGPP port. 1997-04-07 06:54:40 +00:00
Paul Smith
2a294c52d1 Renamed to config.h.W32 at RMS' request. 1997-04-02 06:03:37 +00:00
Paul Smith
71515366cd Renamed to README.W32 at RMS' request. 1997-04-02 05:59:56 +00:00
Roland McGrath
d78f2db327 Mon Mar 10 23:47:02 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* job.c (construct_command_argv_internal): Don't discard an
	explicit empty argument at the end of the command line.  In the
	slow case return immediately if the command line was empty.
1997-03-12 21:17:08 +00:00
Miles Bader
30c9fcfec3 [__GNU__] (NeXT, host_self):
New macros, to make hurd systems use the NeXT code for getting load averages.
1997-02-23 03:38:49 +00:00
Paul Eggert
e2b79aacf7 automatically generated from GPLed version 1997-01-23 04:23:12 +00:00
Paul Eggert
e981c049f4 automatically generated from GPLed version 1997-01-22 05:25:31 +00:00
Jim Meyering
9012013552 [hpux && HAVE_PSTAT_GETDYNAMIC]: Use HPUX's pstat_getdynamic so
we don't need any special privileges to determine load averages.
Patch from Kaveh Ghazi, based on a sample implementation from
Richard J. Rauenzahn.
Indent cpp-directives to reflect nesting.
1997-01-16 03:33:02 +00:00
Karl Berry
cda4f25fd4 Oops, did inadvertent branch. 1997-01-04 19:24:13 +00:00
Ulrich Drepper
b32b9197ab update from main archive 961217 1996-12-18 03:22:53 +00:00
Paul Eggert
b66145d8bc Spelling fix. 1996-12-17 06:25:17 +00:00
David J. MacKenzie
d2fe84cab3 fix a couple of bugs 1996-12-11 00:49:47 +00:00
Karl Berry
c2ea8e2486 (\deftypevarheader, \deftypevrheader): Remove
* texinfo.tex (\deftypevarheader, \deftypevrheader): Remove
        anything after the first space in the name to be indexed, for the
	sake of tzname[2].
	(\dovarind): New macro.
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
1996-11-19 21:11:43 +00:00
Karl Berry
db2384b9ab \indexbreaks, \realunder, \multitable, \footnotezzz. 1996-11-17 00:12:46 +00:00
Karl Berry
9b0b3a6e70 (\value): Don't call \parsearg, @value takes a simple arg. 1996-11-16 00:20:09 +00:00
Karl Berry
a71d56b4cc (\parsetpheaderline): Don't go through \tptemp when
removing braces from #2, use the macro call directly.
	(\removeemptybraces): Expand to #1 instead of defining \tptemp.
	From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
	This makes @deftp {Data type} {struct termios} work again.
1996-11-16 00:19:07 +00:00
Karl Berry
10011ce289 (\set, \value): Allow - and _ in @set variable names. 1996-11-09 23:37:11 +00:00
David J. MacKenzie
84a9fd68b7 many bug fixes and a few additions, mostly derived from bug-gnu-utils 1996-11-09 22:19:34 +00:00
Karl Berry
262ca66cb7 (\readauxfile): Leave \catcode`\^ as other;
* texinfo.tex (\readauxfile): Leave \catcode`\^ as other;
 	otherwise, node names containing ^, such as in info/info.texi,
 	cause an error when run through TeX.
	(\setq): Do not call \auxhat.
	(\auxhat): Definition no longer needed.
	Reported by Howard Gayle <howard@hal.com>.
1996-11-09 18:44:09 +00:00
Richard M. Stallman
a1eb3e67cd Talk about which dir Info files, Bison output, etc. should go in.
Add some more utilities that can be used in make commands.
1996-11-07 22:30:30 +00:00
Karl Berry
78a4848b83 (see ChangeLog for Oct 29.) 1996-11-05 19:52:23 +00:00
Karl Berry
b16829dc46 Call \normalturnoffactive for the sake of \write's that include a \. 1996-11-05 19:51:16 +00:00
Jim Meyering
c71e4ac269 [__hpux]: Define hpux. From Eric Backus.
[__sun]: Define sun.  Reported by Kaveh Ghazi.
1996-10-10 03:29:50 +00:00
Karl Berry
82e6316607 Untabify. 1996-09-30 17:47:57 +00:00
Karl Berry
a8de4b93e3 Changes for Texinfo 3.8 release; see ChangeLog. 1996-09-30 17:39:54 +00:00
Karl Berry
6e7fa14c65 (\inforef): Move to more appropriate place.
* texinfo.tex (\inforef): Move to more appropriate place.
	(\pounds): Remove spurious extra $.
	(\email): Typeset argument in angle brackets.
	(\macro): Use \doignore for robustness, instead of just letting TeX
	parse the argument.
	(\unmacro): Define.
1996-09-18 12:15:20 +00:00
Richard M. Stallman
5206d3f2bc (getloadavg): Add new code for SUNOS_5 to use -lkstat. 1996-09-10 19:50:17 +00:00
Richard M. Stallman
e2da48ca55 Describe preinstall and postinstall commands. 1996-09-09 18:06:22 +00:00
Karl Berry
bc26243d90 Formatting change, define @pounds, etc. 1996-09-06 19:24:48 +00:00
Karl Berry
b4db97478e (\centerchfplain): Rewrite to use \chfplain, and to
actually center.
	(\unnchfplain): Just call \chfplain.
	(\chfplain): Rewrite to be generally callable.
	(\centerparametersmaybe): Hook, a no-op except with @centerchap.
1996-09-02 15:14:43 +00:00
Karl Berry
4e361d0f01 (\key): Do not uppercase the argument; key names
can be mixed case, e.g., `Control'.
1996-08-31 19:08:16 +00:00
Roland McGrath
d5d49d2e5a Regenerated for 3.75 1996-08-28 21:13:05 +00:00
Roland McGrath
191dc2b434 . 1996-08-28 18:15:23 +00:00
Roland McGrath
6fa74367b7 Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
* main.c (print_version): Print out bug-reporting address.
Mon Aug 26 19:55:47 1996  Roland McGrath  <roland@baalperazim.frob.com>

	* main.c (print_data_base): Don't declare ctime; headers do it for us
 	already.
1996-08-27 11:29:03 +00:00
Roland McGrath
4cee1500a4 Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
* version.c: Version 3.75 released.
1996-08-27 10:16:17 +00:00
Karl Berry
2602fb8e71 (\key): Typeset a lozenge around the argument (from
gildea@intouchsys.com).
1996-08-20 18:37:11 +00:00
Karl Berry
bfce132399 (\heading, \subheading, \subsubheading): Can no
* texinfo.tex (\heading, \subheading, \subsubheading): Can no
 	longer call the nonexistent \*secheadingi series. Instead, call
 	\plain*secheading.
	(\plainsubsecheading, \plainsubsubsecheading): New macros, by analogy
	with \plainsecheading.
	(\unnumberedsubseczzz, \unnumberedsubsubseczzz): Call them.
1996-08-05 18:01:12 +00:00
Karl Berry
30cf28ef63 (\HEADINGSdouble, \HEADINGSsingle,
HEADINGSdoubleafter, \HEADINGSsingleafter, \CHAPPAGoff,
\CHAPPAGon, \CHAPPAGodd): Set \contentsalignmacro, analogous to
\pagealignmacro.
(\startcontents): Call \contentsalignmacro instead of \pagealignmacro.
1996-08-03 18:59:17 +00:00
Karl Berry
a7f3831457 Restoring good RCS id. 1996-08-02 15:12:28 +00:00
Karl Berry
bcd11d854b (\indexfonts): Make leading be 12pt. Otherwise, it's too crammed.
(\smalllispx): Remove \setleading{10pt}. That was too small.
(\doprintindex): Do not call \tex ... \Etex.  Index files are Texinfo
source, not TeX source, except for using \ instead of @ as the
escape character (for now).
1996-07-29 19:08:10 +00:00
91 changed files with 7464 additions and 9503 deletions

50
AUTHORS Normal file
View File

@@ -0,0 +1,50 @@
-----------------------------------
GNU make development up to version 3.75 by:
Roland McGrath <roland@gnu.ai.mit.edu>
GNU Make User's Manual written by:
Richard M. Stallman <rms@gnu.ai.mit.edu>
User's Manual edited by:
Roland McGrath <roland@gnu.ai.mit.edu>
Bob Chassell <bob@gnu.ai.mit.edu>
Melissa Weisshaus <melissa@gnu.ai.mit.edu>
Development and maintenance starting with GNU make 3.76 by:
Paul D. Smith <psmith@gnu.ai.mit.edu>
-----------------------------------
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 :)

View File

@@ -2,7 +2,8 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +306,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.

452
ChangeLog
View File

@@ -1,16 +1,396 @@
Fri Sep 19 09:20:49 1997 Paul D. Smith <psmith@baynetworks.com>
* 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 WIN32 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>
* Version 3.75.1
* compatMakefile (objs): Define & use the $(GLOB) variable so
that it's removed correctly from build.sh.in when it's built.
* configure.in: On Solaris we can use the kstat_*() functions to
get load averages without needing special permissions. Add a
check for -lkstat to see if we have it.
* getloadavg.c (getloadavg): Use HAVE_LIBKSTAT instead of SUN5 as
the test to enable kstat_open(), etc. processing.
Fri Apr 4 20:21:18 1997 Eli Zaretskii <eliz@is.elta.co.il>
* <lots>: Fixes to work in the DJGPP DOS environment.
Mon Mar 31 02:42:52 1997 Paul D. Smith <psmith@baynetworks.com>
* function.c (expand_function): Added new function $(wordlist).
* make.texinfo (Filename Functions): Document $(wordlist) function.
* vpath.c (build_vpath_lists): Construct the GPATH variable
information in the same manner we used to construct VPATH.
(gpath_search): New function to search GPATH.
* make.h: Declare the new function.
* remake.c (update_file_1): Call it, and keep VPATH if it's found.
* make.texinfo (Search Algorithm): Document GPATH variable.
Sun Mar 30 20:57:16 1997 Paul D. Smith <psmith@baynetworks.com>
* main.c (handle_non_switch_argument): Defined the MAKECMDGOALS
variable to contain the user options passed in on the cmd line.
* make.texinfo (Goals): Document MAKECMDGOALS variable.
* remake.c (f_mtime): Print a warning if we detect a clock skew
error, rather than failing.
* main.c (main): If we rebuild any makefiles and need to re-exec,
add "-o<mkfile>" options for each makefile rebuilt to avoid
infinite looping.
Fri Mar 28 15:26:05 1997 Paul D. Smith <psmith@baynetworks.com>
* job.c (construct_command_argv_internal): Track whether the last
arg in the cmd string was empty or not (Roland).
(construct_command_argv_internal): If the shell line is empty,
don't do anything (Roland).
* glob/glob.h,glob/glob.c,glob/fnmatch.c,glob/fnmatch.h: Install
the latest changes from the GLIBC version of glob (Ulrich Drepper).
* getloadavg.c,make-stds.texi: New version (Roland).
* (ALL): Changed WIN32 to W32 or WINDOWS32 (RMS).
Mon Mar 24 15:33:34 1997 Rob Tulloh <rob_tulloh@tivoli.com>
* README.W32: Describe preliminary FAT support.
* build_w32.bat: Use a variable for the final exe name.
* dir.c (find_directory): W32: Find the filesystem type.
(dir_contents_file_exists_p): W32: for FAT filesystems, always
rehash since FAT doesn't change directory mtime on change.
* main.c (handle_runtime_exceptions): W32: Add an
UnhandledExceptionFilter so that when make bombs due to ^C or a
bug, it won't cause a GUI requestor to pop up unless debug is
turned on.
(main): Call it.
Mon Mar 24 00:57:34 1997 Paul D. Smith <psmith@baynetworks.com>
* configure.in, config.h.in, config.ami, config.h-vms, config.h.w32:
Check for memmove() function.
* make.h (bcopy): If memmove() available, define bcopy() to use it.
Otherwise just use bcopy(). Don't use memcpy(); it's not guaranteed
to handle overlapping moves.
* read.c (read_makefile): Fix some uninitialized memory reads
(reported by Purify).
* job.c (construct_command_argv_internal): Use bcopy() not
strcpy(); strcpy() isn't guaranteed to handle overlapping moves.
* Makefile.in: Change install-info option ``--infodir'' to
``--info-dir'' for use with new texinfo.
* function.c (expand_function): $(basename) and $(suffix) should
only search for suffixes as far back as the last directory (e.g.,
only the final filename in the path).
Sun Mar 23 00:13:05 1997 Paul D. Smith <psmith@baynetworks.com>
* make.texinfo: Add @dircategory/@direntry information.
(Top): Remove previous reference to (dir) (from RMS).
(Static Usage): Add "all:" rule to example.
(Automatic Dependencies): fix .d file creation example.
* Install VPATH+ patch:
* filedef.h (struct file): Add in hname field to store the hashed
filename, and a flag to remember if we're using the vpath filename
or not. Renamed a few functions for more clarity.
* file.c (lookup_file,enter_file,file_hash_enter): Store filenames
in the hash table based on their "hash name". We can change this
while keeping the original target in "name".
(rehash_file): Renamed from "rename_file" to be more accurate.
Changes the hash name, but not the target name.
* remake.c (update_file_1): Modify -d output for more detailed
VPATH info. If we don't need to rebuild, use the VPATH name.
(f_mtime): Don't search for vpath if we're ignoring it. Call
renamed function rehash_file. Call name_mtime instead of
file_mtime, to avoid infinite recursion since the file wasn't
actually renamed.
* implicit.c (pattern_search): if we find an implicit file in
VPATH, save the original name not the VPATH name.
* make.texinfo (Directory Search): Add a section on the new VPATH
functionality.
Sun Dec 1 18:36:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* dir.c (file_exists_p, file_impossible, file_impossible_p): If
dirname is empty replace it by the name of the root directory.
Note that this doesn't work (yet) for W32, Amiga, or VMS.
Tue Oct 08 13:57:03 1996 Rob Tulloh <tulloh@tivoli.com>
* main.c (main): W32 bug fix for PATH vars.
Tue Sep 17 1996 Paul Eggert <eggert@twinsun.com>
* filedef.h (NEW_MTIME): Don't assume that time_t is a signed
32-bit quantity.
* make.h: (CHAR_BIT, INTEGER_TYPE_SIGNED, INTEGER_TYPE_MAXIMUM,
INTEGER_TYPE_MINIMUM): New macros.
Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
* Version 3.75 released.
* main.c (print_version): Print out bug-reporting address.
Mon Aug 26 19:55:47 1996 Roland McGrath <roland@baalperazim.frob.com>
* main.c (print_data_base): Don't declare ctime; headers do it for us
already.
Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com)
* w32/pathstuff.c: Turned convert_vpath_to_win32() into a
* w32/pathstuff.c: Turned convert_vpath_to_w32() into a
real function. This was done so that VPATH could contain
white space separated pathnames. Please note that directory
paths (in VPATH/vpath context) containing white space are not
supported (just as they are not under Unix). See README.WIN32
supported (just as they are not under Unix). See README.W32
for suggestions.
* w32/include/pathstuff.h: Added prototype for the new
function convert_vpath_to_win32. Deleted macro for same.
function convert_vpath_to_w32. Deleted macro for same.
* README.WIN32: Added some notes about why I chose not to try
* README.W32: Added some notes about why I chose not to try
and support pathnames which contain white space and some
workaround suggestions.
@@ -32,7 +412,7 @@ Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* vmsfunctions.c (vms_stat): `sys$dassgn (DevChan);' added by kkaempf.
* GNUmakefile (win32files): Add NMakefile.
* GNUmakefile (w32files): Add NMakefile.
* NMakefile (LDFLAGS_debug): Value fixed by tulloh.
@@ -50,7 +430,7 @@ Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Version 3.74.6.
* GNUmakefile (win32files): New variable.
* GNUmakefile (w32files): New variable.
(distfiles): Add it.
* w32: Updated by Rob Tulloh.
@@ -121,22 +501,22 @@ Wed May 15 17:37:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
* dir.c: WIN32 does not support inode. For now, fully qualified
* dir.c: W32 does not support inode. For now, fully qualified
pathname along with st_mtime will be keys for files.
Fixed problem where vpath can be confused when files
are added to a directory after the directory has already been
read in. The code now attempts to reread the directory if it
discovers that the datestamp on the directory has changed since
it was cached by make. This problem only seems to occur on WIN32
right now so it is lumped under port #ifdef WIN32.
it was cached by make. This problem only seems to occur on W32
right now so it is lumped under port #ifdef WINDOWS32.
* function.c: WIN32: call subproc library (CreateProcess()) instead of
* function.c: W32: call subproc library (CreateProcess()) instead of
fork/exec.
* job.c: WIN32: Added the code to do fork/exec/waitpid style processing
on WIN32 systems via calls to subproc library.
* job.c: W32: Added the code to do fork/exec/waitpid style processing
on W32 systems via calls to subproc library.
* main.c: WIN32: Several things added here. First, there is code
* main.c: W32: Several things added here. First, there is code
for dealing with PATH and SHELL defaults. Make tries to figure
out if the user has %PATH% set in the environment and sets it to
%Path% if it is not set already. Make also looks to see if sh.exe
@@ -149,65 +529,65 @@ Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
debugging recursive calls to make where problems appear only in the
sub-make.
* make.h: WIN32: A few macros and header files for WIN32 support.
* make.h: W32: A few macros and header files for W32 support.
* misc.c: WIN32: Added a function end_of_token_w32() to assist
* misc.c: W32: Added a function end_of_token_w32() to assist
in parsing code in read.c.
* read.c: WIN32: Fixes similar to MSDOS which allow colon to
* read.c: W32: Fixes similar to MSDOS which allow colon to
appear in filenames. Use of colon in filenames would otherwise
confuse make.
* remake.c: WIN32: Added include of io.h to eliminate compiler
* remake.c: W32: Added include of io.h to eliminate compiler
warnings. Added some code to default LIBDIR if it is not set
on WIN32.
on W32.
* variable.c: WIN32: Added support for detecting Path/PATH
* variable.c: W32: Added support for detecting Path/PATH
and converting them to semicolon separated lists for make's
internal use. New function sync_Path_environment()
which is called in job.c and function.c before creating a new
process. Caller must set Path in environment since we don't
have fork() to do this for us.
* vpath.c: WIN32: Added detection for filenames containing
* vpath.c: W32: Added detection for filenames containing
forward or backward slashes.
* NMakefile: WIN32: Visual C compatible makefile for use with nmake.
* NMakefile: W32: Visual C compatible makefile for use with nmake.
Use this to build GNU make the first time on Windows NT or Windows 95.
* README.WIN32: WIN32: Contains some helpful notes.
* README.W32: W32: Contains some helpful notes.
* build_w32.bat: WIN32: If you don't like nmake, use this the first
* build_w32.bat: W32: If you don't like nmake, use this the first
time you build GNU make on Windows NT or Windows 95.
* config.h.WIN32: WIN32 version of config.h
* config.h.W32: W32 version of config.h
* subproc.bat: WIN32: A bat file used to build the
* subproc.bat: W32: A bat file used to build the
subproc library from the top-level NMakefile. Needed because
WIndows 95 (nmake) doesn't allow you to cd in a make rule.
* w32/include/dirent.h
* w32/compat/dirent.c: WIN32: opendir, readdir, closedir, etc.
* w32/compat/dirent.c: W32: opendir, readdir, closedir, etc.
* w32/include/pathstuff.h: WIN32: used by files needed functions
* w32/include/pathstuff.h: W32: used by files needed functions
defined in pathstuff.c (prototypes).
* w32/include/sub_proc.h: WIN32: prototypes for subproc.lib functions.
* w32/include/sub_proc.h: W32: prototypes for subproc.lib functions.
* w32/include/w32err.h: WIN32: prototypes for w32err.c.
* w32/include/w32err.h: W32: prototypes for w32err.c.
* w32/pathstuff.c: WIN32: File and Path/Path conversion functions.
* w32/pathstuff.c: W32: File and Path/Path conversion functions.
* w32/subproc/build.bat: WIN32: build script for subproc library
* w32/subproc/build.bat: W32: build script for subproc library
if you don't wish to use nmake.
* w32/subproc/NMakefile: WIN32: Visual C compatible makefile for use
* w32/subproc/NMakefile: W32: Visual C compatible makefile for use
with nmake. Used to build subproc library.
* w32/subproc/misc.c: WIN32: subproc library support code
* w32/subproc/proc.h: WIN32: subproc library support code
* w32/subproc/sub_proc.c: WIN32: subproc library source code
* w32/subproc/w32err.c: WIN32: subproc library support code
* w32/subproc/misc.c: W32: subproc library support code
* w32/subproc/proc.h: W32: subproc library support code
* w32/subproc/sub_proc.c: W32: subproc library source code
* w32/subproc/w32err.c: W32: subproc library support code
Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>

View File

@@ -1,296 +1,54 @@
# GNU Make-specific makefile for GNU Make.
# Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
# This file is part of GNU Make.
# This is a maintainer's-only makefile
#
# 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.
# It bootstraps a GNU make maintainer's directory
#
# 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.
.SUFFIXES:
NORECURSE = true
# If the user asked for a specific target, invoke the Mkaefile instead.
#
# 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.
.DEFAULT:
@[ -f Makefile.in -a -f configure -a -f aclocal.m4 -a -f config.h.in ] \
|| $(MAKE) __cfg NORECURSE=
@[ -f Makefile ] \
|| ./configure
$(MAKE) -f Makefile $@
.PHONY: default
default:
.PHONY: __cfg __cfg_basic TAGS
# Set `ARCH' to a string for the type of machine.
ifndef ARCH
ifdef machine
ARCH = $(machine)
endif # machine
endif # not ARCH
# This is variable since the glob subdirectory doesn't use it.
#
ACCONFIG = acconfig.h
override srcdir := .
override CC := $(CC)
ifeq ($(ARCH),hp300)
#customs=yes
endif
ifdef customs
override REMOTE := cstms
else
override REMOTE := stub
__cfg: __cfg_basic config.h.in TAGS
cd glob && $(MAKE) -f ../GNUmakefile __cfg_basic ACCONFIG=
ifdef NORECURSE
@echo ""; echo "Now you should run one of:"; echo ""; \
echo " make all"; \
echo " make dist"; \
echo " make distdir"; \
echo " make distcheck"; echo ""; \
echo "Or similar to proceed.";\
echo ""
endif
# Get most of the information from the Unix-compatible makefile.
include compatMakefile
__cfg_basic: aclocal.m4 stamp-h.in configure Makefile.in
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
aclocal.m4: configure.in
aclocal
# 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
config.h.in: stamp-h.in
stamp-h.in: configure.in aclocal.m4 $(ACCONFIG)
autoheader
echo timestamp > $@
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
autoconf $(ACFLAGS)
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)' $@
autoconf
ifdef customs
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
LOADLIBES := $(addprefix pmake/customs/,customslib.o rpc.o xlog.o) \
pmake/lib/sprite/libsprite.a
endif
Makefile.in: configure.in config.h.in Makefile.am aclocal.m4
automake --add-missing
ifdef ARCH
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
win32files = README.WIN32 build_w32.bat config.h.WIN32 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) $(win32files) \
aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \
make.texinfo make-stds.texi \
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
TAGS:
find . -name '*.[ch]' -print | etags -

View File

@@ -167,7 +167,9 @@ operates.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually

483
Makefile.DOS.template Normal file
View File

@@ -0,0 +1,483 @@
# -*-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 = true
PRE_INSTALL = true
POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
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
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
BUILT_SOURCES = README build.sh.in
EXTRA_DIST = make.man $(BUILT_SOURCES) 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
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) $(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) $(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 $(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(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=$(infodir) $(infodir)/$$file"; install-info --info-dir=$(infodir) $(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=$(infodir) --remove $$file; done
$(NORMAL_UNINSTALL)
for file in $(INFO_DEPS) make.i; do (cd $(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.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
# 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
alloca.o alloca.lo: alloca.c config.h
ar.o ar.lo: ar.c make.h config.h filedef.h dep.h glob/fnmatch.h
arscan.o arscan.lo: arscan.c make.h config.h
commands.o commands.lo: commands.c make.h config.h dep.h filedef.h variable.h job.h commands.h
default.o default.lo: default.c make.h config.h rule.h dep.h filedef.h job.h commands.h variable.h
dir.o dir.lo: dir.c make.h config.h glob/glob.h
expand.o expand.lo: expand.c make.h config.h filedef.h job.h commands.h variable.h
file.o file.lo: file.c make.h config.h dep.h filedef.h job.h commands.h variable.h
function.o function.lo: function.c make.h config.h filedef.h variable.h dep.h job.h commands.h
getloadavg.o getloadavg.lo: getloadavg.c config.h
getopt.o getopt.lo: getopt.c config.h getopt.h
getopt1.o getopt1.lo: getopt1.c config.h getopt.h
implicit.o implicit.lo: implicit.c make.h config.h rule.h dep.h filedef.h
job.o job.lo: job.c make.h config.h job.h filedef.h commands.h variable.h
main.o main.lo: main.c make.h config.h dep.h filedef.h variable.h job.h commands.h getopt.h
misc.o misc.lo: misc.c make.h config.h dep.h
read.o read.lo: read.c make.h config.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
remake.o remake.lo: remake.c make.h config.h filedef.h job.h commands.h dep.h
remote-stub.o remote-stub.lo: remote-stub.c make.h config.h filedef.h job.h commands.h
rule.o rule.lo: rule.c make.h config.h dep.h filedef.h job.h commands.h variable.h rule.h
signame.o signame.lo: signame.c config.h signame.h
variable.o variable.lo: variable.c make.h config.h dep.h filedef.h job.h commands.h variable.h
version.o version.lo: version.c config.h
vpath.o vpath.lo: vpath.c make.h config.h filedef.h variable.h
fnmatch.o fnmatch.lo: fnmatch.c fnmatch.h ../config.h
glob.o glob.lo: glob.c fnmatch.h glob.h ../config.h
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:

98
Makefile.am Normal file
View File

@@ -0,0 +1,98 @@
# -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.2
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
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
BUILT_SOURCES = README build.sh.in
EXTRA_DIST = make.man $(BUILT_SOURCES) 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 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) -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.
#
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-* 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
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

View File

@@ -22,11 +22,6 @@
# 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
RM = delete
@@ -250,7 +245,7 @@ clean: glob-clean
-$(RM) make loadavg "#?.o" core make.dvi
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) TAGS tags
-$(RM) make.?? make.??s make.log make.toc make.*aux

View File

@@ -1,303 +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
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/libglob.a \
$(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/libglob.a: 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 --infodir=$(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 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
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

57
NEWS
View File

@@ -1,10 +1,61 @@
GNU make NEWS -- history of user-visible changes. 9 May 1996
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
19 Sep 1997
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
See the end for copying conditions.
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
Version 3.76.1
* Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
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,
previously maintained by Paul Smith <psmith@baynetworks.com>. See the
manual.
* Make defines a new variable, `MAKECMDGOALS', to contain the goals that
were specified on the command line, if any. Modifying this variable
has no effect on the operation of make.
* A new function, `$(wordlist S,E,TEXT)', is available: it returns a
list of words from number S to number E (inclusive) of TEXT.
* Instead of an error, detection of future modification times gives a
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
the last filename, not the entire string:
Command Old Result New Result
------- ---------- ----------
$(basename a.b) a a
$(basename a.b/c) a a.b/c
$(suffix a.b) b b
$(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).
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
and MS-Windows, building with the DJGPP v2 port of GNU C/C++ compiler
and utilities. See README.DOS for details, and direct all questions
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
Delorie <dj@delorie.com>.
* John W. Eaton has updated the VMS port to support libraries and VPATH.
Version 3.75
* The directory messages printed by `-w' and implicitly in sub-makes,
@@ -23,7 +74,7 @@ Version 3.75
details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
See README.WIN32 for details, and direct all Windows-related questions to
See README.W32 for details, and direct all Windows-related questions to
<rob_tulloh@tivoli.com>.
Version 3.73

View File

@@ -1,7 +1,7 @@
# NOTE: If you have no `make' program at all to process this makefile, run
# `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.
#
# GNU Make is free software; you can redistribute it and/or modify
@@ -29,9 +29,9 @@ OUTDIR=.
MAKEFILE=NMakefile
SUBPROC_MAKEFILE=NMakefile
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /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_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\
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
@@ -52,16 +52,18 @@ subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
subproc.bat $(SUBPROC_MAKEFILE)
config.h: config.h.WIN32
config.h: config.h.W32
copy $? $@
Release:
Release:
nmake /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
clean:
rmdir /s /q WinDebug WinRel
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
erase config.h
$(OUTDIR):
if not exist .\$@\nul mkdir .\$@

37
README
View File

@@ -1,37 +0,0 @@
This directory contains the 3.74.7 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.WIN32 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.

View File

@@ -3,7 +3,7 @@ Author: GNU, Amiga port by Aaron "Optimizer" Digulla
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
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
GNU make):

293
README.DOS.template Normal file
View File

@@ -0,0 +1,293 @@
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
New (since 3.74) DOS-specific features:
1. Supports long filenames when run from DOS box on Windows 95.
2. Supports both stock DOS COMMAND.COM and Unix-style shells
(details in ``Notes'' below).
3. Supports DOS drive letters in dependencies and pattern rules.
4. Better support for DOS-style backslashes in pathnames (but see
``Notes'' below).
5. The $(shell) built-in can run arbitrary complex commands,
including pipes and redirection, even when COMMAND.COM is your
shell.
6. Can be built without floating-point code (see below).
7. Supports signals in child programs and restores the original
directory if the child was interrupted.
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:
1. Unzip the archive, preserving the directory structure (-d switch
if you use PKUNZIP). If you build Make on Windows 95, use an
unzip program that supports long filenames in zip files.
2. Invoke the `configure.bat' batch file.
If you are building Make in-place, i.e. in the same directory
where its sources are kept, just type "configure.bat" and press
[Enter]. Otherwise, you need to supply the path to the source
directory as an argument to the batch file, like this:
configure.bat c:/djgpp/gnu/make-3.76
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
might consider building a version of Make which doesn't issue
floating-point instructions (they don't help much on MSDOS
anyway). To this end, edit the Makefile created by
configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
5. Invoke Make.
If you are building from outside of the source directory, you
need to tell Make where the sources are, like this:
make srcdir=c:/djgpp/gnu/make-3.76
(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 Sh-utils 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:
* GNU 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 `test' and
`rm' programs (from Fileutils and Sh-utils, accordingly).
Notes:
-----
1. The shell issue.
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
directly, as long as they don't include characters special to
the shell or internal shell commands, because that is faster.
When shell features like redirection or filename wildcards are
involved, Make calls the shell.
This port supports both DOS shells (the stock COMMAND.COM and its
4DOS/NDOS replacements), and Unix-style shells (tested with the
venerable Stewartson's `ms_sh' 2.3 and the DJGPP port of `bash' by
Daisuke Aoyama <jack@st.rim.or.jp>).
When the $SHELL variable points to a Unix-style shell, Make
works just like you'd expect on Unix, calling the shell for any
command that involves characters special to the shell or
internal shell commands. The only difference is that, since
there is no standard way to pass command lines longer than the
infamous DOS 126-character limit, this port of Make writes the
command line to a temporary disk file and then invokes the shell
on that file.
If $SHELL points to a DOS-style shell, however, Make will not
call it automatically, as it does with Unix shells. Stock
COMMAND.COM is too dumb and would unnecessarily limit the
functionality of Make. For example, you would not be able to
use long command lines in commands that use redirection or
pipes. Therefore, when presented with a DOS shell, this port of
Make will emulate most of the shell functionality, like
redirection and pipes, and shall only call the shell when a
batch file or a command internal to the shell is invoked. (Even
when a command is an internal shell command, Make will first
search the $PATH for it, so that if a Makefile calls `mkdir',
you can install, say, a port of GNU `mkdir' and have it called
in that case.)
The key to all this is the extended functionality of `spawn' and
`system' functions from the DJGPP library; this port just calls
`system' where it would invoke the shell on Unix. The most
important aspect of these functions is that they use a special
mechanism to pass long (up to 16KB) command lines to DJGPP
programs. In addition, `system' emulates some internal
commands, like `cd' (so that you can now use forward slashes
with it, and can also change the drive if the directory is on
another drive). Another aspect worth mentioning is that you can
call Unix shell scripts directly, provided that the shell whose
name is mentioned on the first line of the script is installed
anywhere along the $PATH. It is impossible to tell here
everything about these functions; refer to the DJGPP library
reference for more details.
The $(shell) built-in is implemented in this port by calling
`popen'. Since `popen' calls `system', the above considerations
are valid for $(shell) as well. In particular, you can put
arbitrary complex commands, including pipes and redirection,
inside $(shell), which is in many cases a valid substitute for
the Unix-style command substitution (`command`) feature.
2. "SHELL=/bin/sh" -- or is it?
Many Unix Makefiles include a line which sets the SHELL, for
those versions of Make which don't have this as the default.
Since many DOS systems don't have `sh' installed (in fact, most
of them don't even have a `/bin' directory), this port takes
such directives with a grain of salt. It will only honor such a
directive if the basename of the shell name (like `sh' in the
above example) can indeed be found in the directory that is
mentioned in the SHELL= line (`/bin' in the above example), or
in the current working directory, or anywhere on the $PATH (in
that order). If the basename doesn't include a filename
extension, Make will look for any known extension that indicates
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
and .pl). If any such file is found, then $SHELL will be
defined to the exact pathname of that file, and that shell will
hence be used for the rest of processing. But if the named
shell is *not* found, the line which sets it will be effectively
ignored, leaving the value of $SHELL as it was before. Since a
lot of decisions that this port makes depend on the gender of
the shell, I feel it doesn't make any sense to tailor Make's
behavior to a shell which is nowhere to be found.
Note that the above special handling of "SHELL=" only happens
for Makefiles; if you set $SHELL in the environment or on the
Make command line, you are expected to give the complete
pathname of the shell, including the filename extension.
The default value of $SHELL is computed as on Unix (see the Make
manual for details), except that if $SHELL is not defined in the
environment, $COMSPEC is used. Also, if an environment variable
named $MAKESHELL is defined, it takes precedence over both
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
environment *is* used to set the shell (since on MSDOS, it's
unlikely that the interactive shell will not be suitable for
Makefile processing).
The bottom line is that you can now write Makefiles where some
of the targets require a real (i.e. Unix-like) shell, which will
nevertheless work when such shell is not available (provided, of
course, that the commands which should always work, don't
require such a shell). More important, you can convert Unix
Makefiles to MSDOS and leave the line which sets the shell
intact, so that people who do have Unixy shell could use it for
targets which aren't converted to DOS (like `install' and
`uninstall', for example).
3. Default directories.
GNU Make knows about standard directories where it searches for
library and include files mentioned in the Makefile. Since
MSDOS machines don't have standard places for these, this port
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
$DJDIR is defined automatically by the DJGPP startup code as the
root of the DJGPP installation tree (unless you've tampered with
the DJGPP.ENV file). This should provide reasonable default
values, unless you moved parts of DJGPP to other directories.
4. Letter-case in filenames.
If you run Make on Windows 95, you should be aware of the
letter-case issue. Make is internally case-sensitive, but all
file operations are case-insensitive on Windows 95, so
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
far as Windows is concerned. The underlying DJGPP C library
functions honor the letter-case of the filenames they get from
the OS, except that by default, they down-case 8+3 DOS filenames
which are stored in upper case in the directory and would break
many Makefiles otherwise. (The details of which filenames are
converted to lower case are explained in the DJGPP libc docs,
under the `_preserve_fncase' and `_lfn_gen_short_fname'
functions, but as a thumb rule, any filename that is stored in
upper case in the directory, is a legal DOS 8+3 filename and
doesn't include characters illegal on MSDOS FAT filesystems,
will be automatically down-cased.) User reports that I have
indicate that this default behavior is generally what you'd
expect; however, since support for long filenames in the DJGPP
port of GNU Make is relatively new, your input is most welcome.
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
environment or in the Makefile.
5. DOS-style pathnames.
There are a lot of places throughout the program sources which
make implicit assumptions about the pathname syntax. In
particular, the directories are assumed to be separated by `/',
and any pathname which doesn't begin with a `/' is assumed to be
relative to the current directory. This port attempts to
support DOS-style pathnames which might include the drive letter
and use backslashes instead of forward slashes. However, this
support is not complete; I feel that pursuing this support too
far might break some more important features, particularly if
you use a Unix-style shell (where a backslash is a quote
character). I only consider support of backslashes desirable
because some Makefiles invoke non-DJGPP programs which don't
understand forward slashes. A notable example of such programs
is the standard programs which come with MSDOS. Otherwise, you
are advised to stay away from backslashes whenever possible. In
particular, filename globbing won't work on pathnames with
backslashes, because the GNU `glob' library doesn't support them
(backslash is special in filename wildcards, and I didn't want
to break that).
One feature which *does* work with backslashes is the filename-
related built-in functions such as $(dir), $(notdir), etc.
Drive letters in pathnames are also fully supported.
Bug reports:
-----------
Bugs that are clearly related to the MSDOS/DJGPP port should be
reported first on the comp.os.msdos.djgpp news group (if you cannot
post to Usenet groups, write to the DJGPP mailing list,
<djgpp@delorie.com>, which is an email gateway into the above news
group). For other bugs, please follow the the procedure explained
in 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
browser/editor.
Enjoy,
Eli Zaretskii <eliz@is.elta.co.il>

View File

@@ -1,10 +1,10 @@
Port of GNU make to Windows NT and Windows 95
Port of GNU make to Windows NT and Windows 95
Builds natively with MSVC 2.x or MSVC 4.x compilers.
To build with nmake on Windows NT or Windows 95:
1. Make sure cl.exe is in your %Path%. Example:
set Path=%Path%;c:/msdev/bin
2. Make sure %include% is set to msvc include directory. Example:
@@ -19,7 +19,7 @@ To build with nmake on Windows NT or Windows 95:
There is a bat file (build_w32.bat) for folks who have fear of nmake.
Outputs:
WinDebug/make.exe
@@ -34,18 +34,58 @@ GNU make and sh.exe:
system. If you don't have sh.exe, port falls back to
MSDOS mode for launching programs (via a batch file).
The MSDOS mode style execution has not been tested too
carefully though (I use GNU bash as sh.exe).
carefully though (I use GNU bash as sh.exe).
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
porting effort. Other possibilites are to get the MKS version
of sh.exe or to build your own with a package like
NutCracker (DataFocus) or Portage (Consensys).
There is a version of GNU bash available from Cygnus gnu-win32
porting effort. Other possibilities are to get the MKS version
of sh.exe or to build your own with a package like
NutCracker (DataFocus) or Portage (Consensys).
Tivoli uses a homegrown port of GNU bash which is not (yet)
freely available. It may be available someday, but I am not in control
of this decision nor do I influence it. Sorry!
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:
I verified all functionality with a slightly modified version
@@ -58,12 +98,12 @@ Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
I did not provide a Visual C project file with this port as
the project file would not be considered freely distributable
(or so I think). It is easy enough to create one though if
you know how to use Visual C.
you know how to use Visual C.
I build the program statically to avoid problems locating DLL's
on machines that may not have MSVC runtime installed. If you
prefer, you can change make to build with shared libraries by
changing /MT to /MD in the NMakefile (or build_w32.bat).
changing /MT to /MD in the NMakefile (or build_w32.bat).
Program has not been built under non-Intel architectures (yet).
@@ -71,7 +111,7 @@ Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
Pathnames and white space:
Unlike Unix, WIN32 systems encourage pathnames which
Unlike Unix, Windows 95/NT systems encourage pathnames which
contain white space (e.g. C:\Program Files\). These sorts of pathnames
are legal under Unix too, but are never encouraged. There is
at least one place in make (VPATH/vpath handling) where paths
@@ -80,7 +120,7 @@ Pathnames and white space:
these sorts of paths could be handled. I offer these suggestions
as workarounds:
1. Use 8.3 notation
1. Use 8.3 notation
2. Rename the directory so it does not contain white space.
If you are unhappy with this choice, this is free software
@@ -105,10 +145,17 @@ SAMBA/NTFS/VFAT:
under VFAT. VFAT users may wish to be aware that this port
of make does respect case sensitivity.
Version 3.76 contains some preliminary support for FAT. Make
now tries to work around some difficulties with stat'ing of
files and caching of filenames and directories internally.
There is still a known problem with filenames sometimes being
found to have modification dates in the future which cause make
to complain about the file and exit (remake.c).
Bug reports:
Please submit bugs via the normal bug reporting mechanism
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
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
text files and can be read with a text editor.

View File

@@ -1,114 +0,0 @@
Port of GNU make to Windows NT and Windows 95
Builds natively with MSVC 2.x or MSVC 4.x compilers.
To build with nmake on Windows NT or Windows 95:
1. Make sure cl.exe is in your %Path%. Example:
set Path=%Path%;c:/msdev/bin
2. Make sure %include% is set to msvc include directory. Example:
set include=c:/msdev/include
3. Make sure %lib% is set to msvc lib directory. Example:
set lib=c:/msdev/lib
4. nmake /f NMakefile
There is a bat file (build_w32.bat) for folks who have fear of nmake.
Outputs:
WinDebug/make.exe
WinRel/make.exe
-- Notes/Caveats --
GNU make and sh.exe:
This port prefers you have a working sh.exe somewhere on your
system. If you don't have sh.exe, port falls back to
MSDOS mode for launching programs (via a batch file).
The MSDOS mode style execution has not been tested too
carefully though (I use GNU bash as sh.exe).
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
porting effort. Other possibilites are to get the MKS version
of sh.exe or to build your own with a package like
NutCracker (DataFocus) or Portage (Consensys).
Tivoli uses a homegrown port of GNU bash which is not (yet)
freely available. It may be available someday, but I am not in control
of this decision nor do I influence it. Sorry!
GNU make test suite:
I verified all functionality with a slightly modified version
of make-test-0.4.5 (modifications to get test suite to run
on Windows NT). All tests pass in an environment that includes
sh.exe. Tested on both Windows NT and Windows 95.
Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
I did not provide a Visual C project file with this port as
the project file would not be considered freely distributable
(or so I think). It is easy enough to create one though if
you know how to use Visual C.
I build the program statically to avoid problems locating DLL's
on machines that may not have MSVC runtime installed. If you
prefer, you can change make to build with shared libraries by
changing /MT to /MD in the NMakefile (or build_w32.bat).
Program has not been built under non-Intel architectures (yet).
I have not tried to build with any other compilers than MSVC.
Pathnames and white space:
Unlike Unix, WIN32 systems encourage pathnames which
contain white space (e.g. C:\Program Files\). These sorts of pathnames
are legal under Unix too, but are never encouraged. There is
at least one place in make (VPATH/vpath handling) where paths
containing white space will simply not work. There may be others
too. I chose to not try and port make in such a way so that
these sorts of paths could be handled. I offer these suggestions
as workarounds:
1. Use 8.3 notation
2. Rename the directory so it does not contain white space.
If you are unhappy with this choice, this is free software
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.
SAMBA/NTFS/VFAT:
I have not had any success building the debug version of this
package using SAMBA as my file server. The reason seems to be
related to the way VC++ 4.0 changes the case name of the pdb
filename it is passed on the command line. It seems to change
the name always to to lower case. I contend that
the VC++ compiler should not change the casename of files that
are passed as arguments on the command line. I don't think this
was a problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
The package builds fine on VFAT and NTFS filesystems.
Most all of the development I have done to date has been using
NTFS and long file names. I have not done any considerable work
under VFAT. VFAT users may wish to be aware that this port
of make does respect case sensitivity.
Bug reports:
Please submit bugs via the normal bug reporting mechanism
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
text files and can be read with a text editor.

View File

@@ -1,5 +1,5 @@
This directory contains the VERSION test release of GNU Make.
All bugs reported for previous test releases have been fixed.
This directory contains the %VERSION% release of GNU Make.
All bugs reported for previous releases have been fixed.
Some bugs surely remain.
For general building and installation instructions, see the file INSTALL.
@@ -14,10 +14,16 @@ 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.WIN32 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.
- 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
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.

View File

@@ -192,7 +192,7 @@ 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 Makefile config.h config.status build.sh
-$(RM) -f config.log config.cache
-$(RM) -f TAGS tags
-$(RM) -f make.?? make.??s make.log make.toc make.*aux

51
TODO.private Normal file
View 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.

View File

@@ -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. */
#undef SCCS_GET

19
aclocal.m4 vendored
View File

@@ -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

116
ar.c
View File

@@ -1,5 +1,5 @@
/* 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.
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. */
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));
#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.
An archive-member reference is a name like `lib(member)'.
@@ -40,7 +41,7 @@ ar_name (name)
char *name;
{
char *p = index (name, '('), *end = name + strlen (name) - 1;
if (p == 0 || p == name || *end != ')')
return 0;
@@ -66,111 +67,7 @@ ar_parse_name (name, arname_p, memname_p)
if (memname_p != 0)
*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,
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
@@ -232,13 +129,12 @@ ar_member_date_1 (desc, mem, truncated,
{
return ar_name_equal (name, mem, truncated) ? date : 0;
}
#endif /* !VMS */
/* Set the archive-member NAME's modtime to now. */
#ifdef VMS
int
ar_touch (name)
ar_touch (name)
char *name;
{
error ("touch archive member is not available on VMS");

205
arscan.c
View File

@@ -1,19 +1,19 @@
/* 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
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.
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 Free Software Foundation; either version 2, or (at your option)
any later version.
This program 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.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "make.h"
@@ -25,6 +25,171 @@
#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. */
#ifdef M_UNIX
#undef M_XENIX
@@ -203,7 +368,7 @@ ar_scan (archive, function, arg)
(void) close (desc);
return -2;
}
name[name_len] = 0;
sscanf (member_header.ar_date, "%12ld", &dateval);
@@ -277,7 +442,7 @@ ar_scan (archive, function, arg)
&& name[2] == '/')
{
int namesize = atoi (name + 3);
name = (char *) alloca (namesize + 1);
nread = read (desc, name, namesize);
if (nread != namesize)
@@ -351,7 +516,7 @@ ar_scan (archive, function, arg)
(void) close (desc);
return -2;
}
/* The names are separated by newlines. Some formats have
a trailing slash. Null terminate the strings for
convenience. */
@@ -365,7 +530,7 @@ ar_scan (archive, function, arg)
clear[-1] = '\0';
}
}
is_namemap = 0;
}
@@ -379,6 +544,7 @@ ar_scan (archive, function, arg)
close (desc);
return 0;
}
#endif /* !VMS */
/* Return nonzero iff NAME matches MEM.
If TRUNCATED is nonzero, MEM may be truncated to
@@ -426,7 +592,7 @@ ar_name_equal (name, mem, truncated)
}
#else /* AIX or APOLLO. */
#ifndef VMS
if (truncated)
{
#ifdef AIAMAG
@@ -435,7 +601,7 @@ ar_name_equal (name, mem, truncated)
#else
struct ar_hdr hdr;
return !strncmp (name, mem,
sizeof (hdr.ar_name) -
sizeof (hdr.ar_name) -
#if !defined (__hpux) && !defined (cray)
1
#else
@@ -444,12 +610,14 @@ ar_name_equal (name, mem, truncated)
);
#endif
}
#endif /* !VMS */
return !strcmp (name, mem);
#endif
}
#ifndef VMS
/* ARGSUSED */
static long int
ar_member_pos (desc, mem, truncated,
@@ -532,6 +700,7 @@ ar_member_touch (arname, memname)
errno = i;
return -3;
}
#endif
#ifdef TEST

View File

@@ -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/libglob.a 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

View File

@@ -2,9 +2,9 @@
# Shell script to build GNU Make in the absence of any `make' program.
# @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.
#
#
# 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)
@@ -14,7 +14,7 @@
# 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.

View File

@@ -1,136 +1,137 @@
set make=gnumake
cd w32\subproc
echo "Creating the subproc library"
%ComSpec% /c build.bat
cd ..\..
del link.dbg link.rel
del config.h
copy config.h.WIN32 config.h
copy config.h.W32 config.h
echo off
echo "Creating GNU make 3.74 for Windows NT"
echo "Creating GNU make for Windows 95/NT"
echo on
if not exist .\WinDebug\nul mkdir .\WinDebug
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.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 off
echo "Linking WinDebug/make374.exe"
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
echo "Linking WinDebug/%make%.exe"
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe @link.dbg
if not exist .\WinDebug/make374.exe echo "WinDebug build failed"
if exist .\WinDebug/make374.exe echo "WinDebug build succeeded!"
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
if not exist .\WinRel\nul mkdir .\WinRel
echo on
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.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 off
echo "Linking WinRel/make374.exe"
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
echo "Linking WinRel/%make%.exe"
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe @link.rel
if not exist .\WinRel/make374.exe echo "WinRel build failed"
if exist .\WinRel/make374.exe echo "WinRel build succeeded!"
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
echo on

View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -369,17 +369,25 @@ RETSIGTYPE
fatal_error_signal (sig)
int sig;
{
#if defined(__MSDOS__) || defined(_AMIGA)
#ifdef __MSDOS__
extern int dos_status, dos_command_running;
if (dos_command_running)
{
/* That was the child who got the signal, not us. */
dos_status |= (sig << 8);
return;
}
remove_intermediates (1);
exit (1);
#else /* not __MSDOS__ */
#ifdef _AMIGA
remove_intermediates (1);
if (sig == SIGINT)
fputs ("*** Break.\n", stderr);
exit (10);
#else
exit (1);
#endif
#else /* Not MSDOS. */
#else /* not Amiga */
handling_fatal_signal = 1;
/* Set the handling for this signal to the default.
@@ -445,7 +453,8 @@ fatal_error_signal (sig)
will be unblocked when we return and arrive then to kill us. */
if (kill (getpid (), sig) < 0)
pfatal_with_name ("kill");
#endif /* MSDOS. */
#endif /* not Amiga */
#endif /* not __MSDOS__ */
}
/* Delete FILE unless it's precious or not actually a file (phony),

View File

@@ -1,272 +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
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/libglob.a \
$(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/libglob.a: 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 --infodir=$(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.

View File

@@ -32,6 +32,9 @@
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
@@ -159,6 +162,12 @@
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define to the name of the SCCS `get' command. */
#define SCCS_GET "get"

View File

@@ -34,6 +34,9 @@
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H 1 */
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
@@ -111,7 +114,7 @@
/* #undef NO_MINUS_C_MINUS_O */
/* 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
with this defined. */
@@ -150,7 +153,7 @@
/* #undef SYS_SIGLIST_DECLARED */
/* Define to `int' if <sys/types.h> doesn't define. */
#define uid_t int
/* #undef uid_t */
/* Define for Encore UMAX. */
/* #undef UMAX */
@@ -159,6 +162,12 @@
instead of <sys/cpustats.h>. */
/* #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. */
/* #undef vfork */
@@ -287,6 +296,6 @@
#define PARAMS(protos) protos
#else /* Not C++ or ANSI C. */
#undef PARAMS
#define PARAMS(protos) ()
#define PARAMS(protos) ()
#endif /* C++ or ANSI C. */

View File

@@ -34,6 +34,10 @@
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
#define HAVE_MEMMOVE 1
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
@@ -172,6 +176,12 @@
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define to the name of the SCCS `get' command. */
#undef SCCS_GET
#define SCCS_GET "echo no sccs get"

View File

@@ -1,289 +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 gid_t int
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
#define 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 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 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 HAVE_STRCOLL
/* Define if your struct stat has st_rdev. */
#undef HAVE_ST_RDEV
#define HAVE_ST_RDEV
/* Define if you have the strftime function. */
#undef HAVE_STRFTIME
#define 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 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 HAVE_UTIME_NULL
/* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
#define 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 pid_t int
/* 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 _POSIX_SOURCE
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
#define RETSIGTYPE void
/* 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 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 uid_t int
/* 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 SCCS_GET "echo no 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 HAVE_DUP2
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
#define HAVE_GETCWD
/* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS
/* Define if you have the mktemp function. */
#undef HAVE_MKTEMP
#define 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 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 HAVE_DIRENT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
#define HAVE_FCNTL_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
#define 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 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 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 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 sun library (-lsun). */
#undef HAVE_LIBSUN

View File

@@ -1,264 +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 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 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 sun library (-lsun). */
#undef HAVE_LIBSUN

View File

@@ -1,68 +1,24 @@
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
#define INCLUDEDIR "c:/djgpp/include"
#define LIBDIR "c:/djgpp/lib"
/* Many things are defined already by a system header. */
#include <sys/config.h>
/* Define if you have dirent.h. */
#define HAVE_DIRENT_H
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Define if you have the strcoll function and it is properly defined. */
#define HAVE_STRCOLL
/* Version of this package (needed by automake) */
#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>. */
#define SYS_SIGLIST_DECLARED
/* Define if you have getdtablesize. */
#define HAVE_GETDTABLESIZE
/* Define if you have dup2. */
#define HAVE_DUP2
/* 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 getcwd. */
#define HAVE_GETCWD
/* Define NSIG. */
#define NSIG SIGMAX
/* Define if you have sigsetmask. */
#define HAVE_SIGSETMASK
/* 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 HAVE_SIGSETMASK 1
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H
#define HAVE_MEMORY_H 1
/* Define if you have the `strerror' function. */
#define HAVE_STRERROR
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
#define SCCS_GET "get"

3249
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,44 +1,44 @@
@echo off
echo Configuring MAKE for go32
rem This batch file assumes a unix-type "sed" program
echo Configuring MAKE for DJGPP
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.
echo # Makefile generated by "configure.bat"> Makefile
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
if exist config.sed del config.sed
:SrcDone
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
update %XSRC%/configh.dos ./config.h
echo "s/@srcdir@/./ ">> config.sed
echo "s/@CC@/gcc/ ">> config.sed
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
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/^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
rem Do they have Make?
redir -o junk.$$$ -eo make -n -f NUL
rem REDIR will return 1 if it cannot run Make.
rem If it can run Make, it will usually return 2,
rem but 0 is also OK with us.
if errorlevel 2 goto MakeOk
if not errorlevel 1 goto MakeOk
if exist junk.$$$ del junk.$$$
echo No Make program found--use DOSBUILD.BAT to build Make.
goto End
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
rem They do have Make. Generate the Makefile.
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
sed -f config2.sed Makefile.in >> Makefile
del config.sed
del config2.sed
:MakeOk
del junk.$$$
update %XSRC%/Makefile.DOS ./Makefile
echo Done.
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
goto End
cd glob
call configure
cd ..
:SmallEnv
echo Your environment is too small. Please enlarge it and run me again.
:End
set XRSC=

View File

@@ -1,14 +1,21 @@
dnl Process this file with autoconf to produce a configure script.
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_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
AM_INIT_AUTOMAKE(make, 3.76.1)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob)
AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
dnl Regular configure stuff
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_CPP dnl Later checks need this.
AC_ARG_PROGRAM
AC_AIX
AC_ISC_POSIX
AC_MINIX
@@ -38,7 +45,7 @@ changequote([,])dnl
fi
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
AC_CHECK_FUNCS(psignal mktemp \
AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
dup2 getcwd sigsetmask getgroups setlinebuf \
seteuid setegid setreuid setregid strerror strsignal)
AC_CHECK_SYMBOL(sys_siglist)
@@ -46,6 +53,7 @@ AC_FUNC_ALLOCA
AC_FUNC_VFORK
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_GETLOADAVG
AC_CHECK_LIB(kstat, kstat_open)
AC_FUNC_STRCOLL
# Check out the wait reality.
@@ -106,10 +114,7 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
fi
rm -f s.conftest conftoast
AC_OUTPUT(Makefile build.sh, [
# Makefile uses this timestamp file to know when to remake Makefile,
# build.sh, and glob/Makefile.
touch stamp-config])
AC_OUTPUT(Makefile build.sh)
dnl Local Variables:
dnl comment-start: "dnl "

192
dir.c
View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -44,7 +44,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define NAMLEN(d) _D_NAMLEN(d)
#endif
#if (defined (POSIX) || defined (WIN32)) && !defined (__GNU_LIBRARY__)
#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
#define REAL_DIR_ENTRY(dp) 1
@@ -56,9 +56,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef __MSDOS__
#include <ctype.h>
#if (DJGPP > 1)
#include <libc/dosio.h>
int __opendir_flags = 0;
#include <fcntl.h>
/* If it's MSDOS that doesn't have _USE_LFN, disable LFN support. */
#ifndef _USE_LFN
#define _USE_LFN 0
#endif
static char *
@@ -69,14 +71,11 @@ dosify (filename)
char *df;
int i;
#if (DJGPP > 1)
if (_USE_LFN)
/* Using long file names; do no transformation. */
if (filename == 0 || _USE_LFN)
return filename;
#endif
if (filename == 0)
return 0;
/* FIXME: what about filenames which violate
8+3 constraints, like "config.h.in", or ".emacs"? */
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
return filename;
@@ -106,7 +105,7 @@ dosify (filename)
}
#endif /* __MSDOS__ */
#ifdef WIN32
#ifdef WINDOWS32
#include "pathstuff.h"
#endif
@@ -180,13 +179,16 @@ vmsstat_dir (name, st)
{
*s++ = 0;
st->st_dev = (char *)vms_hash (name);
h = vms_hash (s);
*(s-1) = ':';
}
else
{
st->st_dev = 0;
s = name;
h = vms_hash (s);
}
h = vms_hash (s);
st->st_ino[0] = h & 0xff;
st->st_ino[1] = h & 0xff00;
st->st_ino[2] = h >> 16;
@@ -206,9 +208,9 @@ struct directory_contents
struct directory_contents *next;
dev_t dev; /* Device and inode numbers of this dir. */
#ifdef WIN32
#ifdef WINDOWS32
/*
* Inode means nothing on WIN32. Even file key information is
* Inode means nothing on WINDOWS32. Even file key information is
* unreliable because it is random per file open and undefined
* for remote filesystems. The most unique attribute I can
* come up with is the fully qualified name of the directory. Beware
@@ -217,13 +219,17 @@ struct directory_contents
*/
char *path_key;
int mtime; /* controls check for stale directory cache */
int fs_flags; /* FS_FAT, FS_NTFS, ... */
#define FS_FAT 0x1
#define FS_NTFS 0x2
#define FS_UNKNOWN 0x4
#else
#ifdef VMS
ino_t ino[3];
#else
ino_t ino;
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
struct dirfile **files; /* Files in this directory. */
DIR *dirstream; /* Stream reading this directory. */
};
@@ -279,8 +285,13 @@ find_directory (name)
register unsigned int hash = 0;
register char *p;
register struct directory *dir;
#ifdef WIN32
#ifdef WINDOWS32
char* w32_path;
char fs_label[BUFSIZ];
char fs_type[BUFSIZ];
long fs_serno;
long fs_flags;
long fs_len;
#endif
#ifdef VMS
if ((*name == '.') && (*(name+1) == 0))
@@ -327,7 +338,7 @@ find_directory (name)
struct directory_contents *dc;
#ifdef WIN32
#ifdef WINDOWS32
w32_path = w32ify(name, 1);
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
#else
@@ -343,7 +354,7 @@ find_directory (name)
hash %= DIRECTORY_BUCKETS;
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
#ifdef WIN32
#ifdef WINDOWS32
if (!strcmp(dc->path_key, w32_path))
#else
if (dc->dev == st.st_dev
@@ -354,7 +365,7 @@ find_directory (name)
#else
&& dc->ino == st.st_ino)
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
break;
if (dc == 0)
@@ -366,9 +377,27 @@ find_directory (name)
/* Enter it in the contents hash table. */
dc->dev = st.st_dev;
#ifdef WIN32
#ifdef WINDOWS32
dc->path_key = strdup(w32_path);
dc->mtime = st.st_mtime;
/*
* NTFS is the only WINDOWS32 filesystem that bumps mtime
* on a directory when files are added/deleted from
* a directory.
*/
w32_path[3] = '\0';
if (GetVolumeInformation(w32_path,
fs_label, sizeof (fs_label),
&fs_serno, &fs_len,
&fs_flags, fs_type, sizeof (fs_type)) == FALSE)
dc->fs_flags = FS_UNKNOWN;
else if (!strcmp(fs_type, "FAT"))
dc->fs_flags = FS_FAT;
else if (!strcmp(fs_type, "NTFS"))
dc->fs_flags = FS_NTFS;
else
dc->fs_flags = FS_UNKNOWN;
#else
#ifdef VMS
dc->ino[0] = st.st_ino[0];
@@ -377,17 +406,10 @@ find_directory (name)
#else
dc->ino = st.st_ino;
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
dc->next = directories_contents[hash];
directories_contents[hash] = dc;
#if defined (__MSDOS__) && (DJGPP > 1)
if (_USE_LFN)
/* We are using long filenames, so tell opendir not
to mess with them. */
__opendir_flags = __OPENDIR_PRESERVE_CASE;
#endif
dc->dirstream = opendir (name);
if (dc->dirstream == 0)
{
@@ -432,7 +454,7 @@ dir_contents_file_exists_p (dir, filename)
register char *p;
register struct dirfile *df;
register struct dirent *d;
#ifdef WIN32
#ifdef WINDOWS32
struct stat st;
int rehash = 0;
#endif
@@ -483,11 +505,16 @@ dir_contents_file_exists_p (dir, filename)
if (dir->dirstream == 0)
{
#ifdef WIN32
/* Check to see if directory has changed since last read */
#ifdef WINDOWS32
/*
* Check to see if directory has changed since last read. FAT
* filesystems force a rehash always as mtime does not change
* on directories (ugh!).
*/
if (dir->path_key &&
stat(dir->path_key, &st) == 0 &&
st.st_mtime > dir->mtime) {
(dir->fs_flags & FS_FAT ||
(stat(dir->path_key, &st) == 0 &&
st.st_mtime > dir->mtime))) {
/* reset date stamp to show most recent re-process */
dir->mtime = st.st_mtime;
@@ -519,7 +546,7 @@ dir_contents_file_exists_p (dir, filename)
for (i = 0; i < len; ++i)
HASHI (newhash, d->d_name[i]);
newhash %= DIRFILE_BUCKETS;
#ifdef WIN32
#ifdef WINDOWS32
/*
* If re-reading a directory, check that this file isn't already
* in the cache.
@@ -543,7 +570,7 @@ dir_contents_file_exists_p (dir, filename)
dir->files[newhash] = df;
df->name = savestring (d->d_name, len);
df->impossible = 0;
#ifdef WIN32
#ifdef WINDOWS32
}
#endif
/* Check if the name matches the one we're searching for. */
@@ -599,12 +626,16 @@ file_exists_p (name)
return dir_file_exists_p ("[]", name);
#else /* !VMS */
dirend = rindex (name, '/');
#ifdef WIN32
if (!dirend)
dirend = rindex(name, '\\');
#endif /* WIN32 */
if (dirend == 0)
return dir_file_exists_p (".", name);
#if defined (WINDOWS32) || defined (__MSDOS__)
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
char *bslash = rindex(name, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file" is unhandled. But I don't think
such names can happen here. */
}
#endif /* WINDOWS32 || __MSDOS__ */
if (dirend == 0)
#ifndef _AMIGA
return dir_file_exists_p (".", name);
@@ -613,9 +644,14 @@ file_exists_p (name)
#endif /* AMIGA */
#endif /* VMS */
dirname = (char *) alloca (dirend - name + 1);
bcopy (name, dirname, dirend - name);
dirname[dirend - name] = '\0';
if (dirend == name)
dirname = "/";
else
{
dirname = (char *) alloca (dirend - name + 1);
bcopy (name, dirname, dirend - name);
dirname[dirend - name] = '\0';
}
return dir_file_exists_p (dirname, dirend + 1);
}
@@ -640,6 +676,16 @@ file_impossible (filename)
dir = find_directory ("[]");
#else
dirend = rindex (p, '/');
#if defined (WINDOWS32) || defined (__MSDOS__)
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
char *bslash = rindex(p, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file" is unhandled. But I don't think
such names can happen here. */
}
#endif /* WINDOWS32 or __MSDOS__ */
if (dirend == 0)
#ifdef _AMIGA
dir = find_directory ("");
@@ -649,9 +695,15 @@ file_impossible (filename)
#endif /* VMS */
else
{
char *dirname = (char *) alloca (dirend - p + 1);
bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0';
char *dirname;
if (dirend == p)
dirname = "/";
else
{
dirname = (char *) alloca (dirend - p + 1);
bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0';
}
dir = find_directory (dirname);
filename = p = dirend + 1;
}
@@ -666,10 +718,10 @@ file_impossible (filename)
structure for it, but leave it out of the contents hash table. */
dir->contents = (struct directory_contents *)
xmalloc (sizeof (struct directory_contents));
#ifdef WIN32
#ifdef WINDOWS32
dir->contents->path_key = NULL;
dir->contents->mtime = 0;
#else /* WIN32 */
#else /* WINDOWS32 */
#ifdef VMS
dir->contents->dev = 0;
dir->contents->ino[0] = dir->contents->ino[1] =
@@ -677,7 +729,7 @@ file_impossible (filename)
#else
dir->contents->dev = dir->contents->ino = 0;
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
dir->contents->files = 0;
dir->contents->dirstream = 0;
}
@@ -718,10 +770,16 @@ file_impossible_p (filename)
dir = find_directory ("[]")->contents;
#else
dirend = rindex (filename, '/');
#ifdef WIN32
if (!dirend)
dirend = rindex (filename, '\\');
#endif /* WIN32 */
#if defined (WINDOWS32) || defined (__MSDOS__)
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
char *bslash = rindex(filename, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file" is unhandled. But I don't think
such names can happen here. */
}
#endif /* WINDOWS32 || __MSDOS__ */
if (dirend == 0)
#ifdef _AMIGA
dir = find_directory ("")->contents;
@@ -731,9 +789,15 @@ file_impossible_p (filename)
#endif /* VMS */
else
{
char *dirname = (char *) alloca (dirend - filename + 1);
bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0';
char *dirname;
if (dirend == filename)
dirname = "/";
else
{
dirname = (char *) alloca (dirend - filename + 1);
bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0';
}
dir = find_directory (dirname)->contents;
p = filename = dirend + 1;
}
@@ -791,10 +855,10 @@ print_dir_data_base ()
if (dir->contents == 0)
printf ("# %s: could not be stat'd.\n", dir->name);
else if (dir->contents->files == 0)
#ifdef WIN32
#ifdef WINDOWS32
printf ("# %s (key %s, mtime %d): could not be opened.\n",
dir->name, dir->contents->path_key,dir->contents->mtime);
#else /* WIN32 */
#else /* WINDOWS32 */
#ifdef VMS
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
dir->name, dir->contents->dev,
@@ -805,7 +869,7 @@ print_dir_data_base ()
dir->name, (long int) dir->contents->dev,
(long int) dir->contents->ino);
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
else
{
register unsigned int f = 0, im = 0;
@@ -817,10 +881,10 @@ print_dir_data_base ()
++im;
else
++f;
#ifdef WIN32
#ifdef WINDOWS32
printf ("# %s (key %s, mtime %d): ",
dir->name, dir->contents->path_key, dir->contents->mtime);
#else /* WIN32 */
#else /* WINDOWS32 */
#ifdef VMS
printf ("# %s (device %d, inode [%d,%d,%d]): ",
dir->name, dir->contents->dev,
@@ -830,7 +894,7 @@ print_dir_data_base ()
printf ("# %s (device %d, inode %d): ",
dir->name, dir->contents->dev, dir->contents->ino);
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
if (f == 0)
fputs ("No", stdout);
else

42
dosbuild.bat Normal file
View File

@@ -0,0 +1,42 @@
@echo Building Make for MSDOS
@rem Echo ON so they will see what is going on.
@echo on
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 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 misc.c -o misc.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.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 rule.c -o rule.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o
@cd glob
@if exist libglob.a del libglob.a
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o
ar rv libglob.a glob.o fnmatch.o
@echo off
cd ..
echo commands.o > respf.$$$
for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
echo glob/libglob.a >> respf.$$$
@echo Linking...
@echo on
gcc -o make.new @respf.$$$
@if exist make.exe echo Make.exe is now built!
@if not exist make.exe echo Make.exe build failed...
@if exist make.exe del respf.$$$

52
file.c
View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -87,7 +87,7 @@ lookup_file (name)
for (f = files[hashval]; f != 0; f = f->next)
{
if (strieq (f->name, name))
if (strieq (f->hname, name))
{
return f;
}
@@ -128,7 +128,7 @@ enter_file (name)
hashval %= FILE_BUCKETS;
for (f = files[hashval]; f != 0; f = f->next)
if (strieq (f->name, name))
if (strieq (f->hname, name))
break;
if (f != 0 && !f->double_colon)
@@ -141,7 +141,7 @@ enter_file (name)
new = (struct file *) xmalloc (sizeof (struct file));
bzero ((char *) new, sizeof (struct file));
new->name = name;
new->name = new->hname = name;
new->update_status = -1;
if (f == 0)
@@ -162,16 +162,16 @@ enter_file (name)
return new;
}
/* Rename FILE to NAME. This is not as simple as resetting
the `name' member, since it must be put in a new hash bucket,
/* Rehash FILE to NAME. This is not as simple as resetting
the `hname' 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)
rehash_file (file, name)
register struct file *file;
char *name;
{
char *oldname = file->name;
char *oldname = file->hname;
register unsigned int oldhash;
register char *n;
@@ -187,6 +187,23 @@ rename_file (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
file_hash_enter (file, name, oldhash, oldname)
register struct file *file;
@@ -208,9 +225,12 @@ file_hash_enter (file, name, oldhash, oldname)
/* Look for an existing file under the new name. */
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
if (strieq (oldfile->name, name))
if (strieq (oldfile->hname, name))
break;
/* If the old file is the same as the new file, something's wrong. */
assert (oldfile != file);
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
{
/* Remove FILE from its hash bucket. */
@@ -228,9 +248,9 @@ file_hash_enter (file, name, oldhash, oldname)
/* Give FILE its new name. */
file->name = name;
file->hname = name;
for (f = file->double_colon; f != 0; f = f->prev)
f->name = name;
f->hname = name;
if (oldfile == 0)
{
@@ -319,6 +339,7 @@ in favor of those for `%s'.",
MERGE (is_target);
MERGE (cmd_target);
MERGE (phony);
MERGE (ignore_vpath);
#undef MERGE
file->renamed = oldfile;
@@ -520,9 +541,7 @@ print_file (f)
struct file *f;
{
register struct dep *d;
#ifdef VMS
extern char *cvt_time PARAMS ((unsigned long));
#endif
putchar ('\n');
if (!f->is_target)
puts ("# Not a target:");
@@ -558,13 +577,8 @@ print_file (f)
else if (f->last_mtime == (time_t) -1)
puts ("# File does not exist.");
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",
ctime (&f->last_mtime), (long int) f->last_mtime);
#endif
printf ("# File has%s been updated.\n",
f->updated ? "" : " not");
switch (f->command_state)

View File

@@ -1,5 +1,5 @@
/* Definition of target file data structures 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -24,6 +24,8 @@ struct file
{
struct file *next;
char *name;
char *hname; /* Hashed filename */
char *vpath; /* VPATH/vpath pathname */
struct dep *deps;
struct commands *cmds; /* Commands to execute for this target. */
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
@@ -77,6 +79,7 @@ struct file
unsigned int secondary:1;
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
this target cannot be remade. */
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */
};
/* Number of intermediate files entered. */
@@ -88,7 +91,7 @@ extern struct file *default_goal_file, *suffix_file, *default_file;
extern struct file *lookup_file (), *enter_file ();
extern void remove_intermediates (), snap_deps ();
extern void rename_file (), file_hash_enter ();
extern void rename_file (), rehash_file (), file_hash_enter ();
extern void set_command_state ();
@@ -111,10 +114,12 @@ extern time_t f_mtime ();
targets, which need to be considered newer than anything that depends on
them, even if said dependents' modtimes are in the future.
NOTE: This assumes 32-bit `time_t's, but I cannot think of a portable way
to produce the largest representable integer of a given signed type. */
#define NEW_MTIME ((time_t) 0x7fffffff)
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) \
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */

View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -23,14 +23,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "job.h"
#include "commands.h"
#ifdef __MSDOS__
#include <process.h>
#include <fcntl.h>
#endif
#ifdef _AMIGA
#include "amiga.h"
#endif
#ifdef WIN32
#ifdef WINDOWS32
#include <windows.h>
#include <io.h>
#include "sub_proc.h"
@@ -164,14 +160,14 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
if (len < pattern_prepercent_len + pattern_postpercent_len)
fail = 1;
/* Does the prefix match? */
/* Does the prefix match? */
if (!fail && pattern_prepercent_len > 0
&& (*t != *pattern
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
fail = 1;
/* Does the suffix match? */
/* Does the suffix match? */
if (!fail && pattern_postpercent_len > 0
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|| t[len - pattern_postpercent_len] != pattern_percent[1]
@@ -235,6 +231,7 @@ enum function
function_firstword,
function_word,
function_words,
function_wordlist,
function_findstring,
function_strip,
function_join,
@@ -271,6 +268,7 @@ static struct
{ "firstword", 9, function_firstword },
{ "word", 4, function_word },
{ "words", 5, function_words },
{ "wordlist", 8, function_wordlist },
{ "findstring", 10, function_findstring },
{ "strip", 5, function_strip },
{ "join", 4, function_join },
@@ -320,12 +318,12 @@ int shell_function_pid = 0, shell_function_completed;
The output is written into VARIABLE_BUFFER starting at O. */
/* Note this absorbs a semicolon and is safe to use in conditionals. */
#define BADARGS(func) \
if (reading_filename != 0) \
makefile_fatal (reading_filename, *reading_lineno_ptr, \
"insufficient arguments to function `%s'", \
func); \
else \
#define BADARGS(func) \
if (reading_filename != 0) \
makefile_fatal (reading_filename, *reading_lineno_ptr, \
"insufficient arguments to function `%s'", \
func); \
else \
fatal ("insufficient arguments to function `%s'", func)
static char *
@@ -336,7 +334,7 @@ expand_function (o, function, text, end)
char *end;
{
char *p, *p2, *p3;
unsigned int i, len;
unsigned int i, j, len;
int doneany = 0;
int count;
char endparen = *end, startparen = *end == ')' ? '(' : '{';
@@ -350,13 +348,16 @@ expand_function (o, function, text, end)
#ifndef VMS /* not supported for vms yet */
case function_shell:
{
#ifdef WIN32
SECURITY_ATTRIBUTES saAttr;
HANDLE hIn;
HANDLE hErr;
HANDLE hChildOutRd;
HANDLE hChildOutWr;
HANDLE hProcess;
#ifdef WINDOWS32
SECURITY_ATTRIBUTES saAttr;
HANDLE hIn;
HANDLE hErr;
HANDLE hChildOutRd;
HANDLE hChildOutWr;
HANDLE hProcess;
#endif
#ifdef __MSDOS__
FILE *fpipe;
#endif
char **argv;
char *error_prefix;
@@ -369,15 +370,17 @@ expand_function (o, function, text, end)
/* Expand the command line. */
text = expand_argument (text, end);
#ifndef __MSDOS__
/* Construct the argument list. */
argv = construct_command_argv (text,
(char **) NULL, (struct file *) 0);
if (argv == 0)
break;
#endif
#ifndef _AMIGA
/* Using a target environment for `shell' loses in cases like:
export var = $(shell echo foobie)
export var = $(shell echo foobie)
because target_environment hits a loop trying to expand $(var)
to put it in the environment. This is even more confusing when
var was not explicitly exported, but just appeared in the
@@ -388,7 +391,7 @@ expand_function (o, function, text, end)
/* Construct the environment. */
envp = target_environment ((struct file *) 0);
#endif
#endif /* Not Amiga. */
#endif /* Not Amiga. */
/* For error messages. */
if (reading_filename != 0)
@@ -400,81 +403,129 @@ expand_function (o, function, text, end)
else
error_prefix = "";
#if !defined(__MSDOS__) && !defined(_AMIGA)
# ifdef WIN32
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
#ifndef _AMIGA
# ifdef WINDOWS32
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
if (DuplicateHandle(GetCurrentProcess(),
GetStdHandle(STD_INPUT_HANDLE),
GetCurrentProcess(),
&hIn,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE) {
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
GetLastError());
}
if (DuplicateHandle(GetCurrentProcess(),
GetStdHandle(STD_ERROR_HANDLE),
GetCurrentProcess(),
&hErr,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE) {
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
GetLastError());
}
if (DuplicateHandle(GetCurrentProcess(),
GetStdHandle(STD_INPUT_HANDLE),
GetCurrentProcess(),
&hIn,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE) {
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
GetLastError());
}
if (DuplicateHandle(GetCurrentProcess(),
GetStdHandle(STD_ERROR_HANDLE),
GetCurrentProcess(),
&hErr,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE) {
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
GetLastError());
}
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
if (!hProcess)
fatal("expand_function: process_init_fd() failed\n");
else
process_register(hProcess);
if (!hProcess)
fatal("expand_function: process_init_fd() failed\n");
else
process_register(hProcess);
/* make sure that CreateProcess() has Path it needs */
sync_Path_environment();
/* make sure that CreateProcess() has Path it needs */
sync_Path_environment();
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
pid = (int) hProcess;
else
fatal("expand_function: unable to launch process (e=%d)\n",
process_last_err(hProcess));
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
pid = (int) hProcess;
else
fatal("expand_function: unable to launch process (e=%d)\n",
process_last_err(hProcess));
/* set up to read data from child */
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
/* set up to read data from child */
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
/* this will be closed almost right away */
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
# else /* WIN32 */
/* this will be closed almost right away */
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
# else /* WINDOWS32 */
# ifdef __MSDOS__
{
/* MSDOS can't fork, but it has `popen'.
(Bwt, why isn't `popen' used in all the versions?) */
struct variable *sh = lookup_variable ("SHELL", 5);
int e;
extern int dos_command_running, dos_status;
/* Make sure not to bother processing an empty line. */
while (isblank (*text))
++text;
if (*text == '\0')
break;
if (sh)
{
char buf[PATH_MAX + 7];
/* This makes sure $SHELL value is used by $(shell), even
though the target environment is not passed to it. */
sprintf (buf, "SHELL=%s", sh->value);
putenv (buf);
}
e = errno;
errno = 0;
dos_command_running = 1;
dos_status = 0;
fpipe = popen (text, "rt");
dos_command_running = 0;
if (!fpipe || dos_status)
{
pipedes[0] = -1;
pid = -1;
if (dos_status)
errno = EINTR;
else if (errno == 0)
errno = ENOMEM;
shell_function_completed = -1;
}
else
{
pipedes[0] = fileno (fpipe);
pid = 42;
errno = e;
shell_function_completed = 1;
}
}
if (pipedes[0] < 0)
# else /* ! __MSDOS__ */
if (pipe (pipedes) < 0)
# endif /* __MSDOS__ */
{
perror_with_name (error_prefix, "pipe");
break;
}
# ifndef __MSDOS__
pid = vfork ();
if (pid < 0)
perror_with_name (error_prefix, "fork");
else if (pid == 0)
child_execute_job (0, pipedes[1], argv, envp);
else
# endif /* WIN32 */
# endif /* ! __MSDOS__ */
# endif /* WINDOWS32 */
{
/* We are the parent. */
char *buffer;
unsigned int maxlen;
int cc;
/* Free the storage only the child needed. */
free (argv[0]);
free ((char *) argv);
#if 0
for (i = 0; envp[i] != 0; ++i)
free (envp[i]);
@@ -483,17 +534,22 @@ expand_function (o, function, text, end)
/* Record the PID for reap_children. */
shell_function_pid = pid;
#ifndef __MSDOS__
shell_function_completed = 0;
/* Free the storage only the child needed. */
free (argv[0]);
free ((char *) argv);
/* Close the write side of the pipe. */
(void) close (pipedes[1]);
#endif
/* Set up and read from the pipe. */
maxlen = 200;
buffer = (char *) xmalloc (maxlen + 1);
/* Close the write side of the pipe. */
(void) close (pipedes[1]);
/* Read from the pipe until it gets EOF. */
i = 0;
do
@@ -516,7 +572,12 @@ expand_function (o, function, text, end)
#endif
/* Close the read side of the pipe. */
#ifdef __MSDOS__
if (fpipe)
(void) pclose (fpipe);
#else
(void) close (pipedes[0]);
#endif
/* Loop until child_handler sets shell_function_completed
to the status of our child shell. */
@@ -545,85 +606,41 @@ expand_function (o, function, text, end)
if (i > 0)
{
if (buffer[i - 1] == '\n')
buffer[--i] = '\0';
{
if (i > 1 && buffer[i - 2] == '\r')
--i;
buffer[--i] = '\0';
}
else
buffer[i] = '\0';
p = buffer;
while ((p = index (p, '\n')) != 0)
*p++ = ' ';
for (p2=p; *p != '\0'; ++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);
}
}
free (buffer);
}
#else /* MSDOS or Amiga */
#ifndef _AMIGA
{
/* MS-DOS can't do fork, but it can do spawn. However, this
means that we don't have an opportunity to reopen stdout to
trap it. Thus, we save our own stdout onto a new descriptor
and dup a temp file's descriptor onto our stdout temporarily.
After we spawn the shell program, we dup our own stdout back
to the stdout descriptor. The buffer reading is the same as
above, except that we're now reading from a file. */
int save_stdout;
int child_stdout;
char tmp_output[FILENAME_MAX];
FILE *child_stream;
unsigned int maxlen = 200;
int cc;
char *buffer;
strcpy (tmp_output, "shXXXXXX");
mktemp (tmp_output);
child_stdout = open (tmp_output,
O_WRONLY|O_CREAT|O_TRUNC|O_TEXT, 0644);
save_stdout = dup (1);
dup2 (child_stdout, 1);
spawnvp (P_WAIT, argv[0], argv);
dup2 (save_stdout, 1);
close (child_stdout);
close (save_stdout);
child_stdout = open (tmp_output, O_RDONLY|O_TEXT, 0644);
buffer = xmalloc (maxlen);
i = 0;
do
{
if (i == maxlen)
{
maxlen += 512;
buffer = (char *) xrealloc (buffer, maxlen + 1);
}
cc = read (child_stdout, &buffer[i], maxlen - i);
if (cc > 0)
i += cc;
} while (cc > 0);
close (child_stdout);
unlink (tmp_output);
if (i > 0)
{
if (buffer[i - 1] == '\n')
buffer[--i] = '\0';
else
buffer[i] = '\0';
p = buffer;
while ((p = index (p, '\n')) != 0)
*p++ = ' ';
o = variable_buffer_output (o, buffer, i);
}
free (buffer);
}
#else /* Amiga */
#else /* Amiga */
{
/* Amiga can't fork nor spawn, but I can start a program with
redirection of my choice. The rest is the same as above. */
redirection of my choice. However, this means that we
don't have an opportunity to reopen stdout to trap it. Thus,
we save our own stdout onto a new descriptor and dup a temp
file's descriptor onto our stdout temporarily. After we
spawn the shell program, we dup our own stdout back to the
stdout descriptor. The buffer reading is the same as above,
except that we're now reading from a file. */
#include <dos/dos.h>
#include <proto/dos.h>
@@ -695,8 +712,7 @@ expand_function (o, function, text, end)
}
free (buffer);
}
#endif /* Not Amiga. */
#endif /* MSDOS or Amiga. */
#endif /* Not Amiga. */
free (text);
break;
@@ -1046,8 +1062,15 @@ expand_function (o, function, text, end)
text = expand_argument (text, end);
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, " ", 1);
doneany = 1;
@@ -1194,6 +1217,91 @@ index argument");
free (text);
break;
case function_wordlist:
/* Get two comma-separated arguments and expand each one. */
count = 0;
for (p = text; p < end; ++p)
{
if (*p == startparen)
++count;
else if (*p == endparen)
--count;
else if (*p == ',' && count <= 0)
break;
}
if (p == end)
BADARGS ("wordlist");
text = expand_argument (text, p);
/* Check the first argument. */
for (p2 = text; *p2 != '\0'; ++p2)
if (*p2 < '0' || *p2 > '9')
{
if (reading_filename != 0)
makefile_fatal (reading_filename, *reading_lineno_ptr,
"non-numeric first argument to `wordlist' function");
else
fatal ("non-numeric first argument to `wordlist' function");
}
i = (unsigned int)atoi(text);
free (text);
/* Check the next argument */
for (p2 = p + 1; isblank(*p2); ++p2)
{}
count = 0;
for (p = p2; p < end; ++p)
{
if (*p == startparen)
++count;
else if (*p == endparen)
--count;
else if (*p == ',' && count <= 0)
break;
}
if (p == end)
BADARGS ("wordlist");
text = expand_argument (p2, p);
for (p2 = text; *p2 != '\0'; ++p2)
if (*p2 < '0' || *p2 > '9')
{
if (reading_filename != 0)
makefile_fatal (reading_filename, *reading_lineno_ptr,
"non-numeric second argument to `wordlist' function");
else
fatal ("non-numeric second argument to `wordlist' function");
}
j = (unsigned int)atoi(text);
free (text);
if (j > i)
j -= i;
else
{
unsigned int k;
k = j;
j = i - j;
i = k;
}
++j;
/* Extract the requested words */
text = expand_argument (p + 1, end);
p2 = text;
while (((p = find_next_token (&p2, &len)) != 0) && --i)
{}
if (p)
{
while (--j && (find_next_token (&p2, &len) != 0))
{}
o = variable_buffer_output (o, p, p2 - p);
}
free (text);
break;
case function_findstring:
/* Get two comma-separated arguments and expand each one. */
count = 0;
@@ -1270,25 +1378,35 @@ index argument");
{
p = p2 + len;
#ifdef VMS
while (p >= p2 && *p != (function == function_dir ? ']' : '.'))
while (p >= p2 && *p != ']'
&& (function != function_basename || *p != '.'))
#else
while (p >= p2 && *p != (function == function_dir ? '/' : '.'))
# ifdef __MSDOS__
while (p >= p2 && *p != '/' && *p != '\\'
&& (function != function_basename || *p != '.'))
# else
while (p >= p2 && *p != '/'
&& (function != function_basename || *p != '.'))
# endif
#endif
--p;
if (p >= p2)
{
if (function == function_dir)
++p;
o = variable_buffer_output (o, p2, p - p2);
}
if (p >= p2 && (function == function_dir))
o = variable_buffer_output (o, p2, ++p - p2);
else if (p >= p2 && (*p == '.'))
o = variable_buffer_output (o, p2, p - p2);
#if defined(WINDOWS32) || defined(__MSDOS__)
/* Handle the "d:foobar" case */
else if (p2[0] && p2[1] == ':' && function == function_dir)
o = variable_buffer_output (o, p2, 2);
#endif
else if (function == function_dir)
#ifdef VMS
o = variable_buffer_output (o, "[]", 2);
o = variable_buffer_output (o, "[]", 2);
#else
#ifndef _AMIGA
o = variable_buffer_output (o, "./", 2);
o = variable_buffer_output (o, "./", 2);
#else
/* o = o */; /* Just a nop... */
/* o = o */; /* Just a nop... */
#endif /* AMIGA */
#endif /* !VMS */
else
@@ -1315,17 +1433,34 @@ index argument");
{
p = p2 + len;
#ifdef VMS
while (p >= p2 && *p != (function == function_notdir ? ']' : '.'))
while (p >= p2 && *p != ']'
&& (function != function_suffix || *p != '.'))
#else
while (p >= p2 && *p != (function == function_notdir ? '/' : '.'))
# ifdef __MSDOS__
while (p >= p2 && *p != '/' && *p != '\\'
&& (function != function_suffix || *p != '.'))
# else
while (p >= p2 && *p != '/'
&& (function != function_suffix || *p != '.'))
# endif
#endif
--p;
if (p >= p2)
{
if (function == function_notdir)
++p;
else if (*p != '.')
continue;
o = variable_buffer_output (o, p, len - (p - p2));
}
#if defined(WINDOWS32) || defined(__MSDOS__)
/* Handle the case of "d:foo/bar". */
else if (function == function_notdir && p2[0] && p2[1] == ':')
{
p = p2 + 2;
o = variable_buffer_output (o, p, len - (p - p2));
}
#endif
else if (function == function_notdir)
o = variable_buffer_output (o, p2, len);

File diff suppressed because it is too large Load Diff

1055
getopt.c Normal file

File diff suppressed because it is too large Load Diff

133
getopt.h Normal file
View File

@@ -0,0 +1,133 @@
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
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
Free Software Foundation; either version 2, or (at your option) any
later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#if defined (__STDC__) && __STDC__
#ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
#else /* not __STDC__ */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* getopt.h */

189
getopt1.c Normal file
View File

@@ -0,0 +1,189 @@
/* 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.
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.
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
Free Software Foundation; either version 2, or (at your option) any
later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "getopt.h"
#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
#include <stdio.h>
/* 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
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long (argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only (argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
}
#endif /* Not ELIDE_CODE. */
#ifdef TEST
#include <stdio.h>
int
main (argc, argv)
int argc;
char **argv;
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
{"delete", 1, 0, 0},
{"verbose", 0, 0, 0},
{"create", 0, 0, 0},
{"file", 1, 0, 0},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == -1)
break;
switch (c)
{
case 0:
printf ("option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case 'd':
printf ("option d with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

View File

@@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,3 +1,24 @@
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>
Win32 hacks from <Rob_Tulloh@tivoli.com>.

10
glob/Makefile.am Normal file
View File

@@ -0,0 +1,10 @@
# -*-Makefile-*-, or close enough
AUTOMAKE_OPTIONS = 1.2 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

View File

@@ -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 .. $@

1664
glob/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
@echo off
echo Configuring glob for GO32
echo Configuring glob for DJGPP
rem This batch file assumes a unix-type "sed" program
echo # Makefile generated by "configure.bat"> Makefile

View File

@@ -1,6 +1,9 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
AC_PREREQ(2.1) dnl Minimum Autoconf version required.
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
AM_INIT_AUTOMAKE(glob, 0.0, nodefs)
AC_PROG_CC
AC_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_RANLIB

View File

@@ -1,27 +1,28 @@
/* 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 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 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.
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. */
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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Enable GNU extensions in fnmatch.h. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
# define _GNU_SOURCE 1
#endif
#include <errno.h>
@@ -37,12 +38,21 @@ Cambridge, MA 02139, USA. */
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
#if defined _LIBC || !defined __GNU_LIBRARY__
#ifndef errno
# if defined STDC_HEADERS || !defined isascii
# define ISASCII(c) 1
# else
# define ISASCII(c) isascii(c)
# endif
# define ISUPPER(c) (ISASCII (c) && isupper (c))
# ifndef errno
extern int errno;
#endif
# endif
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
@@ -55,8 +65,8 @@ fnmatch (pattern, string, flags)
register const char *p = pattern, *n = string;
register char c;
/* Note that this evalutes C many times. */
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
/* Note that this evaluates C many times. */
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
while ((c = *p++) != '\0')
{
@@ -225,6 +235,8 @@ fnmatch (pattern, string, flags)
return 0;
return FNM_NOMATCH;
# undef FOLD
}
#endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@@ -1,22 +1,22 @@
/* Copyright (C) 1991, 1992, 1993 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 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.
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
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.
The GNU C 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. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
@@ -24,7 +24,7 @@ extern "C" {
#endif
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|| defined (WIN32))
|| defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */

View File

@@ -1,19 +1,19 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
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.
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. */
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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* AIX requires this to be the first thing in the file. */
#if defined (_AIX) && !defined (__GNUC__)
@@ -33,6 +33,12 @@ Cambridge, MA 02139, USA. */
#include <sys/types.h>
#include <sys/stat.h>
/* Outcomment the following line for production quality code. */
/* #define NDEBUG 1 */
#include <assert.h>
#include <stdio.h> /* Needed on stupid SunOS for assert. */
/* 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
@@ -52,11 +58,11 @@ Cambridge, MA 02139, USA. */
#ifndef ELIDE_CODE
#ifdef STDC_HEADERS
#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__)
#include <stddef.h>
#endif
#ifdef HAVE_UNISTD_H
#if defined HAVE_UNISTD_H || defined _LIBC
#include <unistd.h>
#ifndef POSIX
#ifdef _POSIX_VERSION
@@ -65,13 +71,16 @@ Cambridge, MA 02139, USA. */
#endif
#endif
#if !defined (_AMIGA) && !defined (VMS) && !defined(WIN32)
#if !defined (_AMIGA) && !defined (VMS) && !defined(WINDOWS32)
#include <pwd.h>
#endif
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
extern int errno;
#endif
#ifndef __set_errno
#define __set_errno(val) errno = (val)
#endif
#ifndef NULL
#define NULL 0
@@ -106,7 +115,7 @@ extern int errno;
#endif
#if (defined (POSIX) || defined (WIN32)) && !defined (__GNU_LIBRARY__)
#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
#define REAL_DIR_ENTRY(dp) 1
@@ -156,7 +165,7 @@ extern void bcopy ();
((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
#endif /* Not ANSI_STRING. */
#ifndef HAVE_STRCOLL
#if !defined HAVE_STRCOLL && !defined _LIBC
#define strcoll strcmp
#endif
@@ -166,7 +175,7 @@ extern void bcopy ();
__inline
#endif
#ifndef __SASC
#ifdef WIN32
#ifdef WINDOWS32
static void *
#else
static char *
@@ -196,11 +205,11 @@ my_realloc (p, n)
#include <alloca.h>
#else /* Not HAVE_ALLOCA_H. */
#ifndef _AIX
#ifdef WIN32
#ifdef WINDOWS32
#include <malloc.h>
#else
extern char *alloca ();
#endif /* WIN32 */
#endif /* WINDOWS32 */
#endif /* Not _AIX. */
#endif /* sparc or HAVE_ALLOCA_H. */
#endif /* GCC. */
@@ -219,7 +228,7 @@ extern char *alloca ();
#endif
#endif
#ifndef STDC_HEADERS
#if !(defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
#undef size_t
#define size_t unsigned int
#endif
@@ -243,7 +252,6 @@ extern char *alloca ();
#undef GLOB_PERIOD
#include <glob.h>
static int glob_pattern_p __P ((const char *pattern, int quote));
static int glob_in_dir __P ((const char *pattern, const char *directory,
int flags,
int (*errfunc) __P ((const char *, int)),
@@ -251,12 +259,58 @@ static int glob_in_dir __P ((const char *pattern, const char *directory,
static int prefix_array __P ((const char *prefix, char **array, size_t n));
static int collated_compare __P ((const __ptr_t, const __ptr_t));
/* Find the end of the sub-pattern in a brace expression. We define
this as an inline function if the compiler permits. */
static
#if __GNUC__ - 0 >= 2
inline
#endif
const char *
next_brace_sub (begin)
const char *begin;
{
unsigned int depth = 0;
const char *cp = begin;
while (1)
{
if (depth == 0)
{
if (*cp != ',' && *cp != '}' && *cp != '\0')
{
if (*cp == '{')
++depth;
++cp;
continue;
}
}
else
{
while (*cp != '\0' && (*cp != '}' || depth > 0))
{
if (*cp == '}')
--depth;
++cp;
}
if (*cp == '\0')
/* An incorrectly terminated brace expression. */
return NULL;
continue;
}
break;
}
return cp;
}
/* Do glob searching for PATTERN, placing results in PGLOB.
The bits defined above may be set in FLAGS.
If a directory cannot be opened or read and ERRFUNC is not nil,
it is called with the pathname that caused the error, and the
`errno' value from the failing call; if it returns non-zero
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
`glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
int
@@ -274,7 +328,7 @@ glob (pattern, flags, errfunc, pglob)
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
{
errno = EINVAL;
__set_errno (EINVAL);
return -1;
}
@@ -283,38 +337,59 @@ glob (pattern, flags, errfunc, pglob)
const char *begin = strchr (pattern, '{');
if (begin != NULL)
{
/* Allocate working buffer large enough for our work. Note that
we have at least an opening and closing brace. */
int firstc;
size_t restlen;
const char *p, *end, *next;
unsigned int depth = 0;
/* Find the end of the brace expression, by counting braces.
While we're at it, notice the first comma at top brace level. */
end = begin + 1;
next = NULL;
while (1)
char *alt_start;
const char *p;
const char *next;
const char *rest;
size_t rest_len;
#ifdef __GNUC__
char onealt[strlen (pattern) - 1];
#else
char *onealt = (char *) malloc (strlen (pattern) - 1);
if (onealt == NULL)
{
switch (*end++)
{
case ',':
if (depth == 0 && next == NULL)
next = end;
continue;
case '{':
++depth;
continue;
case '}':
if (depth-- == 0)
break;
continue;
case '\0':
return glob (pattern, flags &~ GLOB_BRACE, errfunc, pglob);
}
break;
if (!(flags & GLOB_APPEND))
globfree (pglob);
return GLOB_NOSPACE;
}
restlen = strlen (end) + 1;
#endif
/* We know the prefix for all sub-patterns. */
memcpy (onealt, pattern, begin - pattern);
alt_start = &onealt[begin - pattern];
/* Find the first sub-pattern and at the same time find the
rest after the closing brace. */
next = next_brace_sub (begin + 1);
if (next == NULL)
next = end;
{
/* It is an illegal expression. */
#ifndef __GNUC__
free (onealt);
#endif
return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
}
/* Now find the end of the whole brace expression. */
rest = next;
while (*rest != '}')
{
rest = next_brace_sub (rest + 1);
if (rest == NULL)
{
/* It is an illegal expression. */
#ifndef __GNUC__
free (onealt);
#endif
return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
}
}
/* Please note that we now can be sure the brace expression
is well-formed. */
rest_len = strlen (++rest) + 1;
/* We have a brace expression. BEGIN points to the opening {,
NEXT points past the terminator of the first element, and END
@@ -331,72 +406,47 @@ glob (pattern, flags, errfunc, pglob)
}
firstc = pglob->gl_pathc;
/* In this loop P points to the beginning of the current element
and NEXT points past its terminator. */
p = begin + 1;
while (1)
{
/* Construct a whole name that is one of the brace
alternatives in a temporary buffer. */
int result;
size_t bufsz = (begin - pattern) + (next - 1 - p) + restlen;
#ifdef __GNUC__
char onealt[bufsz];
#else
char *onealt = malloc (bufsz);
if (onealt == NULL)
{
if (!(flags & GLOB_APPEND))
globfree (pglob);
return GLOB_NOSPACE;
}
#endif
memcpy (onealt, pattern, begin - pattern);
memcpy (&onealt[begin - pattern], p, next - 1 - p);
memcpy (&onealt[(begin - pattern) + (next - 1 - p)],
end, restlen);
/* Construct the new glob expression. */
memcpy (alt_start, p, next - p);
memcpy (&alt_start[next - p], rest, rest_len);
result = glob (onealt,
((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) |
GLOB_APPEND), errfunc, pglob);
#ifndef __GNUC__
free (onealt);
#endif
((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC))
| GLOB_APPEND), errfunc, pglob);
/* If we got an error, return it. */
if (result && result != GLOB_NOMATCH)
{
#ifndef __GNUC__
free (onealt);
#endif
if (!(flags & GLOB_APPEND))
globfree (pglob);
return result;
}
/* Advance past this alternative and process the next. */
p = next;
depth = 0;
scan:
switch (*p++)
{
case ',':
if (depth == 0)
{
/* Found the next alternative. Loop to glob it. */
next = p;
continue;
}
goto scan;
case '{':
++depth;
goto scan;
case '}':
if (depth-- == 0)
/* End of the brace expression. Break out of the loop. */
break;
goto scan;
}
if (*next == '}')
/* We saw the last entry. */
break;
p = next + 1;
next = next_brace_sub (p);
assert (next != NULL);
}
if (pglob->gl_pathc == firstc &&
!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
#ifndef __GNUC__
free (onealt);
#endif
if (pglob->gl_pathc != firstc)
/* We found some entries. */
return 0;
else if (!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
return GLOB_NOMATCH;
}
}
@@ -449,55 +499,127 @@ glob (pattern, flags, errfunc, pglob)
#ifndef VMS
if ((flags & GLOB_TILDE) && dirname[0] == '~')
{
if (dirname[1] == '\0')
if (dirname[1] == '\0' || dirname[1] == '/')
{
/* Look up home directory. */
dirname = getenv ("HOME");
char *home_dir = getenv ("HOME");
#ifdef _AMIGA
if (dirname == NULL || dirname[0] == '\0')
dirname = "SYS:";
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS:";
#else
#ifdef WIN32
if (dirname == NULL || dirname[0] == '\0')
dirname = "c:/users/default"; /* poor default */
#ifdef WINDOWS32
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "c:/users/default"; /* poor default */
#else
if (dirname == NULL || dirname[0] == '\0')
if (home_dir == NULL || home_dir[0] == '\0')
{
int success;
#if defined HAVE_GETLOGIN_R || defined _LIBC
extern int getlogin_r __P ((char *, size_t));
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
char *name;
if (buflen == 0)
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
a moderate value. */
buflen = 16;
name = (char *) __alloca (buflen);
success = getlogin_r (name, buflen) >= 0;
#else
extern char *getlogin __P ((void));
char *name = getlogin ();
if (name != NULL)
char *name;
success = (name = getlogin ()) != NULL;
#endif
if (success)
{
#if defined HAVE_GETPWNAM_R || defined _LIBC
size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf;
struct passwd pwbuf, *p;
pwtmpbuf = (char *) __alloca (pwbuflen);
success = (__getpwnam_r (name, &pwbuf, pwtmpbuf,
pwbuflen, &p) >= 0);
#else
struct passwd *p = getpwnam (name);
if (p != NULL)
dirname = p->pw_dir;
success = p != NULL;
#endif
if (success)
home_dir = p->pw_dir;
}
}
if (dirname == NULL || dirname[0] == '\0')
dirname = (char *) "~"; /* No luck. */
#endif /* WIN32 */
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = (char *) "~"; /* No luck. */
#endif /* WINDOWS32 */
#endif
/* Now construct the full directory. */
if (dirname[1] == '\0')
dirname = home_dir;
else
{
char *newp;
size_t home_len = strlen (home_dir);
newp = (char *) __alloca (home_len + dirlen);
memcpy (newp, home_dir, home_len);
memcpy (&newp[home_len], &dirname[1], dirlen);
dirname = newp;
}
}
#if !defined _AMIGA && !defined WINDOWS32
else
{
#ifdef _AMIGA
if (dirname == NULL || dirname[0] == '\0')
dirname = "SYS:";
#else
#ifdef WIN32
if (dirname == NULL || dirname[0] == '\0')
dirname = "c:/users/default"; /* poor default */
#else
char *end_name = strchr (dirname, '/');
char *user_name;
char *home_dir;
if (end_name == NULL)
user_name = dirname + 1;
else
{
user_name = (char *) __alloca (end_name - dirname);
memcpy (user_name, dirname + 1, end_name - dirname);
user_name[end_name - dirname - 1] = '\0';
}
/* Look up specific user's home directory. */
struct passwd *p = getpwnam (dirname + 1);
if (p != NULL)
dirname = p->pw_dir;
#endif /* WIN32 */
{
#if defined HAVE_GETPWNAM_R || defined _LIBC
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf = (char *) __alloca (buflen);
struct passwd pwbuf, *p;
if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
home_dir = p->pw_dir;
else
home_dir = NULL;
#else
struct passwd *p = getpwnam (user_name);
if (p != NULL)
home_dir = p->pw_dir;
else
home_dir = NULL;
#endif
}
/* If we found a home directory use this. */
if (home_dir != NULL)
{
char *newp;
size_t home_len = strlen (home_dir);
size_t rest_len = end_name == NULL ? 0 : strlen (end_name);
newp = (char *) __alloca (home_len + rest_len + 1);
memcpy (newp, home_dir, home_len);
memcpy (&newp[home_len], end_name, rest_len);
newp[home_len + rest_len] = '\0';
dirname = newp;
}
}
#endif /* Not Amiga && not WINDOWS32. */
}
#endif /* Not VMS. */
if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
{
/* The directory name contains metacharacters, so we
have to glob for the directory, and then glob for
@@ -528,7 +650,7 @@ glob (pattern, flags, errfunc, pglob)
{
globfree (&dirs);
globfree (&files);
return GLOB_ABEND;
return GLOB_ABORTED;
}
}
#endif /* SHELL. */
@@ -724,8 +846,8 @@ prefix_array (dirname, array, n)
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int
glob_pattern_p (pattern, quote)
int
__glob_pattern_p (pattern, quote)
const char *pattern;
int quote;
{
@@ -756,6 +878,9 @@ glob_pattern_p (pattern, quote)
return 0;
}
#ifdef _LIBC
weak_alias (__glob_pattern_p, glob_pattern_p)
#endif
/* Like `glob', but PATTERN is a final pathname component,
@@ -780,7 +905,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
struct globlink *names = NULL;
size_t nfound = 0;
if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
if (!__glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
{
stream = NULL;
flags |= GLOB_NOCHECK;
@@ -796,7 +921,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
{
if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
(flags & GLOB_ERR))
return GLOB_ABEND;
return GLOB_ABORTED;
}
else
while (1)
@@ -838,7 +963,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
}
if (nfound == 0 && (flags & GLOB_NOMAGIC) &&
! glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
! __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
flags |= GLOB_NOCHECK;
if (nfound == 0 && (flags & GLOB_NOCHECK))
@@ -880,7 +1005,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
errno = save;
__set_errno (save);
}
return nfound == 0 ? GLOB_NOMATCH : 0;
@@ -891,7 +1016,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
errno = save;
__set_errno (save);
}
while (names != NULL)
{
@@ -903,4 +1028,3 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
}
#endif /* Not ELIDE_CODE. */

View File

@@ -1,22 +1,21 @@
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
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
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.
The GNU C 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. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _GLOB_H
#define _GLOB_H 1
#ifdef __cplusplus
@@ -25,17 +24,21 @@ extern "C"
#endif
#undef __ptr_t
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|| defined (WIN32))
#undef __P
#define __P(protos) protos
#define __ptr_t void *
#if (defined __cplusplus || (defined __STDC__ && __STDC__) \
|| defined WINDOWS32)
# undef __P
# define __P(protos) protos
# define __ptr_t void *
# if !defined __GNUC__ || __GNUC__ < 2
# undef __const
# define __const const
# endif
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(protos) ()
#undef const
#define const
#define __ptr_t char *
# undef __P
# define __P(protos) ()
# undef __const
# define __const
# define __ptr_t char *
#endif /* C++ or ANSI C. */
/* Bits set in the FLAGS argument to `glob'. */
@@ -47,26 +50,37 @@ extern "C"
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
#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_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE)
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_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. */
#else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD)
#endif
/* Error returns from `glob'. */
#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. */
#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
/* Structure describing a globbing run. */
#if !defined (_AMIGA) && !defined (VMS) /* Buggy compiler. */
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
struct stat;
#endif
typedef struct
@@ -80,9 +94,9 @@ typedef struct
are used instead of the normal file access functions. */
void (*gl_closedir) __P ((void *));
struct dirent *(*gl_readdir) __P ((void *));
__ptr_t (*gl_opendir) __P ((const char *));
int (*gl_lstat) __P ((const char *, struct stat *));
int (*gl_stat) __P ((const char *, struct stat *));
__ptr_t (*gl_opendir) __P ((__const char *));
int (*gl_lstat) __P ((__const char *, struct stat *));
int (*gl_stat) __P ((__const char *, struct stat *));
} glob_t;
/* Do glob searching for PATTERN, placing results in PGLOB.
@@ -93,14 +107,24 @@ typedef struct
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
extern int glob __P ((const char *__pattern, int __flags,
int (*__errfunc) __P ((const char *, int)),
extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) __P ((__const char *, int)),
glob_t *__pglob));
/* Free storage allocated in PGLOB by a previous `glob' call. */
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
}
#endif

View File

@@ -349,9 +349,9 @@ 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 this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
@end smallexample
Also add information on how to contact you by electronic and paper mail.

View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -152,7 +152,7 @@ pattern_search (file, archive, depth, recursions)
register struct rule *rule;
register struct dep *dep;
char *p;
char *p, *vp;
#ifndef NO_ARCHIVES
if (archive || ar_name (filename))
@@ -167,6 +167,17 @@ pattern_search (file, archive, depth, recursions)
lastslash = rindex (filename, ']');
#else
lastslash = rindex (filename, '/');
#ifdef __MSDOS__
/* Handle backslashes (possibly mixed with forward slashes)
and the case of "d:file". */
{
char *bslash = rindex (filename, '\\');
if (lastslash == 0 || bslash > lastslash)
lastslash = bslash;
if (lastslash == 0 && filename[0] && filename[1] == ':')
lastslash = filename + 1;
}
#endif
#endif
if (lastslash != 0 && lastslash[1] == '\0')
lastslash = 0;
@@ -388,10 +399,12 @@ pattern_search (file, archive, depth, recursions)
}
/* This code, given FILENAME = "lib/foo.o", dependency name
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
if (vpath_search (&p, (time_t *) 0))
vp = p;
if (vpath_search (&vp, (time_t *) 0))
{
DEBUGP2 ("Found dependency as `%s'.%s\n", p, "");
found_files[deps_found++] = p;
DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp);
strcpy(vp, p);
found_files[deps_found++] = vp;
continue;
}
@@ -554,7 +567,7 @@ pattern_search (file, archive, depth, recursions)
dep->next = file->deps;
file->deps = dep;
}
if (!checked_lastslash[foundrule])
/* Always allocate new storage, since STEM might be
on the stack for an intermediate file. */

546
job.c
View File

@@ -1,6 +1,5 @@
/* Job execution and handling 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -25,26 +24,33 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <assert.h>
/* Default shell to use. */
#ifdef WIN32
#ifdef WINDOWS32
char *default_shell = "sh.exe";
int no_default_sh_exe = 1;
#else /* WIN32 */
#ifndef _AMIGA
char default_shell[] = "/bin/sh";
#else
#else /* WINDOWS32 */
#ifdef _AMIGA
char default_shell[] = "";
extern int MyExecute (char **);
#endif
#endif /* WIN32 */
#else
#ifdef __MSDOS__
/* The default shell is a pointer so we can change it if Makefile
says so. It is without an explicit path so we get a chance
to search the $PATH for it (since MSDOS doesn't have standard
directories we could trust). */
char *default_shell = "command.com";
#else /* __MSDOS__ */
char default_shell[] = "/bin/sh";
#endif /* __MSDOS__ */
#endif /* _AMIGA */
#endif /* WINDOWS32 */
#ifdef __MSDOS__
#include <process.h>
static int execute_by_shell;
static int dos_pid = 123;
static int dos_status;
static char *dos_bname;
static char *dos_bename;
static int dos_batch_file;
#endif /* MSDOS. */
int dos_status;
int dos_command_running;
#endif /* __MSDOS__ */
#ifdef _AMIGA
#include <proto/dos.h>
@@ -61,7 +67,7 @@ static int amiga_batch_file;
#include <lib$routines.h>
#endif
#ifdef WIN32
#ifdef WINDOWS32
#include <windows.h>
#include <io.h>
#include <process.h>
@@ -73,7 +79,7 @@ static int amiga_batch_file;
static char *dos_bname;
static char *dos_bename;
static int dos_batch_file;
#endif /* WIN32 */
#endif /* WINDOWS32 */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
@@ -191,8 +197,12 @@ static int good_stdin_used = 0;
/* Chain of children waiting to run until the load average goes down. */
static struct child *waiting_jobs = 0;
/* Non-zero if we use a *real* shell (always so on Unix). */
int unixy_shell = 1;
#ifdef WIN32
#ifdef WINDOWS32
/*
* The macro which references this function is defined in make.h.
*/
@@ -200,7 +210,7 @@ int w32_kill(int pid, int sig)
{
return ((process_kill(pid, sig) == TRUE) ? 0 : -1);
}
#endif /* WIN32 */
#endif /* WINDOWS32 */
/* Write an error message describing the exit status given in
EXIT_CODE, EXIT_SIG, and COREDUMP, for the target TARGET_NAME.
@@ -342,7 +352,7 @@ reap_children (block, err)
}
else if (pid == 0)
{
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WIN32)
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
/* No remote children. Check for local children. */
if (any_local)
@@ -396,13 +406,15 @@ reap_children (block, err)
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
coredump = WCOREDUMP (status);
}
#else /* MSDOS, Amiga, WIN32. */
#else /* __MSDOS__, Amiga, WINDOWS32. */
#ifdef __MSDOS__
/* Life is very different on MSDOS. */
pid = dos_pid - 1;
status = dos_status;
exit_code = dos_status;
exit_sig = 0;
exit_code = WEXITSTATUS (status);
if (exit_code == 0xff)
exit_code = -1;
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
coredump = 0;
#endif /* __MSDOS__ */
#ifdef _AMIGA
@@ -413,7 +425,7 @@ reap_children (block, err)
exit_sig = 0;
coredump = 0;
#endif /* _AMIGA */
#ifdef WIN32
#ifdef WINDOWS32
{
HANDLE hPID;
int err;
@@ -429,7 +441,7 @@ reap_children (block, err)
if (err)
fprintf(stderr, "make (e=%d): %s",
exit_code, map_win32_error_to_string(exit_code));
exit_code, map_windows32_error_to_string(exit_code));
exit_sig = process_signal(hPID);
@@ -446,8 +458,8 @@ reap_children (block, err)
}
pid = (int) hPID;
}
#endif /* WIN32 */
#endif /* Not MSDOS. */
#endif /* WINDOWS32 */
#endif /* Not __MSDOS__ */
}
else
/* We got a remote child. */
@@ -655,13 +667,6 @@ block_sigs ()
}
#ifdef POSIX
#ifdef __MSDOS__
void
unblock_sigs ()
{
return;
}
#else
void
unblock_sigs ()
{
@@ -670,7 +675,6 @@ unblock_sigs ()
sigprocmask (SIG_SETMASK, &empty, (sigset_t *) 0);
}
#endif
#endif
/* Start a job to run the commands specified in CHILD.
CHILD is updated to reflect the commands and ID of the child process.
@@ -780,6 +784,25 @@ start_job_command (child)
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
? "%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
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
@@ -805,9 +828,8 @@ start_job_command (child)
fflush (stdout);
fflush (stderr);
#ifndef WIN32
#ifndef _AMIGA
#ifndef VMS
#if !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
/* Set up a bad standard input that reads from a broken pipe. */
@@ -835,8 +857,7 @@ start_job_command (child)
}
}
#endif /* !AMIGA */
#endif /* !WIN32 */
#endif /* !WINDOWS32 && !_AMIGA && !__MSDOS__ */
/* Decide whether to give this child the `good' standard input
(one that points to the terminal or whatever), or the `bad' one
@@ -846,7 +867,7 @@ start_job_command (child)
if (child->good_stdin)
good_stdin_used = 1;
#endif /* Not VMS */
#endif /* !VMS */
child->deleted = 0;
@@ -856,7 +877,7 @@ start_job_command (child)
child->environment = target_environment (child->file);
#endif
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WIN32)
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
#ifndef VMS
/* start_waiting_job has set CHILD->remote if we can start a remote job. */
@@ -919,21 +940,56 @@ start_job_command (child)
#endif /* !VMS */
}
#else /* MSDOS or Amiga. */
#else /* __MSDOS__ or Amiga or WINDOWS32 */
#ifdef __MSDOS__
dos_status = spawnvpe (P_WAIT, argv[0], argv, child->environment);
++dead_children;
child->pid = dos_pid++;
if (dos_batch_file)
{
dos_batch_file = 0;
remove (dos_bname); /* Ignore errors. */
if (access (dos_bename, 0))
dos_status = 1;
else
dos_status = 0;
remove (dos_bename);
}
{
int proc_return;
block_sigs ();
dos_status = 0;
/* We call `system' to do the job of the SHELL, since stock DOS
shell is too dumb. Our `system' knows how to handle long
command lines even if pipes/redirection is needed; it will only
call COMMAND.COM when its internal commands are used. */
if (execute_by_shell)
{
char *cmdline = argv[0];
/* We don't have a way to pass environment to `system',
so we need to save and restore ours, sigh... */
char **parent_environ = environ;
environ = child->environment;
/* If we have a *real* shell, tell `system' to call
it to do everything for us. */
if (unixy_shell)
{
/* A *real* shell on MSDOS may not support long
command lines the DJGPP way, so we must use `system'. */
cmdline = argv[2]; /* get past "shell -c" */
}
dos_command_running = 1;
proc_return = system (cmdline);
dos_command_running = 0;
environ = parent_environ;
execute_by_shell = 0; /* for the next time */
}
else
{
dos_command_running = 1;
proc_return = spawnvpe (P_WAIT, argv[0], argv, child->environment);
dos_command_running = 0;
}
if (proc_return == -1)
dos_status |= 0xff;
else
dos_status |= (proc_return & 0xff);
++dead_children;
child->pid = dos_pid++;
}
#endif /* __MSDOS__ */
#ifdef _AMIGA
amiga_status = MyExecute (argv);
@@ -945,8 +1001,8 @@ start_job_command (child)
amiga_batch_file = 0;
DeleteFile (amiga_bname); /* Ignore errors. */
}
#endif /* Not Amiga */
#ifdef WIN32
#endif /* Amiga */
#ifdef WINDOWS32
{
HANDLE hPID;
char* arg0;
@@ -976,8 +1032,8 @@ start_job_command (child)
fprintf(stderr, "\nCounted %d args in failed launch\n", i);
}
}
#endif /* WIN32 */
#endif /* Not MSDOS. */
#endif /* WINDOWS32 */
#endif /* __MSDOS__ or Amiga or WINDOWS32 */
/* We are the parent side. Set the state to
say the commands are running and return. */
@@ -1101,7 +1157,7 @@ new_job (file)
/* IN points to where in the line we are scanning.
OUT points to where in the line we are writing.
When we collapse a backslash-newline combination,
IN gets ahead out OUT. */
IN gets ahead of OUT. */
in = out = cmds->command_lines[i];
while ((ref = index (in, '$')) != 0)
@@ -1295,7 +1351,7 @@ start_waiting_jobs ()
return;
}
#ifndef WIN32
#ifndef WINDOWS32
#ifdef VMS
#include <descrip.h>
#include <clidef.h>
@@ -1508,7 +1564,7 @@ child_execute_job (argv, child)
#else /* !VMS */
#ifndef _AMIGA
#if !defined (_AMIGA) && !defined (__MSDOS__)
/* UNIX:
Replace the current process with one executing the command in ARGV.
STDIN_FD and STDOUT_FD are used as the process's stdin and stdout; ENVP is
@@ -1531,9 +1587,9 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp)
/* Run the command. */
exec_command (argv, envp);
}
#endif /* !AMIGA */
#endif /* !AMIGA && !__MSDOS__ */
#endif /* !VMS */
#endif /* !WIN32 */
#endif /* !WINDOWS32 */
#ifndef _AMIGA
/* Replace the current process with one running the command in ARGV,
@@ -1544,11 +1600,66 @@ exec_command (argv, envp)
char **argv, **envp;
{
#ifdef VMS
/* Run the program. */
execve (argv[0], argv, envp);
perror_with_name ("execve: ", argv[0]);
_exit (EXIT_FAILURE);
/* Run the program. */
execve (argv[0], argv, envp);
perror_with_name ("execve: ", argv[0]);
_exit (EXIT_FAILURE);
#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. */
child_access ();
@@ -1600,21 +1711,22 @@ exec_command (argv, envp)
}
_exit (127);
#endif /* !WINDOWS32 */
#endif /* !VMS */
}
#else /* On Amiga */
void exec_command (argv)
char **argv;
{
MyExecute (argv);
MyExecute (argv);
}
void clean_tmp (void)
{
DeleteFile (amiga_bname);
DeleteFile (amiga_bname);
}
#endif /* An Amiga */
#endif /* On Amiga */
#ifndef VMS
/* Figure out the argument list necessary to run LINE as a command. Try to
@@ -1636,13 +1748,46 @@ construct_command_argv_internal (line, restp, shell, ifs)
char *shell, *ifs;
{
#ifdef __MSDOS__
static char sh_chars[] = "\"|<>";
static char *sh_cmds[] = { "break", "call", "cd", "chcp", "chdir", "cls",
"copy", "ctty", "date", "del", "dir", "echo",
"erase", "exit", "for", "goto", "if", "if", "md",
"mkdir", "path", "pause", "prompt", "rem", "ren",
"rename", "set", "shift", "time", "type",
"ver", "verify", "vol", ":", 0 };
/* MSDOS supports both the stock DOS shell and ports of Unixy shells.
We call `system' for anything that requires ``slow'' processing,
because DOS shells are too dumb. When $SHELL points to a real
(unix-style) shell, `system' just calls it to do everything. When
$SHELL points to a DOS shell, `system' does most of the work
internally, calling the shell only for its internal commands.
However, it looks on the $PATH first, so you can e.g. have an
external command named `mkdir'.
Since we call `system', certain characters and commands below are
actually not specific to COMMAND.COM, but to the DJGPP implementation
of `system'. In particular:
The shell wildcard characters are in DOS_CHARS because they will
not be expanded if we call the child via `spawnXX'.
The `;' is in DOS_CHARS, because our `system' knows how to run
multiple commands on a single line.
DOS_CHARS also include characters special to 4DOS/NDOS, so we
won't have to tell one from another and have one more set of
commands and special characters. */
static char sh_chars_dos[] = "*?[];|<>%^&()";
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
"copy", "ctty", "date", "del", "dir", "echo",
"erase", "exit", "for", "goto", "if", "md",
"mkdir", "path", "pause", "prompt", "rd",
"rmdir", "rem", "ren", "rename", "set",
"shift", "time", "type", "ver", "verify",
"vol", ":", 0 };
static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^";
static char *sh_cmds_sh[] = { "cd", "eval", "exec", "exit", "login",
"logout", "set", "umask", "wait", "while",
"for", "case", "if", ":", ".", "break",
"continue", "export", "read", "readonly",
"shift", "times", "trap", "switch", 0 };
char *sh_chars;
char **sh_cmds;
#else
#ifdef _AMIGA
static char sh_chars[] = "#;\"|<>()?*$`";
@@ -1652,7 +1797,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
"unset", "unsetenv", "version",
0 };
#else
#ifdef WIN32
#ifdef WINDOWS32
static char sh_chars_dos[] = "\"|<>";
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
"copy", "ctty", "date", "del", "dir", "echo",
@@ -1668,23 +1813,23 @@ construct_command_argv_internal (line, restp, shell, ifs)
"trap", "switch", "test", 0 };
char* sh_chars;
char** sh_cmds;
#else /* WIN32 */
#else /* WINDOWS32 */
static char sh_chars[] = "#;\"*?[]&|<>(){}$`^";
static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
"logout", "set", "umask", "wait", "while", "for",
"case", "if", ":", ".", "break", "continue",
"export", "read", "readonly", "shift", "times",
"trap", "switch", 0 };
#endif /* WIN32 */
#endif /* WINDOWS32 */
#endif /* Amiga */
#endif /* MSDOS */
#endif /* __MSDOS__ */
register int i;
register char *p;
register char *ap;
char *end;
int instring, word_has_equals, seen_nonequals;
int instring, word_has_equals, seen_nonequals, last_argument_was_empty;
char **new_argv = 0;
#ifdef WIN32
#ifdef WINDOWS32
int slow_flag = 0;
if (no_default_sh_exe) {
@@ -1694,7 +1839,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
sh_cmds = sh_cmds_sh;
sh_chars = sh_chars_sh;
}
#endif
#endif /* WINDOWS32 */
if (restp != NULL)
*restp = NULL;
@@ -1708,8 +1853,8 @@ construct_command_argv_internal (line, restp, shell, ifs)
/* See if it is safe to parse commands internally. */
if (shell == 0)
shell = default_shell;
#ifdef WINDOWS32
else if (strcmp (shell, default_shell))
#ifdef WIN32
{
char *s1 = _fullpath(NULL, shell, 0);
char *s2 = _fullpath(NULL, default_shell, 0);
@@ -1722,8 +1867,32 @@ construct_command_argv_internal (line, restp, shell, ifs)
free(s2);
}
if (slow_flag)
#endif /* WIN32 */
goto slow;
#else /* not WINDOWS32 */
#ifdef __MSDOS__
else if (stricmp (shell, default_shell))
{
extern int _is_unixy_shell (const char *_path);
message (1, "$SHELL changed (was `%s', now `%s')", default_shell, shell);
unixy_shell = _is_unixy_shell (shell);
default_shell = shell;
}
if (unixy_shell)
{
sh_chars = sh_chars_sh;
sh_cmds = sh_cmds_sh;
}
else
{
sh_chars = sh_chars_dos;
sh_cmds = sh_cmds_dos;
}
#else /* not __MSDOS__ */
else if (strcmp (shell, default_shell))
goto slow;
#endif /* not __MSDOS__ */
#endif /* not WINDOWS32 */
if (ifs != 0)
for (ap = ifs; *ap != '\0'; ++ap)
@@ -1741,7 +1910,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
/* I is how many complete arguments have been found. */
i = 0;
instring = word_has_equals = seen_nonequals = 0;
instring = word_has_equals = seen_nonequals = last_argument_was_empty = 0;
for (p = line; *p != '\0'; ++p)
{
if (ap > end)
@@ -1753,7 +1922,11 @@ construct_command_argv_internal (line, restp, shell, ifs)
/* Inside a string, just copy any char except a closing quote
or a backslash-newline combination. */
if (*p == instring)
instring = 0;
{
instring = 0;
if (ap == new_argv[0] || *(ap-1) == '\0')
last_argument_was_empty = 1;
}
else if (*p == '\\' && p[1] == '\n')
goto swallow_escaped_newline;
else if (*p == '\n' && restp != NULL)
@@ -1763,8 +1936,10 @@ construct_command_argv_internal (line, restp, shell, ifs)
goto end_of_line;
}
/* Backslash, $, and ` are special inside double quotes.
If we see any of those, punt. */
else if (instring == '"' && index ("\\$`", *p) != 0)
If we see any of those, punt.
But on MSDOS, if we use COMMAND.COM, double and single
quotes have the same effect. */
else if (instring == '"' && index ("\\$`", *p) != 0 && unixy_shell)
goto slow;
else
*ap++ = *p;
@@ -1772,6 +1947,11 @@ construct_command_argv_internal (line, restp, shell, ifs)
else if (index (sh_chars, *p) != 0)
/* Not inside a string, but it's a special char. */
goto slow;
#ifdef __MSDOS__
else if (*p == '.' && p[1] == '.' && p[2] == '.' && p[3] != '.')
/* `...' is a wildcard in DJGPP. */
goto slow;
#endif
else
/* Not a special char. */
switch (*p)
@@ -1781,7 +1961,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
first word with no equals sign in it. This is not the case
with sh -k, but we never get here when using nonstandard
shell flags. */
if (! seen_nonequals)
if (! seen_nonequals && unixy_shell)
goto slow;
word_has_equals = 1;
*ap++ = '=';
@@ -1846,6 +2026,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
Terminate the text of the argument. */
*ap++ = '\0';
new_argv[++i] = ap;
last_argument_was_empty = 0;
/* Update SEEN_NONEQUALS, which tells us if every word
heretofore has contained an `='. */
@@ -1887,7 +2068,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
/* Terminate the last argument and the argument list. */
*ap = '\0';
if (new_argv[i][0] != '\0')
if (new_argv[i][0] != '\0' || last_argument_was_empty)
++i;
new_argv[i] = 0;
@@ -1914,7 +2095,40 @@ construct_command_argv_internal (line, restp, shell, ifs)
free (new_argv[0]);
free ((void *)new_argv);
}
#ifdef WIN32
#ifdef __MSDOS__
execute_by_shell = 1; /* actually, call `system' if shell isn't unixy */
#endif
#ifdef _AMIGA
{
char *ptr;
char *buffer;
char *dptr;
buffer = (char *)xmalloc (strlen (line)+1);
ptr = line;
for (dptr=buffer; *ptr; )
{
if (*ptr == '\\' && ptr[1] == '\n')
ptr += 2;
else if (*ptr == '@') /* Kludge: multiline commands */
{
ptr += 2;
*dptr++ = '\n';
}
else
*dptr++ = *ptr++;
}
*dptr = 0;
new_argv = (char **) xmalloc(2 * sizeof(char *));
new_argv[0] = buffer;
new_argv[1] = 0;
}
#else /* Not Amiga */
#ifdef WINDOWS32
/*
* Not eating this whitespace caused things like
*
@@ -1930,77 +2144,39 @@ construct_command_argv_internal (line, restp, shell, ifs)
++line;
if (*line == '\0')
return 0;
#endif
#if defined(__MSDOS__) || defined(WIN32)
#ifdef WIN32
/*
* only come here if no sh.exe command
*/
if (no_default_sh_exe)
#endif
{
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;
}
#endif /* MSDOS. */
#ifdef _AMIGA
{
char *ptr;
char *buffer;
char *dptr;
buffer = (char *)xmalloc (strlen (line)+1);
ptr = line;
for (dptr=buffer; *ptr; )
{
if (*ptr == '\\' && ptr[1] == '\n')
ptr += 2;
else if (*ptr == '@') /* Kludge: multiline commands */
{
ptr += 2;
*dptr++ = '\n';
}
else
*dptr++ = *ptr++;
}
*dptr = 0;
new_argv = (char **) xmalloc(2 * sizeof(char *));
new_argv[0] = buffer;
new_argv[1] = 0;
}
#else /* Not MSDOS or Amiga */
#ifdef WIN32
/*
* This is technically an else to the above 'if (no_default_sh_exe)',
* but (IMHO) coding if-else across ifdef is dangerous.
* only come here if no sh.exe command
*/
if (!no_default_sh_exe)
#endif
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 */
{
/* SHELL may be a multi-word command. Construct a command line
"SHELL -c LINE", with all special chars in LINE escaped.
@@ -2038,27 +2214,57 @@ construct_command_argv_internal (line, restp, shell, ifs)
since it was most likely used to line
up the continued line with the previous one. */
if (*p == '\t')
strcpy (p, p + 1);
bcopy (p + 1, p, strlen (p));
p = next_token (p);
--p;
*ap++ = '\\';
if (unixy_shell)
*ap++ = '\\';
*ap++ = ' ';
continue;
}
if (*p == '\\' || *p == '\'' || *p == '"'
|| isspace (*p)
|| index (sh_chars, *p) != 0)
/* DOS shells don't know about backslash-escaping. */
if (unixy_shell &&
(*p == '\\' || *p == '\'' || *p == '"'
|| isspace (*p)
|| index (sh_chars, *p) != 0))
*ap++ = '\\';
#ifdef __MSDOS__
else if (unixy_shell && strncmp (p, "...", 3) == 0)
{
/* The case of `...' wildcard again. */
strcpy (ap, "\\.\\.\\");
ap += 5;
p += 2;
}
#endif
*ap++ = *p;
}
if (ap == new_line + shell_len + sizeof (minus_c) - 1)
/* Line was empty. */
return 0;
*ap = '\0';
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
(char *) 0, (char *) 0);
if (unixy_shell)
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
(char *) 0, (char *) 0);
#ifdef __MSDOS__
else
{
/* With MSDOS shells, we must construct the command line here
instead of recursively calling ourselves, because we
cannot backslash-escape the special characters (see above). */
new_argv = (char **) xmalloc (sizeof (char *));
line_len = strlen (new_line) - shell_len - sizeof (minus_c) + 1;
new_argv[0] = xmalloc (line_len + 1);
strncpy (new_argv[0],
new_line + shell_len + sizeof (minus_c) - 1, line_len);
new_argv[0][line_len] = '\0';
}
#endif
}
#endif /* Not MSDOS nor Amiga. */
#endif /* ! AMIGA */
return new_argv;
}
@@ -2090,7 +2296,7 @@ construct_command_argv (line, restp, file)
warn_undefined_variables_flag = 0;
shell = allocated_variable_expand_for_file ("$(SHELL)", file);
#ifdef WIN32
#ifdef WINDOWS32
/*
* Convert to forward slashes so that construct_command_argv_internal()
* is not confused.

348
main.c
View File

@@ -1,5 +1,5 @@
/* Argument parsing and main program of GNU Make.
Copyright (C) 1988, 89, 90, 91, 94, 95, 96 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,94,95,96,97 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
# include <dos/dos.h>
# include <proto/dos.h>
#endif
#ifdef WIN32
#ifdef WINDOWS32
#include <windows.h>
#include "pathstuff.h"
#endif
@@ -129,7 +129,7 @@ int just_print_flag;
int debug_flag = 0;
#ifdef WIN32
#ifdef WINDOWS32
/* Suspend make in main for a short time to allow debugger to attach */
int suspend_flag = 0;
@@ -240,7 +240,7 @@ static const struct command_switch switches[] =
{ 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
"debug", 0,
"Print lots of debugging information" },
#ifdef WIN32
#ifdef WINDOWS32
{ 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
"suspend-for-debug", 0,
"Suspend process to allow a debugger to attach" },
@@ -392,6 +392,12 @@ struct file *default_file;
This turns on pedantic compliance with POSIX.2. */
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. */
@@ -450,6 +456,96 @@ debug_signal_handler (sig)
debug_flag = ! debug_flag;
}
#ifdef WINDOWS32
/*
* HANDLE runtime exceptions by avoiding a requestor on the GUI. Capture
* exception and print it to stderr instead.
*
* If debug_flag not set, just print a simple message and exit.
* If debug_flag set, print a more verbose message.
* If compiled for DEBUG, let exception pass through to GUI so that
* debuggers can attach.
*/
LONG WINAPI
handle_runtime_exceptions( struct _EXCEPTION_POINTERS *exinfo )
{
PEXCEPTION_RECORD exrec = exinfo->ExceptionRecord;
LPSTR cmdline = GetCommandLine();
LPSTR prg = strtok(cmdline, " ");
CHAR errmsg[1024];
#ifdef USE_EVENT_LOG
HANDLE hEventSource;
LPTSTR lpszStrings[1];
#endif
if (!debug_flag)
{
sprintf(errmsg, "%s: Interrupt/Exception caught ", prg);
sprintf(&errmsg[strlen(errmsg)],
"(code = 0x%x, addr = 0x%x)\r\n",
exrec->ExceptionCode, exrec->ExceptionAddress);
fprintf(stderr, errmsg);
exit(255);
}
sprintf(errmsg,
"\r\nUnhandled exception filter called from program %s\r\n", prg);
sprintf(&errmsg[strlen(errmsg)], "ExceptionCode = %x\r\n",
exrec->ExceptionCode);
sprintf(&errmsg[strlen(errmsg)], "ExceptionFlags = %x\r\n",
exrec->ExceptionFlags);
sprintf(&errmsg[strlen(errmsg)], "ExceptionAddress = %x\r\n",
exrec->ExceptionAddress);
if (exrec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION
&& exrec->NumberParameters >= 2)
sprintf(&errmsg[strlen(errmsg)],
"Access violation: %s operation at address %x\r\n",
exrec->ExceptionInformation[0] ? "write": "read",
exrec->ExceptionInformation[1]);
/* turn this on if we want to put stuff in the event log too */
#ifdef USE_EVENT_LOG
hEventSource = RegisterEventSource(NULL, "GNU Make");
lpszStrings[0] = errmsg;
if (hEventSource != NULL)
{
ReportEvent(hEventSource, /* handle of event source */
EVENTLOG_ERROR_TYPE, /* event type */
0, /* event category */
0, /* event ID */
NULL, /* current user's SID */
1, /* strings in lpszStrings */
0, /* no bytes of raw data */
lpszStrings, /* array of error strings */
NULL); /* no raw data */
(VOID) DeregisterEventSource(hEventSource);
}
#endif
/* Write the error to stderr too */
fprintf(stderr, errmsg);
#ifdef DEBUG
return EXCEPTION_CONTINUE_SEARCH;
#else
exit(255);
#endif
}
#endif /* WINDOWS32 */
#ifdef __MSDOS__
static void
msdos_return_to_initial_directory ()
{
if (directory_before_chdir)
chdir (directory_before_chdir);
}
#endif
#ifndef _AMIGA
int
main (argc, argv, envp)
@@ -465,16 +561,30 @@ int main (int argc, char ** argv)
char **p;
struct dep *read_makefiles;
PATH_VAR (current_directory);
#ifdef WIN32
#ifdef WINDOWS32
extern int no_default_sh_exe;
char *unix_path = NULL;
char *win32_path = NULL;
char *windows32_path = NULL;
SetUnhandledExceptionFilter(handle_runtime_exceptions);
#endif
default_goal_file = 0;
reading_filename = 0;
reading_lineno_ptr = 0;
#if defined (__MSDOS__) && !defined (_POSIX_SOURCE)
/* Request the most powerful version of `system', to
make up for the dumb default shell. */
__system_flags = (__system_redirect
| __system_use_shell
| __system_allow_multiple_cmds
| __system_allow_long_cmds
| __system_handle_null_commands
| __system_emulate_chdir);
#endif
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
signame_init ();
#endif
@@ -547,8 +657,16 @@ int main (int argc, char ** argv)
#ifdef __MSDOS__
if (program == 0)
program = rindex (argv[0], '\\');
if (program == 0)
program = rindex (argv[0], ':');
else
{
/* Some weird environments might pass us argv[0] with
both kinds of slashes; we must find the rightmost. */
char *p = rindex (argv[0], '\\');
if (p && p > program)
program = p;
}
if (program == 0 && argv[0][1] == ':')
program = argv[0] + 1;
#endif
if (program == 0)
program = argv[0];
@@ -561,7 +679,7 @@ int main (int argc, char ** argv)
/* Figure out where we are. */
#ifdef WIN32
#ifdef WINDOWS32
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
#else
if (getcwd (current_directory, GET_PATH_MAX) == 0)
@@ -578,10 +696,14 @@ int main (int argc, char ** argv)
else
directory_before_chdir = savestring (current_directory,
strlen (current_directory));
#ifdef __MSDOS__
/* Make sure we will return to the initial directory, come what may. */
atexit (msdos_return_to_initial_directory);
#endif
/* Read in variables from the environment. It is important that this be
done before $(MAKE) is are figured out so its definitions will not be
one from the environment. */
done before $(MAKE) is figured out so its definitions will not be
from the environment. */
#ifndef _AMIGA
for (i = 0; envp[i] != 0; ++i)
@@ -589,11 +711,11 @@ int main (int argc, char ** argv)
register char *ep = envp[i];
while (*ep != '=')
++ep;
#ifdef WIN32
if (!strncmp(ep, "PATH", 4))
unix_path = &ep[5];
if (!strncmp(ep, "Path", 4))
win32_path = &ep[5];
#ifdef WINDOWS32
if (!unix_path && !strncmp(envp[i], "PATH=", 5))
unix_path = ep+1;
if (!windows32_path && !strncmp(envp[i], "Path=", 5))
windows32_path = ep+1;
#endif
/* The result of pointer arithmetic is cast to unsigned int for
machines where ptrdiff_t is a different size that doesn't widen
@@ -607,12 +729,12 @@ int main (int argc, char ** argv)
be exported, because it was originally in the environment. */
->export = v_export;
}
#ifdef WIN32
#ifdef WINDOWS32
/*
* PATH defaults to Path iff PATH not found and Path is found.
*/
if (!unix_path && win32_path)
define_variable("PATH", 4, win32_path, o_env, 1)->export = v_export;
if (!unix_path && windows32_path)
define_variable("PATH", 4, windows32_path, o_env, 1)->export = v_export;
#endif
#else /* For Amiga, read the ENV: device, ignoring all dirs */
{
@@ -655,7 +777,7 @@ int main (int argc, char ** argv)
decode_env_switches ("MFLAGS", 6);
#endif
decode_switches (argc, argv, 0);
#ifdef WIN32
#ifdef WINDOWS32
if (suspend_flag) {
fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId());
fprintf(stderr, "%s is suspending for 30 seconds...", argv[0]);
@@ -679,7 +801,7 @@ int main (int argc, char ** argv)
so the result will run the same program regardless of the current dir.
If it is a name with no slash, we can only hope that PATH did not
find it in the current directory.) */
#ifdef WIN32
#ifdef WINDOWS32
/*
* Convert from backslashes to forward slashes for
* programs like sh which don't like them. Shouldn't
@@ -690,11 +812,11 @@ int main (int argc, char ** argv)
strstr(argv[0], "..") ||
!strncmp(argv[0], "//", 2))
argv[0] = strdup(w32ify(argv[0],1));
#else /* WIN32 */
#else /* WINDOWS32 */
if (current_directory[0] != '\0'
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
argv[0] = concat (current_directory, "/", argv[0]);
#endif /* WIN32 */
#endif /* WINDOWS32 */
#endif
/* The extra indirection through $(MAKE_COMMAND) is done
@@ -767,7 +889,7 @@ int main (int argc, char ** argv)
free (dir);
}
#ifdef WIN32
#ifdef WINDOWS32
/*
* THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER
* TO NOT CONFUSE THE DEPENDENCY CHECKING CODE IN implicit.c.
@@ -839,7 +961,7 @@ int main (int argc, char ** argv)
}
}
}
#endif /* WIN32 */
#endif /* WINDOWS32 */
/* Figure out the level of recursion. */
{
struct variable *v = lookup_variable ("MAKELEVEL", 9);
@@ -868,7 +990,7 @@ int main (int argc, char ** argv)
starting_directory = current_directory;
else
{
#ifdef WIN32
#ifdef WINDOWS32
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
#else
if (getcwd (current_directory, GET_PATH_MAX) == 0)
@@ -985,7 +1107,7 @@ int main (int argc, char ** argv)
define_makeflags (0, 0);
#ifdef WIN32
#ifdef WINDOWS32
/*
* Now that makefiles are parsed, see if a Makefile gave a
* value for SHELL and use that for default_shell instead if
@@ -1030,7 +1152,7 @@ int main (int argc, char ** argv)
error("Resetting make for single job mode.");
job_slots = 1;
}
#endif /* WIN32 */
#endif /* WINDOWS32 */
/* Define the default variables. */
define_default_variables ();
@@ -1042,6 +1164,28 @@ int main (int argc, char ** argv)
read_makefiles
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
#ifdef __MSDOS__
/* We need to know what kind of shell we will be using. */
{
extern int _is_unixy_shell (const char *_path);
struct variable *shv = lookup_variable("SHELL", 5);
extern int unixy_shell;
extern char *default_shell;
if (shv && *shv->value)
{
char *shell_path = recursively_expand(shv);
if (shell_path && _is_unixy_shell (shell_path))
unixy_shell = 1;
else
unixy_shell = 0;
if (shell_path)
default_shell = shell_path;
}
}
#endif /* __MSDOS__ */
/* Decode switches again, in case the variables were set by the makefile. */
decode_env_switches ("MAKEFLAGS", 9);
#if 0
@@ -1111,6 +1255,8 @@ int main (int argc, char ** argv)
time_t *makefile_mtimes = 0;
unsigned int mm_idx = 0;
char **nargv = argv;
int nargc = argc;
if (debug_flag)
puts ("Updating makefiles....");
@@ -1193,52 +1339,47 @@ int main (int argc, char ** argv)
in updating or could not be found at all. */
int any_failed = 0;
register unsigned int i;
struct dep *d;
for (i = 0; read_makefiles != 0; ++i)
{
struct dep *d = read_makefiles;
read_makefiles = d->next;
if (d->file->updated)
{
/* This makefile was updated. */
if (d->file->update_status == 0)
{
/* It was successfully updated. */
any_remade |= (file_mtime_no_search (d->file)
!= makefile_mtimes[i]);
}
else if (! (d->changed & RM_DONTCARE))
{
time_t mtime;
/* The update failed and this makefile was not
from the MAKEFILES variable, so we care. */
error ("Failed to remake makefile `%s'.",
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != (time_t) -1
&& mtime != makefile_mtimes[i]);
}
}
else
/* This makefile was not found at all. */
if (! (d->changed & RM_DONTCARE))
{
/* This is a makefile we care about. See how much. */
if (d->changed & RM_INCLUDED)
/* An included makefile. We don't need
to die, but we do want to complain. */
error ("Included makefile `%s' was not found.",
dep_name (d));
else
{
/* A normal makefile. We must die later. */
error ("Makefile `%s' was not found", dep_name (d));
any_failed = 1;
}
}
free ((char *) d);
}
for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next)
if (d->file->updated)
{
/* This makefile was updated. */
if (d->file->update_status == 0)
{
/* It was successfully updated. */
any_remade |= (file_mtime_no_search (d->file)
!= makefile_mtimes[i]);
}
else if (! (d->changed & RM_DONTCARE))
{
time_t mtime;
/* The update failed and this makefile was not
from the MAKEFILES variable, so we care. */
error ("Failed to remake makefile `%s'.",
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != (time_t) -1
&& mtime != makefile_mtimes[i]);
}
}
else
/* This makefile was not found at all. */
if (! (d->changed & RM_DONTCARE))
{
/* This is a makefile we care about. See how much. */
if (d->changed & RM_INCLUDED)
/* An included makefile. We don't need
to die, but we do want to complain. */
error ("Included makefile `%s' was not found.",
dep_name (d));
else
{
/* A normal makefile. We must die later. */
error ("Makefile `%s' was not found", dep_name (d));
any_failed = 1;
}
}
if (any_remade)
goto re_exec;
@@ -1264,7 +1405,7 @@ int main (int argc, char ** argv)
/* These names might have changed. */
register unsigned int i, j = 0;
for (i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-f")) /* XXX */
if (!strncmp (argv[i], "-f", 2)) /* XXX */
{
char *p = &argv[i][2];
if (*p == '\0')
@@ -1275,6 +1416,25 @@ int main (int argc, char ** argv)
}
}
/* Add -o options for all makefiles that were remade */
{
register unsigned int i;
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 *));
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;
}
if (directories != 0 && directories->idx > 0)
{
char bad;
@@ -1326,7 +1486,7 @@ int main (int argc, char ** argv)
{
char **p;
fputs ("Re-executing:", stdout);
for (p = argv; *p != 0; ++p)
for (p = nargv; *p != 0; ++p)
printf (" %s", *p);
puts ("");
}
@@ -1335,9 +1495,9 @@ int main (int argc, char ** argv)
fflush (stderr);
#ifndef _AMIGA
exec_command (argv, environ);
exec_command (nargv, environ);
#else
exec_command (argv);
exec_command (nargv);
exit (0);
#endif
/* NOTREACHED */
@@ -1400,6 +1560,10 @@ int main (int argc, char ** argv)
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. */
die (status);
}
@@ -1514,6 +1678,29 @@ handle_non_switch_argument (arg, env)
}
lastgoal->name = 0;
lastgoal->file = f;
{
/* Add this target name to the MAKECMDGOALS variable. */
struct variable *v;
char *value;
v = lookup_variable("MAKECMDGOALS", 12);
if (v == 0)
value = f->name;
else
{
/* Paste the old and new values together */
unsigned int oldlen, newlen;
oldlen = strlen(v->value);
newlen = strlen(f->name);
value = (char *)alloca(oldlen + 1 + newlen + 1);
bcopy(v->value, value, oldlen);
value[oldlen] = ' ';
bcopy(f->name, &value[oldlen + 1], newlen + 1);
}
define_variable("MAKECMDGOALS", 12, value, o_default, 0);
}
}
}
@@ -2137,11 +2324,13 @@ print_version ()
printf ("-%s", remote_description);
printf (", by Richard Stallman and Roland McGrath.\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97\n\
%s\tFree Software Foundation, Inc.\n\
%sThis is free software; see the source for copying conditions.\n\
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede, precede);
%sPARTICULAR PURPOSE.\n\n\
%sReport bugs to <bug-gnu-utils@prep.ai.mit.edu>.\n\n",
precede, precede, precede, precede, precede, precede);
printed_version = 1;
@@ -2155,7 +2344,6 @@ print_version ()
static void
print_data_base ()
{
extern char *ctime ();
time_t when;
when = time ((time_t *) 0);

63
maintMakefile Normal file
View File

@@ -0,0 +1,63 @@
# 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 config.ami configh.dos config.h.W32 config.h-vms
# 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 Makefile.DOS
#
Makefile.DOS: Makefile.DOS.template Makefile.am configure.in
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)@' \
$< > $@
chmod a-w $@
# Construct build.sh.in
#
build.sh.in: build.template Makefile.am
rm -f $@
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
$(patsubst %.c,%.o,$(globsrc)))@' \
$< > $@
chmod a-w+x $@
# 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/stamp-h.in
MAINTAINERCLEANFILES = $(TEMPLATES) missing Makefile.DOS build.sh.in \
$(maintFILES)
# 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)

View File

@@ -28,6 +28,8 @@ describes conventions for writing the Makefiles for GNU programs.
* Command Variables:: Variables for Specifying Commands
* Directory Variables:: Variables for Installation Directories
* Standard Targets:: Standard Targets for Users
* Install Command Categories:: Three categories of commands in the `install'
rule: normal, pre-install and post-install.
@end menu
@node Makefile Basics
@@ -65,9 +67,10 @@ part of the make or @file{$(srcdir)/} if the file is an unchanging part
of the source code. Without one of these prefixes, the current search
path is used.
The distinction between @file{./} and @file{$(srcdir)/} is important
when using the @samp{--srcdir} option to @file{configure}. A rule of
the form:
The distinction between @file{./} (the @dfn{build directory}) and
@file{$(srcdir)/} (the @dfn{source directory}) is important because
users can build in a separate directory using the @samp{--srcdir} option
to @file{configure}. A rule of the form:
@smallexample
foo.1 : foo.man sedscript
@@ -75,9 +78,8 @@ foo.1 : foo.man sedscript
@end smallexample
@noindent
will fail when the current directory is not the source directory,
because @file{foo.man} and @file{sedscript} are not in the current
directory.
will fail when the build directory is not the source directory, because
@file{foo.man} and @file{sedscript} are in the the source directory.
When using GNU @code{make}, relying on @samp{VPATH} to find the source
file will work in the case where there is a single dependency file,
@@ -109,6 +111,18 @@ foo.1 : foo.man sedscript
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
@end smallexample
GNU distributions usually contain some files which are not source
files---for example, Info files, and the output from Autoconf, Automake,
Bison or Flex. Since these files normally appear in the source
directory, they should always appear in the source directory, not in the
build directory. So Makefile rules to update them should put the
updated files in the source directory.
However, if a file does not appear in the distribution, then the
Makefile should not put it in the source directory, because building a
program in ordinary circumstances should not modify the source directory
in any way.
Try to make the build and installation targets, at least (and all their
subtargets) work correctly with a parallel @code{make}.
@@ -122,11 +136,17 @@ special features of @code{ksh} or @code{bash}.
The @code{configure} script and the Makefile rules for building and
installation should not use any utilities directly except these:
@c dd find
@c gunzip gzip md5sum
@c mkfifo mknod tee uname
@example
cat cmp cp echo egrep expr false grep
ln mkdir mv pwd rm rmdir sed test touch true
cat cmp cp diff echo egrep expr false grep install-info
ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
@end example
The compression program @code{gzip} can be used in the @code{dist} rule.
Stick to the generally supported options for these programs. For
example, don't use @samp{mkdir -p}, convenient as it may be, because
most systems don't support it.
@@ -140,26 +160,33 @@ user can substitute alternatives. Here are some of the programs we
mean:
@example
ar bison cc flex install ld lex
ar bison cc flex install ld ldconfig lex
make makeinfo ranlib texi2dvi yacc
@end example
Use the following @code{make} variables:
Use the following @code{make} variables to run those programs:
@example
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX)
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
@end example
When you use @code{ranlib}, you should make sure nothing bad happens if
the system does not have @code{ranlib}. Arrange to ignore an error
from that command, and print a message before the command to tell the
user that failure of the @code{ranlib} command does not mean a problem.
(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.)
When you use @code{ranlib} or @code{ldconfig}, you should make sure
nothing bad happens if the system does not have the program in question.
Arrange to ignore an error from that command, and print a message before
the command to tell the user that failure of this command does not mean
a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with
this.)
If you use symbolic links, you should implement a fallback for systems
that don't have symbolic links.
Additional utilities that can be used via Make variables are:
@example
chgrp chmod chown mknod
@end example
It is ok to use other utilities in Makefile portions (or scripts)
intended only for particular systems where you know those utilities
exist.
@@ -212,6 +239,9 @@ Put @code{CFLAGS} last in the compilation command, after other variables
containing compiler options, so the user can use @code{CFLAGS} to
override the others.
@code{CFLAGS} should be used in every invocation of the C compiler,
both those which do compilation and those which do linking.
Every Makefile should define the variable @code{INSTALL}, which is the
basic command for installing a file into the system.
@@ -328,14 +358,11 @@ files. This directory should normally be @file{/usr/local/etc}, but
write it as @file{$(prefix)/etc}.
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
@c rewritten to avoid overfull hbox --tower
Do not install executables
@c here
in this directory (they probably
belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not
install files that are modified in the normal course of their use
(programs whose purpose is to change the configuration of the system
excluded). Those probably belong in @file{$(localstatedir)}.
Do not install executables here in this directory (they probably belong
in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install
files that are modified in the normal course of their use (programs
whose purpose is to change the configuration of the system excluded).
Those probably belong in @file{$(localstatedir)}.
@item sharedstatedir
The directory for installing architecture-independent data files which
@@ -388,7 +415,7 @@ should normally be @file{/usr/local/include}, but write it as
@file{$(prefix)/include}.
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
Most compilers other than GCC do not look for header files in
Most compilers other than GCC do not look for header files in directory
@file{/usr/local/include}. So installing the header files this way is
only useful with GCC. Sometimes this is not a problem because some
libraries are only really intended to work with GCC. But some libraries
@@ -541,6 +568,7 @@ Here is a sample rule to install an Info file:
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
@smallexample
$(infodir)/foo.info: foo.info
$(POST_INSTALL)
# There may be a newer info file in . than in srcdir.
-if test -f foo.info; then d=.; \
else d=$(srcdir); fi; \
@@ -557,17 +585,24 @@ $(infodir)/foo.info: foo.info
else true; fi
@end smallexample
When writing the @code{install} target, you must classify all the
commands into three categories: normal ones, @dfn{pre-installation}
commands and @dfn{post-installation} commands. @xref{Install Command
Categories}.
@item uninstall
Delete all the installed files that the @samp{install} target would
create (but not the noninstalled files such as @samp{make all} would
create).
Delete all the installed files---the copies that the @samp{install}
target creates.
This rule should not modify the directories where compilation is done,
only the directories where files are installed.
The uninstallation commands are divided into three categories, just like
the installation commands. @xref{Install Command Categories}.
@item install-strip
Like @code{install}, but strip the executable files while installing
them. The definition of this target can be very simple:
them. In many cases, the definition of this target can be very simple:
@smallexample
install-strip:
@@ -652,6 +687,12 @@ You must define the variable @code{MAKEINFO} in the Makefile. It should
run the @code{makeinfo} program, which is part of the Texinfo
distribution.
Normally a GNU distribution comes with Info files, and that means the
Info files are present in the source directory. Therefore, the Make
rule for an info file should update it in the source directory. When
users build the package, ordinarily Make will not update the Info files
because they will already be up to date.
@item dvi
Generate DVI files for all Texinfo documentation.
For example:
@@ -734,3 +775,119 @@ installdirs: mkinstalldirs
This rule should not modify the directories where compilation is done.
It should do nothing but create installation directories.
@end table
@node Install Command Categories
@section Install Command Categories
@cindex pre-installation commands
@cindex post-installation commands
When writing the @code{install} target, you must classify all the
commands into three categories: normal ones, @dfn{pre-installation}
commands and @dfn{post-installation} commands.
Normal commands move files into their proper places, and set their
modes. They may not alter any files except the ones that come entirely
from the package they belong to.
Pre-installation and post-installation commands may alter other files;
in particular, they can edit global configuration files or data bases.
Pre-installation commands are typically executed before the normal
commands, and post-installation commands are typically run after the
normal commands.
The most common use for a post-installation command is to run
@code{install-info}. This cannot be done with a normal command, since
it alters a file (the Info directory) which does not come entirely and
solely from the package being installed. It is a post-installation
command because it needs to be done after the normal command which
installs the package's Info files.
Most programs don't need any pre-installation commands, but we have the
feature just in case it is needed.
To classify the commands in the @code{install} rule into these three
categories, insert @dfn{category lines} among them. A category line
specifies the category for the commands that follow.
A category line consists of a tab and a reference to a special Make
variable, plus an optional comment at the end. There are three
variables you can use, one for each category; the variable name
specifies the category. Category lines are no-ops in ordinary execution
because these three Make variables are normally undefined (and you
@emph{should not} define them in the makefile).
Here are the three possible category lines, each with a comment that
explains what it means:
@smallexample
$(PRE_INSTALL) # @r{Pre-install commands follow.}
$(POST_INSTALL) # @r{Post-install commands follow.}
$(NORMAL_INSTALL) # @r{Normal commands follow.}
@end smallexample
If you don't use a category line at the beginning of the @code{install}
rule, all the commands are classified as normal until the first category
line. If you don't use any category lines, all the commands are
classified as normal.
These are the category lines for @code{uninstall}:
@smallexample
$(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.}
$(POST_UNINSTALL) # @r{Post-uninstall commands follow.}
$(NORMAL_UNINSTALL) # @r{Normal commands follow.}
@end smallexample
Typically, a pre-uninstall command would be used for deleting entries
from the Info directory.
If the @code{install} or @code{uninstall} target has any dependencies
which act as subroutines of installation, then you should start
@emph{each} dependency's commands with a category line, and start the
main target's commands with a category line also. This way, you can
ensure that each command is placed in the right category regardless of
which of the dependencies actually run.
Pre-installation and post-installation commands should not run any
programs except for these:
@example
[ basename bash cat chgrp chmod chown cmp cp dd diff echo
egrep expand expr false fgrep find getopt grep gunzip gzip
hostname install install-info kill ldconfig ln ls md5sum
mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
test touch true uname xargs yes
@end example
@cindex binary packages
The reason for distinguishing the commands in this way is for the sake
of making binary packages. Typically a binary package contains all the
executables and other files that need to be installed, and has its own
method of installing them---so it does not need to run the normal
installation commands. But installing the binary package does need to
execute the pre-installation and post-installation commands.
Programs to build binary packages work by extracting the
pre-installation and post-installation commands. Here is one way of
extracting the pre-installation commands:
@smallexample
make -n install -o all \
PRE_INSTALL=pre-install \
POST_INSTALL=post-install \
NORMAL_INSTALL=normal-install \
| gawk -f pre-install.awk
@end smallexample
@noindent
where the file @file{pre-install.awk} could contain this:
@smallexample
$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}
on @{print $0@}
$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@}
@end smallexample
The resulting file of pre-installation commands is executed as a shell
script as part of installing the binary package.

14
make.1
View File

@@ -8,7 +8,7 @@ make \- GNU make utility to maintain groups of programs
makefile ] [ option ] ...
target ...
.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 .
It is updated only occasionally, because the GNU project does not use nroff.
For complete, current documentation, refer to the Info file
@@ -110,7 +110,7 @@ or if the target does not exist.
.B \-b
.TP 0.5i
.B \-m
These options are ignored for compatibility with other versions of
These options are ignored for compatibility with other versions of
.IR make .
.TP 0.5i
.BI "\-C " dir
@@ -157,7 +157,7 @@ If several
.B \-I
options are used to specify several directories, the directories are
searched in the order specified.
Unlike the arguments to other flags of
Unlike the arguments to other flags of
.IR make ,
directories given with
.B \-I
@@ -236,11 +236,11 @@ Silent operation; do not print the commands as they are executed.
Cancel the effect of the
.B \-k
option.
This is never necessary except in a recursive
This is never necessary except in a recursive
.I make
where
.B \-k
might be inherited from the top-level
might be inherited from the top-level
.I make
via MAKEFLAGS or if you set
.B \-k
@@ -254,7 +254,7 @@ future invocations of
.IR make .
.TP 0.5i
.B \-v
Print the version of the
Print the version of the
.I make
program plus a copyright, a list of authors and a notice that there
is no warranty.
@@ -285,7 +285,7 @@ it is almost the same as running a
.I touch
command on the given file before running
.IR make ,
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 .
.SH "SEE ALSO"
.PD 0

35
make.h
View File

@@ -1,5 +1,5 @@
/* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 1988,89,90,91,92,93,94,95,96 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -72,7 +72,7 @@ extern int errno;
#include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
#if defined (_POSIX_VERSION) && !defined (ultrix)
#if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
#define POSIX
#endif
#endif
@@ -137,6 +137,19 @@ extern unsigned int get_path_max PARAMS ((void));
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
/* Nonzero if the integer type T is signed. */
#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
/* The minimum and maximum values for the integer type T.
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */
#define INTEGER_TYPE_MINIMUM(t) \
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
#ifdef STAT_MACROS_BROKEN
#ifdef S_ISREG
#undef S_ISREG
@@ -202,8 +215,8 @@ extern void exit PARAMS ((int));
#ifndef bzero
#define bzero(s, n) memset ((s), 0, (n))
#endif
#ifndef bcopy
#define bcopy(s, d, n) memcpy ((d), (s), (n))
#if defined(HAVE_MEMMOVE) && !defined(bcopy)
#define bcopy(s, d, n) memmove ((d), (s), (n))
#endif
#else /* Not ANSI_STRING. */
@@ -277,13 +290,17 @@ extern char *alloca ();
#define ENUM_BITFIELD(bits)
#endif
#if defined(__MSDOS__) || defined(WIN32)
#if defined(__MSDOS__) || defined(WINDOWS32)
#define PATH_SEPARATOR_CHAR ';'
#else
#if defined(VMS)
#define PATH_SEPARATOR_CHAR ','
#else
#define PATH_SEPARATOR_CHAR ':'
#endif
#endif
#ifdef WIN32
#ifdef WINDOWS32
#include <fcntl.h>
#include <malloc.h>
#define pipe(p) _pipe(p, 512, O_BINARY)
@@ -346,6 +363,7 @@ extern void create_pattern_rule ();
extern void build_vpath_lists ();
extern void construct_vpath_list ();
extern int vpath_search ();
extern int gpath_search ();
extern void construct_include_path ();
extern void uniquize_deps ();
@@ -362,9 +380,9 @@ extern void child_access ();
#endif
/* 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(WIN32)
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
extern long int atol ();
#ifndef VMS
@@ -393,6 +411,7 @@ extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
extern int print_directory_flag, warn_undefined_variables_flag;
extern int posix_pedantic;
extern int clock_skew_detected;
extern unsigned int job_slots;
#ifndef NO_FLOAT

View File

@@ -9,9 +9,9 @@
@set RCSID $Id$
@set EDITION 0.51
@set VERSION 3.75 Beta
@set UPDATED 9 May 1996
@set UPDATE-MONTH May 1996
@set VERSION 3.76 Beta
@set UPDATED 26 Aug 1997
@set UPDATE-MONTH Aug 1997
@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
@@ -25,6 +25,11 @@
@syncodeindex pg cp
@ifinfo
@dircategory The GNU make utility
@direntry
* GNU make: (make.info). The GNU make utility.
@end direntry
This file documents the GNU Make utility, which determines
automatically which pieces of a large program need to be recompiled,
and issues the commands to recompile them.
@@ -32,7 +37,7 @@ and issues the commands to recompile them.
This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97
Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
@@ -68,7 +73,7 @@ by the Free Software Foundation.
@author Richard M. Stallman and Roland McGrath
@page
@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
Published by the Free Software Foundation @*
59 Temple Place -- Suite 330, @*
@@ -95,7 +100,7 @@ Cover art by Etienne Suvasa.
@page
@ifinfo
@node Top, Overview, (dir), (dir)
@node Top, Overview, , (dir)
@top Make
The GNU @code{make} utility automatically determines which pieces of a
@@ -196,6 +201,7 @@ Searching Directories for Dependencies
to every dependency.
* Selective Search:: Specifying a search path
for a specified class of names.
* Search Algorithm:: When and how search paths are applied.
* Commands/Search:: How to write shell commands that work together
with search paths.
* Implicit/Search:: How search paths affect implicit rules.
@@ -239,6 +245,8 @@ How to Use Variables
* Defining:: An alternate way to set a variable
to a verbatim string.
* Environment:: Variable values can come from the environment.
* Automatic:: Some special variables have predefined
meanings for use with implicit rules.
Advanced Features for Reference to Variables
@@ -256,7 +264,7 @@ Functions for Transforming Text
* Syntax of Functions:: How to write a function call.
* 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.
* Origin Function:: Find where a variable got its value.
* Shell Function:: Substitute the output of a shell command.
@@ -288,7 +296,7 @@ Using Implicit Rules
* Last Resort:: How to defining commands for rules
which cannot find any.
* Suffix Rules:: The old-fashioned style of implicit rule.
* Search Algorithm:: The precise algorithm for applying
* Implicit Rule Search:: The precise algorithm for applying
implicit rules.
Defining and Redefining Pattern Rules
@@ -307,6 +315,7 @@ Using @code{make} to Update Archive Files
* Archive Members:: Archive members as targets.
* Archive Update:: The implicit rule for archive member targets.
* Archive Pitfalls:: Dangers to watch out for when using archives.
* Archive Suffix Rules:: You can write a special kind of suffix rule
for updating archives.
@@ -1093,6 +1102,8 @@ makefile as has been traditionally done with other versions of
@cindex @code{-I}
@cindex @code{--include-dir}
@cindex included makefiles, default directries
@cindex default directries for included makefiles
@findex /usr/gnu/include
@findex /usr/local/include
@findex /usr/include
@@ -1103,7 +1114,10 @@ First, any directories you have specified with the @samp{-I} or
(@pxref{Options Summary, ,Summary of Options}).
Then the following directories (if they exist)
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/local/include}, @file{/usr/include}.
@@ -1455,7 +1469,10 @@ significance. If alone, or followed by a slash, it represents your home
directory. For example @file{~/bin} expands to @file{/home/you/bin}.
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}
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,
and in commands (where the shell does the expansion). In other
@@ -1569,6 +1586,24 @@ expansion, but you need more sophisticated techniques, including the
These are described in the following section.
@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
@subsection The Function @code{wildcard}
@findex wildcard
@@ -1645,6 +1680,7 @@ just the search paths.
to every dependency.
* Selective Search:: Specifying a search path
for a specified class of names.
* Search Algorithm:: When and how search paths are applied.
* Commands/Search:: How to write shell commands that work together
with search paths.
* Implicit/Search:: How search paths affect implicit rules.
@@ -1665,14 +1701,16 @@ rules.
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
@code{VPATH} for a file with that name. If a file is found in one of
them, that file becomes the dependency. Rules may then specify the
names of source files in the dependencies as if they all existed in the
current directory. @xref{Commands/Search, ,Writing Shell Commands with
Directory Search}.
them, that file may become the dependency (see below). Rules may then
specify the names of files in the dependency list as if they all
existed in the current directory. @xref{Commands/Search, ,Writing Shell
Commands with Directory Search}.
In the @code{VPATH} variable, directory names are separated by colons or
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,
@@ -1701,15 +1739,16 @@ foo.o : src/foo.c
assuming the file @file{foo.c} does not exist in the current directory but
is found in the directory @file{src}.
@node Selective Search, Commands/Search, General Search, Directory Search
@node Selective Search, Search Algorithm, General Search, Directory Search
@subsection The @code{vpath} Directive
@findex vpath
Similar to the @code{VPATH} variable but more selective is the @code{vpath}
directive (note lower case), which allows you to specify a search path for a particular class
of file names, those that match a particular pattern. Thus you can supply
certain search directories for one class of file names and other directories
(or none) for other file names.
Similar to the @code{VPATH} variable, but more selective, is the
@code{vpath} directive (note lower case), which allows you to specify a
search path for a particular class of file names: those that match a
particular pattern. Thus you can supply certain search directories for
one class of file names and other directories (or none) for other file
names.
There are three forms of the @code{vpath} directive:
@@ -1719,8 +1758,8 @@ Specify the search path @var{directories} for file names that match
@var{pattern}.
The search path, @var{directories}, is a list of directories to be
searched, separated by colons or blanks, just like the search path used
in the @code{VPATH} variable.
searched, separated by colons (semi-colons on MS-DOS and MS-Windows) or
blanks, just like the search path used in the @code{VPATH} variable.
@item vpath @var{pattern}
Clear out the search path associated with @var{pattern}.
@@ -1800,7 +1839,74 @@ vpath % blish
will look for a file ending in @samp{.c} in @file{foo}, then
@file{bar}, then @file{blish}.
@node Commands/Search, Implicit/Search, Selective Search, Directory Search
@node Search Algorithm, Commands/Search, Selective Search, Directory Search
@subsection How Directory Searches are Performed
@cindex algorithm for directory search
@cindex directory search algorithm
When a dependency is found through directory search, regardless of type
(general or selective), the pathname located may not be the one that
@code{make} actually provides you in the dependency list. Sometimes
the path discovered through directory search is thrown away.
The algorithm @code{make} uses to decide whether to keep or abandon a
path found via directory search is as follows:
@enumerate
@item
If a target file does not exist at the path specified in the makefile,
directory search is performed.
@item
If the directory search is successful, that path is kept and this file
is tentatively stored as the target.
@item
All dependencies of this target are examined using this same method.
@item
After processing the dependencies, the target may or may not need to be
rebuilt:
@enumerate a
@item
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
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
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
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
This algorithm may seem complex, but in practice it is quite often
exactly what you want.
@cindex traditional directory search
@cindex directory search, traditional
Other versions of @code{make} use a simpler algorithm: if the file does
not exist, and it is found via directory search, then that pathname is
always used whether or not the target needs to be built. Thus, if the
target is rebuilt it is created at the pathname discovered during
directory search.
@vindex GPATH
If, in fact, this is the behavior you want for some or all of your
directories, you can use the @code{GPATH} variable to indicate this to
@code{make}.
@code{GPATH} has the same syntax and format as @code{VPATH} (that is, a
space- or colon-delimited list of pathnames). If an out-of-date target
is found by directory search in a directory that also appears in
@code{GPATH}, then that pathname is not thrown away. The target is
rebuilt using the expanded path.
@node Commands/Search, Implicit/Search, Search Algorithm, Directory Search
@subsection Writing Shell Commands with Directory Search
@cindex shell command, and directory search
@cindex directory search (@code{VPATH}), and shell commands
@@ -1884,7 +1990,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}
search paths and the @code{VPATH} search path, and then in the
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,
@@ -2112,7 +2220,7 @@ The commands specified for @code{.DEFAULT} are used for any target for
which no rules are found (either explicit rules or implicit rules).
@xref{Last Resort}. If @code{.DEFAULT} commands are specified, every
file mentioned as a dependency, but not as a target in a rule, will have
these commands executed on its behalf. @xref{Search Algorithm,
these commands executed on its behalf. @xref{Implicit Rule Search,
,Implicit Rule Search Algorithm}.
@findex .PRECIOUS
@@ -2409,6 +2517,8 @@ from the corresponding @file{.c} file:
@group
objects = foo.o bar.o
all: $(objects)
$(objects): %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@@
@end group
@@ -2603,7 +2713,8 @@ called @file{@var{name}.d} from a C source file called @file{@var{name}.c}:
@group
%.d: %.c
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1 $@@/g'\'' > $@@'
| sed '\''s/\($*\)\.o[ :]*/\1.o $@@ : /g'\'' > $@@; \
[ -s $@@ ] || rm -f $@@'
@end group
@end smallexample
@@ -2757,13 +2868,15 @@ by making a new subshell for each line. (In practice, @code{make} may
take shortcuts that do not affect the results.)
@cindex @code{cd} (shell command)
@strong{Please note:} this implies that shell commands such as
@code{cd} that set variables local to each process will not affect the
following command lines. If you want to use @code{cd} to affect the
next command, put the two on a single line with a 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:
@strong{Please note:} this implies that shell commands such as @code{cd}
that set variables local to each process will not affect the following
command lines. @footnote{On MS-DOS, the value of current working
directory is @strong{global}, so changing it @emph{will} affect the
following command lines on those systems.} If you want to use @code{cd}
to affect the next command, put the two on a single line with a
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
foo : bar/lose
@@ -2794,13 +2907,75 @@ foo : bar/lose
The program used as the shell is taken from the variable @code{SHELL}.
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
Unlike most variables, the variable @code{SHELL} is never set from the
environment. This is because the @code{SHELL} environment variable is
used to specify your personal choice of shell program for interactive
use. It would be very bad for personal choices like this to affect
the functioning of makefiles. @xref{Environment, ,Variables from the
Environment}.
use. It would be very bad for personal choices like this to affect the
functioning of makefiles. @xref{Environment, ,Variables from the
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
@section Parallel Execution
@@ -2817,6 +2992,9 @@ for it to finish before executing the next. However, the @samp{-j} or
@samp{--jobs} option tells @code{make} to execute many commands
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
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,
@@ -3033,7 +3211,7 @@ subdirectory. You can do it by writing this:
@example
subsystem:
cd subdir; $(MAKE)
cd subdir && $(MAKE)
@end example
@noindent
@@ -3069,13 +3247,13 @@ not the explicit command name @samp{make}, as shown here:
@example
@group
subsystem:
cd subdir; $(MAKE)
cd subdir && $(MAKE)
@end group
@end example
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
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
executed for recursive invocations.
@cindex @code{cd} (shell command)
@@ -3092,7 +3270,7 @@ Consider the command @samp{make -t} in the above example. (The
any commands; see @ref{Instead of Execution}.) Following the usual
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
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
commands.@refill
@cindex @code{-t}, and recursion
@@ -3343,7 +3521,7 @@ value of @code{MAKEFLAGS}, like this:
@example
subsystem:
cd subdir; $(MAKE) MAKEFLAGS=
cd subdir && $(MAKE) MAKEFLAGS=
@end example
@vindex MAKEOVERRIDES
@@ -3382,7 +3560,7 @@ this:
@example
subsystem:
cd subdir; $(MAKE) $(MFLAGS)
cd subdir && $(MAKE) $(MFLAGS)
@end example
@noindent
@@ -4508,7 +4686,9 @@ Such problems would be especially likely with the variable @code{SHELL},
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
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 Conditionals, Functions, Using Variables, Top
@chapter Conditional Parts of Makefiles
@@ -4805,7 +4985,7 @@ call, just as a variable might be substituted.
@menu
* Syntax of Functions:: How to write a function call.
* 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.
* Origin Function:: Find where a variable got its value.
* Shell Function:: Substitute the output of a shell command.
@@ -4874,7 +5054,7 @@ bar:= $(subst $(space),$(comma),$(foo))
Here the @code{subst} function replaces each space with a comma, through
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
@cindex functions, for text
@@ -5138,7 +5318,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
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
@cindex functions, for file names
@cindex file name functions
@@ -5205,11 +5385,11 @@ file names.
For example,
@example
$(suffix src/foo.c hacks)
$(suffix src/foo.c src-1.0/bar.c hacks)
@end example
@noindent
produces the result @samp{.c}.
produces the result @samp{.c .c}.
@item $(basename @var{names}@dots{})
@findex basename
@@ -5217,15 +5397,16 @@ produces the result @samp{.c}.
@cindex file name, basename of
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
(and not including) the last period. Otherwise, the basename is the
entire file name. For example,
(and not including) the last period. Periods in the directory part are
ignored. If there is no period, the basename is the entire file name.
For example,
@example
$(basename src/foo.c hacks)
$(basename src/foo.c src-1.0/bar hacks)
@end example
@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)
@item $(addsuffix @var{suffix},@var{names}@dots{})
@@ -5284,8 +5465,8 @@ was given to those two functions.@refill
@item $(word @var{n},@var{text})
@findex word
@cindex words, selecting
@cindex selecting words
@cindex word, selecting a
@cindex selecting a word
Returns the @var{n}th word of @var{text}. The legitimate values of
@var{n} start from 1. If @var{n} is bigger than the number of words
in @var{text}, the value is empty. For example,
@@ -5297,6 +5478,25 @@ $(word 2, foo bar baz)
@noindent
returns @samp{bar}.
@item $(wordlist @var{s},@var{e},@var{text})
@findex wordlist
@cindex words, selecting lists of
@cindex selecting word lists
Returns the list of words in @var{text} starting with word @var{s} and
ending with word @var{e} (inclusive). The legitimate values of @var{s}
and @var{e} start from 1. If @var{s} is bigger than the number of words
in @var{text}, the value is empty. If @var{e} is bigger than the number
of words in @var{text}, words up to the end of @var{text} are returned.
If @var{s} is greater than @var{e}, @code{make} swaps them for you. For
example,
@example
$(wordlist 2, 3, foo bar baz)
@end example
@noindent
returns @samp{bar baz}.
@c Following item phrased to prevent overfull hbox. --RJC 17 Jul 92
@item $(words @var{text})
@findex words
@@ -5333,7 +5533,7 @@ that match the pattern.
@xref{Wildcards, ,Using Wildcard Characters in File Names}.
@end table
@node Foreach Function, Origin Function, Filename Functions, Functions
@node Foreach Function, Origin Function, File Name Functions, Functions
@section The @code{foreach} Function
@findex foreach
@cindex words, iterating over
@@ -5546,8 +5746,10 @@ The @code{shell} function performs the same function that backquotes
(@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
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
spaces.@refill
before substituting it into the surrounding text, is to convert each
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
function calls are expanded. In most cases, this is when the makefile is
@@ -5662,6 +5864,28 @@ parsed as a switch or variable definition, respectively). Even
targets not in the makefile may be specified, if @code{make} can find
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
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
@@ -6095,6 +6319,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.
@xref{Parallel, ,Parallel Execution},
for more information on how commands are run.
Note that this option is ignored on MS-DOS.
@item -k
@cindex @code{-k}
@@ -6312,7 +6537,7 @@ retained for compatibility.
* Last Resort:: How to defining commands for rules
which cannot find any.
* Suffix Rules:: The old-fashioned style of implicit rule.
* Search Algorithm:: The precise algorithm for applying
* Implicit Rule Search:: The precise algorithm for applying
implicit rules.
@end menu
@@ -6370,7 +6595,7 @@ result of another implicit rule, we say that @dfn{chaining} is occurring.
In general, @code{make} searches for an implicit rule for each target, and
for each double-colon rule, that has no commands. A file that is mentioned
only as a dependency is considered a target whose rule specifies nothing,
so implicit rule search happens for it. @xref{Search Algorithm, ,Implicit Rule Search Algorithm}, for the
so implicit rule search happens for it. @xref{Implicit Rule Search, ,Implicit Rule Search Algorithm}, for the
details of how the search is done.
Note that explicit dependencies do not influence implicit rule search.
@@ -7253,7 +7478,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
appending @samp{D} or @samp{F}, respectively. These variants are
semi-obsolete in GNU @code{make} since the functions @code{dir} and
@code{notdir} can be used to get a similar effect (@pxref{Filename
@code{notdir} can be used to get a similar effect (@pxref{File Name
Functions, , Functions for File Names}). Note, however, that the
@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:
@@ -7508,7 +7733,7 @@ Commands, ,Defining Empty Commands}).@refill
You can use a last-resort rule to override part of another makefile.
@xref{Overriding Makefiles, , Overriding Part of Another Makefile}.
@node Suffix Rules, Search Algorithm, Last Resort, Implicit Rules
@node Suffix Rules, Implicit Rule Search, Last Resort, Implicit Rules
@section Old-Fashioned Suffix Rules
@cindex old-fashioned suffix rules
@cindex suffix rule
@@ -7610,7 +7835,7 @@ before @code{make} reads any makefiles. You can change the list of suffixes
with a rule for the special target @code{.SUFFIXES}, but that does not alter
this variable.
@node Search Algorithm, , Suffix Rules, Implicit Rules
@node Implicit Rule Search, , Suffix Rules, Implicit Rules
@section Implicit Rule Search Algorithm
@cindex implicit rule, search algorithm
@cindex search algorithm, implicit rule
@@ -8159,6 +8384,10 @@ characters. In other versions of @code{make}, they must begin with
Keep track of the current level of @code{make} recursion using the
variable @code{MAKELEVEL}. @xref{Recursion, ,Recursive Use of @code{make}}.
@item
Provide any goals given on the command line in the variable
@code{MAKECMDGOALS}. @xref{Goals, ,Arguments to Specify the Goals}.
@item
Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}.
@@ -8423,43 +8652,43 @@ Sort the words in @var{list} lexicographically, removing duplicates.@*
@item $(dir @var{names}@dots{})
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{})
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{})
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{})
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{})
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{})
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})
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})
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})
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{})
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{})
Find file names matching a shell file name pattern (@emph{not} a
@@ -8563,6 +8792,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
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
The name with which @code{make} was invoked.
@@ -8580,6 +8815,12 @@ The flags given to @code{make}. You can set this in the environment or
a makefile to set flags.@*
@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 SUFFIXES
The default list of suffixes before @code{make} reads any makefiles.

View File

@@ -5,7 +5,7 @@ $! P1 is non-empty if you want to link with the VAXCRTL library instead
$! of the shareable executable
$!
$ def/nolog sys sys$library:
$ 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"
$ 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 getopt getopt1"
$ copy config.h-vms config.h
$ n=0
$ loop:
@@ -17,18 +17,18 @@ $ n = n + 1
$ goto loop
$ linkit:
$ if p1 .nes. "" then goto link_using_library
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
$ link/exe=make 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,fnmatch,getopt,getopt1
$ exit
$ link_using_library:
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
$ link/exe=make 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,fnmatch,getopt,getopt1,sys$library:vaxcrtl/lib
$!
$ 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'
$ cc/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
$ exit
$ endsubroutine : compileit

View File

@@ -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.
#
# VMS extensions from GNU Make 3.60 imported by
@@ -31,13 +31,13 @@ CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
#LDFLAGS = /deb
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"
# If you don't want archive support, comment these out.
#ARCHIVES = ,ar.obj,arscan.obj
#ARCHIVES_SRC = ar.c arscan.c
ARCHIVES = ,ar.obj,arscan.obj
ARCHIVES_SRC = ar.c arscan.c
# If your system needs extra libraries loaded in, define them here.
# System V probably need -lPW for alloca.

4
misc.c
View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -397,7 +397,7 @@ end_of_token (s)
return s;
}
#ifdef WIN32
#ifdef WINDOWS32
/*
* Same as end_of_token, but take into account a stop character
*/

142
read.c
View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -30,7 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "glob/glob.h"
#endif
#ifndef WIN32
#ifndef WINDOWS32
#ifndef _AMIGA
#ifndef VMS
#include <pwd.h>
@@ -38,7 +38,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
struct passwd *getpwnam PARAMS ((char *name));
#endif
#endif
#endif /* !WIN32 */
#endif /* !WINDOWS32 */
/* A `struct linebuffer' is a structure which holds a line of text.
`readline' reads a line from a stream into a linebuffer
@@ -81,7 +81,7 @@ static struct conditionals *conditionals = &toplevel_conditionals;
static char *default_include_directories[] =
{
#if defined(WIN32) && !defined(INCLUDEDIR)
#if defined(WINDOWS32) && !defined(INCLUDEDIR)
/*
* This completly up to the user when they install MSVC or other packages.
* This is defined as a placeholder.
@@ -271,6 +271,7 @@ read_makefile (filename, flags)
unsigned int commands_started;
register char *p;
char *p2;
int len;
int ignoring = 0, in_ignored_define = 0;
int no_targets = 0; /* Set when reading a rule without targets. */
char *passed_filename = filename;
@@ -283,7 +284,7 @@ read_makefile (filename, flags)
char *pattern = 0, *pattern_percent;
int makefile_errno;
#ifdef WIN32
#if defined (WINDOWS32) || defined (__MSDOS__)
int check_again;
#endif
@@ -302,8 +303,9 @@ read_makefile (filename, flags)
#ifdef lint /* Suppress `used before set' messages. */
two_colon = 0;
pattern_percent = 0;
#endif
pattern_percent = 0;
commands_started = lineno;
if (debug_flag)
{
@@ -452,8 +454,7 @@ read_makefile (filename, flags)
remove_comments (collapsed);
/* strncmp is first to avoid dereferencing out into space. */
#define word1eq(s, l) (!strncmp (s, p, l) \
&& (p[l] == '\0' || isblank (p[l])))
#define word1eq(s, l) (len == l && !strncmp (s, p, l))
p = collapsed;
while (isspace (*p))
++p;
@@ -461,6 +462,21 @@ read_makefile (filename, flags)
/* This line is completely empty. */
continue;
/* Find the end of the first token */
for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2)
{}
len = p2 - p;
/* Find the start of the second token. If it's a `:', jump past
preprocessor stuff since it can't be that--this allows targets named
`export', etc. */
while (isspace (*p2))
++p2;
if (*p2 == '\0')
p2 = NULL;
else if (p2[0] == ':' && p2[1] == '\0')
goto check_var;
/* We must first check for conditional and `define' directives before
ignoring anything, since they control what we will do with
following lines. */
@@ -578,7 +594,29 @@ read_makefile (filename, flags)
v->export = v_noexport;
}
}
else if (word1eq ("include", 7) || word1eq ("-include", 8)
else if (word1eq ("vpath", 5))
{
char *pattern;
unsigned int len;
p2 = variable_expand (p + 5);
p = find_next_token (&p2, &len);
if (p != 0)
{
pattern = savestring (p, len);
p = find_next_token (&p2, &len);
/* No searchpath means remove all previous
selective VPATH's with the same pattern. */
}
else
/* No pattern means remove all previous selective VPATH's. */
pattern = 0;
construct_vpath_list (pattern, p);
if (pattern != 0)
free (pattern);
}
else
check_var:
if (word1eq ("include", 7) || word1eq ("-include", 8)
|| word1eq ("sinclude", 8))
{
/* We have found an `include' line specifying a nested
@@ -642,26 +680,6 @@ read_makefile (filename, flags)
reading_filename = filename;
reading_lineno_ptr = &lineno;
}
else if (word1eq ("vpath", 5))
{
char *pattern;
unsigned int len;
p2 = variable_expand (p + 5);
p = find_next_token (&p2, &len);
if (p != 0)
{
pattern = savestring (p, len);
p = find_next_token (&p2, &len);
/* No searchpath means remove all previous
selective VPATH's with the same pattern. */
}
else
/* No pattern means remove all previous selective VPATH's. */
pattern = 0;
construct_vpath_list (pattern, p);
if (pattern != 0)
free (pattern);
}
#undef word1eq
else if (try_variable_definition (filename, lineno, p, o_file))
/* This line has been dealt with. */
@@ -764,11 +782,6 @@ read_makefile (filename, flags)
else
break;
}
#ifdef __MSDOS__
/* For MS-DOS, skip a "C:\...". */
if (p != 0 && p[1] == '\\' && isalpha (p[-1]))
p = 0;
#endif
#ifdef _AMIGA
/* Here, the situation is quite complicated. Let's have a look
at a couple of targets:
@@ -785,10 +798,10 @@ read_makefile (filename, flags)
if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1])))
p = 0;
#endif
#ifdef WIN32
#if defined (WINDOWS32) || defined (__MSDOS__)
do {
check_again = 0;
/* For WIN32, 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])) {
p = index(p + 1, ':');
check_again = 1;
@@ -894,13 +907,17 @@ do_define (name, namelen, origin, lineno, infile, filename)
initbuffer (&lb);
while (!feof (infile))
{
unsigned int len;
lineno += nlines;
nlines = readline (&lb, infile, filename, lineno);
collapse_continuations (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;
remove_comments (p);
@@ -915,12 +932,11 @@ do_define (name, namelen, origin, lineno, infile, filename)
(void) define_variable (var, strlen (var), definition, origin, 1);
free (definition);
freebuffer (&lb);
return lineno;
return (lineno + nlines);
}
else
{
unsigned int len = strlen (lb.buffer);
len = strlen (lb.buffer);
/* Increase the buffer size if necessary. */
if (idx + len + 1 > length)
{
@@ -1462,7 +1478,11 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
/* See if this is first target seen whose name does
not start with a `.', unless it contains a slash. */
if (default_goal_file == 0 && set_default
&& (*name != '.' || index (name, '/') != 0))
&& (*name != '.' || index (name, '/') != 0
#ifdef __MSDOS__
|| index (name, '\\') != 0
#endif
))
{
int reject = 0;
@@ -1622,9 +1642,11 @@ parse_file_seq (stringp, stopchar, size, strip)
*p =' ';
#endif
#ifdef __MSDOS__
/* For MS-DOS, skip a "C:\...". */
if (stopchar == ':' && p != 0 && p[1] == '\\' && isalpha (p[-1]))
p = 0;
/* 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
if (stopchar == ':' && p && *p == ':' &&
@@ -1633,8 +1655,8 @@ parse_file_seq (stringp, stopchar, size, strip)
p = find_char_unquote (p+1, stopchars, 1);
}
#endif
#ifdef WIN32
/* For WIN32, skip a "C:\..." or "C:/...". */
#ifdef WINDOWS32
/* For WINDOWS32, skip a "C:\..." or "C:/...". */
if (stopchar == ':' &&
p != 0 &&
(p[1] == '\\' || p[1] == '/') &&
@@ -1943,6 +1965,10 @@ construct_include_path (arg_dirs)
register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *));
register unsigned int idx = 0;
#ifdef __MSDOS__
defsize++;
#endif
/* First consider any dirs specified with -I switches.
Ignore dirs that don't exist. */
@@ -1974,6 +2000,22 @@ construct_include_path (arg_dirs)
/* Now add at the end the standard default dirs. */
#ifdef __MSDOS__
{
/* The environment variable $DJDIR holds the root of the
DJGPP directory tree; add ${DJDIR}/include. */
struct variable *djdir = lookup_variable ("DJDIR", 5);
if (djdir)
{
char *defdir = (char *) xmalloc (strlen (djdir->value) + 8 + 1);
strcat (strcpy (defdir, djdir->value), "/include");
dirs[idx++] = defdir;
}
}
#endif
for (i = 0; default_include_directories[i] != 0; ++i)
if (stat (default_include_directories[i], &stbuf) == 0
&& S_ISDIR (stbuf.st_mode))
@@ -2029,7 +2071,7 @@ tilde_expand (name)
free (home_dir);
home_dir = getenv ("HOME");
}
#if !defined(_AMIGA) && !defined(WIN32)
#if !defined(_AMIGA) && !defined(WINDOWS32)
if (home_dir == 0 || home_dir[0] == '\0')
{
extern char *getlogin ();
@@ -2042,7 +2084,7 @@ tilde_expand (name)
home_dir = p->pw_dir;
}
}
#endif /* !AMIGA && !WIN32 */
#endif /* !AMIGA && !WINDOWS32 */
if (home_dir != 0)
{
char *new = concat (home_dir, "", name + 1);
@@ -2051,7 +2093,7 @@ tilde_expand (name)
return new;
}
}
#if !defined(_AMIGA) && !defined(WIN32)
#if !defined(_AMIGA) && !defined(WINDOWS32)
else
{
struct passwd *pwent;
@@ -2069,7 +2111,7 @@ tilde_expand (name)
else if (userend != 0)
*userend = '/';
}
#endif /* !AMIGA && !WIN32 */
#endif /* !AMIGA && !WINDOWS32 */
#endif /* !VMS */
return 0;
}

View File

@@ -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.
This port was done by Klaus Kämpf (kkaempf@progis.de) of
proGIS Software, Aachen, Germany
This port was done by Klaus Kämpf <kkaempf@progis.de> of
proGIS Software, Aachen, Germany.
To build Make, simply type @makefile. This should compile all the
necessary files and link Make.
There is also a file called makefile.vms. If you already have GNU
Make 3.74 built you can just use Make with this makefile to rebuild.
necessary files and link Make. There is also a file called
makefile.vms. If you already have GNU Make built you can just use
Make with this makefile to rebuild.
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
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 ('\').
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-).
But it will stop on -E- and -F- errors. (unless you do something to override
this in your makefile, or whatever).

140
remake.c
View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -29,10 +29,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/file.h>
#endif
#ifdef __MSDOS__
#include "variable.h"
#endif
#ifdef VMS
#include <starlet.h>
#endif
#ifdef WIN32
#ifdef WINDOWS32
#include <io.h>
#endif
@@ -52,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));
#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
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
@@ -566,13 +566,46 @@ update_file_1 (file, depth)
if (!must_make)
{
DEBUGPR ("No need to remake target `%s'.\n");
if (debug_flag)
{
print_spaces(depth);
printf("No need to remake target `%s'", file->name);
if (!streq(file->name, file->hname))
printf("; using VPATH name `%s'", file->hname);
printf(".\n");
fflush(stdout);
}
notice_finished_file (file);
/* Since we don't need to remake the file, convert it to use the
VPATH filename if we found one. hfile will be either the
local name if no VPATH or the VPATH name if one was found. */
while (file)
{
file->name = file->hname;
file = file->prev;
}
return 0;
}
DEBUGPR ("Must remake target `%s'.\n");
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
VPATH */
if (!streq(file->name, file->hname))
{
if (debug_flag)
{
print_spaces (depth);
printf(" Ignoring VPATH name `%s'.\n", file->hname);
fflush(stdout);
}
file->ignore_vpath = 1;
}
/* Now, take appropriate actions to remake the file. */
remake_file (file);
@@ -745,7 +778,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
check_renamed (file);
mtime = file_mtime (file);
check_renamed (file);
if (mtime > this_mtime)
if (mtime != (time_t) -1 && mtime > this_mtime)
*must_make_ptr = 1;
/* Otherwise, update all non-intermediate files we depend on,
if necessary, and see whether any of them is more
@@ -1003,7 +1036,7 @@ f_mtime (file, search)
{
mtime = name_mtime (file->name);
if (mtime == (time_t) -1 && search)
if (mtime == (time_t) -1 && search && !file->ignore_vpath)
{
/* If name_mtime failed, search VPATH. */
char *name = file->name;
@@ -1016,9 +1049,20 @@ f_mtime (file, search)
/* vpath_search and library_search store zero in MTIME
if they didn't need to do a stat call for their work. */
file->last_mtime = mtime;
rename_file (file, name);
/* 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);
check_renamed (file);
return file_mtime (file);
mtime = name_mtime (name);
}
}
}
@@ -1026,29 +1070,39 @@ f_mtime (file, search)
{
/* Files can have bogus timestamps that nothing newly made will be
"newer" than. Updating their dependents could just result in loops.
So notify the user of the anomaly by treating future files as
unrecoverably absent. */
So notify the user of the anomaly with a warning.
static time_t now;
if (mtime != -1 && mtime > now && ! file->updated)
We only need to do this once, for now. */
static time_t now = 0;
if (!clock_skew_detected
&& mtime != (time_t)-1 && mtime > now
&& !file->updated)
{
/* This file's time appears to be in the future.
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);
if (mtime > now)
#else
extern time_t time ();
if (mtime > time (&now))
time (&now);
#ifdef WINDOWS32
/*
* FAT filesystems round time to nearest even second(!). Just
* allow for any file (NTFS or FAT) to perhaps suffer from this
* braindamage.
*
* Apparently, this doesn't happen with the MS-DOS/DJGPP port,
* although MS-DOS and MS-Windows 3.X/9X also use FAT filesystems.
*/
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
#else
if (mtime > now)
#endif
{
error ("*** File `%s' has modification time in the future",
file->name);
file->update_status = 2;
}
{
error("*** Warning: File `%s' has modification time in the future",
file->name);
clock_skew_detected = 1;
}
}
}
@@ -1073,11 +1127,7 @@ name_mtime (name)
{
struct stat st;
#ifdef VMS
if (vms_stat (name, &st) < 0)
#else
if (stat (name, &st) < 0)
#endif
return (time_t) -1;
return (time_t) st.st_mtime;
@@ -1099,7 +1149,7 @@ library_search (lib, mtime_ptr)
"/lib",
"/usr/lib",
#endif
#if defined(WIN32) && !defined(LIBDIR)
#if defined(WINDOWS32) && !defined(LIBDIR)
/*
* This is completely up to the user at product install time. Just define
* a placeholder.
@@ -1145,6 +1195,30 @@ library_search (lib, mtime_ptr)
/* Now try the standard set of directories. */
#ifdef __MSDOS__
{
/* The default library directory is at ${DJDIR}/lib. */
struct variable *djdir = lookup_variable ("DJDIR", 5);
if (djdir)
{
size_t djdir_len = strlen (djdir->value);
if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2)
buf = (char *) xrealloc (djdir_len + 1);
sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname);
mtime = name_mtime (buf);
if (mtime != (time_t) -1)
{
*lib = buf;
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
}
}
}
#endif
for (dp = dirs; *dp != 0; ++dp)
{
#ifndef _AMIGA

View File

@@ -1,19 +1,21 @@
/* Convert between signal names and numbers.
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 Free Software Foundation; either version 2, or (at your option)
any later version.
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
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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.
The GNU C 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 General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -231,6 +233,9 @@ signame_init ()
#if defined (SIGINFO)
init_sig (SIGINFO, "INFO", "Information request");
#endif
#if defined (SIGNOFP)
init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available");
#endif
}
/* Return the abbreviation for signal NUMBER. */

View File

@@ -1,19 +1,21 @@
/* Convert between signal names and numbers.
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
Copyright (C) 1990, 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 Free Software Foundation; either version 2, or (at your option)
any later version.
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
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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.
The GNU C 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 General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#if defined (__STDC__) && __STDC__

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -22,7 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "job.h"
#include "commands.h"
#include "variable.h"
#ifdef WIN32
#ifdef WINDOWS32
#include "pathstuff.h"
#endif
@@ -333,8 +333,6 @@ merge_variable_set_lists (setlist0, setlist1)
merge_variable_sets (list0->set, next->set);
free ((char *) next);
last0 = list0;
list0 = list0->next;
}
@@ -354,7 +352,7 @@ merge_variable_set_lists (setlist0, setlist1)
void
define_automatic_variables ()
{
#ifdef WIN32
#ifdef WINDOWS32
extern char* default_shell;
#else
extern char default_shell[];
@@ -373,12 +371,39 @@ define_automatic_variables ()
? "" : remote_description);
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
#ifdef __MSDOS__
/* Allow to specify a special shell just for Make,
and use $COMSPEC as the default $SHELL when appropriate. */
{
static char shell_str[] = "SHELL";
const int shlen = sizeof (shell_str) - 1;
struct variable *mshp = lookup_variable ("MAKESHELL", 9);
struct variable *comp = lookup_variable ("COMSPEC", 7);
/* Make $MAKESHELL override $SHELL even if -e is in effect. */
if (mshp)
(void) define_variable (shell_str, shlen,
mshp->value, o_env_override, 0);
else if (comp)
{
/* $COMSPEC shouldn't override $SHELL. */
struct variable *shp = lookup_variable (shell_str, shlen);
if (!shp)
(void) define_variable (shell_str, shlen, comp->value, o_env, 0);
}
}
#endif
/* This won't override any definition, but it
will provide one if there isn't one there. */
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
v->export = v_export; /* Always export SHELL. */
/* On MSDOS we do use SHELL from environment, since
it isn't a standard environment variable on MSDOS,
so whoever sets it, does that on purpose. */
#ifndef __MSDOS__
/* Don't let SHELL come from the environment. */
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
{
@@ -386,6 +411,7 @@ define_automatic_variables ()
v->origin = o_file;
v->value = savestring (default_shell, strlen (default_shell));
}
#endif
/* Make sure MAKEFILES gets exported if it is set. */
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
@@ -546,20 +572,20 @@ target_environment (file)
&& v->origin != o_env && v->origin != o_env_override)
{
char *value = recursively_expand (v);
#ifdef WIN32
#ifdef WINDOWS32
if (strcmp(v->name, "Path") == 0 ||
strcmp(v->name, "PATH") == 0)
convert_Path_to_win32(value, ';');
convert_Path_to_windows32(value, ';');
#endif
result[nvariables++] = concat (v->name, "=", value);
free (value);
}
else
#ifdef WIN32
#ifdef WINDOWS32
{
if (strcmp(v->name, "Path") == 0 ||
strcmp(v->name, "PATH") == 0)
convert_Path_to_win32(v->value, ';');
convert_Path_to_windows32(v->value, ';');
result[nvariables++] = concat (v->name, "=", v->value);
}
#else
@@ -734,6 +760,88 @@ try_variable_definition (filename, lineno, line, origin)
}
}
#ifdef __MSDOS__
/* Many Unix Makefiles include a line saying "SHELL=/bin/sh", but
non-Unix systems don't conform to this default configuration (in
fact, most of them don't even have `/bin'). On the other hand,
$SHELL in the environment, if set, points to the real pathname of
the shell.
Therefore, we generally won't let lines like "SHELL=/bin/sh" from
the Makefile override $SHELL from the environment. But first, we
look for the basename of the shell in the directory where SHELL=
points, and along the $PATH; if it is found in any of these places,
we define $SHELL to be the actual pathname of the shell. Thus, if
you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on
your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
defining SHELL to be "d:/unix/bash.exe". */
if (origin == o_file
&& strcmp (expanded_name, "SHELL") == 0)
{
char shellpath[PATH_MAX];
extern char * __dosexec_find_on_path (const char *, char *[], char *);
/* See if we can find "/bin/sh.exe", "/bin/sh.com", etc. */
if (__dosexec_find_on_path (value, (char **)0, shellpath))
{
char *p;
for (p = shellpath; *p; p++)
{
if (*p == '\\')
*p = '/';
}
v = define_variable (expanded_name, strlen (expanded_name),
shellpath, origin, flavor == recursive);
}
else
{
char *shellbase, *bslash;
struct variable *pathv = lookup_variable ("PATH", 4);
char *path_string;
char *fake_env[2];
size_t pathlen = 0;
shellbase = rindex (value, '/');
bslash = rindex (value, '\\');
if (!shellbase || bslash > shellbase)
shellbase = bslash;
if (!shellbase && value[1] == ':')
shellbase = value + 1;
if (shellbase)
shellbase++;
else
shellbase = value;
/* Search for the basename of the shell (with standard
executable extensions) along the $PATH. */
if (pathv)
pathlen = strlen (pathv->value);
path_string = (char *)xmalloc (5 + pathlen + 2 + 1);
/* On MSDOS, current directory is considered as part of $PATH. */
sprintf (path_string, "PATH=.;%s", pathv ? pathv->value : "");
fake_env[0] = path_string;
fake_env[1] = (char *)0;
if (__dosexec_find_on_path (shellbase, fake_env, shellpath))
{
char *p;
for (p = shellpath; *p; p++)
{
if (*p == '\\')
*p = '/';
}
v = define_variable (expanded_name, strlen (expanded_name),
shellpath, origin, flavor == recursive);
}
else
v = lookup_variable (expanded_name, strlen (expanded_name));
free (path_string);
}
}
else
#endif /* __MSDOS__ */
v = define_variable (expanded_name, strlen (expanded_name),
value, origin, flavor == recursive);
@@ -884,7 +992,7 @@ print_file_variables (file)
print_variable_set (file->variables->set, "# ");
}
#ifdef WIN32
#ifdef WINDOWS32
void
sync_Path_environment(void)
{
@@ -902,9 +1010,9 @@ sync_Path_environment(void)
free(environ_path);
/*
* Create something WIN32 world can grok
* Create something WINDOWS32 world can grok
*/
convert_Path_to_win32(path, ';');
convert_Path_to_windows32(path, ';');
environ_path = concat("Path", "=", path);
putenv(environ_path);
free(path);

View File

@@ -1,4 +1,9 @@
char *version_string = "3.74.7";
/* 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:

View File

@@ -4,8 +4,10 @@
#define MAXNAMLEN 255
#ifndef __DECC
typedef unsigned long u_long;
typedef unsigned short u_short;
#endif
struct direct {
off_t d_off;

View File

@@ -330,9 +330,9 @@ vmsify (name, type)
else
{
strcpy (vptr, "[.");
nstate = N_DOT;
vptr += 2;
copyto (&vptr, &fptr, '/', 1);
nstate = N_OPEN;
state = 9;
}
}
@@ -738,6 +738,7 @@ vmsify (name, type)
s = strchr (vptr, ']');
if (s != 0)
{
nstate = N_OPEN;
while (s > vptr)
{
s--;

126
vpath.c
View File

@@ -1,5 +1,5 @@
/* 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.
GNU Make is free software; you can redistribute it and/or modify
@@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "make.h"
#include "filedef.h"
#include "variable.h"
#ifdef WIN32
#ifdef WINDOWS32
#include "pathstuff.h"
#endif
@@ -43,6 +43,10 @@ static struct vpath *vpaths;
/* Structure for the general VPATH given in the variable. */
static struct vpath *general_vpath;
/* Structure for GPATH given in the variable. */
static struct vpath *gpaths;
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr));
@@ -98,6 +102,38 @@ build_vpath_lists ()
general_vpath = vpaths;
vpaths = save_vpaths;
}
/* If there is a GPATH variable with a nonnull value, construct the
GPATH list from it. We use variable_expand rather than just
calling lookup_variable so that it will be recursively expanded. */
{
/* Turn off --warn-undefined-variables while we expand SHELL and IFS. */
int save = warn_undefined_variables_flag;
warn_undefined_variables_flag = 0;
p = variable_expand ("$(strip $(GPATH))");
warn_undefined_variables_flag = save;
}
if (*p != '\0')
{
/* Save the list of vpaths. */
struct vpath *save_vpaths = vpaths;
/* Empty `vpaths' so the new one will have no next, and `vpaths'
will still be nil if P contains no existing directories. */
vpaths = 0;
/* Parse P. */
construct_vpath_list ("%", p);
/* Store the created path as the GPATH,
and restore the old list of vpaths. */
gpaths = vpaths;
vpaths = save_vpaths;
}
}
/* Construct the VPATH listing for the pattern and searchpath given.
@@ -109,14 +145,15 @@ build_vpath_lists ()
variable.
If SEARCHPATH is nil, remove all previous listings with the same
pattern. If PATTERN is nil, remove all VPATH listings.
Existing and readable directories that are not "." given in the
searchpath separated by colons are loaded into the directory hash
table if they are not there already and put in the VPATH searchpath
for the given pattern with trailing slashes stripped off if present
(and if the directory is not the root, "/").
The length of the longest entry in the list is put in the structure as well.
The new entry will be at the head of the VPATHS chain. */
pattern. If PATTERN is nil, remove all VPATH listings. Existing
and readable directories that are not "." given in the searchpath
separated by the path element separator (defined in make.h) are
loaded into the directory hash table if they are not there already
and put in the VPATH searchpath for the given pattern with trailing
slashes stripped off if present (and if the directory is not the
root, "/"). The length of the longest entry in the list is put in
the structure as well. The new entry will be at the head of the
VPATHS chain. */
void
construct_vpath_list (pattern, dirpath)
@@ -173,14 +210,14 @@ construct_vpath_list (pattern, dirpath)
return;
}
#ifdef WIN32
convert_vpath_to_win32(dirpath, ';');
#ifdef WINDOWS32
convert_vpath_to_windows32(dirpath, ';');
#endif
/* Figure out the maximum number of VPATH entries and
put it in MAXELEM. We start with 2, one before the
first colon and one nil, the list terminator and
increment our estimated number for each colon or blank we find. */
/* Figure out the maximum number of VPATH entries and put it in
MAXELEM. We start with 2, one before the first separator and one
nil (the list terminator) and increment our estimated number for
each separator or blank we find. */
maxelem = 2;
p = dirpath;
while (*p != '\0')
@@ -190,7 +227,7 @@ construct_vpath_list (pattern, dirpath)
vpath = (char **) xmalloc (maxelem * sizeof (char *));
maxvpath = 0;
/* Skip over any initial colons and blanks. */
/* Skip over any initial separators and blanks. */
p = dirpath;
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
++p;
@@ -209,6 +246,10 @@ construct_vpath_list (pattern, dirpath)
len = p - v;
/* Make sure there's no trailing slash,
but still allow "/" as a directory. */
#ifdef __MSDOS__
/* We need also to leave alone a trailing slash in "d:/". */
if (len > 3 || (len > 1 && v[1] != ':'))
#endif
if (len > 1 && p[-1] == '/')
--len;
@@ -231,7 +272,7 @@ construct_vpath_list (pattern, dirpath)
free (v);
}
/* Skip over colons and blanks between entries. */
/* Skip over separators and blanks between entries. */
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
++p;
}
@@ -270,6 +311,24 @@ construct_vpath_list (pattern, dirpath)
}
}
/* Search the GPATH list for a pathname string that matches the one passed
in. If it is found, return 1. Otherwise we return 0. */
int
gpath_search (file, len)
char *file;
int len;
{
register char **gp;
if (gpaths && (len <= gpaths->maxlen))
for (gp = gpaths->searchpath; *gp != NULL; ++gp)
if (!strncmp(*gp, file, len) && (*gp)[len] == '\0')
return 1;
return 0;
}
/* Search the VPATH list whose pattern matches *FILE for a directory
where the name pointed to by FILE exists. If it is found, we set *FILE to
the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is
@@ -287,8 +346,8 @@ vpath_search (file, mtime_ptr)
there is nothing we can do. */
if (**file == '/'
#ifdef WIN32
|| **file == '\\'
#if defined (WINDOWS32) || defined (__MSDOS__)
|| **file == '\\'
|| (*file)[1] == ':'
#endif
|| (vpaths == 0 && general_vpath == 0))
@@ -343,9 +402,13 @@ selective_vpath_search (path, file, mtime_ptr)
pointer to the name-within-directory and FLEN is its length. */
n = rindex (*file, '/');
#ifdef WIN32
if (!n)
n = rindex(*file,, '\\');
#if defined (WINDOWS32) || defined (__MSDOS__)
/* We need the rightmost slash or backslash. */
{
char *bslash = rindex(*file, '\\');
if (!n || bslash > n)
n = bslash;
}
#endif
name_dplen = n != 0 ? n - *file : 0;
filename = name_dplen > 0 ? n + 1 : *file;
@@ -373,18 +436,27 @@ selective_vpath_search (path, file, mtime_ptr)
/* Add the directory prefix already in *FILE. */
if (name_dplen > 0)
{
#ifndef VMS
*n++ = '/';
#endif
bcopy (*file, n, name_dplen);
n += name_dplen;
}
#if defined (WINDOWS32) || defined (__MSDOS__)
/* Cause the next if to treat backslash and slash alike. */
if (n != name && n[-1] == '\\' )
n[-1] = '/';
#endif
/* Now add the name-within-directory at the end of NAME. */
#ifndef VMS
if (n != name && n[-1] != '/')
{
*n = '/';
bcopy (filename, n + 1, flen + 1);
}
else
#endif
bcopy (filename, n, flen + 1);
/* Check if the file is mentioned in a makefile. If *FILE is not
@@ -397,7 +469,7 @@ selective_vpath_search (path, file, mtime_ptr)
inadequately commented change in July 1990; I am not sure off
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
seem logical. */
{
@@ -411,6 +483,9 @@ selective_vpath_search (path, file, mtime_ptr)
/* That file wasn't mentioned in the makefile.
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.
Now NAME is the name of the directory to look in. */
*n = '\0';
@@ -419,6 +494,7 @@ selective_vpath_search (path, file, mtime_ptr)
construct_vpath_list or the code just above put it there.
Does the file we seek exist in it? */
exists_in_cache = exists = dir_file_exists_p (name, filename);
#endif
}
if (exists)
@@ -431,8 +507,10 @@ selective_vpath_search (path, file, mtime_ptr)
struct stat st;
#ifndef VMS
/* Put the slash back in NAME. */
*n = '/';
#endif
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|| stat (name, &st) == 0) /* Does it really exist? */

View File

@@ -78,7 +78,7 @@ closedir(DIR *pDir)
return;
}
/* close the WIN32 directory handle */
/* close the WINDOWS32 directory handle */
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
FindClose(pDir->dir_hDirHandle);
@@ -134,7 +134,7 @@ rewinddir(DIR* pDir)
return;
}
/* close the WIN32 directory handle */
/* close the WINDOWS32 directory handle */
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
if (!FindClose(pDir->dir_hDirHandle))
errno = EBADF;

View File

@@ -15,7 +15,7 @@
struct dirent
{
ino_t d_ino; /* unused - no equivalent on WIN32 */
ino_t d_ino; /* unused - no equivalent on WINDOWS32 */
char d_name[NAME_MAX+1];
};

View File

@@ -1,8 +1,8 @@
#ifndef _PATHSTUFF_H
#define _PATHSTUFF_H
extern char * convert_Path_to_win32(char *Path, char to_delim);
extern char * convert_vpath_to_win32(char *Path, char to_delim);
extern char * convert_Path_to_windows32(char *Path, char to_delim);
extern char * convert_vpath_to_windows32(char *Path, char to_delim);
extern char * w32ify(char *file, int resolve);
extern char * getcwd_fs(char *buf, int len);

View File

@@ -9,18 +9,11 @@
* $Source$
*
* $Revision$
*
* Description:
*
* (C) COPYRIGHT TIVOLI Systems, Inc. 1991-1994
* Unpublished Work
* All Rights Reserved
* Licensed Material - Property of TIVOLI Systems, Inc.
*/
/* $Id$ */
#ifdef WIN32
#ifdef WINDOWS32
#define EXTERN_DECL(entry, args) extern entry args
#define VOID_DECL void

View File

@@ -5,6 +5,6 @@
#define EXTERN_DECL(entry, args) entry args
#endif
EXTERN_DECL(char * map_win32_error_to_string, (DWORD error));
EXTERN_DECL(char * map_windows32_error_to_string, (DWORD error));
#endif /* !_W32ERR_H */

View File

@@ -4,10 +4,10 @@
#include "pathstuff.h"
/*
* Convert delimiter separated vpath to Canonical format.
* Convert delimiter separated vpath to Canonical format.
*/
char *
convert_vpath_to_win32(char *Path, char to_delim)
convert_vpath_to_windows32(char *Path, char to_delim)
{
char *etok; /* token separator for old Path */
@@ -19,49 +19,48 @@ convert_vpath_to_win32(char *Path, char to_delim)
if (isblank(*etok))
*etok = to_delim;
return (convert_Path_to_win32(Path, to_delim));
return (convert_Path_to_windows32(Path, to_delim));
}
/*
* Convert delimiter separated path to Canonical format.
* Convert delimiter separated path to Canonical format.
*/
char *
convert_Path_to_win32(char *Path, char to_delim)
convert_Path_to_windows32(char *Path, char to_delim)
{
char *etok; /* token separator for old Path */
char *p; /* points to element of old Path */
/* is this a multi-element Path ? */
for (p = Path, etok = strpbrk(p, ":;");
etok;
etok;
etok = strpbrk(p, ":;"))
if ((etok - p) == 1) {
if (*(etok - 1) == ';' ||
*(etok - 1) == ':') {
etok[-1] = to_delim;
etok[0] = to_delim;
etok[-1] = to_delim;
etok[0] = to_delim;
p = ++etok;
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 */
*etok = to_delim;
p = ++etok;
} else
/* all finished, force abort */
p += strlen(p);
p += strlen(p);
} else {
/* found another one, no drive letter */
*etok = to_delim;
p = ++etok;
}
#if 0
/* convert to backward slashes */
for (p = Path, p = strchr(p, '/'); p; p = strchr(p, '/'))
*p = '\\';
#endif
return Path;
}
}
/*
* Convert to forward slashes. Resolve to full pathname optionally
@@ -100,10 +99,10 @@ getcwd_fs(char* buf, int len)
#ifdef unused
/*
* Convert delimiter separated pathnames (e.g. PATH) or single file pathname
* (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that
* _NutPathToNutc() fails to convert, just return the path we were handed
* and assume the caller will know what to do with it (It was probably
* a mistake to try and convert it anyway due to some of the bizarre things
* (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that
* _NutPathToNutc() fails to convert, just return the path we were handed
* and assume the caller will know what to do with it (It was probably
* a mistake to try and convert it anyway due to some of the bizarre things
* that might look like pathnames in makefiles).
*/
char *
@@ -119,8 +118,8 @@ convert_path_to_nutc(char *path)
char *rval;
/* is this a multi-element path ? */
for (p = path, etok = strpbrk(p, ":;"), count = 0;
etok;
for (p = path, etok = strpbrk(p, ":;"), count = 0;
etok;
etok = strpbrk(p, ":;"))
if ((etok - p) == 1) {
if (*(etok - 1) == ';' ||
@@ -132,15 +131,15 @@ convert_path_to_nutc(char *path)
p = ++etok, count++;
else
/* all finished, force abort */
p += strlen(p);
} else
p += strlen(p);
} else
/* found another one, no drive letter */
p = ++etok, count++;
if (count) {
count++; /* x1;x2;x3 <- need to count x3 */
/*
/*
* Hazard a guess on how big the buffer needs to be.
* We have to convert things like c:/foo to /c=/foo.
*/
@@ -154,10 +153,10 @@ convert_path_to_nutc(char *path)
* a time. Single file pathnames will fail this and fall
* to the logic below loop.
*/
for (p = path, etok = strpbrk(p, ":;");
etok;
for (p = path, etok = strpbrk(p, ":;");
etok;
etok = strpbrk(p, ":;")) {
/* don't trip up on device specifiers or empty path slots */
if ((etok - p) == 1)
if (*(etok - 1) == ';' ||
@@ -165,14 +164,14 @@ convert_path_to_nutc(char *path)
p = ++etok;
continue;
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
break; /* thing found was a WIN32 pathname */
break; /* thing found was a WINDOWS32 pathname */
/* save separator */
sep = *etok;
/* terminate the current path element -- temporarily */
*etok = '\0';
#ifdef __NUTC__
/* convert to NutC format */
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
@@ -187,20 +186,20 @@ convert_path_to_nutc(char *path)
*pathp++ = '/';
strcpy(pathp, &p[2]);
#endif
pathp += strlen(pathp);
*pathp++ = ':'; /* use Unix style path separtor for new path */
*pathp = '\0'; /* make sure we are null terminaed */
/* restore path separator */
*etok = sep;
/* point p to first char of next path element */
p = ++etok;
}
} else {
nutc_path_len = strlen(path) + 3;
nutc_path_len = strlen(path) + 3;
nutc_path = xmalloc(nutc_path_len);
pathp = nutc_path;
*pathp = '\0';
@@ -211,7 +210,7 @@ convert_path_to_nutc(char *path)
* OK, here we handle the last element in PATH (e.g. c of a;b;c)
* or the path was a single filename and will be converted
* here. Note, testing p here assures that we don't trip up
* on paths like a;b; which have trailing delimiter followed by
* on paths like a;b; which have trailing delimiter followed by
* nothing.
*/
if (*p != '\0') {
@@ -234,6 +233,6 @@ convert_path_to_nutc(char *path)
rval = savestring(nutc_path, strlen(nutc_path));
free(nutc_path);
return rval;
}
}
#endif

View File

@@ -1,7 +1,7 @@
# NOTE: If you have no `make' program at all to process this makefile, run
# `build.bat' instead.
#
# Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 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.
#
# GNU Make is free software; you can redistribute it and/or modify
@@ -27,7 +27,7 @@ CC = cl
OUTDIR=.
MAKEFILE=NMakefile
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D _WINDOWS -I. -I../include
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include
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/

View File

@@ -1,10 +1,10 @@
if not exist .\WinDebug\nul mkdir .\WinDebug
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /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 _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 WIN32 /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 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 sub_proc.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
if not exist .\WinRel\nul mkdir .\WinRel
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /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 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 WIN32 /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 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 sub_proc.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

View File

@@ -7,7 +7,7 @@
/*
* Description: Convert a NULL string terminated UNIX environment block to
* an environment block suitable for a win32 system call
* an environment block suitable for a windows32 system call
*
* Returns: TRUE= success, FALSE=fail
*

View File

@@ -319,14 +319,10 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
char *fname;
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);
strcpy(fname, exec_path);
ext = fname + strlen(fname);
strcpy(ext, ".exe");
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
@@ -334,6 +330,13 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
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");
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
@@ -341,6 +344,13 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
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");
if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
@@ -395,7 +405,7 @@ process_begin(
exec_handle = find_file(exec_path, &file_info);
/*
* If we couldn't open the file, just assume that Win32 will be able
* If we couldn't open the file, just assume that Windows32 will be able
* to find and execute it.
*/
if (exec_handle == (HANDLE)HFILE_ERROR) {
@@ -489,14 +499,8 @@ process_begin(
startInfo.hStdOutput = (HANDLE)pproc->sv_stdout[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 (envblk) free(envblk);
return -1;
} else {
if (CreateProcess(
@@ -514,6 +518,7 @@ process_begin(
pproc->last_err = GetLastError();
pproc->lerrno = E_FORK;
fprintf(stderr, "process_begin: CreateProcess(%s, %s, ...) failed.\n", exec_path, command_line);
if (envblk) free(envblk);
free( command_line );
return(-1);
}
@@ -538,6 +543,7 @@ process_begin(
}
free( command_line );
if (envblk) free(envblk);
pproc->lerrno=0;
return 0;
}
@@ -578,7 +584,7 @@ proc_stdout_thread(sub_process *pproc)
for (;;) {
if (ReadFile( (HANDLE)pproc->sv_stdout[0], &c, 1, &nread, NULL)
== FALSE) {
/* map_win32_error_to_string(GetLastError());*/
/* map_windows32_error_to_string(GetLastError());*/
_endthreadex(0);
}
if (nread == 0)
@@ -609,7 +615,7 @@ proc_stderr_thread(sub_process *pproc)
for (;;) {
if (ReadFile( (HANDLE)pproc->sv_stderr[0], &c, 1, &nread, NULL) == FALSE) {
map_win32_error_to_string(GetLastError());
map_windows32_error_to_string(GetLastError());
_endthreadex(0);
}
if (nread == 0)
@@ -718,7 +724,7 @@ process_pipe_io(
one second to collect all remaining output */
if (wait_return == WAIT_FAILED) {
/* map_win32_error_to_string(GetLastError());*/
/* map_windows32_error_to_string(GetLastError());*/
pproc->last_err = GetLastError();
pproc->lerrno = E_SCALL;
goto done;
@@ -835,7 +841,7 @@ process_file_io(
wait_return = WaitForSingleObject(childhand, INFINITE);
if (wait_return != WAIT_OBJECT_0) {
/* map_win32_error_to_string(GetLastError());*/
/* map_windows32_error_to_string(GetLastError());*/
pproc->last_err = GetLastError();
pproc->lerrno = E_SCALL;
goto done2;
@@ -883,7 +889,7 @@ process_cleanup(
/*
* Try to protect against WIN32 argument munging. This function takes
* 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().
*
@@ -1003,14 +1009,35 @@ make_command_line( char *shell_name, char *exec_path, char **argv)
char** nargv;
char* buf;
int i;
char** shargv = NULL;
char* p = NULL;
char* q = NULL;
int j = 0;
if (shell_name) {
/* handle things like: #!/bin/sh -x */
/* count tokens */
q = strdup(shell_name);
for (j = 0, p = q; (p = strtok(p, " \t")) != NULL; p = NULL, j++);
free(q);
/* copy tokens */
q = strdup(shell_name);
shargv = (char **) malloc((j+1) * sizeof (char *));
for (j = 0, p = q; (p = strtok(p, " \t")) != NULL; p = NULL, j++)
shargv[j] = strdup(p);
shargv[j] = NULL;
free(q);
/* create argv */
for (i = 0; argv[i]; i++);
i += 2;
i += (j+1);
nargv = (char **) malloc(i * sizeof (char *));
nargv[0] = shell_name;
for (i = 1; argv[i-1]; i++)
nargv[i] = argv[i-1];
for (i = 0; shargv[i] != NULL; i++)
nargv[i] = shargv[i];
for (j = 0; argv[j]; j++, i++)
nargv[i] = argv[j];
nargv[i] = NULL;
} else
nargv = argv;
@@ -1018,8 +1045,12 @@ make_command_line( char *shell_name, char *exec_path, char **argv)
/* create string suitable for CreateProcess() */
buf = fix_command_line(nargv);
if (shell_name)
if (shell_name) {
for (j = 0; shargv[j]; j++)
free(shargv[j]);
free(shargv);
free(nargv);
}
return buf;
}

View File

@@ -2,7 +2,7 @@
#include "w32err.h"
/*
* Description: the win32 version of perror()
* Description: the windows32 version of perror()
*
* Returns: a pointer to a static error
*
@@ -10,7 +10,7 @@
* comp.os.ms-windows.programmer.win32
*/
char *
map_win32_error_to_string (DWORD ercode) {
map_windows32_error_to_string (DWORD ercode) {
/* __declspec (thread) necessary if you will use multiple threads */
__declspec (thread) static char szMessageBuffer[128];