Compare commits

..

74 Commits
3.75 ... 3.75.1

Author SHA1 Message Date
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
67 changed files with 6051 additions and 2900 deletions

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.

222
ChangeLog
View File

@@ -1,3 +1,153 @@
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.
@@ -11,17 +161,17 @@ Mon Aug 26 19:55:47 1996 Roland McGrath <roland@baalperazim.frob.com>
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.
@@ -43,7 +193,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.
@@ -61,7 +211,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.
@@ -132,22 +282,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
@@ -160,65 +310,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

@@ -42,7 +42,9 @@ endif
# Get most of the information from the Unix-compatible makefile.
include compatMakefile
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
CVS = cvs
# Remove autoconf magic.
prefix = /usr/local
@@ -58,10 +60,10 @@ config.h.in: $(AC_MACRODIR)/acconfig.h
endif
configure: configure.in aclocal.m4
autoconf $(ACFLAGS)
test -d CVS && cvs commit -m'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)' $@
-test -d CVS && $(CVS) commit -m'autoheader $(ACFLAGS)' $@
ifdef customs
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
@@ -154,7 +156,7 @@ $(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
$(CVS) commit -m'Updated from libc' glob
touch $@
$(libc-srcdir)/posix/glob.tar: force
$(MAKE) -C $(@D) $(@F) no_deps=t
@@ -177,7 +179,7 @@ Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
echo '# Automatically generated dependencies.'; \
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
) > $@
cvs commit -mRegenerated $@
$(CVS) commit -mRegenerated $@
.SUFFIXES: .dep
# Maintain the automatically-generated dependencies.
@@ -202,7 +204,7 @@ build.sh.in: build.template compatMakefile
$< > $@.new
chmod a+x $@.new
mv -f $@.new $@
cvs commit -mRegenerated $@
$(CVS) commit -mRegenerated $@
# Make the distribution tar files.
@@ -222,21 +224,22 @@ 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)
dosfiles = README.DOS dosbuild.bat
w32files = README.W32 build_w32.bat config.h.W32 subproc.bat NMakefile \
$(addprefix w32/,pathstuff.c compat/dirent.c include/dirent.h \
include/pathstuff.h include/sub_proc.h \
include/w32err.h subproc/NMakefile \
subproc/build.bat subproc/misc.c \
subproc/proc.h subproc/sub_proc.c \
subproc/w32err.c)
distfiles=README INSTALL COPYING ChangeLog NEWS \
configure Makefile.in configure.in build.sh.in mkinstalldirs \
configh.dos configure.bat \
$(amigafiles) $(vmsfiles) $(win32files) \
$(amigafiles) $(vmsfiles) $(w32files) $(dosfiles) \
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 \
$(wildcard make.?? make.??s make.toc make.aux) make.man texinfo.tex \
TAGS tags install-sh \
make.info make.info*
ifndef dist-flavor
@@ -244,7 +247,7 @@ dist-flavor = alpha
endif
.PHONY: cvs-mark
cvs-mark: $(distfiles)
cvs tag -F make-$(subst .,-,$(version))
$(CVS) tag -F make-$(subst .,-,$(version))
dist: local-inst
.PHONY: local-inst
@@ -268,7 +271,7 @@ $(alpha-dir)/%: %
sed 's/VERSION/$(version)/' < $< > $@
# Make sure I don't edit it by accident.
chmod a-w $@
cvs commit -m'Regenerated for $(version)' $@
$(CVS) commit -m'Regenerated for $(version)' $@
define make-tar
@rm -fr make-$(version)

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

View File

