Changes for make 3.75.1

This commit is contained in:
Paul Smith 1997-04-07 07:21:16 +00:00
parent 7bb7ba7849
commit 0ada207e2d
54 changed files with 3193 additions and 1550 deletions

215
ChangeLog
View file

@ -1,3 +1,146 @@
Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com>
* Version 3.75.1
* compatMakefile (objs): Define & use theo $(GLOB) variable so
that it's removed correctly from build.sh.in when it's built.
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 +154,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 +186,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 +204,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 +275,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 +303,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

@ -206,7 +206,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 +271,472 @@ $(objs): config.h
# Automatically generated dependencies will be put at the end of the file.
# Automatically generated dependencies.
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
commands.h
job.o: job.c make.h job.h filedef.h commands.h variable.h
dir.o: dir.c make.h
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
misc.o: misc.c make.h dep.h
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
getopt.h
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
glob/glob.h
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
rule.h
implicit.o: implicit.c make.h rule.h dep.h filedef.h
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
variable.h
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
variable.h
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
function.o: function.c make.h filedef.h variable.h dep.h job.h \
commands.h
vpath.o: vpath.c make.h filedef.h variable.h
commands.o: commands.c
commands.o: ./make.h
commands.o: /usr/include/sys/types.h
commands.o: /usr/include/sys/stdtypes.h
commands.o: /usr/include/sys/sysmacros.h
commands.o: /usr/include/sys/stat.h
commands.o: /usr/include/sys/types.h
commands.o: /usr/include/signal.h
commands.o: /usr/include/sys/signal.h
commands.o: /usr/include/vm/faultcode.h
commands.o: /usr/include/sys/stdtypes.h
commands.o: /usr/include/stdio.h
commands.o: /usr/include/ctype.h
commands.o: /usr/include/time.h
commands.o: /usr/include/sys/stdtypes.h
commands.o: /usr/include/errno.h
commands.o: /usr/include/sys/errno.h
commands.o: ./signame.h
commands.o: /usr/include/strings.h
commands.o: ./dep.h
commands.o: ./filedef.h
commands.o: ./variable.h
commands.o: ./job.h
commands.o: ./commands.h
job.o: job.c
job.o: ./make.h
job.o: /usr/include/sys/types.h
job.o: /usr/include/sys/stdtypes.h
job.o: /usr/include/sys/sysmacros.h
job.o: /usr/include/sys/stat.h
job.o: /usr/include/sys/types.h
job.o: /usr/include/signal.h
job.o: /usr/include/sys/signal.h
job.o: /usr/include/vm/faultcode.h
job.o: /usr/include/sys/stdtypes.h
job.o: /usr/include/stdio.h
job.o: /usr/include/ctype.h
job.o: /usr/include/time.h
job.o: /usr/include/sys/stdtypes.h
job.o: /usr/include/errno.h
job.o: /usr/include/sys/errno.h
job.o: ./signame.h
job.o: /usr/include/strings.h
job.o: ./job.h
job.o: ./filedef.h
job.o: ./commands.h
job.o: ./variable.h
job.o: /usr/include/assert.h
job.o: /usr/include/sys/file.h
job.o: /usr/include/sys/types.h
job.o: /usr/include/sys/fcntlcom.h
job.o: /usr/include/sys/stdtypes.h
job.o: /usr/include/sys/stat.h
dir.o: dir.c
dir.o: ./make.h
dir.o: /usr/include/sys/types.h
dir.o: /usr/include/sys/stdtypes.h
dir.o: /usr/include/sys/sysmacros.h
dir.o: /usr/include/sys/stat.h
dir.o: /usr/include/sys/types.h
dir.o: /usr/include/signal.h
dir.o: /usr/include/sys/signal.h
dir.o: /usr/include/vm/faultcode.h
dir.o: /usr/include/sys/stdtypes.h
dir.o: /usr/include/stdio.h
dir.o: /usr/include/ctype.h
dir.o: /usr/include/time.h
dir.o: /usr/include/sys/stdtypes.h
dir.o: /usr/include/errno.h
dir.o: /usr/include/sys/errno.h
dir.o: ./signame.h
dir.o: /usr/include/strings.h
file.o: file.c
file.o: ./make.h
file.o: /usr/include/sys/types.h
file.o: /usr/include/sys/stdtypes.h
file.o: /usr/include/sys/sysmacros.h
file.o: /usr/include/sys/stat.h
file.o: /usr/include/sys/types.h
file.o: /usr/include/signal.h
file.o: /usr/include/sys/signal.h
file.o: /usr/include/vm/faultcode.h
file.o: /usr/include/sys/stdtypes.h
file.o: /usr/include/stdio.h
file.o: /usr/include/ctype.h
file.o: /usr/include/time.h
file.o: /usr/include/sys/stdtypes.h
file.o: /usr/include/errno.h
file.o: /usr/include/sys/errno.h
file.o: ./signame.h
file.o: /usr/include/strings.h
file.o: ./dep.h
file.o: ./filedef.h
file.o: ./job.h
file.o: ./commands.h
file.o: ./variable.h
file.o: /usr/include/assert.h
misc.o: misc.c
misc.o: ./make.h
misc.o: /usr/include/sys/types.h
misc.o: /usr/include/sys/stdtypes.h
misc.o: /usr/include/sys/sysmacros.h
misc.o: /usr/include/sys/stat.h
misc.o: /usr/include/sys/types.h
misc.o: /usr/include/signal.h
misc.o: /usr/include/sys/signal.h
misc.o: /usr/include/vm/faultcode.h
misc.o: /usr/include/sys/stdtypes.h
misc.o: /usr/include/stdio.h
misc.o: /usr/include/ctype.h
misc.o: /usr/include/time.h
misc.o: /usr/include/sys/stdtypes.h
misc.o: /usr/include/errno.h
misc.o: /usr/include/sys/errno.h
misc.o: ./signame.h
misc.o: /usr/include/strings.h
misc.o: ./dep.h
main.o: main.c
main.o: ./make.h
main.o: /usr/include/sys/types.h
main.o: /usr/include/sys/stdtypes.h
main.o: /usr/include/sys/sysmacros.h
main.o: /usr/include/sys/stat.h
main.o: /usr/include/sys/types.h
main.o: /usr/include/signal.h
main.o: /usr/include/sys/signal.h
main.o: /usr/include/vm/faultcode.h
main.o: /usr/include/sys/stdtypes.h
main.o: /usr/include/stdio.h
main.o: /usr/include/ctype.h
main.o: /usr/include/time.h
main.o: /usr/include/sys/stdtypes.h
main.o: /usr/include/errno.h
main.o: /usr/include/sys/errno.h
main.o: ./signame.h
main.o: /usr/include/strings.h
main.o: ./dep.h
main.o: ./filedef.h
main.o: ./variable.h
main.o: ./job.h
main.o: ./commands.h
main.o: ./getopt.h
main.o: /usr/include/assert.h
read.o: read.c
read.o: ./make.h
read.o: /usr/include/sys/types.h
read.o: /usr/include/sys/stdtypes.h
read.o: /usr/include/sys/sysmacros.h
read.o: /usr/include/sys/stat.h
read.o: /usr/include/sys/types.h
read.o: /usr/include/signal.h
read.o: /usr/include/sys/signal.h
read.o: /usr/include/vm/faultcode.h
read.o: /usr/include/sys/stdtypes.h
read.o: /usr/include/stdio.h
read.o: /usr/include/ctype.h
read.o: /usr/include/time.h
read.o: /usr/include/sys/stdtypes.h
read.o: /usr/include/errno.h
read.o: /usr/include/sys/errno.h
read.o: ./signame.h
read.o: /usr/include/strings.h
read.o: ./dep.h
read.o: ./filedef.h
read.o: ./job.h
read.o: ./commands.h
read.o: ./variable.h
read.o: ./glob/glob.h
read.o: /usr/include/pwd.h
read.o: /usr/include/sys/types.h
remake.o: remake.c
remake.o: ./make.h
remake.o: /usr/include/sys/types.h
remake.o: /usr/include/sys/stdtypes.h
remake.o: /usr/include/sys/sysmacros.h
remake.o: /usr/include/sys/stat.h
remake.o: /usr/include/sys/types.h
remake.o: /usr/include/signal.h
remake.o: /usr/include/sys/signal.h
remake.o: /usr/include/vm/faultcode.h
remake.o: /usr/include/sys/stdtypes.h
remake.o: /usr/include/stdio.h
remake.o: /usr/include/ctype.h
remake.o: /usr/include/time.h
remake.o: /usr/include/sys/stdtypes.h
remake.o: /usr/include/errno.h
remake.o: /usr/include/sys/errno.h
remake.o: ./signame.h
remake.o: /usr/include/strings.h
remake.o: ./filedef.h
remake.o: ./job.h
remake.o: ./commands.h
remake.o: ./dep.h
remake.o: /usr/include/assert.h
remake.o: /usr/include/sys/file.h
remake.o: /usr/include/sys/types.h
remake.o: /usr/include/sys/fcntlcom.h
remake.o: /usr/include/sys/stdtypes.h
remake.o: /usr/include/sys/stat.h
rule.o: rule.c
rule.o: ./make.h
rule.o: /usr/include/sys/types.h
rule.o: /usr/include/sys/stdtypes.h
rule.o: /usr/include/sys/sysmacros.h
rule.o: /usr/include/sys/stat.h
rule.o: /usr/include/sys/types.h
rule.o: /usr/include/signal.h
rule.o: /usr/include/sys/signal.h
rule.o: /usr/include/vm/faultcode.h
rule.o: /usr/include/sys/stdtypes.h
rule.o: /usr/include/stdio.h
rule.o: /usr/include/ctype.h
rule.o: /usr/include/time.h
rule.o: /usr/include/sys/stdtypes.h
rule.o: /usr/include/errno.h
rule.o: /usr/include/sys/errno.h
rule.o: ./signame.h
rule.o: /usr/include/strings.h
rule.o: ./dep.h
rule.o: ./filedef.h
rule.o: ./job.h
rule.o: ./commands.h
rule.o: ./variable.h
rule.o: ./rule.h
implicit.o: implicit.c
implicit.o: ./make.h
implicit.o: /usr/include/sys/types.h
implicit.o: /usr/include/sys/stdtypes.h
implicit.o: /usr/include/sys/sysmacros.h
implicit.o: /usr/include/sys/stat.h
implicit.o: /usr/include/sys/types.h
implicit.o: /usr/include/signal.h
implicit.o: /usr/include/sys/signal.h
implicit.o: /usr/include/vm/faultcode.h
implicit.o: /usr/include/sys/stdtypes.h
implicit.o: /usr/include/stdio.h
implicit.o: /usr/include/ctype.h
implicit.o: /usr/include/time.h
implicit.o: /usr/include/sys/stdtypes.h
implicit.o: /usr/include/errno.h
implicit.o: /usr/include/sys/errno.h
implicit.o: ./signame.h
implicit.o: /usr/include/strings.h
implicit.o: ./rule.h
implicit.o: ./dep.h
implicit.o: ./filedef.h
default.o: default.c
default.o: ./make.h
default.o: /usr/include/sys/types.h
default.o: /usr/include/sys/stdtypes.h
default.o: /usr/include/sys/sysmacros.h
default.o: /usr/include/sys/stat.h
default.o: /usr/include/sys/types.h
default.o: /usr/include/signal.h
default.o: /usr/include/sys/signal.h
default.o: /usr/include/vm/faultcode.h
default.o: /usr/include/sys/stdtypes.h
default.o: /usr/include/stdio.h
default.o: /usr/include/ctype.h
default.o: /usr/include/time.h
default.o: /usr/include/sys/stdtypes.h
default.o: /usr/include/errno.h
default.o: /usr/include/sys/errno.h
default.o: ./signame.h
default.o: /usr/include/strings.h
default.o: ./rule.h
default.o: ./dep.h
default.o: ./filedef.h
default.o: ./job.h
default.o: ./commands.h
default.o: ./variable.h
variable.o: variable.c
variable.o: ./make.h
variable.o: /usr/include/sys/types.h
variable.o: /usr/include/sys/stdtypes.h
variable.o: /usr/include/sys/sysmacros.h
variable.o: /usr/include/sys/stat.h
variable.o: /usr/include/sys/types.h
variable.o: /usr/include/signal.h
variable.o: /usr/include/sys/signal.h
variable.o: /usr/include/vm/faultcode.h
variable.o: /usr/include/sys/stdtypes.h
variable.o: /usr/include/stdio.h
variable.o: /usr/include/ctype.h
variable.o: /usr/include/time.h
variable.o: /usr/include/sys/stdtypes.h
variable.o: /usr/include/errno.h
variable.o: /usr/include/sys/errno.h
variable.o: ./signame.h
variable.o: /usr/include/strings.h
variable.o: ./dep.h
variable.o: ./filedef.h
variable.o: ./job.h
variable.o: ./commands.h
variable.o: ./variable.h
expand.o: expand.c
expand.o: ./make.h
expand.o: /usr/include/sys/types.h
expand.o: /usr/include/sys/stdtypes.h
expand.o: /usr/include/sys/sysmacros.h
expand.o: /usr/include/sys/stat.h
expand.o: /usr/include/sys/types.h
expand.o: /usr/include/signal.h
expand.o: /usr/include/sys/signal.h
expand.o: /usr/include/vm/faultcode.h
expand.o: /usr/include/sys/stdtypes.h
expand.o: /usr/include/stdio.h
expand.o: /usr/include/ctype.h
expand.o: /usr/include/time.h
expand.o: /usr/include/sys/stdtypes.h
expand.o: /usr/include/errno.h
expand.o: /usr/include/sys/errno.h
expand.o: ./signame.h
expand.o: /usr/include/strings.h
expand.o: ./filedef.h
expand.o: ./job.h
expand.o: ./commands.h
expand.o: ./variable.h
function.o: function.c
function.o: ./make.h
function.o: /usr/include/sys/types.h
function.o: /usr/include/sys/stdtypes.h
function.o: /usr/include/sys/sysmacros.h
function.o: /usr/include/sys/stat.h
function.o: /usr/include/sys/types.h
function.o: /usr/include/signal.h
function.o: /usr/include/sys/signal.h
function.o: /usr/include/vm/faultcode.h
function.o: /usr/include/sys/stdtypes.h
function.o: /usr/include/stdio.h
function.o: /usr/include/ctype.h
function.o: /usr/include/time.h
function.o: /usr/include/sys/stdtypes.h
function.o: /usr/include/errno.h
function.o: /usr/include/sys/errno.h
function.o: ./signame.h
function.o: /usr/include/strings.h
function.o: ./filedef.h
function.o: ./variable.h
function.o: ./dep.h
function.o: ./job.h
function.o: ./commands.h
vpath.o: vpath.c
vpath.o: ./make.h
vpath.o: /usr/include/sys/types.h
vpath.o: /usr/include/sys/stdtypes.h
vpath.o: /usr/include/sys/sysmacros.h
vpath.o: /usr/include/sys/stat.h
vpath.o: /usr/include/sys/types.h
vpath.o: /usr/include/signal.h
vpath.o: /usr/include/sys/signal.h
vpath.o: /usr/include/vm/faultcode.h
vpath.o: /usr/include/sys/stdtypes.h
vpath.o: /usr/include/stdio.h
vpath.o: /usr/include/ctype.h
vpath.o: /usr/include/time.h
vpath.o: /usr/include/sys/stdtypes.h
vpath.o: /usr/include/errno.h
vpath.o: /usr/include/sys/errno.h
vpath.o: ./signame.h
vpath.o: /usr/include/strings.h
vpath.o: ./filedef.h
vpath.o: ./variable.h
version.o: version.c
ar.o: ar.c make.h filedef.h dep.h
arscan.o: arscan.c make.h
signame.o: signame.c signame.h
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
ar.o: ar.c
ar.o: ./make.h
ar.o: /usr/include/sys/types.h
ar.o: /usr/include/sys/stdtypes.h
ar.o: /usr/include/sys/sysmacros.h
ar.o: /usr/include/sys/stat.h
ar.o: /usr/include/sys/types.h
ar.o: /usr/include/signal.h
ar.o: /usr/include/sys/signal.h
ar.o: /usr/include/vm/faultcode.h
ar.o: /usr/include/sys/stdtypes.h
ar.o: /usr/include/stdio.h
ar.o: /usr/include/ctype.h
ar.o: /usr/include/time.h
ar.o: /usr/include/sys/stdtypes.h
ar.o: /usr/include/errno.h
ar.o: /usr/include/sys/errno.h
ar.o: ./signame.h
ar.o: /usr/include/strings.h
ar.o: ./filedef.h
ar.o: ./dep.h
arscan.o: arscan.c
arscan.o: ./make.h
arscan.o: /usr/include/sys/types.h
arscan.o: /usr/include/sys/stdtypes.h
arscan.o: /usr/include/sys/sysmacros.h
arscan.o: /usr/include/sys/stat.h
arscan.o: /usr/include/sys/types.h
arscan.o: /usr/include/signal.h
arscan.o: /usr/include/sys/signal.h
arscan.o: /usr/include/vm/faultcode.h
arscan.o: /usr/include/sys/stdtypes.h
arscan.o: /usr/include/stdio.h
arscan.o: /usr/include/ctype.h
arscan.o: /usr/include/time.h
arscan.o: /usr/include/sys/stdtypes.h
arscan.o: /usr/include/errno.h
arscan.o: /usr/include/sys/errno.h
arscan.o: ./signame.h
arscan.o: /usr/include/strings.h
arscan.o: /usr/include/sys/file.h
arscan.o: /usr/include/sys/types.h
arscan.o: /usr/include/sys/fcntlcom.h
arscan.o: /usr/include/sys/stdtypes.h
arscan.o: /usr/include/sys/stat.h
arscan.o: /usr/include/ar.h
signame.o: signame.c
signame.o: /usr/include/stdio.h
signame.o: /usr/include/sys/types.h
signame.o: /usr/include/sys/stdtypes.h
signame.o: /usr/include/sys/sysmacros.h
signame.o: /usr/include/signal.h
signame.o: /usr/include/sys/signal.h
signame.o: /usr/include/vm/faultcode.h
signame.o: /usr/include/sys/stdtypes.h
signame.o: ./signame.h
remote-stub.o: remote-stub.c
remote-stub.o: ./make.h
remote-stub.o: /usr/include/sys/types.h
remote-stub.o: /usr/include/sys/stdtypes.h
remote-stub.o: /usr/include/sys/sysmacros.h
remote-stub.o: /usr/include/sys/stat.h
remote-stub.o: /usr/include/sys/types.h
remote-stub.o: /usr/include/signal.h
remote-stub.o: /usr/include/sys/signal.h
remote-stub.o: /usr/include/vm/faultcode.h
remote-stub.o: /usr/include/sys/stdtypes.h
remote-stub.o: /usr/include/stdio.h
remote-stub.o: /usr/include/ctype.h
remote-stub.o: /usr/include/time.h
remote-stub.o: /usr/include/sys/stdtypes.h
remote-stub.o: /usr/include/errno.h
remote-stub.o: /usr/include/sys/errno.h
remote-stub.o: ./signame.h
remote-stub.o: /usr/include/strings.h
remote-stub.o: ./filedef.h
remote-stub.o: ./job.h
remote-stub.o: ./commands.h
getopt.o: getopt.c
getopt1.o: getopt1.c getopt.h
getopt.o: /usr/include/stdio.h
getopt.o: ./getopt.h
getopt1.o: getopt1.c
getopt1.o: ./getopt.h
getopt1.o: /usr/include/stdio.h
getloadavg.o: getloadavg.c
getloadavg.o: /usr/include/sys/types.h
getloadavg.o: /usr/include/sys/stdtypes.h
getloadavg.o: /usr/include/sys/sysmacros.h
getloadavg.o: /usr/include/sys/param.h
getloadavg.o: /usr/include/machine/param.h
getloadavg.o: /usr/include/machine/devaddr.h
getloadavg.o: /usr/include/sys/signal.h
getloadavg.o: /usr/include/vm/faultcode.h
getloadavg.o: /usr/include/sys/stdtypes.h
getloadavg.o: /usr/include/sys/types.h
getloadavg.o: /usr/include/errno.h
getloadavg.o: /usr/include/sys/errno.h
getloadavg.o: /usr/include/stdio.h
getloadavg.o: /usr/include/nlist.h
getloadavg.o: /usr/include/sys/file.h
getloadavg.o: /usr/include/sys/types.h
getloadavg.o: /usr/include/sys/fcntlcom.h
getloadavg.o: /usr/include/sys/stdtypes.h
getloadavg.o: /usr/include/sys/stat.h
getloadavg.o: /usr/include/sys/types.h

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.

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

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