@@ -107,11 +107,13 @@ TEXI2DVI = texi2dvi
ETAGS = etags -w
CTAGS = ctags -w
GLOB = glob/libglob.a
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
rule.o implicit.o default.o variable.o expand.o function.o \
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
getopt.o getopt1.o glob/libglob.a \
$(ALLOCA) $(extras)
getopt.o getopt1.o \
$(GLOB) $(ALLOCA) $(extras)
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
@@ -158,7 +160,7 @@ make: $(objs)
SHELL = /bin/sh
@SET_MAKE@
glob/libglob.a: FORCE config.h
$(GLOB): FORCE config.h
cd glob; $(MAKE) libglob.a
FORCE:
@@ -206,7 +208,7 @@ $(infodir)/make.info: make.info
# 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; \
install-info --info-dir=$(infodir) $$dir/make.info; \
else true; fi
$(mandir)/$(manprefix)make.$(manext): make.man
@@ -271,33 +273,36 @@ $(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 \
commands.o: commands.c make.h signame.h dep.h filedef.h variable.h \
job.h commands.h
job.o: job.c make.h signame.h job.h filedef.h commands.h variable.h
dir.o: dir.c make.h signame.h
file.o: file.c make.h signame.h dep.h filedef.h job.h commands.h \
variable.h
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
misc.o: misc.c make.h signame.h dep.h
main.o: main.c make.h signame.h dep.h filedef.h variable.h job.h \
commands.h getopt.h
read.o: read.c make.h signame.h dep.h filedef.h job.h commands.h \
variable.h glob/glob.h
remake.o: remake.c make.h signame.h filedef.h job.h commands.h dep.h
rule.o: rule.c make.h signame.h dep.h filedef.h job.h commands.h \
variable.h rule.h
implicit.o: implicit.c make.h signame.h rule.h dep.h filedef.h
default.o: default.c make.h signame.h rule.h dep.h filedef.h job.h \
commands.h variable.h
variable.o: variable.c make.h signame.h dep.h filedef.h job.h \
commands.h variable.h
expand.o: expand.c make.h signame.h filedef.h job.h commands.h \
variable.h
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
function.o: function.c make.h signame.h filedef.h variable.h dep.h \
job.h commands.h
vpath.o: vpath.c make.h signame.h filedef.h variable.h
version.o: version.c
ar.o: ar.c make.h filedef.h dep.h
arscan.o: arscan.c make.h
ar.o: ar.c make.h signame.h filedef.h dep.h
arscan.o: arscan.c make.h signame.h
signame.o: signame.c signame.h
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
getopt.o: getopt.c
remote-stub.o: remote-stub.c make.h signame.h filedef.h job.h \
commands.h
getopt.o: getopt.c getopt.h
getopt1.o: getopt1.c getopt.h
getloadavg.o: getloadavg.c

42
NEWS
View File

@@ -1,10 +1,46 @@
GNU make NEWS -- history of user-visible changes. 9 May 1996
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
06 Apr 1996
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
* 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.
* 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>
* 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>.
Version 3.75
* The directory messages printed by `-w' and implicitly in sub-makes,
@@ -23,7 +59,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

@@ -29,7 +29,7 @@ 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 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/
@@ -52,7 +52,7 @@ 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:

4
README
View File

@@ -1,4 +1,4 @@
This directory contains the 3.75 test release of GNU Make.
This directory contains the 3.75.1 test release of GNU Make.
All bugs reported for previous test releases have been fixed.
Some bugs surely remain.
@@ -14,7 +14,7 @@ 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.W32 for details about GNU Make on Windows NT or 95.
See README.Amiga for details about GNU Make on AmigaDOS.
The MSDOS port of GNU Make is available as part of DJGPP; see the
WWW page http://www.delorie.com/djgpp/ for more information.

257
README.DOS.template Normal file
View File

@@ -0,0 +1,257 @@
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.
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 it 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).
3. If you have Make, the configure script will need a Unix-style
Sed program. If you don't have that installed, you can find one
on one of the DJGPP mirror sites.
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, invoke the configure batch file like so:
configure no-float
5. Invoke Make.
6. If you have a Unix-style shell installed, you can use the
`install' target. You will also need GNU Fileutils and GNU
Sh-utils for this (they should be available from the DJGPP
sites).
7. The `clean' targets require Unix-style `rm' program.
Notes:
-----
1. The shell issue.
This is probably the most significant improvement in this port.
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 recent 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 this is the first DJGPP port of Make that
supports long filenames, 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
releative 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,13 +34,13 @@ 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 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
@@ -58,12 +58,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 +71,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 +80,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,6 +105,13 @@ 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

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

@@ -14,7 +14,7 @@ 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.W32 for details about GNU Make on Windows NT or 95.
See README.Amiga for details about GNU Make on AmigaDOS.
The MSDOS port of GNU Make is available as part of DJGPP; see the
WWW page http://www.delorie.com/djgpp/ for more information.

View File

@@ -45,7 +45,7 @@ includedir=${prefix}/include
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}"
objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
# Compile the source files into those objects.
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do

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

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

@@ -107,11 +107,13 @@ TEXI2DVI = texi2dvi
ETAGS = etags -w
CTAGS = ctags -w
GLOB = glob/libglob.a
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
rule.o implicit.o default.o variable.o expand.o function.o \
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
getopt.o getopt1.o glob/libglob.a \
$(ALLOCA) $(extras)
getopt.o getopt1.o \
$(GLOB) $(ALLOCA) $(extras)
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
@@ -158,7 +160,7 @@ make: $(objs)
SHELL = /bin/sh
MAKE = make
glob/libglob.a: FORCE config.h
$(GLOB): FORCE config.h
cd glob; $(MAKE) libglob.a
FORCE:
@@ -206,7 +208,7 @@ $(infodir)/make.info: make.info
# 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; \
install-info --info-dir=$(infodir) $$dir/make.info; \
else true; fi
$(mandir)/$(manprefix)make.$(manext): make.man

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

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 */
@@ -287,6 +290,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

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

@@ -35,6 +35,9 @@
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if your system has a working fnmatch function. */
#undef HAVE_FNMATCH
/* Define if your system has its own `getloadavg' function. */
#undef HAVE_GETLOADAVG
@@ -127,9 +130,9 @@
/* 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
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
@@ -182,6 +185,12 @@
/* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS
/* Define if you have the getloadavg function. */
#undef HAVE_GETLOADAVG
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the mktemp function. */
#undef HAVE_MKTEMP
@@ -260,5 +269,8 @@
/* Define if you have the dgc library (-ldgc). */
#undef HAVE_LIBDGC
/* Define if you have the kstat library (-lkstat). */
#undef HAVE_LIBKSTAT
/* Define if you have the sun library (-lsun). */
#undef HAVE_LIBSUN

View File