@ -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,9 @@
/* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the mktemp function. */
#undef HAVE_MKTEMP

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"

775
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)

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

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

View file

@ -43,7 +43,7 @@
DGUX
eunice UNIX emulator under VMS.
hpux
MSDOS No-op for MSDOS.
__MSDOS__ No-op for MSDOS.
NeXT
sgi
sequent Sequent Dynix 3.x.x (BSD)
@ -52,7 +52,7 @@
UMAX
UMAX4_3
VMS
WIN32 No-op for Windows95/NT.
WINDOWS32 No-op for Windows95/NT.
__linux__ Linux: assumes /proc filesystem mounted.
Support from Michael K. Johnson.
__NetBSD__ NetBSD: assumes /kern filesystem mounted.
@ -824,7 +824,7 @@ getloadavg (loadavg, nelem)
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
# endif /* OSF_MIPS */
# if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32))
# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32))
# define LDAV_DONE
/* A faithful emulation is going to have to be saved for a rainy day. */
@ -832,7 +832,7 @@ getloadavg (loadavg, nelem)
{
loadavg[elem] = 0.0;
}
# endif /* MSDOS */
# endif /* __MSDOS__ || WINDOWS32 */
# if !defined (LDAV_DONE) && defined (OSF_ALPHA)
# define LDAV_DONE

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

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

440
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, 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)
@ -1767,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;
@ -1776,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)
@ -1785,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++ = '=';
@ -1919,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
*
@ -1935,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.
@ -2043,19 +2144,31 @@ 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)
@ -2063,10 +2176,25 @@ construct_command_argv_internal (line, restp, shell, ifs)
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;
}
@ -2098,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);
}
}
}

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

@ -231,6 +231,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

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