@@ -21,13 +21,7 @@
#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
#undef SYS_SIGLIST_DECLARED
/* Define if you have sys_siglist. */
#undef HAVE_SYS_SIGLIST
@@ -38,6 +32,18 @@
/* Define if you have psignal. */
#define HAVE_PSIGNAL
/* Define if you have strsignal. */
#undef HAVE_STRSIGNAL
/* Define NSIG. */
#define NSIG SIGMAX
/* Define if you have getdtablesize. */
#define HAVE_GETDTABLESIZE
/* Define if you have dup2. */
#define HAVE_DUP2
/* Define if you have getcwd. */
#define HAVE_GETCWD
@@ -62,7 +68,13 @@
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE
/* Define if you have the `strerror' function. */
#define HAVE_STRERROR
/* Define if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H
#define SCCS_GET "get"

824
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,49 @@
@echo off
echo Configuring MAKE for go32
echo Configuring MAKE for DJGPP
rem This batch file assumes a unix-type "sed" program
update configh.dos config.h
echo # Makefile generated by "configure.bat"> Makefile
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
rem They do have Make. Generate Makefiles.
:MakeOk
del junk.$$$
echo # Makefile generated for DJGPP by "configure.bat"> Makefile
if exist config.sed del config.sed
echo ": try_sl ">> config.sed
echo "/\\$/ { ">> config.sed
echo " N ">> config.sed
echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
echo " b try_sl ">> config.sed
echo " N ">> config.sed
echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
echo " b try_sl ">> config.sed
echo "} ">> config.sed
echo "s/@srcdir@/./ ">> config.sed
echo "s/@exec_prefix@/$(DJDIR)/ ">> config.sed
echo "s/@prefix@/$(DJDIR)/ ">> config.sed
echo "s/@CC@/gcc/ ">> config.sed
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
if "%1"=="no-float" goto nofloat
if "%1"=="NO-FLOAT" goto nofloat
if "%1"=="NO_FLOAT" goto nofloat
if "%1"=="no_float" goto nofloat
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
goto floatdone
:nofloat
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -DNO_FLOAT/ ">> config.sed
:floatdone
echo "s/@LDFLAGS@// ">> config.sed
echo "s/@RANLIB@/ranlib/ ">> config.sed
echo "s/@DEFS@// ">> config.sed
@@ -27,6 +52,10 @@ echo "s/@ALLOCA@// ">> config.sed
echo "s/@LIBS@// ">> config.sed
echo "s/@LIBOBJS@// ">> config.sed
echo "s/@SET_MAKE@// ">> config.sed
echo "s/@NEED_SETGID@/false/ ">> config.sed
echo "s/@INSTALL_PROGRAM@/install/ ">> config.sed
echo "s/@INSTALL_DATA@/install -m 644/ ">> config.sed
echo "s/@INSTALL@/install/ ">> config.sed
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
echo "s/^config.h *:/_config.h:/ ">> config.sed
echo "s/^defines *=.*$/defines =/ ">> config.sed
@@ -34,7 +63,16 @@ echo "/mv -f make.new make/d ">> config.sed
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
echo "/^tagsrcs *=/s/\$(srcs)/$(srcs:.h.in=.h)/ ">> config.sed
echo "s/\*.o/*.o *.exe make.new/ ">> config.sed
echo "s/\.info\*/.i*/g ">> config.sed
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
if exist config2.sed goto SedOk
echo To configure Make you need a Unix-style Sed program!
goto End
:SedOk
sed -f config2.sed Makefile.in >> Makefile
del config.sed
del config2.sed
@@ -42,3 +80,4 @@ del config2.sed
cd glob
call configure
cd ..
:End

View File

@@ -38,7 +38,7 @@ changequote([,])dnl
fi
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
AC_CHECK_FUNCS(psignal mktemp \
AC_CHECK_FUNCS(memmove psignal mktemp \
dup2 getcwd sigsetmask getgroups setlinebuf \
seteuid setegid setreuid setregid strerror strsignal)
AC_CHECK_SYMBOL(sys_siglist)
@@ -46,6 +46,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.

185
dir.c
View File

@@ -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
@@ -206,9 +205,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 +216,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 +282,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 +335,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 +351,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 +362,7 @@ find_directory (name)
#else
&& dc->ino == st.st_ino)
#endif
#endif /* WIN32 */
#endif /* WINDOWS32 */
break;
if (dc == 0)
@@ -366,9 +374,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 +403,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 +451,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 +502,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 +543,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 +567,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 +623,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 +641,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 +673,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 +692,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 +715,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 +726,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 +767,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 +786,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 +852,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 +866,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 +878,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 +891,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.$$$

24
file.c
View File

@@ -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;
@@ -208,9 +208,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 +231,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 +322,7 @@ in favor of those for `%s'.",
MERGE (is_target);
MERGE (cmd_target);
MERGE (phony);
MERGE (ignore_vpath);
#undef MERGE
file->renamed = oldfile;

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 rehash_file (), file_hash_enter ();
extern void set_command_state ();
@@ -109,11 +112,8 @@ extern time_t f_mtime ();
trouble when the machine running make and the machine holding a file have
different ideas about what time it is; and can also lose for `force'
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)
them, even if said dependents' modtimes are in the future. */
#define NEW_MTIME INTEGER_TYPE_MAXIMUM (time_t)
#define check_renamed(file) \

View File

@@ -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"
@@ -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 },
@@ -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
#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,11 +370,13 @@ 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:
@@ -400,8 +403,8 @@ expand_function (o, function, text, end)
else
error_prefix = "";
#if !defined(__MSDOS__) && !defined(_AMIGA)
# ifdef WIN32
#ifndef _AMIGA
# ifdef WINDOWS32
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
@@ -451,30 +454,78 @@ expand_function (o, function, text, end)
/* this will be closed almost right away */
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
# else /* WIN32 */
if (pipe (pipedes) < 0)
{
perror_with_name (error_prefix, "pipe");
break;
}
# 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. */
@@ -557,73 +618,16 @@ expand_function (o, function, text, end)
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>
@@ -696,7 +700,6 @@ expand_function (o, function, text, end)
free (buffer);
}
#endif /* Not Amiga. */
#endif /* MSDOS or Amiga. */
free (text);
break;
@@ -1194,6 +1197,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,17 +1358,27 @@ 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);
@@ -1315,17 +1413,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;
++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

1053
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 */

File diff suppressed because one or more lines are too long

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,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,19 +1,20 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1996 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
@@ -24,7 +25,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,10 @@ 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>
/* 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 +56,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 +69,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 +113,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 +163,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 +173,7 @@ extern void bcopy ();
__inline
#endif
#ifndef __SASC
#ifdef WIN32
#ifdef WINDOWS32
static void *
#else
static char *
@@ -196,11 +203,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 +226,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
@@ -251,6 +258,51 @@ 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 (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,
@@ -274,7 +326,7 @@ glob (pattern, flags, errfunc, pglob)
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
{
errno = EINVAL;
__set_errno (EINVAL);
return -1;
}
@@ -283,38 +335,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 +404,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,51 +497,123 @@ 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')
{
extern char *getlogin __P ((void));
char *name = getlogin ();
if (name != NULL)
extern int getlogin_r __P ((char *, size_t));
int success;
#if defined HAVE_GETLOGIN_R || defined _LIBC
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 = __alloca (buflen);
success = getlogin_r (name, buflen) >= 0;
#else
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 = __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 = __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 = __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 = __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 = __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. */
@@ -880,7 +1000,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 +1011,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 +1023,3 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
}
#endif /* Not ELIDE_CODE. */

View File

@@ -1,19 +1,22 @@
/* Copyright (C) 1991, 1992, 1995, 1996 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 file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
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 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.
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. */
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 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
@@ -26,7 +29,7 @@ extern "C"
#undef __ptr_t
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|| defined (WIN32))
|| defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#define __ptr_t void *

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

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

456
job.c
View File

@@ -25,26 +25,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 +68,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 +80,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 +198,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 +211,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 +353,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 +407,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 +426,7 @@ reap_children (block, err)
exit_sig = 0;
coredump = 0;
#endif /* _AMIGA */
#ifdef WIN32
#ifdef WINDOWS32
{
HANDLE hPID;
int err;
@@ -429,7 +442,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 +459,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 +668,6 @@ block_sigs ()
}
#ifdef POSIX
#ifdef __MSDOS__
void
unblock_sigs ()
{
return;
}
#else
void
unblock_sigs ()
{
@@ -670,7 +676,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.
@@ -805,9 +810,10 @@ start_job_command (child)
fflush (stdout);
fflush (stderr);
#ifndef WIN32
#ifndef _AMIGA
#ifndef VMS
#ifndef WINDOWS32
#ifndef _AMIGA
#ifndef __MSDOS__
/* Set up a bad standard input that reads from a broken pipe. */
@@ -836,7 +842,8 @@ start_job_command (child)
}
#endif /* !AMIGA */
#endif /* !WIN32 */
#endif /* !WINDOWS32 */
#endif /* !__MSDOS__ */
/* Decide whether to give this child the `good' standard input
(one that points to the terminal or whatever), or the `bad' one
@@ -856,7 +863,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 +926,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 +987,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 +1018,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 +1143,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 +1337,7 @@ start_waiting_jobs ()
return;
}
#ifndef WIN32
#ifndef WINDOWS32
#ifdef VMS
#include <descrip.h>
#include <clidef.h>
@@ -1508,7 +1550,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 +1573,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,
@@ -1614,7 +1656,7 @@ void clean_tmp (void)
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 +1678,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 +1727,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 +1743,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 +1769,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 +1783,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 +1797,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 +1840,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 +1852,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 == '\0')
last_argument_was_empty = 1;
}
else if (*p == '\\' && p[1] == '\n')
goto swallow_escaped_newline;
else if (*p == '\n' && restp != NULL)
@@ -1763,8 +1866,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 +1877,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 +1891,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 +1956,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 +1998,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 +2025,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 +2074,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 +2144,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 +2226,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.

329
main.c
View File

@@ -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" },
@@ -450,6 +450,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 +555,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 +651,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 +673,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 +690,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 +705,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 +723,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 +771,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 +795,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 +806,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 +883,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 +955,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 +984,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 +1101,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 +1146,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 +1158,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 +1249,8 @@ int main (int argc, char ** argv)
time_t *makefile_mtimes = 0;
unsigned int mm_idx = 0;
char **nargv = argv;
char nargc = argc;
if (debug_flag)
puts ("Updating makefiles....");
@@ -1193,52 +1333,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 +1399,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 +1410,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 +1480,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 +1489,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 */
@@ -1514,6 +1668,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);
}
}
}

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.

24
make.h
View File

@@ -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,13 @@ extern char *alloca ();
#define ENUM_BITFIELD(bits)
#endif
#if defined(__MSDOS__) || defined(WIN32)
#if defined(__MSDOS__) || defined(WINDOWS32)
#define PATH_SEPARATOR_CHAR ';'
#else
#define PATH_SEPARATOR_CHAR ':'
#endif
#ifdef WIN32
#ifdef WINDOWS32
#include <fcntl.h>
#include <malloc.h>
#define pipe(p) _pipe(p, 512, O_BINARY)
@@ -346,6 +359,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 ();
@@ -364,7 +378,7 @@ extern void child_access ();
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
because such systems often declare the 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

View File

@@ -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.
@@ -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
@@ -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.
@@ -1645,6 +1654,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,10 +1675,10 @@ 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 source files in the dependencies 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
@@ -1701,7 +1711,7 @@ 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
@@ -1800,7 +1810,71 @@ 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.
@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 filename specified in the makefile.
@end enumerate
@end enumerate
This may seem overly complex, but in fact it is almost always 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
@@ -2112,7 +2186,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 +2483,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 +2679,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
@@ -5284,8 +5361,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 +5374,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
@@ -5656,6 +5752,12 @@ You can specify a different goal or goals with arguments to @code{make}.
Use the name of the goal as an argument. If you specify several goals,
@code{make} processes each of them in turn, in the order you name them.
@cindex @code{MAKECMDGOALS}
@vindex MAKECMDGOALS
@code{Make} will set the special variable @code{MAKECMDGOALS} to the
list of goals you specified on the command line. If no goals were given
on the command line, this variable is empty.
Any target in the makefile may be specified as a goal (unless it
starts with @samp{-} or contains an @samp{=}, in which case it will be
parsed as a switch or variable definition, respectively). Even
@@ -6312,7 +6414,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 +6472,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.
@@ -7508,7 +7610,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 +7712,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 +8261,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}.

2
misc.c
View File

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

129
read.c
View File

@@ -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 == ':')
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;
@@ -1462,7 +1475,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 +1639,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 +1652,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 +1962,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 +1997,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 +2068,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 +2081,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 +2090,7 @@ tilde_expand (name)
return new;
}
}
#if !defined(_AMIGA) && !defined(WIN32)
#if !defined(_AMIGA) && !defined(WINDOWS32)
else
{
struct passwd *pwent;
@@ -2069,7 +2108,7 @@ tilde_expand (name)
else if (userend != 0)
*userend = '/';
}
#endif /* !AMIGA && !WIN32 */
#endif /* !AMIGA && !WINDOWS32 */
#endif /* !VMS */
return 0;
}

106
remake.c
View File

@@ -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
@@ -566,13 +570,63 @@ 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 GPATH, toss the VPATH */
if (!streq(file->name, file->hname))
{
char *name = file->name;
if (gpath_search (&name, NULL))
{
register struct file *fp = file;
/* Since we found the file on GPATH, convert it to use the
VPATH filename. */
while (fp)
{
fp->name = fp->hname;
fp = fp->prev;
}
DEBUGPR (" Using VPATH `%s' due to GPATH.\n");
}
else
{
if (debug_flag)
{
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);
@@ -1003,7 +1057,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 +1070,9 @@ 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);
rehash_file (file, name);
check_renamed (file);
return file_mtime (file);
mtime = name_mtime (name);
}
}
}
@@ -1026,10 +1080,9 @@ 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;
static time_t now = 0;
if (mtime != -1 && mtime > now && ! file->updated)
{
/* This file's time appears to be in the future.
@@ -1039,16 +1092,13 @@ f_mtime (file, search)
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);
#endif
{
error ("*** File `%s' has modification time in the future",
file->name);
file->update_status = 2;
}
if (mtime > now)
error ("*** Warning: File `%s' has modification time in the future",
file->name);
}
}
@@ -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

@@ -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
@@ -354,7 +354,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 +373,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 +413,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 +574,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 +762,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 +994,7 @@ print_file_variables (file)
print_variable_set (file->variables->set, "# ");
}
#ifdef WIN32
#ifdef WINDOWS32
void
sync_Path_environment(void)
{
@@ -902,9 +1012,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,4 @@
char *version_string = "3.75";
char *version_string = "3.75.1";
/*
Local variables:

82
vpath.c
View File

@@ -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.
@@ -173,8 +209,8 @@ 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
@@ -209,6 +245,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;
@@ -270,6 +310,23 @@ construct_vpath_list (pattern, dirpath)
}
}
/* Search the GPATH list 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 not NULL) to its modtime (or
zero if no stat call was done), and return 1. Otherwise we return 0. */
int
gpath_search (file, mtime_ptr)
char **file;
time_t *mtime_ptr;
{
if (gpaths != 0
&& selective_vpath_search (gpaths, file, mtime_ptr))
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 +344,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 +400,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;
@@ -378,6 +439,11 @@ selective_vpath_search (path, file, mtime_ptr)
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. */
if (n != name && n[-1] != '/')
{

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);
@@ -90,7 +90,7 @@ closedir(DIR *pDir)
struct dirent *
readdir(DIR* pDir)
{
WIN32_FIND_DATA wfdFindData;
WINDOWS32_FIND_DATA wfdFindData;
if (!pDir) {
errno = EINVAL;
@@ -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

@@ -20,7 +20,7 @@
/* $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,21 +19,21 @@ 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) == ';' ||
@@ -48,7 +48,7 @@ convert_Path_to_win32(char *Path, char 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;
@@ -61,7 +61,7 @@ convert_Path_to_win32(char *Path, char to_delim)
*p = '\\';
#endif
return Path;
}
}
/*
* Convert to forward slashes. Resolve to full pathname optionally
@@ -100,10 +100,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 +119,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 +132,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 +154,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 +165,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 +187,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 +211,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 +234,6 @@ convert_path_to_nutc(char *path)
rval = savestring(nutc_path, strlen(nutc_path));
free(nutc_path);
return rval;
}
}
#endif

View File

@@ -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 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 WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /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 WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /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

@@ -395,7 +395,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) {
@@ -578,7 +578,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 +609,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 +718,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 +835,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 +883,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().
*

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];