mirror of
https://github.com/mirror/make.git
synced 2026-09-02 04:38:12 +08:00
Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0239bb0af | ||
|
|
2d29a55137 | ||
|
|
806c7aa46c | ||
|
|
47daa6787e | ||
|
|
eb4d510a74 | ||
|
|
c86587fb9b | ||
|
|
fd688f6e9c | ||
|
|
f96ef9a409 | ||
|
|
09616e5837 | ||
|
|
cf9aa5b70b | ||
|
|
9033f1a656 | ||
|
|
ccfe89b829 | ||
|
|
35f1bbbe23 | ||
|
|
9f88582943 | ||
|
|
b38d9d2ae9 | ||
|
|
132e0eda6c | ||
|
|
c297b2fbd5 | ||
|
|
ec08feae97 | ||
|
|
8c7887ac02 | ||
|
|
08cf536bfb | ||
|
|
b48b02c7f4 | ||
|
|
e7a0e14a43 | ||
|
|
6413a1d08e | ||
|
|
8f34c48e3f | ||
|
|
818bb8940c | ||
|
|
cc4d91d751 | ||
|
|
36d804bd51 | ||
|
|
f95d071efc | ||
|
|
c0deecf9ee | ||
|
|
dd63648825 | ||
|
|
229ba33d0e | ||
|
|
ccbe33db90 | ||
|
|
32efbf8dc3 | ||
|
|
6e3b0629f1 | ||
|
|
51659ed000 | ||
|
|
7827f1bde8 | ||
|
|
922730c406 | ||
|
|
5e91041347 | ||
|
|
9f7ba4a505 | ||
|
|
2745ed943b | ||
|
|
0cb72b4a51 | ||
|
|
73fcfdbe24 | ||
|
|
0ada207e2d | ||
|
|
7bb7ba7849 | ||
|
|
2a294c52d1 | ||
|
|
71515366cd | ||
|
|
d78f2db327 | ||
|
|
30c9fcfec3 | ||
|
|
e2b79aacf7 | ||
|
|
e981c049f4 | ||
|
|
9012013552 | ||
|
|
cda4f25fd4 | ||
|
|
b32b9197ab | ||
|
|
b66145d8bc | ||
|
|
d2fe84cab3 | ||
|
|
c2ea8e2486 | ||
|
|
db2384b9ab | ||
|
|
9b0b3a6e70 | ||
|
|
a71d56b4cc | ||
|
|
10011ce289 | ||
|
|
84a9fd68b7 | ||
|
|
262ca66cb7 | ||
|
|
a1eb3e67cd | ||
|
|
78a4848b83 | ||
|
|
b16829dc46 | ||
|
|
c71e4ac269 | ||
|
|
82e6316607 | ||
|
|
a8de4b93e3 | ||
|
|
6e7fa14c65 | ||
|
|
5206d3f2bc | ||
|
|
e2da48ca55 | ||
|
|
bc26243d90 | ||
|
|
b4db97478e | ||
|
|
4e361d0f01 |
5
COPYING
5
COPYING
@@ -2,7 +2,8 @@
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
59 Temple Place - Suite 330, Boston, MA
|
||||||
|
02111-1307, USA.
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -305,7 +306,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
|||||||
222
ChangeLog
222
ChangeLog
@@ -1,3 +1,153 @@
|
|||||||
|
Mon Apr 7 02:06:22 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* Version 3.75.1
|
||||||
|
|
||||||
|
* compatMakefile (objs): Define & use the $(GLOB) variable so
|
||||||
|
that it's removed correctly from build.sh.in when it's built.
|
||||||
|
|
||||||
|
* configure.in: On Solaris we can use the kstat_*() functions to
|
||||||
|
get load averages without needing special permissions. Add a
|
||||||
|
check for -lkstat to see if we have it.
|
||||||
|
|
||||||
|
* getloadavg.c (getloadavg): Use HAVE_LIBKSTAT instead of SUN5 as
|
||||||
|
the test to enable kstat_open(), etc. processing.
|
||||||
|
|
||||||
|
Fri Apr 4 20:21:18 1997 Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
* <lots>: Fixes to work in the DJGPP DOS environment.
|
||||||
|
|
||||||
|
Mon Mar 31 02:42:52 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* function.c (expand_function): Added new function $(wordlist).
|
||||||
|
|
||||||
|
* make.texinfo (Filename Functions): Document $(wordlist) function.
|
||||||
|
|
||||||
|
* vpath.c (build_vpath_lists): Construct the GPATH variable
|
||||||
|
information in the same manner we used to construct VPATH.
|
||||||
|
(gpath_search): New function to search GPATH.
|
||||||
|
|
||||||
|
* make.h: Declare the new function.
|
||||||
|
|
||||||
|
* remake.c (update_file_1): Call it, and keep VPATH if it's found.
|
||||||
|
|
||||||
|
* make.texinfo (Search Algorithm): Document GPATH variable.
|
||||||
|
|
||||||
|
Sun Mar 30 20:57:16 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* main.c (handle_non_switch_argument): Defined the MAKECMDGOALS
|
||||||
|
variable to contain the user options passed in on the cmd line.
|
||||||
|
|
||||||
|
* make.texinfo (Goals): Document MAKECMDGOALS variable.
|
||||||
|
|
||||||
|
* remake.c (f_mtime): Print a warning if we detect a clock skew
|
||||||
|
error, rather than failing.
|
||||||
|
|
||||||
|
* main.c (main): If we rebuild any makefiles and need to re-exec,
|
||||||
|
add "-o<mkfile>" options for each makefile rebuilt to avoid
|
||||||
|
infinite looping.
|
||||||
|
|
||||||
|
Fri Mar 28 15:26:05 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* job.c (construct_command_argv_internal): Track whether the last
|
||||||
|
arg in the cmd string was empty or not (Roland).
|
||||||
|
(construct_command_argv_internal): If the shell line is empty,
|
||||||
|
don't do anything (Roland).
|
||||||
|
|
||||||
|
* glob/glob.h,glob/glob.c,glob/fnmatch.c,glob/fnmatch.h: Install
|
||||||
|
the latest changes from the GLIBC version of glob (Ulrich Drepper).
|
||||||
|
|
||||||
|
* getloadavg.c,make-stds.texi: New version (Roland).
|
||||||
|
|
||||||
|
* (ALL): Changed WIN32 to W32 or WINDOWS32 (RMS).
|
||||||
|
|
||||||
|
Mon Mar 24 15:33:34 1997 Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* README.W32: Describe preliminary FAT support.
|
||||||
|
|
||||||
|
* build_w32.bat: Use a variable for the final exe name.
|
||||||
|
|
||||||
|
* dir.c (find_directory): W32: Find the filesystem type.
|
||||||
|
(dir_contents_file_exists_p): W32: for FAT filesystems, always
|
||||||
|
rehash since FAT doesn't change directory mtime on change.
|
||||||
|
|
||||||
|
* main.c (handle_runtime_exceptions): W32: Add an
|
||||||
|
UnhandledExceptionFilter so that when make bombs due to ^C or a
|
||||||
|
bug, it won't cause a GUI requestor to pop up unless debug is
|
||||||
|
turned on.
|
||||||
|
(main): Call it.
|
||||||
|
|
||||||
|
Mon Mar 24 00:57:34 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* configure.in, config.h.in, config.ami, config.h-vms, config.h.w32:
|
||||||
|
Check for memmove() function.
|
||||||
|
|
||||||
|
* make.h (bcopy): If memmove() available, define bcopy() to use it.
|
||||||
|
Otherwise just use bcopy(). Don't use memcpy(); it's not guaranteed
|
||||||
|
to handle overlapping moves.
|
||||||
|
|
||||||
|
* read.c (read_makefile): Fix some uninitialized memory reads
|
||||||
|
(reported by Purify).
|
||||||
|
|
||||||
|
* job.c (construct_command_argv_internal): Use bcopy() not
|
||||||
|
strcpy(); strcpy() isn't guaranteed to handle overlapping moves.
|
||||||
|
|
||||||
|
* Makefile.in: Change install-info option ``--infodir'' to
|
||||||
|
``--info-dir'' for use with new texinfo.
|
||||||
|
|
||||||
|
* function.c (expand_function): $(basename) and $(suffix) should
|
||||||
|
only search for suffixes as far back as the last directory (e.g.,
|
||||||
|
only the final filename in the path).
|
||||||
|
|
||||||
|
Sun Mar 23 00:13:05 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* make.texinfo: Add @dircategory/@direntry information.
|
||||||
|
(Top): Remove previous reference to (dir) (from RMS).
|
||||||
|
(Static Usage): Add "all:" rule to example.
|
||||||
|
(Automatic Dependencies): fix .d file creation example.
|
||||||
|
|
||||||
|
* Install VPATH+ patch:
|
||||||
|
|
||||||
|
* filedef.h (struct file): Add in hname field to store the hashed
|
||||||
|
filename, and a flag to remember if we're using the vpath filename
|
||||||
|
or not. Renamed a few functions for more clarity.
|
||||||
|
|
||||||
|
* file.c (lookup_file,enter_file,file_hash_enter): Store filenames
|
||||||
|
in the hash table based on their "hash name". We can change this
|
||||||
|
while keeping the original target in "name".
|
||||||
|
(rehash_file): Renamed from "rename_file" to be more accurate.
|
||||||
|
Changes the hash name, but not the target name.
|
||||||
|
|
||||||
|
* remake.c (update_file_1): Modify -d output for more detailed
|
||||||
|
VPATH info. If we don't need to rebuild, use the VPATH name.
|
||||||
|
(f_mtime): Don't search for vpath if we're ignoring it. Call
|
||||||
|
renamed function rehash_file. Call name_mtime instead of
|
||||||
|
file_mtime, to avoid infinite recursion since the file wasn't
|
||||||
|
actually renamed.
|
||||||
|
|
||||||
|
* implicit.c (pattern_search): if we find an implicit file in
|
||||||
|
VPATH, save the original name not the VPATH name.
|
||||||
|
|
||||||
|
* make.texinfo (Directory Search): Add a section on the new VPATH
|
||||||
|
functionality.
|
||||||
|
|
||||||
|
Sun Dec 1 18:36:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* dir.c (file_exists_p, file_impossible, file_impossible_p): If
|
||||||
|
dirname is empty replace it by the name of the root directory.
|
||||||
|
Note that this doesn't work (yet) for W32, Amiga, or VMS.
|
||||||
|
|
||||||
|
Tue Oct 08 13:57:03 1996 Rob Tulloh <tulloh@tivoli.com>
|
||||||
|
|
||||||
|
* main.c (main): W32 bug fix for PATH vars.
|
||||||
|
|
||||||
|
Tue Sep 17 1996 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
|
* filedef.h (NEW_MTIME): Don't assume that time_t is a signed
|
||||||
|
32-bit quantity.
|
||||||
|
|
||||||
|
* make.h: (CHAR_BIT, INTEGER_TYPE_SIGNED, INTEGER_TYPE_MAXIMUM,
|
||||||
|
INTEGER_TYPE_MINIMUM): New macros.
|
||||||
|
|
||||||
Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
|
Tue Aug 27 01:06:34 1996 Roland McGrath <roland@baalperazim.frob.com>
|
||||||
|
|
||||||
* Version 3.75 released.
|
* Version 3.75 released.
|
||||||
@@ -11,17 +161,17 @@ Mon Aug 26 19:55:47 1996 Roland McGrath <roland@baalperazim.frob.com>
|
|||||||
|
|
||||||
Sun Jul 28 15:37:09 1996 Rob Tulloh (tulloh@tivoli.com)
|
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
|
real function. This was done so that VPATH could contain
|
||||||
white space separated pathnames. Please note that directory
|
white space separated pathnames. Please note that directory
|
||||||
paths (in VPATH/vpath context) containing white space are not
|
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.
|
for suggestions.
|
||||||
|
|
||||||
* w32/include/pathstuff.h: Added prototype for the new
|
* 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
|
and support pathnames which contain white space and some
|
||||||
workaround suggestions.
|
workaround suggestions.
|
||||||
|
|
||||||
@@ -43,7 +193,7 @@ Thu Jul 25 19:53:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|||||||
|
|
||||||
* vmsfunctions.c (vms_stat): `sys$dassgn (DevChan);' added by kkaempf.
|
* 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.
|
* NMakefile (LDFLAGS_debug): Value fixed by tulloh.
|
||||||
|
|
||||||
@@ -61,7 +211,7 @@ Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|||||||
|
|
||||||
* Version 3.74.6.
|
* Version 3.74.6.
|
||||||
|
|
||||||
* GNUmakefile (win32files): New variable.
|
* GNUmakefile (w32files): New variable.
|
||||||
(distfiles): Add it.
|
(distfiles): Add it.
|
||||||
* w32: Updated by Rob Tulloh.
|
* w32: Updated by Rob Tulloh.
|
||||||
|
|
||||||
@@ -132,22 +282,22 @@ Wed May 15 17:37:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|||||||
|
|
||||||
Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
|
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.
|
pathname along with st_mtime will be keys for files.
|
||||||
Fixed problem where vpath can be confused when files
|
Fixed problem where vpath can be confused when files
|
||||||
are added to a directory after the directory has already been
|
are added to a directory after the directory has already been
|
||||||
read in. The code now attempts to reread the directory if it
|
read in. The code now attempts to reread the directory if it
|
||||||
discovers that the datestamp on the directory has changed since
|
discovers that the datestamp on the directory has changed since
|
||||||
it was cached by make. This problem only seems to occur on WIN32
|
it was cached by make. This problem only seems to occur on W32
|
||||||
right now so it is lumped under port #ifdef WIN32.
|
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.
|
fork/exec.
|
||||||
|
|
||||||
* job.c: WIN32: Added the code to do fork/exec/waitpid style processing
|
* job.c: W32: Added the code to do fork/exec/waitpid style processing
|
||||||
on WIN32 systems via calls to subproc library.
|
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
|
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
|
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
|
%Path% if it is not set already. Make also looks to see if sh.exe
|
||||||
@@ -160,65 +310,65 @@ Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
|
|||||||
debugging recursive calls to make where problems appear only in the
|
debugging recursive calls to make where problems appear only in the
|
||||||
sub-make.
|
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.
|
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
|
appear in filenames. Use of colon in filenames would otherwise
|
||||||
confuse make.
|
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
|
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
|
and converting them to semicolon separated lists for make's
|
||||||
internal use. New function sync_Path_environment()
|
internal use. New function sync_Path_environment()
|
||||||
which is called in job.c and function.c before creating a new
|
which is called in job.c and function.c before creating a new
|
||||||
process. Caller must set Path in environment since we don't
|
process. Caller must set Path in environment since we don't
|
||||||
have fork() to do this for us.
|
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.
|
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.
|
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.
|
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
|
subproc library from the top-level NMakefile. Needed because
|
||||||
WIndows 95 (nmake) doesn't allow you to cd in a make rule.
|
WIndows 95 (nmake) doesn't allow you to cd in a make rule.
|
||||||
|
|
||||||
* w32/include/dirent.h
|
* 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).
|
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.
|
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.
|
with nmake. Used to build subproc library.
|
||||||
|
|
||||||
* w32/subproc/misc.c: WIN32: subproc library support code
|
* w32/subproc/misc.c: W32: subproc library support code
|
||||||
* w32/subproc/proc.h: WIN32: subproc library support code
|
* w32/subproc/proc.h: W32: subproc library support code
|
||||||
* w32/subproc/sub_proc.c: WIN32: subproc library source code
|
* w32/subproc/sub_proc.c: W32: subproc library source code
|
||||||
* w32/subproc/w32err.c: WIN32: subproc library support 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>
|
Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
|||||||
25
GNUmakefile
25
GNUmakefile
@@ -44,6 +44,8 @@ include compatMakefile
|
|||||||
|
|
||||||
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
|
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
|
||||||
|
|
||||||
|
CVS = cvs
|
||||||
|
|
||||||
# Remove autoconf magic.
|
# Remove autoconf magic.
|
||||||
prefix = /usr/local
|
prefix = /usr/local
|
||||||
exec_prefix = $(prefix)
|
exec_prefix = $(prefix)
|
||||||
@@ -58,10 +60,10 @@ config.h.in: $(AC_MACRODIR)/acconfig.h
|
|||||||
endif
|
endif
|
||||||
configure: configure.in aclocal.m4
|
configure: configure.in aclocal.m4
|
||||||
autoconf $(ACFLAGS)
|
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
|
config.h.in: configure.in aclocal.m4
|
||||||
autoheader $(ACFLAGS)
|
autoheader $(ACFLAGS)
|
||||||
test -d CVS && cvs commit -m'autoheader $(ACFLAGS)' $@
|
-test -d CVS && $(CVS) commit -m'autoheader $(ACFLAGS)' $@
|
||||||
|
|
||||||
ifdef customs
|
ifdef customs
|
||||||
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
||||||
@@ -154,7 +156,7 @@ $(globfiles): stamp-glob ;
|
|||||||
stamp-glob: $(libc-srcdir)/posix/glob.tar
|
stamp-glob: $(libc-srcdir)/posix/glob.tar
|
||||||
-rm -f stamp-glob glob/*
|
-rm -f stamp-glob glob/*
|
||||||
tar xvf $< glob
|
tar xvf $< glob
|
||||||
cvs commit -m'Updated from libc' glob
|
$(CVS) commit -m'Updated from libc' glob
|
||||||
touch $@
|
touch $@
|
||||||
$(libc-srcdir)/posix/glob.tar: force
|
$(libc-srcdir)/posix/glob.tar: force
|
||||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
$(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.'; \
|
echo '# Automatically generated dependencies.'; \
|
||||||
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
||||||
) > $@
|
) > $@
|
||||||
cvs commit -mRegenerated $@
|
$(CVS) commit -mRegenerated $@
|
||||||
|
|
||||||
.SUFFIXES: .dep
|
.SUFFIXES: .dep
|
||||||
# Maintain the automatically-generated dependencies.
|
# Maintain the automatically-generated dependencies.
|
||||||
@@ -202,7 +204,7 @@ build.sh.in: build.template compatMakefile
|
|||||||
$< > $@.new
|
$< > $@.new
|
||||||
chmod a+x $@.new
|
chmod a+x $@.new
|
||||||
mv -f $@.new $@
|
mv -f $@.new $@
|
||||||
cvs commit -mRegenerated $@
|
$(CVS) commit -mRegenerated $@
|
||||||
|
|
||||||
# Make the distribution tar files.
|
# Make the distribution tar files.
|
||||||
|
|
||||||
@@ -222,7 +224,8 @@ vmsfiles = config.h-vms makefile.com makefile.vms readme.vms \
|
|||||||
vmsdir.h vmsfunctions.c vmsify.c
|
vmsdir.h vmsfunctions.c vmsify.c
|
||||||
amigafiles = README.Amiga config.ami Makefile.ami SCOPTIONS SMakefile \
|
amigafiles = README.Amiga config.ami Makefile.ami SCOPTIONS SMakefile \
|
||||||
amiga.c amiga.h make.lnk
|
amiga.c amiga.h make.lnk
|
||||||
win32files = README.WIN32 build_w32.bat config.h.WIN32 subproc.bat NMakefile \
|
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 \
|
$(addprefix w32/,pathstuff.c compat/dirent.c include/dirent.h \
|
||||||
include/pathstuff.h include/sub_proc.h \
|
include/pathstuff.h include/sub_proc.h \
|
||||||
include/w32err.h subproc/NMakefile \
|
include/w32err.h subproc/NMakefile \
|
||||||
@@ -232,11 +235,11 @@ win32files = README.WIN32 build_w32.bat config.h.WIN32 subproc.bat NMakefile \
|
|||||||
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
||||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
||||||
configh.dos configure.bat \
|
configh.dos configure.bat \
|
||||||
$(amigafiles) $(vmsfiles) $(win32files) \
|
$(amigafiles) $(vmsfiles) $(w32files) $(dosfiles) \
|
||||||
aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \
|
aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \
|
||||||
make.texinfo make-stds.texi \
|
make.texinfo make-stds.texi \
|
||||||
make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \
|
$(wildcard make.?? make.??s make.toc make.aux) make.man texinfo.tex \
|
||||||
install-sh \
|
TAGS tags install-sh \
|
||||||
make.info make.info*
|
make.info make.info*
|
||||||
|
|
||||||
ifndef dist-flavor
|
ifndef dist-flavor
|
||||||
@@ -244,7 +247,7 @@ dist-flavor = alpha
|
|||||||
endif
|
endif
|
||||||
.PHONY: cvs-mark
|
.PHONY: cvs-mark
|
||||||
cvs-mark: $(distfiles)
|
cvs-mark: $(distfiles)
|
||||||
cvs tag -F make-$(subst .,-,$(version))
|
$(CVS) tag -F make-$(subst .,-,$(version))
|
||||||
|
|
||||||
dist: local-inst
|
dist: local-inst
|
||||||
.PHONY: local-inst
|
.PHONY: local-inst
|
||||||
@@ -268,7 +271,7 @@ $(alpha-dir)/%: %
|
|||||||
sed 's/VERSION/$(version)/' < $< > $@
|
sed 's/VERSION/$(version)/' < $< > $@
|
||||||
# Make sure I don't edit it by accident.
|
# Make sure I don't edit it by accident.
|
||||||
chmod a-w $@
|
chmod a-w $@
|
||||||
cvs commit -m'Regenerated for $(version)' $@
|
$(CVS) commit -m'Regenerated for $(version)' $@
|
||||||
|
|
||||||
define make-tar
|
define make-tar
|
||||||
@rm -fr make-$(version)
|
@rm -fr make-$(version)
|
||||||
|
|||||||
4
INSTALL
4
INSTALL
@@ -167,7 +167,9 @@ operates.
|
|||||||
`--quiet'
|
`--quiet'
|
||||||
`--silent'
|
`--silent'
|
||||||
`-q'
|
`-q'
|
||||||
Do not print messages saying which checks are being made.
|
Do not print messages saying which checks are being made. To
|
||||||
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
|
messages will still be shown).
|
||||||
|
|
||||||
`--srcdir=DIR'
|
`--srcdir=DIR'
|
||||||
Look for the package's source code in directory DIR. Usually
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
|||||||
61
Makefile.in
61
Makefile.in
@@ -107,11 +107,13 @@ TEXI2DVI = texi2dvi
|
|||||||
ETAGS = etags -w
|
ETAGS = etags -w
|
||||||
CTAGS = ctags -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 \
|
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 \
|
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 \
|
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||||
getopt.o getopt1.o glob/libglob.a \
|
getopt.o getopt1.o \
|
||||||
$(ALLOCA) $(extras)
|
$(GLOB) $(ALLOCA) $(extras)
|
||||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||||
@@ -158,7 +160,7 @@ make: $(objs)
|
|||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
glob/libglob.a: FORCE config.h
|
$(GLOB): FORCE config.h
|
||||||
cd glob; $(MAKE) libglob.a
|
cd glob; $(MAKE) libglob.a
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
@@ -206,7 +208,7 @@ $(infodir)/make.info: make.info
|
|||||||
# fail gracefully when there is an unknown command.
|
# fail gracefully when there is an unknown command.
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
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
|
else true; fi
|
||||||
|
|
||||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
$(mandir)/$(manprefix)make.$(manext): make.man
|
||||||
@@ -271,33 +273,36 @@ $(objs): config.h
|
|||||||
# Automatically generated dependencies will be put at the end of the file.
|
# Automatically generated dependencies will be put at the end of the file.
|
||||||
|
|
||||||
# Automatically generated dependencies.
|
# Automatically generated dependencies.
|
||||||
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
commands.o: commands.c make.h signame.h dep.h filedef.h variable.h \
|
||||||
commands.h
|
job.h commands.h
|
||||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
job.o: job.c make.h signame.h job.h filedef.h commands.h variable.h
|
||||||
dir.o: dir.c make.h
|
dir.o: dir.c make.h signame.h
|
||||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
file.o: file.c make.h signame.h dep.h filedef.h job.h commands.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.h
|
||||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
misc.o: misc.c make.h signame.h dep.h
|
||||||
|
main.o: main.c make.h signame.h dep.h filedef.h variable.h job.h \
|
||||||
|
commands.h getopt.h
|
||||||
|
read.o: read.c make.h signame.h dep.h filedef.h job.h commands.h \
|
||||||
|
variable.h glob/glob.h
|
||||||
|
remake.o: remake.c make.h signame.h filedef.h job.h commands.h dep.h
|
||||||
|
rule.o: rule.c make.h signame.h dep.h filedef.h job.h commands.h \
|
||||||
|
variable.h rule.h
|
||||||
|
implicit.o: implicit.c make.h signame.h rule.h dep.h filedef.h
|
||||||
|
default.o: default.c make.h signame.h rule.h dep.h filedef.h job.h \
|
||||||
|
commands.h variable.h
|
||||||
|
variable.o: variable.c make.h signame.h dep.h filedef.h job.h \
|
||||||
|
commands.h variable.h
|
||||||
|
expand.o: expand.c make.h signame.h filedef.h job.h commands.h \
|
||||||
variable.h
|
variable.h
|
||||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
function.o: function.c make.h signame.h filedef.h variable.h dep.h \
|
||||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
job.h commands.h
|
||||||
commands.h
|
vpath.o: vpath.c make.h signame.h filedef.h variable.h
|
||||||
vpath.o: vpath.c make.h filedef.h variable.h
|
|
||||||
version.o: version.c
|
version.o: version.c
|
||||||
ar.o: ar.c make.h filedef.h dep.h
|
ar.o: ar.c make.h signame.h filedef.h dep.h
|
||||||
arscan.o: arscan.c make.h
|
arscan.o: arscan.c make.h signame.h
|
||||||
signame.o: signame.c signame.h
|
signame.o: signame.c signame.h
|
||||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
remote-stub.o: remote-stub.c make.h signame.h filedef.h job.h \
|
||||||
getopt.o: getopt.c
|
commands.h
|
||||||
|
getopt.o: getopt.c getopt.h
|
||||||
getopt1.o: getopt1.c getopt.h
|
getopt1.o: getopt1.c getopt.h
|
||||||
getloadavg.o: getloadavg.c
|
getloadavg.o: getloadavg.c
|
||||||
|
|||||||
42
NEWS
42
NEWS
@@ -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.
|
See the end for copying conditions.
|
||||||
|
|
||||||
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
Please send GNU make bug reports to bug-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
|
Version 3.75
|
||||||
|
|
||||||
* The directory messages printed by `-w' and implicitly in sub-makes,
|
* 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>.
|
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.
|
* 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>.
|
<rob_tulloh@tivoli.com>.
|
||||||
|
|
||||||
Version 3.73
|
Version 3.73
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ OUTDIR=.
|
|||||||
MAKEFILE=NMakefile
|
MAKEFILE=NMakefile
|
||||||
SUBPROC_MAKEFILE=NMakefile
|
SUBPROC_MAKEFILE=NMakefile
|
||||||
|
|
||||||
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D 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_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
||||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||||
|
|
||||||
@@ -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:
|
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||||
subproc.bat $(SUBPROC_MAKEFILE)
|
subproc.bat $(SUBPROC_MAKEFILE)
|
||||||
|
|
||||||
config.h: config.h.WIN32
|
config.h: config.h.W32
|
||||||
copy $? $@
|
copy $? $@
|
||||||
|
|
||||||
Release:
|
Release:
|
||||||
|
|||||||
4
README
4
README
@@ -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.
|
All bugs reported for previous test releases have been fixed.
|
||||||
Some bugs surely remain.
|
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
|
GNU Make. If you get errors from your system's Make when building GNU
|
||||||
Make, try using `build.sh' instead.
|
Make, try using `build.sh' instead.
|
||||||
|
|
||||||
See README.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.
|
See README.Amiga for details about GNU Make on AmigaDOS.
|
||||||
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
||||||
WWW page http://www.delorie.com/djgpp/ for more information.
|
WWW page http://www.delorie.com/djgpp/ for more information.
|
||||||
|
|||||||
257
README.DOS.template
Normal file
257
README.DOS.template
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
|
||||||
|
|
||||||
|
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
|
||||||
|
|
||||||
|
|
||||||
|
New (since 3.74) DOS-specific features:
|
||||||
|
|
||||||
|
1. Supports long filenames when run from DOS box on Windows 95.
|
||||||
|
|
||||||
|
2. Supports both stock DOS COMMAND.COM and Unix-style shells
|
||||||
|
(details in ``Notes'' below).
|
||||||
|
|
||||||
|
3. Supports DOS drive letters in dependencies and pattern rules.
|
||||||
|
|
||||||
|
4. Better support for DOS-style backslashes in pathnames (but see
|
||||||
|
``Notes'' below).
|
||||||
|
|
||||||
|
5. The $(shell) built-in can run arbitrary complex commands,
|
||||||
|
including pipes and redirection, even when COMMAND.COM is your
|
||||||
|
shell.
|
||||||
|
|
||||||
|
6. Can be built without floating-point code (see below).
|
||||||
|
|
||||||
|
7. Supports signals in child programs and restores the original
|
||||||
|
directory if the child was interrupted.
|
||||||
|
|
||||||
|
8. Can be built without (a previous version of) Make.
|
||||||
|
|
||||||
|
|
||||||
|
To build:
|
||||||
|
|
||||||
|
1. Unzip the archive, preserving the directory structure (-d switch
|
||||||
|
if you use PKUNZIP). If you build Make on Windows 95, use an
|
||||||
|
unzip program that supports long filenames in zip files.
|
||||||
|
|
||||||
|
2. Invoke the `configure.bat' batch file.
|
||||||
|
|
||||||
|
If it doesn't find a working Make, it will suggest to use the
|
||||||
|
`dosbuild.bat' batch file to build Make. Either do as it
|
||||||
|
suggests or install another Make program (a pre-compiled binary
|
||||||
|
should be available from the usual DJGPP sites).
|
||||||
|
|
||||||
|
3. If you have Make, the configure script will need a Unix-style
|
||||||
|
Sed program. If you don't have that installed, you can find one
|
||||||
|
on one of the DJGPP mirror sites.
|
||||||
|
|
||||||
|
4. If you will need to run Make on machines without an FPU, you
|
||||||
|
might consider building a version of Make which doesn't issue
|
||||||
|
floating-point instructions (they don't help much on MSDOS
|
||||||
|
anyway). To this end, invoke the configure batch file like so:
|
||||||
|
|
||||||
|
configure no-float
|
||||||
|
|
||||||
|
5. Invoke Make.
|
||||||
|
|
||||||
|
6. If you have a Unix-style shell installed, you can use the
|
||||||
|
`install' target. You will also need GNU Fileutils and GNU
|
||||||
|
Sh-utils for this (they should be available from the DJGPP
|
||||||
|
sites).
|
||||||
|
|
||||||
|
7. The `clean' targets require Unix-style `rm' program.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
-----
|
||||||
|
|
||||||
|
1. The shell issue.
|
||||||
|
|
||||||
|
This is probably the most significant improvement in this port.
|
||||||
|
|
||||||
|
The original behavior of GNU Make is to invoke commands
|
||||||
|
directly, as long as they don't include characters special to
|
||||||
|
the shell or internal shell commands, because that is faster.
|
||||||
|
When shell features like redirection or filename wildcards are
|
||||||
|
involved, Make calls the shell.
|
||||||
|
|
||||||
|
This port supports both DOS shells (the stock COMMAND.COM and
|
||||||
|
its 4DOS/NDOS replacements), and Unix-style shells (tested with
|
||||||
|
the venerable Stewartson's `ms_sh' 2.3 and the recent DJGPP port
|
||||||
|
of `bash' by Daisuke Aoyama <jack@st.rim.or.jp>).
|
||||||
|
|
||||||
|
When the $SHELL variable points to a Unix-style shell, Make
|
||||||
|
works just like you'd expect on Unix, calling the shell for any
|
||||||
|
command that involves characters special to the shell or
|
||||||
|
internal shell commands. The only difference is that, since
|
||||||
|
there is no standard way to pass command lines longer than the
|
||||||
|
infamous DOS 126-character limit, this port of Make writes the
|
||||||
|
command line to a temporary disk file and then invokes the shell
|
||||||
|
on that file.
|
||||||
|
|
||||||
|
If $SHELL points to a DOS-style shell, however, Make will not
|
||||||
|
call it automatically, as it does with Unix shells. Stock
|
||||||
|
COMMAND.COM is too dumb and would unnecessarily limit the
|
||||||
|
functionality of Make. For example, you would not be able to
|
||||||
|
use long command lines in commands that use redirection or
|
||||||
|
pipes. Therefore, when presented with a DOS shell, this port of
|
||||||
|
Make will emulate most of the shell functionality, like
|
||||||
|
redirection and pipes, and shall only call the shell when a
|
||||||
|
batch file or a command internal to the shell is invoked. (Even
|
||||||
|
when a command is an internal shell command, Make will first
|
||||||
|
search the $PATH for it, so that if a Makefile calls `mkdir',
|
||||||
|
you can install, say, a port of GNU `mkdir' and have it called
|
||||||
|
in that case.)
|
||||||
|
|
||||||
|
The key to all this is the extended functionality of `spawn' and
|
||||||
|
`system' functions from the DJGPP library; this port just calls
|
||||||
|
`system' where it would invoke the shell on Unix. The most
|
||||||
|
important aspect of these functions is that they use a special
|
||||||
|
mechanism to pass long (up to 16KB) command lines to DJGPP
|
||||||
|
programs. In addition, `system' emulates some internal
|
||||||
|
commands, like `cd' (so that you can now use forward slashes
|
||||||
|
with it, and can also change the drive if the directory is on
|
||||||
|
another drive). Another aspect worth mentioning is that you can
|
||||||
|
call Unix shell scripts directly, provided that the shell whose
|
||||||
|
name is mentioned on the first line of the script is installed
|
||||||
|
anywhere along the $PATH. It is impossible to tell here
|
||||||
|
everything about these functions; refer to the DJGPP library
|
||||||
|
reference for more details.
|
||||||
|
|
||||||
|
The $(shell) built-in is implemented in this port by calling
|
||||||
|
`popen'. Since `popen' calls `system', the above considerations
|
||||||
|
are valid for $(shell) as well. In particular, you can put
|
||||||
|
arbitrary complex commands, including pipes and redirection,
|
||||||
|
inside $(shell), which is in many cases a valid substitute for
|
||||||
|
the Unix-style command substitution (`command`) feature.
|
||||||
|
|
||||||
|
|
||||||
|
2. "SHELL=/bin/sh" -- or is it?
|
||||||
|
|
||||||
|
Many Unix Makefiles include a line which sets the SHELL, for
|
||||||
|
those versions of Make which don't have this as the default.
|
||||||
|
Since many DOS systems don't have `sh' installed (in fact, most
|
||||||
|
of them don't even have a `/bin' directory), this port takes
|
||||||
|
such directives with a grain of salt. It will only honor such a
|
||||||
|
directive if the basename of the shell name (like `sh' in the
|
||||||
|
above example) can indeed be found in the directory that is
|
||||||
|
mentioned in the SHELL= line (`/bin' in the above example), or
|
||||||
|
in the current working directory, or anywhere on the $PATH (in
|
||||||
|
that order). If the basename doesn't include a filename
|
||||||
|
extension, Make will look for any known extension that indicates
|
||||||
|
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
|
||||||
|
and .pl). If any such file is found, then $SHELL will be
|
||||||
|
defined to the exact pathname of that file, and that shell will
|
||||||
|
hence be used for the rest of processing. But if the named
|
||||||
|
shell is *not* found, the line which sets it will be effectively
|
||||||
|
ignored, leaving the value of $SHELL as it was before. Since a
|
||||||
|
lot of decisions that this port makes depend on the gender of
|
||||||
|
the shell, I feel it doesn't make any sense to tailor Make's
|
||||||
|
behavior to a shell which is nowhere to be found.
|
||||||
|
|
||||||
|
Note that the above special handling of "SHELL=" only happens
|
||||||
|
for Makefiles; if you set $SHELL in the environment or on the
|
||||||
|
Make command line, you are expected to give the complete
|
||||||
|
pathname of the shell, including the filename extension.
|
||||||
|
|
||||||
|
The default value of $SHELL is computed as on Unix (see the Make
|
||||||
|
manual for details), except that if $SHELL is not defined in the
|
||||||
|
environment, $COMSPEC is used. Also, if an environment variable
|
||||||
|
named $MAKESHELL is defined, it takes precedence over both
|
||||||
|
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
|
||||||
|
environment *is* used to set the shell (since on MSDOS, it's
|
||||||
|
unlikely that the interactive shell will not be suitable for
|
||||||
|
Makefile processing).
|
||||||
|
|
||||||
|
The bottom line is that you can now write Makefiles where some
|
||||||
|
of the targets require a real (i.e. Unix-like) shell, which will
|
||||||
|
nevertheless work when such shell is not available (provided, of
|
||||||
|
course, that the commands which should always work, don't
|
||||||
|
require such a shell). More important, you can convert Unix
|
||||||
|
Makefiles to MSDOS and leave the line which sets the shell
|
||||||
|
intact, so that people who do have Unixy shell could use it for
|
||||||
|
targets which aren't converted to DOS (like `install' and
|
||||||
|
`uninstall', for example).
|
||||||
|
|
||||||
|
|
||||||
|
3. Default directories.
|
||||||
|
|
||||||
|
GNU Make knows about standard directories where it searches for
|
||||||
|
library and include files mentioned in the Makefile. Since
|
||||||
|
MSDOS machines don't have standard places for these, this port
|
||||||
|
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
|
||||||
|
$DJDIR is defined automatically by the DJGPP startup code as the
|
||||||
|
root of the DJGPP installation tree (unless you've tampered with
|
||||||
|
the DJGPP.ENV file). This should provide reasonable default
|
||||||
|
values, unless you moved parts of DJGPP to other directories.
|
||||||
|
|
||||||
|
|
||||||
|
4. Letter-case in filenames.
|
||||||
|
|
||||||
|
If you run Make on Windows 95, you should be aware of the
|
||||||
|
letter-case issue. Make is internally case-sensitive, but all
|
||||||
|
file operations are case-insensitive on Windows 95, so
|
||||||
|
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
|
||||||
|
far as Windows is concerned. The underlying DJGPP C library
|
||||||
|
functions honor the letter-case of the filenames they get from
|
||||||
|
the OS, except that by default, they down-case 8+3 DOS filenames
|
||||||
|
which are stored in upper case in the directory and would break
|
||||||
|
many Makefiles otherwise. (The details of which filenames are
|
||||||
|
converted to lower case are explained in the DJGPP libc docs,
|
||||||
|
under the `_preserve_fncase' and `_lfn_gen_short_fname'
|
||||||
|
functions, but as a thumb rule, any filename that is stored in
|
||||||
|
upper case in the directory, is a legal DOS 8+3 filename and
|
||||||
|
doesn't include characters illegal on MSDOS FAT filesystems,
|
||||||
|
will be automatically down-cased.) User reports that I have
|
||||||
|
indicate that this default behavior is generally what you'd
|
||||||
|
expect; however, since this is the first DJGPP port of Make that
|
||||||
|
supports long filenames, your input is most welcome.
|
||||||
|
|
||||||
|
In any case, if you hit a situation where you must force Make to
|
||||||
|
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
||||||
|
environment or in the Makefile.
|
||||||
|
|
||||||
|
|
||||||
|
5. DOS-style pathnames.
|
||||||
|
|
||||||
|
There are a lot of places throughout the program sources which
|
||||||
|
make implicit assumptions about the pathname syntax. In
|
||||||
|
particular, the directories are assumed to be separated by `/',
|
||||||
|
and any pathname which doesn't begin with a `/' is assumed to be
|
||||||
|
releative to the current directory. This port attempts to
|
||||||
|
support DOS-style pathnames which might include the drive letter
|
||||||
|
and use backslashes instead of forward slashes. However, this
|
||||||
|
support is not complete; I feel that pursuing this support too
|
||||||
|
far might break some more important features, particularly if
|
||||||
|
you use a Unix-style shell (where a backslash is a quote
|
||||||
|
character). I only consider support of backslashes desirable
|
||||||
|
because some Makefiles invoke non-DJGPP programs which don't
|
||||||
|
understand forward slashes. A notable example of such programs
|
||||||
|
is the standard programs which come with MSDOS. Otherwise, you
|
||||||
|
are advised to stay away from backslashes whenever possible. In
|
||||||
|
particular, filename globbing won't work on pathnames with
|
||||||
|
backslashes, because the GNU `glob' library doesn't support them
|
||||||
|
(backslash is special in filename wildcards, and I didn't want
|
||||||
|
to break that).
|
||||||
|
|
||||||
|
One feature which *does* work with backslashes is the filename-
|
||||||
|
related built-in functions such as $(dir), $(notdir), etc.
|
||||||
|
Drive letters in pathnames are also fully supported.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Bug reports:
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Bugs that are clearly related to the MSDOS/DJGPP port should be
|
||||||
|
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
||||||
|
post to Usenet groups, write to the DJGPP mailing list,
|
||||||
|
<djgpp@delorie.com>, which is an email gateway into the above news
|
||||||
|
group). For other bugs, please follow the the procedure explained
|
||||||
|
in the "Bugs" chapter of the Info docs. If you don't have an Info
|
||||||
|
reader, look up that chapter in the `make.i1' file with any text
|
||||||
|
browser/editor.
|
||||||
|
|
||||||
|
|
||||||
|
Enjoy,
|
||||||
|
Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
@@ -71,7 +71,7 @@ Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
|
|||||||
|
|
||||||
Pathnames and white space:
|
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
|
contain white space (e.g. C:\Program Files\). These sorts of pathnames
|
||||||
are legal under Unix too, but are never encouraged. There is
|
are legal under Unix too, but are never encouraged. There is
|
||||||
at least one place in make (VPATH/vpath handling) where paths
|
at least one place in make (VPATH/vpath handling) where paths
|
||||||
@@ -105,6 +105,13 @@ SAMBA/NTFS/VFAT:
|
|||||||
under VFAT. VFAT users may wish to be aware that this port
|
under VFAT. VFAT users may wish to be aware that this port
|
||||||
of make does respect case sensitivity.
|
of make does respect case sensitivity.
|
||||||
|
|
||||||
|
Version 3.76 contains some preliminary support for FAT.
|
||||||
|
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:
|
Bug reports:
|
||||||
|
|
||||||
Please submit bugs via the normal bug reporting mechanism
|
Please submit bugs via the normal bug reporting mechanism
|
||||||
|
|||||||
114
README.WIN32
114
README.WIN32
@@ -1,114 +0,0 @@
|
|||||||
Port of GNU make to Windows NT and Windows 95
|
|
||||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
|
||||||
|
|
||||||
To build with nmake on Windows NT or Windows 95:
|
|
||||||
|
|
||||||
1. Make sure cl.exe is in your %Path%. Example:
|
|
||||||
|
|
||||||
set Path=%Path%;c:/msdev/bin
|
|
||||||
|
|
||||||
2. Make sure %include% is set to msvc include directory. Example:
|
|
||||||
|
|
||||||
set include=c:/msdev/include
|
|
||||||
|
|
||||||
3. Make sure %lib% is set to msvc lib directory. Example:
|
|
||||||
|
|
||||||
set lib=c:/msdev/lib
|
|
||||||
|
|
||||||
4. nmake /f NMakefile
|
|
||||||
|
|
||||||
|
|
||||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
|
||||||
|
|
||||||
Outputs:
|
|
||||||
|
|
||||||
WinDebug/make.exe
|
|
||||||
WinRel/make.exe
|
|
||||||
|
|
||||||
|
|
||||||
-- Notes/Caveats --
|
|
||||||
|
|
||||||
GNU make and sh.exe:
|
|
||||||
|
|
||||||
This port prefers you have a working sh.exe somewhere on your
|
|
||||||
system. If you don't have sh.exe, port falls back to
|
|
||||||
MSDOS mode for launching programs (via a batch file).
|
|
||||||
The MSDOS mode style execution has not been tested too
|
|
||||||
carefully though (I use GNU bash as sh.exe).
|
|
||||||
|
|
||||||
There are very few true ports of Bourne shell for NT right now.
|
|
||||||
There is a version of GNU bash available from Cygnus gnu-win32
|
|
||||||
porting effort. Other possibilites are to get the MKS version
|
|
||||||
of sh.exe or to build your own with a package like
|
|
||||||
NutCracker (DataFocus) or Portage (Consensys).
|
|
||||||
|
|
||||||
Tivoli uses a homegrown port of GNU bash which is not (yet)
|
|
||||||
freely available. It may be available someday, but I am not in control
|
|
||||||
of this decision nor do I influence it. Sorry!
|
|
||||||
|
|
||||||
GNU make test suite:
|
|
||||||
|
|
||||||
I verified all functionality with a slightly modified version
|
|
||||||
of make-test-0.4.5 (modifications to get test suite to run
|
|
||||||
on Windows NT). All tests pass in an environment that includes
|
|
||||||
sh.exe. Tested on both Windows NT and Windows 95.
|
|
||||||
|
|
||||||
Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
|
|
||||||
|
|
||||||
I did not provide a Visual C project file with this port as
|
|
||||||
the project file would not be considered freely distributable
|
|
||||||
(or so I think). It is easy enough to create one though if
|
|
||||||
you know how to use Visual C.
|
|
||||||
|
|
||||||
I build the program statically to avoid problems locating DLL's
|
|
||||||
on machines that may not have MSVC runtime installed. If you
|
|
||||||
prefer, you can change make to build with shared libraries by
|
|
||||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
|
||||||
|
|
||||||
Program has not been built under non-Intel architectures (yet).
|
|
||||||
|
|
||||||
I have not tried to build with any other compilers than MSVC.
|
|
||||||
|
|
||||||
Pathnames and white space:
|
|
||||||
|
|
||||||
Unlike Unix, WIN32 systems encourage pathnames which
|
|
||||||
contain white space (e.g. C:\Program Files\). These sorts of pathnames
|
|
||||||
are legal under Unix too, but are never encouraged. There is
|
|
||||||
at least one place in make (VPATH/vpath handling) where paths
|
|
||||||
containing white space will simply not work. There may be others
|
|
||||||
too. I chose to not try and port make in such a way so that
|
|
||||||
these sorts of paths could be handled. I offer these suggestions
|
|
||||||
as workarounds:
|
|
||||||
|
|
||||||
1. Use 8.3 notation
|
|
||||||
2. Rename the directory so it does not contain white space.
|
|
||||||
|
|
||||||
If you are unhappy with this choice, this is free software
|
|
||||||
and you are free to take a crack at making this work. The code
|
|
||||||
in w32/pathstuff.c and vpath.c would be the places to start.
|
|
||||||
|
|
||||||
SAMBA/NTFS/VFAT:
|
|
||||||
|
|
||||||
I have not had any success building the debug version of this
|
|
||||||
package using SAMBA as my file server. The reason seems to be
|
|
||||||
related to the way VC++ 4.0 changes the case name of the pdb
|
|
||||||
filename it is passed on the command line. It seems to change
|
|
||||||
the name always to to lower case. I contend that
|
|
||||||
the VC++ compiler should not change the casename of files that
|
|
||||||
are passed as arguments on the command line. I don't think this
|
|
||||||
was a problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
|
||||||
|
|
||||||
The package builds fine on VFAT and NTFS filesystems.
|
|
||||||
|
|
||||||
Most all of the development I have done to date has been using
|
|
||||||
NTFS and long file names. I have not done any considerable work
|
|
||||||
under VFAT. VFAT users may wish to be aware that this port
|
|
||||||
of make does respect case sensitivity.
|
|
||||||
|
|
||||||
Bug reports:
|
|
||||||
|
|
||||||
Please submit bugs via the normal bug reporting mechanism
|
|
||||||
which is described in one of the texinfo files. If you don't
|
|
||||||
have texinfo for Windows NT or Windows 95, these files are simple
|
|
||||||
text files and can be read with a text editor.
|
|
||||||
|
|
||||||
@@ -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
|
GNU Make. If you get errors from your system's Make when building GNU
|
||||||
Make, try using `build.sh' instead.
|
Make, try using `build.sh' instead.
|
||||||
|
|
||||||
See README.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.
|
See README.Amiga for details about GNU Make on AmigaDOS.
|
||||||
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
||||||
WWW page http://www.delorie.com/djgpp/ for more information.
|
WWW page http://www.delorie.com/djgpp/ for more information.
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ includedir=${prefix}/include
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# These are all the objects we need to link together.
|
# 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.
|
# Compile the source files into those objects.
|
||||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||||
|
|||||||
133
build_w32.bat
133
build_w32.bat
@@ -1,136 +1,137 @@
|
|||||||
|
set make=gnumake
|
||||||
cd w32\subproc
|
cd w32\subproc
|
||||||
echo "Creating the subproc library"
|
echo "Creating the subproc library"
|
||||||
%ComSpec% /c build.bat
|
%ComSpec% /c build.bat
|
||||||
cd ..\..
|
cd ..\..
|
||||||
del link.dbg link.rel
|
del link.dbg link.rel
|
||||||
del config.h
|
del config.h
|
||||||
copy config.h.WIN32 config.h
|
copy config.h.W32 config.h
|
||||||
echo off
|
echo off
|
||||||
echo "Creating GNU make 3.74 for Windows NT"
|
echo "Creating GNU make for Windows 95/NT"
|
||||||
echo on
|
echo on
|
||||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D 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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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 WinDebug\pathstuff.obj >>link.dbg
|
||||||
echo off
|
echo off
|
||||||
echo "Linking WinDebug/make374.exe"
|
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/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
|
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
|
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
|
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
|
||||||
if not exist .\WinDebug/make374.exe echo "WinDebug build failed"
|
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
|
||||||
if exist .\WinDebug/make374.exe echo "WinDebug build succeeded!"
|
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
|
||||||
if not exist .\WinRel\nul mkdir .\WinRel
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
echo on
|
echo on
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D 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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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 WinRel\pathstuff.obj >>link.rel
|
||||||
echo off
|
echo off
|
||||||
echo "Linking WinRel/make374.exe"
|
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/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
|
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
|
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
|
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
|
||||||
if not exist .\WinRel/make374.exe echo "WinRel build failed"
|
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
|
||||||
if exist .\WinRel/make374.exe echo "WinRel build succeeded!"
|
if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
|
||||||
echo on
|
echo on
|
||||||
|
|||||||
21
commands.c
21
commands.c
@@ -369,17 +369,25 @@ RETSIGTYPE
|
|||||||
fatal_error_signal (sig)
|
fatal_error_signal (sig)
|
||||||
int 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);
|
remove_intermediates (1);
|
||||||
|
exit (1);
|
||||||
|
#else /* not __MSDOS__ */
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
|
remove_intermediates (1);
|
||||||
if (sig == SIGINT)
|
if (sig == SIGINT)
|
||||||
fputs ("*** Break.\n", stderr);
|
fputs ("*** Break.\n", stderr);
|
||||||
|
|
||||||
exit (10);
|
exit (10);
|
||||||
#else
|
#else /* not Amiga */
|
||||||
exit (1);
|
|
||||||
#endif
|
|
||||||
#else /* Not MSDOS. */
|
|
||||||
handling_fatal_signal = 1;
|
handling_fatal_signal = 1;
|
||||||
|
|
||||||
/* Set the handling for this signal to the default.
|
/* 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. */
|
will be unblocked when we return and arrive then to kill us. */
|
||||||
if (kill (getpid (), sig) < 0)
|
if (kill (getpid (), sig) < 0)
|
||||||
pfatal_with_name ("kill");
|
pfatal_with_name ("kill");
|
||||||
#endif /* MSDOS. */
|
#endif /* not Amiga */
|
||||||
|
#endif /* not __MSDOS__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Delete FILE unless it's precious or not actually a file (phony),
|
/* Delete FILE unless it's precious or not actually a file (phony),
|
||||||
|
|||||||
@@ -107,11 +107,13 @@ TEXI2DVI = texi2dvi
|
|||||||
ETAGS = etags -w
|
ETAGS = etags -w
|
||||||
CTAGS = ctags -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 \
|
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 \
|
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 \
|
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||||
getopt.o getopt1.o glob/libglob.a \
|
getopt.o getopt1.o \
|
||||||
$(ALLOCA) $(extras)
|
$(GLOB) $(ALLOCA) $(extras)
|
||||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||||
@@ -158,7 +160,7 @@ make: $(objs)
|
|||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
MAKE = make
|
MAKE = make
|
||||||
|
|
||||||
glob/libglob.a: FORCE config.h
|
$(GLOB): FORCE config.h
|
||||||
cd glob; $(MAKE) libglob.a
|
cd glob; $(MAKE) libglob.a
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
@@ -206,7 +208,7 @@ $(infodir)/make.info: make.info
|
|||||||
# fail gracefully when there is an unknown command.
|
# fail gracefully when there is an unknown command.
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
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
|
else true; fi
|
||||||
|
|
||||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
$(mandir)/$(manprefix)make.$(manext): make.man
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
#undef HAVE_ALLOCA_H
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
/* Define if you don't have vprintf but do have _doprnt. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
#undef HAVE_DOPRNT
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@
|
|||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
/* #undef HAVE_ALLOCA_H 1 */
|
/* #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. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
/* #undef HAVE_DOPRNT */
|
/* #undef HAVE_DOPRNT */
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,10 @@
|
|||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
#undef HAVE_ALLOCA_H
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* 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. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
#undef HAVE_DOPRNT
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
|||||||
289
config.h.WIN32
289
config.h.WIN32
@@ -1,289 +0,0 @@
|
|||||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define if on AIX 3.
|
|
||||||
System headers sometimes define this.
|
|
||||||
We just want to avoid a redefinition error message. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
#undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define if using alloca.c. */
|
|
||||||
#undef C_ALLOCA
|
|
||||||
|
|
||||||
/* Define to empty if the keyword does not work. */
|
|
||||||
#undef const
|
|
||||||
|
|
||||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
|
||||||
This function is required for alloca.c support on those systems. */
|
|
||||||
#undef CRAY_STACKSEG_END
|
|
||||||
|
|
||||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
|
||||||
#undef DGUX
|
|
||||||
|
|
||||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
|
||||||
#undef GETLOADAVG_PRIVILEGED
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef gid_t
|
|
||||||
#define gid_t int
|
|
||||||
|
|
||||||
/* Define if you have alloca, as a function or macro. */
|
|
||||||
#undef HAVE_ALLOCA
|
|
||||||
#define HAVE_ALLOCA
|
|
||||||
|
|
||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
|
||||||
#undef HAVE_ALLOCA_H
|
|
||||||
|
|
||||||
/* Define if you don't have vprintf but do have _doprnt. */
|
|
||||||
#undef HAVE_DOPRNT
|
|
||||||
|
|
||||||
/* Define if your system has its own `getloadavg' function. */
|
|
||||||
#undef HAVE_GETLOADAVG
|
|
||||||
|
|
||||||
/* Define if you have the getmntent function. */
|
|
||||||
#undef HAVE_GETMNTENT
|
|
||||||
|
|
||||||
/* Define if the `long double' type works. */
|
|
||||||
#undef HAVE_LONG_DOUBLE
|
|
||||||
|
|
||||||
/* Define if you support file names longer than 14 characters. */
|
|
||||||
#undef HAVE_LONG_FILE_NAMES
|
|
||||||
#define HAVE_LONG_FILE_NAMES
|
|
||||||
|
|
||||||
/* Define if you have a working `mmap' system call. */
|
|
||||||
#undef HAVE_MMAP
|
|
||||||
|
|
||||||
/* Define if system calls automatically restart after interruption
|
|
||||||
by a signal. */
|
|
||||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
|
||||||
|
|
||||||
/* Define if your struct stat has st_blksize. */
|
|
||||||
#undef HAVE_ST_BLKSIZE
|
|
||||||
|
|
||||||
/* Define if your struct stat has st_blocks. */
|
|
||||||
#undef HAVE_ST_BLOCKS
|
|
||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
|
||||||
#undef HAVE_STRCOLL
|
|
||||||
#define HAVE_STRCOLL
|
|
||||||
|
|
||||||
/* Define if your struct stat has st_rdev. */
|
|
||||||
#undef HAVE_ST_RDEV
|
|
||||||
#define HAVE_ST_RDEV
|
|
||||||
|
|
||||||
/* Define if you have the strftime function. */
|
|
||||||
#undef HAVE_STRFTIME
|
|
||||||
#define HAVE_STRFTIME
|
|
||||||
|
|
||||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
|
||||||
#undef HAVE_SYS_WAIT_H
|
|
||||||
|
|
||||||
/* Define if your struct tm has tm_zone. */
|
|
||||||
#undef HAVE_TM_ZONE
|
|
||||||
|
|
||||||
/* Define if you don't have tm_zone but do have the external array
|
|
||||||
tzname. */
|
|
||||||
#undef HAVE_TZNAME
|
|
||||||
#define HAVE_TZNAME
|
|
||||||
|
|
||||||
/* Define if you have <unistd.h>. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
|
||||||
#undef HAVE_UTIME_NULL
|
|
||||||
#define HAVE_UTIME_NULL
|
|
||||||
|
|
||||||
/* Define if you have <vfork.h>. */
|
|
||||||
#undef HAVE_VFORK_H
|
|
||||||
|
|
||||||
/* Define if you have the vprintf function. */
|
|
||||||
#undef HAVE_VPRINTF
|
|
||||||
#define HAVE_VPRINTF
|
|
||||||
|
|
||||||
/* Define if you have the wait3 system call. */
|
|
||||||
#undef HAVE_WAIT3
|
|
||||||
|
|
||||||
/* Define if on MINIX. */
|
|
||||||
#undef _MINIX
|
|
||||||
|
|
||||||
/* Define if your struct nlist has an n_un member. */
|
|
||||||
#undef NLIST_NAME_UNION
|
|
||||||
|
|
||||||
/* Define if you have <nlist.h>. */
|
|
||||||
#undef NLIST_STRUCT
|
|
||||||
|
|
||||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
|
||||||
#undef NO_MINUS_C_MINUS_O
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef pid_t
|
|
||||||
#define pid_t int
|
|
||||||
|
|
||||||
/* Define if the system does not provide POSIX.1 features except
|
|
||||||
with this defined. */
|
|
||||||
#undef _POSIX_1_SOURCE
|
|
||||||
|
|
||||||
/* Define if you need to in order for stat and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
#define _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#undef RETSIGTYPE
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* Define if the setvbuf function takes the buffering type as its second
|
|
||||||
argument and the buffer pointer as the third, as on System V
|
|
||||||
before release 3. */
|
|
||||||
#undef SETVBUF_REVERSED
|
|
||||||
|
|
||||||
/* If using the C implementation of alloca, define if you know the
|
|
||||||
direction of stack growth for your system; otherwise it will be
|
|
||||||
automatically deduced at run-time.
|
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown
|
|
||||||
*/
|
|
||||||
#undef STACK_DIRECTION
|
|
||||||
|
|
||||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
|
||||||
#undef STAT_MACROS_BROKEN
|
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
#define STDC_HEADERS
|
|
||||||
|
|
||||||
/* Define on System V Release 4. */
|
|
||||||
#undef SVR4
|
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
|
||||||
#undef SYS_SIGLIST_DECLARED
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
|
||||||
#undef uid_t
|
|
||||||
#define uid_t int
|
|
||||||
|
|
||||||
/* Define for Encore UMAX. */
|
|
||||||
#undef UMAX
|
|
||||||
|
|
||||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
|
||||||
instead of <sys/cpustats.h>. */
|
|
||||||
#undef UMAX4_3
|
|
||||||
|
|
||||||
/* Define vfork as fork if vfork does not work. */
|
|
||||||
#undef vfork
|
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
|
||||||
#undef SCCS_GET
|
|
||||||
#define SCCS_GET "echo no sccs get"
|
|
||||||
|
|
||||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
|
||||||
#undef SCCS_GET_MINUS_G
|
|
||||||
|
|
||||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
|
||||||
#undef HAVE_SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
|
||||||
#undef HAVE__SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
|
||||||
#undef HAVE_UNION_WAIT
|
|
||||||
|
|
||||||
/* Define if you have the dup2 function. */
|
|
||||||
#undef HAVE_DUP2
|
|
||||||
#define HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have the getcwd function. */
|
|
||||||
#undef HAVE_GETCWD
|
|
||||||
#define HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have the getgroups function. */
|
|
||||||
#undef HAVE_GETGROUPS
|
|
||||||
|
|
||||||
/* Define if you have the mktemp function. */
|
|
||||||
#undef HAVE_MKTEMP
|
|
||||||
#define HAVE_MKTEMP
|
|
||||||
|
|
||||||
/* Define if you have the psignal function. */
|
|
||||||
#undef HAVE_PSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have the setegid function. */
|
|
||||||
#undef HAVE_SETEGID
|
|
||||||
|
|
||||||
/* Define if you have the seteuid function. */
|
|
||||||
#undef HAVE_SETEUID
|
|
||||||
|
|
||||||
/* Define if you have the setlinebuf function. */
|
|
||||||
#undef HAVE_SETLINEBUF
|
|
||||||
|
|
||||||
/* Define if you have the setregid function. */
|
|
||||||
#undef HAVE_SETREGID
|
|
||||||
|
|
||||||
/* Define if you have the setreuid function. */
|
|
||||||
#undef HAVE_SETREUID
|
|
||||||
|
|
||||||
/* Define if you have the sigsetmask function. */
|
|
||||||
#undef HAVE_SIGSETMASK
|
|
||||||
|
|
||||||
/* Define if you have the strerror function. */
|
|
||||||
#undef HAVE_STRERROR
|
|
||||||
#define HAVE_STRERROR
|
|
||||||
|
|
||||||
/* Define if you have the strsignal function. */
|
|
||||||
#undef HAVE_STRSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have the wait3 function. */
|
|
||||||
#undef HAVE_WAIT3
|
|
||||||
|
|
||||||
/* Define if you have the waitpid function. */
|
|
||||||
#undef HAVE_WAITPID
|
|
||||||
|
|
||||||
/* Define if you have the <dirent.h> header file. */
|
|
||||||
#undef HAVE_DIRENT_H
|
|
||||||
#define HAVE_DIRENT_H
|
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
|
||||||
#undef HAVE_FCNTL_H
|
|
||||||
#define HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#undef HAVE_LIMITS_H
|
|
||||||
#define HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define if you have the <mach/mach.h> header file. */
|
|
||||||
#undef HAVE_MACH_MACH_H
|
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
#define HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define if you have the <ndir.h> header file. */
|
|
||||||
#undef HAVE_NDIR_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
#define HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/dir.h> header file. */
|
|
||||||
#undef HAVE_SYS_DIR_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/ndir.h> header file. */
|
|
||||||
#undef HAVE_SYS_NDIR_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
|
||||||
#undef HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/timeb.h> header file. */
|
|
||||||
#undef HAVE_SYS_TIMEB_H
|
|
||||||
#define HAVE_SYS_TIMEB_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/wait.h> header file. */
|
|
||||||
#undef HAVE_SYS_WAIT_H
|
|
||||||
|
|
||||||
/* Define if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define if you have the dgc library (-ldgc). */
|
|
||||||
#undef HAVE_LIBDGC
|
|
||||||
|
|
||||||
/* Define if you have the sun library (-lsun). */
|
|
||||||
#undef HAVE_LIBSUN
|
|
||||||
12
config.h.in
12
config.h.in
@@ -35,6 +35,9 @@
|
|||||||
/* Define if you don't have vprintf but do have _doprnt. */
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
#undef HAVE_DOPRNT
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if your system has a working fnmatch function. */
|
||||||
|
#undef HAVE_FNMATCH
|
||||||
|
|
||||||
/* Define if your system has its own `getloadavg' function. */
|
/* Define if your system has its own `getloadavg' function. */
|
||||||
#undef HAVE_GETLOADAVG
|
#undef HAVE_GETLOADAVG
|
||||||
|
|
||||||
@@ -182,6 +185,12 @@
|
|||||||
/* Define if you have the getgroups function. */
|
/* Define if you have the getgroups function. */
|
||||||
#undef HAVE_GETGROUPS
|
#undef HAVE_GETGROUPS
|
||||||
|
|
||||||
|
/* Define if you have the getloadavg function. */
|
||||||
|
#undef HAVE_GETLOADAVG
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#undef HAVE_MEMMOVE
|
||||||
|
|
||||||
/* Define if you have the mktemp function. */
|
/* Define if you have the mktemp function. */
|
||||||
#undef HAVE_MKTEMP
|
#undef HAVE_MKTEMP
|
||||||
|
|
||||||
@@ -260,5 +269,8 @@
|
|||||||
/* Define if you have the dgc library (-ldgc). */
|
/* Define if you have the dgc library (-ldgc). */
|
||||||
#undef HAVE_LIBDGC
|
#undef HAVE_LIBDGC
|
||||||
|
|
||||||
|
/* Define if you have the kstat library (-lkstat). */
|
||||||
|
#undef HAVE_LIBKSTAT
|
||||||
|
|
||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
#undef HAVE_LIBSUN
|
#undef HAVE_LIBSUN
|
||||||
|
|||||||
@@ -21,13 +21,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
#define SYS_SIGLIST_DECLARED
|
#undef SYS_SIGLIST_DECLARED
|
||||||
|
|
||||||
/* Define if you have getdtablesize. */
|
|
||||||
#define HAVE_GETDTABLESIZE
|
|
||||||
|
|
||||||
/* Define if you have dup2. */
|
|
||||||
#define HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have sys_siglist. */
|
/* Define if you have sys_siglist. */
|
||||||
#undef HAVE_SYS_SIGLIST
|
#undef HAVE_SYS_SIGLIST
|
||||||
@@ -38,6 +32,18 @@
|
|||||||
/* Define if you have psignal. */
|
/* Define if you have psignal. */
|
||||||
#define 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 if you have getcwd. */
|
||||||
#define HAVE_GETCWD
|
#define HAVE_GETCWD
|
||||||
|
|
||||||
@@ -62,7 +68,13 @@
|
|||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H
|
#define HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE
|
||||||
|
|
||||||
/* Define if you have the `strerror' function. */
|
/* Define if you have the `strerror' function. */
|
||||||
#define HAVE_STRERROR
|
#define HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
|
#define HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|||||||
@@ -1,10 +1,25 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Configuring MAKE for go32
|
echo Configuring MAKE for DJGPP
|
||||||
rem This batch file assumes a unix-type "sed" program
|
rem This batch file assumes a unix-type "sed" program
|
||||||
|
|
||||||
update configh.dos config.h
|
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
|
if exist config.sed del config.sed
|
||||||
|
|
||||||
@@ -16,9 +31,19 @@ echo " b try_sl ">> config.sed
|
|||||||
echo "} ">> config.sed
|
echo "} ">> config.sed
|
||||||
|
|
||||||
echo "s/@srcdir@/./ ">> 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/@CC@/gcc/ ">> config.sed
|
||||||
echo "s/@CFLAGS@/-O2 -g/ ">> 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
|
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/@LDFLAGS@// ">> config.sed
|
||||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
||||||
echo "s/@DEFS@// ">> config.sed
|
echo "s/@DEFS@// ">> config.sed
|
||||||
@@ -27,6 +52,10 @@ echo "s/@ALLOCA@// ">> config.sed
|
|||||||
echo "s/@LIBS@// ">> config.sed
|
echo "s/@LIBS@// ">> config.sed
|
||||||
echo "s/@LIBOBJS@// ">> config.sed
|
echo "s/@LIBOBJS@// ">> config.sed
|
||||||
echo "s/@SET_MAKE@// ">> 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/^Makefile *:/_Makefile:/ ">> config.sed
|
||||||
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
||||||
echo "s/^defines *=.*$/defines =/ ">> 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
|
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
|
||||||
|
|
||||||
|
echo "/^tagsrcs *=/s/\$(srcs)/$(srcs:.h.in=.h)/ ">> config.sed
|
||||||
|
|
||||||
|
echo "s/\*.o/*.o *.exe make.new/ ">> config.sed
|
||||||
|
echo "s/\.info\*/.i*/g ">> config.sed
|
||||||
|
|
||||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
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
|
sed -f config2.sed Makefile.in >> Makefile
|
||||||
del config.sed
|
del config.sed
|
||||||
del config2.sed
|
del config2.sed
|
||||||
@@ -42,3 +80,4 @@ del config2.sed
|
|||||||
cd glob
|
cd glob
|
||||||
call configure
|
call configure
|
||||||
cd ..
|
cd ..
|
||||||
|
:End
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ changequote([,])dnl
|
|||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||||
|
|
||||||
AC_CHECK_FUNCS(psignal mktemp \
|
AC_CHECK_FUNCS(memmove psignal mktemp \
|
||||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||||
seteuid setegid setreuid setregid strerror strsignal)
|
seteuid setegid setreuid setregid strerror strsignal)
|
||||||
AC_CHECK_SYMBOL(sys_siglist)
|
AC_CHECK_SYMBOL(sys_siglist)
|
||||||
@@ -46,6 +46,7 @@ AC_FUNC_ALLOCA
|
|||||||
AC_FUNC_VFORK
|
AC_FUNC_VFORK
|
||||||
AC_FUNC_SETVBUF_REVERSED
|
AC_FUNC_SETVBUF_REVERSED
|
||||||
AC_FUNC_GETLOADAVG
|
AC_FUNC_GETLOADAVG
|
||||||
|
AC_CHECK_LIB(kstat, kstat_open)
|
||||||
AC_FUNC_STRCOLL
|
AC_FUNC_STRCOLL
|
||||||
|
|
||||||
# Check out the wait reality.
|
# Check out the wait reality.
|
||||||
|
|||||||
171
dir.c
171
dir.c
@@ -44,7 +44,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#define NAMLEN(d) _D_NAMLEN(d)
|
#define NAMLEN(d) _D_NAMLEN(d)
|
||||||
#endif
|
#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
|
/* Posix does not require that the d_ino field be present, and some
|
||||||
systems do not provide it. */
|
systems do not provide it. */
|
||||||
#define REAL_DIR_ENTRY(dp) 1
|
#define REAL_DIR_ENTRY(dp) 1
|
||||||
@@ -56,9 +56,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#if (DJGPP > 1)
|
#include <fcntl.h>
|
||||||
#include <libc/dosio.h>
|
|
||||||
int __opendir_flags = 0;
|
/* If it's MSDOS that doesn't have _USE_LFN, disable LFN support. */
|
||||||
|
#ifndef _USE_LFN
|
||||||
|
#define _USE_LFN 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@@ -69,14 +71,11 @@ dosify (filename)
|
|||||||
char *df;
|
char *df;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#if (DJGPP > 1)
|
if (filename == 0 || _USE_LFN)
|
||||||
if (_USE_LFN)
|
|
||||||
/* Using long file names; do no transformation. */
|
|
||||||
return filename;
|
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)
|
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
||||||
return filename;
|
return filename;
|
||||||
|
|
||||||
@@ -106,7 +105,7 @@ dosify (filename)
|
|||||||
}
|
}
|
||||||
#endif /* __MSDOS__ */
|
#endif /* __MSDOS__ */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -206,9 +205,9 @@ struct directory_contents
|
|||||||
struct directory_contents *next;
|
struct directory_contents *next;
|
||||||
|
|
||||||
dev_t dev; /* Device and inode numbers of this dir. */
|
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
|
* unreliable because it is random per file open and undefined
|
||||||
* for remote filesystems. The most unique attribute I can
|
* for remote filesystems. The most unique attribute I can
|
||||||
* come up with is the fully qualified name of the directory. Beware
|
* come up with is the fully qualified name of the directory. Beware
|
||||||
@@ -217,13 +216,17 @@ struct directory_contents
|
|||||||
*/
|
*/
|
||||||
char *path_key;
|
char *path_key;
|
||||||
int mtime; /* controls check for stale directory cache */
|
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
|
#else
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
ino_t ino[3];
|
ino_t ino[3];
|
||||||
#else
|
#else
|
||||||
ino_t ino;
|
ino_t ino;
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
struct dirfile **files; /* Files in this directory. */
|
struct dirfile **files; /* Files in this directory. */
|
||||||
DIR *dirstream; /* Stream reading this directory. */
|
DIR *dirstream; /* Stream reading this directory. */
|
||||||
};
|
};
|
||||||
@@ -279,8 +282,13 @@ find_directory (name)
|
|||||||
register unsigned int hash = 0;
|
register unsigned int hash = 0;
|
||||||
register char *p;
|
register char *p;
|
||||||
register struct directory *dir;
|
register struct directory *dir;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
char* w32_path;
|
char* w32_path;
|
||||||
|
char fs_label[BUFSIZ];
|
||||||
|
char fs_type[BUFSIZ];
|
||||||
|
long fs_serno;
|
||||||
|
long fs_flags;
|
||||||
|
long fs_len;
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
if ((*name == '.') && (*(name+1) == 0))
|
if ((*name == '.') && (*(name+1) == 0))
|
||||||
@@ -327,7 +335,7 @@ find_directory (name)
|
|||||||
|
|
||||||
struct directory_contents *dc;
|
struct directory_contents *dc;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
w32_path = w32ify(name, 1);
|
w32_path = w32ify(name, 1);
|
||||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
||||||
#else
|
#else
|
||||||
@@ -343,7 +351,7 @@ find_directory (name)
|
|||||||
hash %= DIRECTORY_BUCKETS;
|
hash %= DIRECTORY_BUCKETS;
|
||||||
|
|
||||||
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (!strcmp(dc->path_key, w32_path))
|
if (!strcmp(dc->path_key, w32_path))
|
||||||
#else
|
#else
|
||||||
if (dc->dev == st.st_dev
|
if (dc->dev == st.st_dev
|
||||||
@@ -354,7 +362,7 @@ find_directory (name)
|
|||||||
#else
|
#else
|
||||||
&& dc->ino == st.st_ino)
|
&& dc->ino == st.st_ino)
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (dc == 0)
|
if (dc == 0)
|
||||||
@@ -366,9 +374,27 @@ find_directory (name)
|
|||||||
|
|
||||||
/* Enter it in the contents hash table. */
|
/* Enter it in the contents hash table. */
|
||||||
dc->dev = st.st_dev;
|
dc->dev = st.st_dev;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
dc->path_key = strdup(w32_path);
|
dc->path_key = strdup(w32_path);
|
||||||
dc->mtime = st.st_mtime;
|
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
|
#else
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
dc->ino[0] = st.st_ino[0];
|
dc->ino[0] = st.st_ino[0];
|
||||||
@@ -377,17 +403,10 @@ find_directory (name)
|
|||||||
#else
|
#else
|
||||||
dc->ino = st.st_ino;
|
dc->ino = st.st_ino;
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
dc->next = directories_contents[hash];
|
dc->next = directories_contents[hash];
|
||||||
directories_contents[hash] = dc;
|
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);
|
dc->dirstream = opendir (name);
|
||||||
if (dc->dirstream == 0)
|
if (dc->dirstream == 0)
|
||||||
{
|
{
|
||||||
@@ -432,7 +451,7 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
register char *p;
|
register char *p;
|
||||||
register struct dirfile *df;
|
register struct dirfile *df;
|
||||||
register struct dirent *d;
|
register struct dirent *d;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int rehash = 0;
|
int rehash = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -483,11 +502,16 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
|
|
||||||
if (dir->dirstream == 0)
|
if (dir->dirstream == 0)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/* Check to see if directory has changed since last read */
|
/*
|
||||||
|
* 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 &&
|
if (dir->path_key &&
|
||||||
stat(dir->path_key, &st) == 0 &&
|
(dir->fs_flags & FS_FAT ||
|
||||||
st.st_mtime > dir->mtime) {
|
(stat(dir->path_key, &st) == 0 &&
|
||||||
|
st.st_mtime > dir->mtime))) {
|
||||||
|
|
||||||
/* reset date stamp to show most recent re-process */
|
/* reset date stamp to show most recent re-process */
|
||||||
dir->mtime = st.st_mtime;
|
dir->mtime = st.st_mtime;
|
||||||
@@ -519,7 +543,7 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < len; ++i)
|
||||||
HASHI (newhash, d->d_name[i]);
|
HASHI (newhash, d->d_name[i]);
|
||||||
newhash %= DIRFILE_BUCKETS;
|
newhash %= DIRFILE_BUCKETS;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* If re-reading a directory, check that this file isn't already
|
* If re-reading a directory, check that this file isn't already
|
||||||
* in the cache.
|
* in the cache.
|
||||||
@@ -543,7 +567,7 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
dir->files[newhash] = df;
|
dir->files[newhash] = df;
|
||||||
df->name = savestring (d->d_name, len);
|
df->name = savestring (d->d_name, len);
|
||||||
df->impossible = 0;
|
df->impossible = 0;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Check if the name matches the one we're searching for. */
|
/* 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);
|
return dir_file_exists_p ("[]", name);
|
||||||
#else /* !VMS */
|
#else /* !VMS */
|
||||||
dirend = rindex (name, '/');
|
dirend = rindex (name, '/');
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
if (!dirend)
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
dirend = rindex(name, '\\');
|
{
|
||||||
#endif /* WIN32 */
|
char *bslash = rindex(name, '\\');
|
||||||
if (dirend == 0)
|
if (!dirend || bslash > dirend)
|
||||||
return dir_file_exists_p (".", name);
|
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)
|
if (dirend == 0)
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
return dir_file_exists_p (".", name);
|
return dir_file_exists_p (".", name);
|
||||||
@@ -613,9 +641,14 @@ file_exists_p (name)
|
|||||||
#endif /* AMIGA */
|
#endif /* AMIGA */
|
||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
|
|
||||||
|
if (dirend == name)
|
||||||
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
dirname = (char *) alloca (dirend - name + 1);
|
dirname = (char *) alloca (dirend - name + 1);
|
||||||
bcopy (name, dirname, dirend - name);
|
bcopy (name, dirname, dirend - name);
|
||||||
dirname[dirend - name] = '\0';
|
dirname[dirend - name] = '\0';
|
||||||
|
}
|
||||||
return dir_file_exists_p (dirname, dirend + 1);
|
return dir_file_exists_p (dirname, dirend + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -640,6 +673,16 @@ file_impossible (filename)
|
|||||||
dir = find_directory ("[]");
|
dir = find_directory ("[]");
|
||||||
#else
|
#else
|
||||||
dirend = rindex (p, '/');
|
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)
|
if (dirend == 0)
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
dir = find_directory ("");
|
dir = find_directory ("");
|
||||||
@@ -649,9 +692,15 @@ file_impossible (filename)
|
|||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname = (char *) alloca (dirend - p + 1);
|
char *dirname;
|
||||||
|
if (dirend == p)
|
||||||
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dirname = (char *) alloca (dirend - p + 1);
|
||||||
bcopy (p, dirname, dirend - p);
|
bcopy (p, dirname, dirend - p);
|
||||||
dirname[dirend - p] = '\0';
|
dirname[dirend - p] = '\0';
|
||||||
|
}
|
||||||
dir = find_directory (dirname);
|
dir = find_directory (dirname);
|
||||||
filename = p = dirend + 1;
|
filename = p = dirend + 1;
|
||||||
}
|
}
|
||||||
@@ -666,10 +715,10 @@ file_impossible (filename)
|
|||||||
structure for it, but leave it out of the contents hash table. */
|
structure for it, but leave it out of the contents hash table. */
|
||||||
dir->contents = (struct directory_contents *)
|
dir->contents = (struct directory_contents *)
|
||||||
xmalloc (sizeof (struct directory_contents));
|
xmalloc (sizeof (struct directory_contents));
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
dir->contents->path_key = NULL;
|
dir->contents->path_key = NULL;
|
||||||
dir->contents->mtime = 0;
|
dir->contents->mtime = 0;
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
dir->contents->dev = 0;
|
dir->contents->dev = 0;
|
||||||
dir->contents->ino[0] = dir->contents->ino[1] =
|
dir->contents->ino[0] = dir->contents->ino[1] =
|
||||||
@@ -677,7 +726,7 @@ file_impossible (filename)
|
|||||||
#else
|
#else
|
||||||
dir->contents->dev = dir->contents->ino = 0;
|
dir->contents->dev = dir->contents->ino = 0;
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
dir->contents->files = 0;
|
dir->contents->files = 0;
|
||||||
dir->contents->dirstream = 0;
|
dir->contents->dirstream = 0;
|
||||||
}
|
}
|
||||||
@@ -718,10 +767,16 @@ file_impossible_p (filename)
|
|||||||
dir = find_directory ("[]")->contents;
|
dir = find_directory ("[]")->contents;
|
||||||
#else
|
#else
|
||||||
dirend = rindex (filename, '/');
|
dirend = rindex (filename, '/');
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
if (!dirend)
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
dirend = rindex (filename, '\\');
|
{
|
||||||
#endif /* WIN32 */
|
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)
|
if (dirend == 0)
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
dir = find_directory ("")->contents;
|
dir = find_directory ("")->contents;
|
||||||
@@ -731,9 +786,15 @@ file_impossible_p (filename)
|
|||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname = (char *) alloca (dirend - filename + 1);
|
char *dirname;
|
||||||
|
if (dirend == filename)
|
||||||
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dirname = (char *) alloca (dirend - filename + 1);
|
||||||
bcopy (p, dirname, dirend - p);
|
bcopy (p, dirname, dirend - p);
|
||||||
dirname[dirend - p] = '\0';
|
dirname[dirend - p] = '\0';
|
||||||
|
}
|
||||||
dir = find_directory (dirname)->contents;
|
dir = find_directory (dirname)->contents;
|
||||||
p = filename = dirend + 1;
|
p = filename = dirend + 1;
|
||||||
}
|
}
|
||||||
@@ -791,10 +852,10 @@ print_dir_data_base ()
|
|||||||
if (dir->contents == 0)
|
if (dir->contents == 0)
|
||||||
printf ("# %s: could not be stat'd.\n", dir->name);
|
printf ("# %s: could not be stat'd.\n", dir->name);
|
||||||
else if (dir->contents->files == 0)
|
else if (dir->contents->files == 0)
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
printf ("# %s (key %s, mtime %d): could not be opened.\n",
|
printf ("# %s (key %s, mtime %d): could not be opened.\n",
|
||||||
dir->name, dir->contents->path_key,dir->contents->mtime);
|
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
|
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
|
||||||
dir->name, dir->contents->dev,
|
dir->name, dir->contents->dev,
|
||||||
@@ -805,7 +866,7 @@ print_dir_data_base ()
|
|||||||
dir->name, (long int) dir->contents->dev,
|
dir->name, (long int) dir->contents->dev,
|
||||||
(long int) dir->contents->ino);
|
(long int) dir->contents->ino);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
register unsigned int f = 0, im = 0;
|
register unsigned int f = 0, im = 0;
|
||||||
@@ -817,10 +878,10 @@ print_dir_data_base ()
|
|||||||
++im;
|
++im;
|
||||||
else
|
else
|
||||||
++f;
|
++f;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
printf ("# %s (key %s, mtime %d): ",
|
printf ("# %s (key %s, mtime %d): ",
|
||||||
dir->name, dir->contents->path_key, dir->contents->mtime);
|
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
printf ("# %s (device %d, inode [%d,%d,%d]): ",
|
printf ("# %s (device %d, inode [%d,%d,%d]): ",
|
||||||
dir->name, dir->contents->dev,
|
dir->name, dir->contents->dev,
|
||||||
@@ -830,7 +891,7 @@ print_dir_data_base ()
|
|||||||
printf ("# %s (device %d, inode %d): ",
|
printf ("# %s (device %d, inode %d): ",
|
||||||
dir->name, dir->contents->dev, dir->contents->ino);
|
dir->name, dir->contents->dev, dir->contents->ino);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
fputs ("No", stdout);
|
fputs ("No", stdout);
|
||||||
else
|
else
|
||||||
|
|||||||
42
dosbuild.bat
Normal file
42
dosbuild.bat
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
@echo Building Make for MSDOS
|
||||||
|
@rem Echo ON so they will see what is going on.
|
||||||
|
@echo on
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g read.c -o read.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remake.c -o remake.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o
|
||||||
|
@cd glob
|
||||||
|
@if exist libglob.a del libglob.a
|
||||||
|
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
|
||||||
|
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o
|
||||||
|
ar rv libglob.a glob.o fnmatch.o
|
||||||
|
@echo off
|
||||||
|
cd ..
|
||||||
|
echo commands.o > respf.$$$
|
||||||
|
for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
|
||||||
|
for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
|
||||||
|
echo glob/libglob.a >> respf.$$$
|
||||||
|
@echo Linking...
|
||||||
|
@echo on
|
||||||
|
gcc -o make.new @respf.$$$
|
||||||
|
@if exist make.exe echo Make.exe is now built!
|
||||||
|
@if not exist make.exe echo Make.exe build failed...
|
||||||
|
@if exist make.exe del respf.$$$
|
||||||
24
file.c
24
file.c
@@ -87,7 +87,7 @@ lookup_file (name)
|
|||||||
|
|
||||||
for (f = files[hashval]; f != 0; f = f->next)
|
for (f = files[hashval]; f != 0; f = f->next)
|
||||||
{
|
{
|
||||||
if (strieq (f->name, name))
|
if (strieq (f->hname, name))
|
||||||
{
|
{
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ enter_file (name)
|
|||||||
hashval %= FILE_BUCKETS;
|
hashval %= FILE_BUCKETS;
|
||||||
|
|
||||||
for (f = files[hashval]; f != 0; f = f->next)
|
for (f = files[hashval]; f != 0; f = f->next)
|
||||||
if (strieq (f->name, name))
|
if (strieq (f->hname, name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (f != 0 && !f->double_colon)
|
if (f != 0 && !f->double_colon)
|
||||||
@@ -141,7 +141,7 @@ enter_file (name)
|
|||||||
|
|
||||||
new = (struct file *) xmalloc (sizeof (struct file));
|
new = (struct file *) xmalloc (sizeof (struct file));
|
||||||
bzero ((char *) new, sizeof (struct file));
|
bzero ((char *) new, sizeof (struct file));
|
||||||
new->name = name;
|
new->name = new->hname = name;
|
||||||
new->update_status = -1;
|
new->update_status = -1;
|
||||||
|
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
@@ -162,16 +162,16 @@ enter_file (name)
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rename FILE to NAME. This is not as simple as resetting
|
/* Rehash FILE to NAME. This is not as simple as resetting
|
||||||
the `name' member, since it must be put in a new hash bucket,
|
the `hname' member, since it must be put in a new hash bucket,
|
||||||
and possibly merged with an existing file called NAME. */
|
and possibly merged with an existing file called NAME. */
|
||||||
|
|
||||||
void
|
void
|
||||||
rename_file (file, name)
|
rehash_file (file, name)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
char *oldname = file->name;
|
char *oldname = file->hname;
|
||||||
register unsigned int oldhash;
|
register unsigned int oldhash;
|
||||||
register char *n;
|
register char *n;
|
||||||
|
|
||||||
@@ -208,9 +208,12 @@ file_hash_enter (file, name, oldhash, oldname)
|
|||||||
/* Look for an existing file under the new name. */
|
/* Look for an existing file under the new name. */
|
||||||
|
|
||||||
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
||||||
if (strieq (oldfile->name, name))
|
if (strieq (oldfile->hname, name))
|
||||||
break;
|
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))
|
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||||
{
|
{
|
||||||
/* Remove FILE from its hash bucket. */
|
/* Remove FILE from its hash bucket. */
|
||||||
@@ -228,9 +231,9 @@ file_hash_enter (file, name, oldhash, oldname)
|
|||||||
|
|
||||||
/* Give FILE its new name. */
|
/* Give FILE its new name. */
|
||||||
|
|
||||||
file->name = name;
|
file->hname = name;
|
||||||
for (f = file->double_colon; f != 0; f = f->prev)
|
for (f = file->double_colon; f != 0; f = f->prev)
|
||||||
f->name = name;
|
f->hname = name;
|
||||||
|
|
||||||
if (oldfile == 0)
|
if (oldfile == 0)
|
||||||
{
|
{
|
||||||
@@ -319,6 +322,7 @@ in favor of those for `%s'.",
|
|||||||
MERGE (is_target);
|
MERGE (is_target);
|
||||||
MERGE (cmd_target);
|
MERGE (cmd_target);
|
||||||
MERGE (phony);
|
MERGE (phony);
|
||||||
|
MERGE (ignore_vpath);
|
||||||
#undef MERGE
|
#undef MERGE
|
||||||
|
|
||||||
file->renamed = oldfile;
|
file->renamed = oldfile;
|
||||||
|
|||||||
14
filedef.h
14
filedef.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definition of target file data structures for GNU Make.
|
/* Definition of target file data structures for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -24,6 +24,8 @@ struct file
|
|||||||
{
|
{
|
||||||
struct file *next;
|
struct file *next;
|
||||||
char *name;
|
char *name;
|
||||||
|
char *hname; /* Hashed filename */
|
||||||
|
char *vpath; /* VPATH/vpath pathname */
|
||||||
struct dep *deps;
|
struct dep *deps;
|
||||||
struct commands *cmds; /* Commands to execute for this target. */
|
struct commands *cmds; /* Commands to execute for this target. */
|
||||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||||
@@ -77,6 +79,7 @@ struct file
|
|||||||
unsigned int secondary:1;
|
unsigned int secondary:1;
|
||||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||||
this target cannot be remade. */
|
this target cannot be remade. */
|
||||||
|
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Number of intermediate files entered. */
|
/* 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 struct file *lookup_file (), *enter_file ();
|
||||||
extern void remove_intermediates (), snap_deps ();
|
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 ();
|
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
|
trouble when the machine running make and the machine holding a file have
|
||||||
different ideas about what time it is; and can also lose for `force'
|
different ideas about what time it is; and can also lose for `force'
|
||||||
targets, which need to be considered newer than anything that depends on
|
targets, which need to be considered newer than anything that depends on
|
||||||
them, even if said dependents' modtimes are in the future.
|
them, even if said dependents' modtimes are in the future. */
|
||||||
|
#define NEW_MTIME INTEGER_TYPE_MAXIMUM (time_t)
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
#define check_renamed(file) \
|
#define check_renamed(file) \
|
||||||
|
|||||||
299
function.c
299
function.c
@@ -23,14 +23,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
|
||||||
#include <process.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
#include "amiga.h"
|
#include "amiga.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include "sub_proc.h"
|
#include "sub_proc.h"
|
||||||
@@ -235,6 +231,7 @@ enum function
|
|||||||
function_firstword,
|
function_firstword,
|
||||||
function_word,
|
function_word,
|
||||||
function_words,
|
function_words,
|
||||||
|
function_wordlist,
|
||||||
function_findstring,
|
function_findstring,
|
||||||
function_strip,
|
function_strip,
|
||||||
function_join,
|
function_join,
|
||||||
@@ -271,6 +268,7 @@ static struct
|
|||||||
{ "firstword", 9, function_firstword },
|
{ "firstword", 9, function_firstword },
|
||||||
{ "word", 4, function_word },
|
{ "word", 4, function_word },
|
||||||
{ "words", 5, function_words },
|
{ "words", 5, function_words },
|
||||||
|
{ "wordlist", 8, function_wordlist },
|
||||||
{ "findstring", 10, function_findstring },
|
{ "findstring", 10, function_findstring },
|
||||||
{ "strip", 5, function_strip },
|
{ "strip", 5, function_strip },
|
||||||
{ "join", 4, function_join },
|
{ "join", 4, function_join },
|
||||||
@@ -336,7 +334,7 @@ expand_function (o, function, text, end)
|
|||||||
char *end;
|
char *end;
|
||||||
{
|
{
|
||||||
char *p, *p2, *p3;
|
char *p, *p2, *p3;
|
||||||
unsigned int i, len;
|
unsigned int i, j, len;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
int count;
|
int count;
|
||||||
char endparen = *end, startparen = *end == ')' ? '(' : '{';
|
char endparen = *end, startparen = *end == ')' ? '(' : '{';
|
||||||
@@ -350,13 +348,16 @@ expand_function (o, function, text, end)
|
|||||||
#ifndef VMS /* not supported for vms yet */
|
#ifndef VMS /* not supported for vms yet */
|
||||||
case function_shell:
|
case function_shell:
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
SECURITY_ATTRIBUTES saAttr;
|
SECURITY_ATTRIBUTES saAttr;
|
||||||
HANDLE hIn;
|
HANDLE hIn;
|
||||||
HANDLE hErr;
|
HANDLE hErr;
|
||||||
HANDLE hChildOutRd;
|
HANDLE hChildOutRd;
|
||||||
HANDLE hChildOutWr;
|
HANDLE hChildOutWr;
|
||||||
HANDLE hProcess;
|
HANDLE hProcess;
|
||||||
|
#endif
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
FILE *fpipe;
|
||||||
#endif
|
#endif
|
||||||
char **argv;
|
char **argv;
|
||||||
char *error_prefix;
|
char *error_prefix;
|
||||||
@@ -369,11 +370,13 @@ expand_function (o, function, text, end)
|
|||||||
/* Expand the command line. */
|
/* Expand the command line. */
|
||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
|
#ifndef __MSDOS__
|
||||||
/* Construct the argument list. */
|
/* Construct the argument list. */
|
||||||
argv = construct_command_argv (text,
|
argv = construct_command_argv (text,
|
||||||
(char **) NULL, (struct file *) 0);
|
(char **) NULL, (struct file *) 0);
|
||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
/* Using a target environment for `shell' loses in cases like:
|
/* Using a target environment for `shell' loses in cases like:
|
||||||
@@ -400,8 +403,8 @@ expand_function (o, function, text, end)
|
|||||||
else
|
else
|
||||||
error_prefix = "";
|
error_prefix = "";
|
||||||
|
|
||||||
#if !defined(__MSDOS__) && !defined(_AMIGA)
|
#ifndef _AMIGA
|
||||||
# ifdef WIN32
|
# ifdef WINDOWS32
|
||||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
saAttr.bInheritHandle = TRUE;
|
saAttr.bInheritHandle = TRUE;
|
||||||
saAttr.lpSecurityDescriptor = NULL;
|
saAttr.lpSecurityDescriptor = NULL;
|
||||||
@@ -451,30 +454,78 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
/* this will be closed almost right away */
|
/* this will be closed almost right away */
|
||||||
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
||||||
# else /* WIN32 */
|
# 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)
|
if (pipe (pipedes) < 0)
|
||||||
|
# endif /* __MSDOS__ */
|
||||||
{
|
{
|
||||||
perror_with_name (error_prefix, "pipe");
|
perror_with_name (error_prefix, "pipe");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifndef __MSDOS__
|
||||||
pid = vfork ();
|
pid = vfork ();
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
perror_with_name (error_prefix, "fork");
|
perror_with_name (error_prefix, "fork");
|
||||||
else if (pid == 0)
|
else if (pid == 0)
|
||||||
child_execute_job (0, pipedes[1], argv, envp);
|
child_execute_job (0, pipedes[1], argv, envp);
|
||||||
else
|
else
|
||||||
# endif /* WIN32 */
|
# endif /* ! __MSDOS__ */
|
||||||
|
# endif /* WINDOWS32 */
|
||||||
{
|
{
|
||||||
/* We are the parent. */
|
/* We are the parent. */
|
||||||
|
|
||||||
char *buffer;
|
char *buffer;
|
||||||
unsigned int maxlen;
|
unsigned int maxlen;
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
/* Free the storage only the child needed. */
|
|
||||||
free (argv[0]);
|
|
||||||
free ((char *) argv);
|
|
||||||
#if 0
|
#if 0
|
||||||
for (i = 0; envp[i] != 0; ++i)
|
for (i = 0; envp[i] != 0; ++i)
|
||||||
free (envp[i]);
|
free (envp[i]);
|
||||||
@@ -483,17 +534,22 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
/* Record the PID for reap_children. */
|
/* Record the PID for reap_children. */
|
||||||
shell_function_pid = pid;
|
shell_function_pid = pid;
|
||||||
|
#ifndef __MSDOS__
|
||||||
shell_function_completed = 0;
|
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. */
|
/* Set up and read from the pipe. */
|
||||||
|
|
||||||
maxlen = 200;
|
maxlen = 200;
|
||||||
buffer = (char *) xmalloc (maxlen + 1);
|
buffer = (char *) xmalloc (maxlen + 1);
|
||||||
|
|
||||||
/* Close the write side of the pipe. */
|
|
||||||
(void) close (pipedes[1]);
|
|
||||||
|
|
||||||
/* Read from the pipe until it gets EOF. */
|
/* Read from the pipe until it gets EOF. */
|
||||||
i = 0;
|
i = 0;
|
||||||
do
|
do
|
||||||
@@ -516,7 +572,12 @@ expand_function (o, function, text, end)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Close the read side of the pipe. */
|
/* Close the read side of the pipe. */
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
if (fpipe)
|
||||||
|
(void) pclose (fpipe);
|
||||||
|
#else
|
||||||
(void) close (pipedes[0]);
|
(void) close (pipedes[0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Loop until child_handler sets shell_function_completed
|
/* Loop until child_handler sets shell_function_completed
|
||||||
to the status of our child shell. */
|
to the status of our child shell. */
|
||||||
@@ -557,73 +618,16 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
free (buffer);
|
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
|
/* 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 <dos/dos.h>
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
|
|
||||||
@@ -696,7 +700,6 @@ expand_function (o, function, text, end)
|
|||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#endif /* Not Amiga. */
|
#endif /* Not Amiga. */
|
||||||
#endif /* MSDOS or Amiga. */
|
|
||||||
|
|
||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
@@ -1194,6 +1197,91 @@ index argument");
|
|||||||
free (text);
|
free (text);
|
||||||
break;
|
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:
|
case function_findstring:
|
||||||
/* Get two comma-separated arguments and expand each one. */
|
/* Get two comma-separated arguments and expand each one. */
|
||||||
count = 0;
|
count = 0;
|
||||||
@@ -1270,17 +1358,27 @@ index argument");
|
|||||||
{
|
{
|
||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
while (p >= p2 && *p != (function == function_dir ? ']' : '.'))
|
while (p >= p2 && *p != ']'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
#else
|
#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
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2 && (function == function_dir))
|
||||||
{
|
o = variable_buffer_output (o, p2, ++p - p2);
|
||||||
if (function == function_dir)
|
else if (p >= p2 && (*p == '.'))
|
||||||
++p;
|
|
||||||
o = variable_buffer_output (o, p2, p - p2);
|
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)
|
else if (function == function_dir)
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
o = variable_buffer_output (o, "[]", 2);
|
o = variable_buffer_output (o, "[]", 2);
|
||||||
@@ -1315,17 +1413,34 @@ index argument");
|
|||||||
{
|
{
|
||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
while (p >= p2 && *p != (function == function_notdir ? ']' : '.'))
|
while (p >= p2 && *p != ']'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
#else
|
#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
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2)
|
||||||
{
|
{
|
||||||
if (function == function_notdir)
|
if (function == function_notdir)
|
||||||
++p;
|
++p;
|
||||||
|
else if (*p != '.')
|
||||||
|
continue;
|
||||||
o = variable_buffer_output (o, p, len - (p - p2));
|
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)
|
else if (function == function_notdir)
|
||||||
o = variable_buffer_output (o, p2, len);
|
o = variable_buffer_output (o, p2, len);
|
||||||
|
|
||||||
|
|||||||
118
getloadavg.c
118
getloadavg.c
@@ -1,5 +1,5 @@
|
|||||||
/* Get the system load averages.
|
/* Get the system load averages.
|
||||||
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995
|
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995, 1997
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -19,6 +19,14 @@
|
|||||||
|
|
||||||
/* Compile-time symbols that this file uses:
|
/* Compile-time symbols that this file uses:
|
||||||
|
|
||||||
|
HAVE_PSTAT_GETDYNAMIC Define this if your system has the
|
||||||
|
pstat_getdynamic function. I think it
|
||||||
|
is unique to HPUX9. The best way to get the
|
||||||
|
definition is through the AC_FUNC_GETLOADAVG
|
||||||
|
macro that comes with autoconf 2.13 or newer.
|
||||||
|
If that isn't an option, then just put
|
||||||
|
AC_CHECK_FUNCS(pstat_getdynamic) in your
|
||||||
|
configure.in file.
|
||||||
FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist.
|
FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist.
|
||||||
KERNEL_FILE Pathname of the kernel to nlist.
|
KERNEL_FILE Pathname of the kernel to nlist.
|
||||||
LDAV_CVT() Scale the load average from the kernel.
|
LDAV_CVT() Scale the load average from the kernel.
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
DGUX
|
DGUX
|
||||||
eunice UNIX emulator under VMS.
|
eunice UNIX emulator under VMS.
|
||||||
hpux
|
hpux
|
||||||
MSDOS No-op for MSDOS.
|
__MSDOS__ No-op for MSDOS.
|
||||||
NeXT
|
NeXT
|
||||||
sgi
|
sgi
|
||||||
sequent Sequent Dynix 3.x.x (BSD)
|
sequent Sequent Dynix 3.x.x (BSD)
|
||||||
@@ -52,7 +60,7 @@
|
|||||||
UMAX
|
UMAX
|
||||||
UMAX4_3
|
UMAX4_3
|
||||||
VMS
|
VMS
|
||||||
WIN32 No-op for Windows95/NT.
|
WINDOWS32 No-op for Windows95/NT.
|
||||||
__linux__ Linux: assumes /proc filesystem mounted.
|
__linux__ Linux: assumes /proc filesystem mounted.
|
||||||
Support from Michael K. Johnson.
|
Support from Michael K. Johnson.
|
||||||
__NetBSD__ NetBSD: assumes /kern filesystem mounted.
|
__NetBSD__ NetBSD: assumes /kern filesystem mounted.
|
||||||
@@ -73,7 +81,7 @@
|
|||||||
/* Both the Emacs and non-Emacs sections want this. Some
|
/* Both the Emacs and non-Emacs sections want this. Some
|
||||||
configuration files' definitions for the LOAD_AVE_CVT macro (like
|
configuration files' definitions for the LOAD_AVE_CVT macro (like
|
||||||
sparc.h's) use macros like FSCALE, defined here. */
|
sparc.h's) use macros like FSCALE, defined here. */
|
||||||
#ifdef unix
|
#if defined (unix) || defined (__unix)
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -133,6 +141,14 @@ extern int errno;
|
|||||||
# define hpux
|
# define hpux
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if defined (__hpux) && !defined (hpux)
|
||||||
|
# define hpux
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined (__sun) && !defined (sun)
|
||||||
|
# define sun
|
||||||
|
# endif
|
||||||
|
|
||||||
# if defined(hp300) && !defined(hpux)
|
# if defined(hp300) && !defined(hpux)
|
||||||
# define MORE_BSD
|
# define MORE_BSD
|
||||||
# endif
|
# endif
|
||||||
@@ -141,12 +157,19 @@ extern int errno;
|
|||||||
# define decstation
|
# define decstation
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if defined (__SVR4) && !defined (SVR4)
|
||||||
|
# define SVR4
|
||||||
|
# endif
|
||||||
|
|
||||||
# if (defined(sun) && defined(SVR4)) || defined (SOLARIS2)
|
# if (defined(sun) && defined(SVR4)) || defined (SOLARIS2)
|
||||||
# define SUNOS_5
|
# define SUNOS_5
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined (__osf__) && (defined (__alpha) || defined (__alpha__))
|
# if defined (__osf__) && (defined (__alpha) || defined (__alpha__))
|
||||||
# define OSF_ALPHA
|
# define OSF_ALPHA
|
||||||
|
# include <sys/mbuf.h>
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# include <net/route.h>
|
||||||
# include <sys/table.h>
|
# include <sys/table.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -354,7 +377,7 @@ extern int errno;
|
|||||||
# define KERNEL_FILE "/hp-ux"
|
# define KERNEL_FILE "/hp-ux"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if !defined(KERNEL_FILE) && (defined(_SEQUENT_) || defined(MIPS) || defined(SVR4) || defined(ISC) || defined (sgi) || defined(SVR4) || (defined (ardent) && defined (titan)))
|
# if !defined(KERNEL_FILE) && (defined(_SEQUENT_) || defined(MIPS) || defined(SVR4) || defined(ISC) || defined (sgi) || (defined (ardent) && defined (titan)))
|
||||||
# define KERNEL_FILE "/unix"
|
# define KERNEL_FILE "/unix"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -382,6 +405,7 @@ extern int errno;
|
|||||||
# ifdef LOAD_AVE_TYPE
|
# ifdef LOAD_AVE_TYPE
|
||||||
|
|
||||||
# ifndef VMS
|
# ifndef VMS
|
||||||
|
# ifndef __linux__
|
||||||
# ifndef NLIST_STRUCT
|
# ifndef NLIST_STRUCT
|
||||||
# include <a.out.h>
|
# include <a.out.h>
|
||||||
# else /* NLIST_STRUCT */
|
# else /* NLIST_STRUCT */
|
||||||
@@ -391,6 +415,11 @@ extern int errno;
|
|||||||
# ifdef SUNOS_5
|
# ifdef SUNOS_5
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
# include <kvm.h>
|
# include <kvm.h>
|
||||||
|
# include <kstat.h>
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
|
||||||
|
# include <sys/pstat.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifndef KERNEL_FILE
|
# ifndef KERNEL_FILE
|
||||||
@@ -400,6 +429,7 @@ extern int errno;
|
|||||||
# ifndef LDAV_SYMBOL
|
# ifndef LDAV_SYMBOL
|
||||||
# define LDAV_SYMBOL "_avenrun"
|
# define LDAV_SYMBOL "_avenrun"
|
||||||
# endif /* LDAV_SYMBOL */
|
# endif /* LDAV_SYMBOL */
|
||||||
|
# endif /* __linux__ */
|
||||||
|
|
||||||
# else /* VMS */
|
# else /* VMS */
|
||||||
|
|
||||||
@@ -417,6 +447,14 @@ extern int errno;
|
|||||||
|
|
||||||
# endif /* LOAD_AVE_TYPE */
|
# endif /* LOAD_AVE_TYPE */
|
||||||
|
|
||||||
|
# if defined(__GNU__) && !defined (NeXT)
|
||||||
|
/* Note that NeXT Openstep defines __GNU__ even though it should not. */
|
||||||
|
/* GNU system acts much like NeXT, for load average purposes,
|
||||||
|
but not exactly. */
|
||||||
|
# define NeXT
|
||||||
|
# define host_self mach_host_self
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef NeXT
|
# ifdef NeXT
|
||||||
# ifdef HAVE_MACH_MACH_H
|
# ifdef HAVE_MACH_MACH_H
|
||||||
# include <mach/mach.h>
|
# include <mach/mach.h>
|
||||||
@@ -486,7 +524,7 @@ static int getloadavg_initialized;
|
|||||||
/* Offset in kmem to seek to read load average, or 0 means invalid. */
|
/* Offset in kmem to seek to read load average, or 0 means invalid. */
|
||||||
static long offset;
|
static long offset;
|
||||||
|
|
||||||
#if !defined(VMS) && !defined(sgi)
|
# if !defined(VMS) && !defined(sgi) && !defined(__linux__)
|
||||||
static struct nlist nl[2];
|
static struct nlist nl[2];
|
||||||
# endif /* Not VMS or sgi */
|
# endif /* Not VMS or sgi */
|
||||||
|
|
||||||
@@ -516,6 +554,70 @@ getloadavg (loadavg, nelem)
|
|||||||
elem = -1;
|
elem = -1;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if !defined (LDAV_DONE) && defined (HAVE_LIBKSTAT)
|
||||||
|
/* Use libkstat because we don't have to be root. */
|
||||||
|
# define LDAV_DONE
|
||||||
|
kstat_ctl_t *kc;
|
||||||
|
kstat_t *ksp;
|
||||||
|
kstat_named_t *kn;
|
||||||
|
|
||||||
|
kc = kstat_open ();
|
||||||
|
if (kc == 0)
|
||||||
|
return -1;
|
||||||
|
ksp = kstat_lookup (kc, "unix", 0, "system_misc");
|
||||||
|
if (ksp == 0 )
|
||||||
|
return -1;
|
||||||
|
if (kstat_read (kc, ksp, 0) == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
|
||||||
|
kn = kstat_data_lookup (ksp, "avenrun_1min");
|
||||||
|
if (kn == 0)
|
||||||
|
{
|
||||||
|
/* Return -1 if no load average information is available. */
|
||||||
|
nelem = 0;
|
||||||
|
elem = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nelem >= 1)
|
||||||
|
loadavg[elem++] = (double) kn->value.ul/FSCALE;
|
||||||
|
|
||||||
|
if (nelem >= 2)
|
||||||
|
{
|
||||||
|
kn = kstat_data_lookup (ksp, "avenrun_5min");
|
||||||
|
if (kn != 0)
|
||||||
|
{
|
||||||
|
loadavg[elem++] = (double) kn->value.ul/FSCALE;
|
||||||
|
|
||||||
|
if (nelem >= 3)
|
||||||
|
{
|
||||||
|
kn = kstat_data_lookup (ksp, "avenrun_15min");
|
||||||
|
if (kn != 0)
|
||||||
|
loadavg[elem++] = (double) kn->value.ul/FSCALE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
kstat_close (kc);
|
||||||
|
# endif /* HAVE_LIBKSTAT */
|
||||||
|
|
||||||
|
# if !defined (LDAV_DONE) && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
|
||||||
|
/* Use pstat_getdynamic() because we don't have to be root. */
|
||||||
|
# define LDAV_DONE
|
||||||
|
# undef LOAD_AVE_TYPE
|
||||||
|
|
||||||
|
struct pst_dynamic dyn_info;
|
||||||
|
if (pstat_getdynamic (&dyn_info, sizeof (dyn_info), 0, 0) < 0)
|
||||||
|
return -1;
|
||||||
|
if (nelem > 0)
|
||||||
|
loadavg[elem++] = dyn_info.psd_avg_1_min;
|
||||||
|
if (nelem > 1)
|
||||||
|
loadavg[elem++] = dyn_info.psd_avg_5_min;
|
||||||
|
if (nelem > 2)
|
||||||
|
loadavg[elem++] = dyn_info.psd_avg_15_min;
|
||||||
|
|
||||||
|
# endif /* hpux && HAVE_PSTAT_GETDYNAMIC */
|
||||||
|
|
||||||
# if !defined (LDAV_DONE) && defined (__linux__)
|
# if !defined (LDAV_DONE) && defined (__linux__)
|
||||||
# define LDAV_DONE
|
# define LDAV_DONE
|
||||||
# undef LOAD_AVE_TYPE
|
# undef LOAD_AVE_TYPE
|
||||||
@@ -735,7 +837,7 @@ getloadavg (loadavg, nelem)
|
|||||||
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
|
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
|
||||||
# endif /* OSF_MIPS */
|
# endif /* OSF_MIPS */
|
||||||
|
|
||||||
#if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32))
|
# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32))
|
||||||
# define LDAV_DONE
|
# define LDAV_DONE
|
||||||
|
|
||||||
/* A faithful emulation is going to have to be saved for a rainy day. */
|
/* A faithful emulation is going to have to be saved for a rainy day. */
|
||||||
@@ -743,7 +845,7 @@ getloadavg (loadavg, nelem)
|
|||||||
{
|
{
|
||||||
loadavg[elem] = 0.0;
|
loadavg[elem] = 0.0;
|
||||||
}
|
}
|
||||||
#endif /* MSDOS */
|
# endif /* __MSDOS__ || WINDOWS32 */
|
||||||
|
|
||||||
# if !defined (LDAV_DONE) && defined (OSF_ALPHA)
|
# if !defined (LDAV_DONE) && defined (OSF_ALPHA)
|
||||||
# define LDAV_DONE
|
# define LDAV_DONE
|
||||||
|
|||||||
133
getopt.h
Normal file
133
getopt.h
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/* Declarations for getopt.
|
||||||
|
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
|
later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _GETOPT_H
|
||||||
|
#define _GETOPT_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For communication from `getopt' to the caller.
|
||||||
|
When `getopt' finds an option that takes an argument,
|
||||||
|
the argument value is returned here.
|
||||||
|
Also, when `ordering' is RETURN_IN_ORDER,
|
||||||
|
each non-option ARGV-element is returned here. */
|
||||||
|
|
||||||
|
extern char *optarg;
|
||||||
|
|
||||||
|
/* Index in ARGV of the next element to be scanned.
|
||||||
|
This is used for communication to and from the caller
|
||||||
|
and for communication between successive calls to `getopt'.
|
||||||
|
|
||||||
|
On entry to `getopt', zero means this is the first call; initialize.
|
||||||
|
|
||||||
|
When `getopt' returns -1, this is the index of the first of the
|
||||||
|
non-option elements that the caller should itself scan.
|
||||||
|
|
||||||
|
Otherwise, `optind' communicates from one call to the next
|
||||||
|
how much of ARGV has been scanned so far. */
|
||||||
|
|
||||||
|
extern int optind;
|
||||||
|
|
||||||
|
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||||
|
for unrecognized options. */
|
||||||
|
|
||||||
|
extern int opterr;
|
||||||
|
|
||||||
|
/* Set to an option character which was unrecognized. */
|
||||||
|
|
||||||
|
extern int optopt;
|
||||||
|
|
||||||
|
/* Describe the long-named options requested by the application.
|
||||||
|
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||||
|
of `struct option' terminated by an element containing a name which is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
The field `has_arg' is:
|
||||||
|
no_argument (or 0) if the option does not take an argument,
|
||||||
|
required_argument (or 1) if the option requires an argument,
|
||||||
|
optional_argument (or 2) if the option takes an optional argument.
|
||||||
|
|
||||||
|
If the field `flag' is not NULL, it points to a variable that is set
|
||||||
|
to the value given in the field `val' when the option is found, but
|
||||||
|
left unchanged if the option is not found.
|
||||||
|
|
||||||
|
To have a long-named option do something other than set an `int' to
|
||||||
|
a compiled-in constant, such as set a value from `optarg', set the
|
||||||
|
option's `flag' field to zero and its `val' field to a nonzero
|
||||||
|
value (the equivalent single-letter option character, if there is
|
||||||
|
one). For long options that have a zero `flag' field, `getopt'
|
||||||
|
returns the contents of the `val' field. */
|
||||||
|
|
||||||
|
struct option
|
||||||
|
{
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
const char *name;
|
||||||
|
#else
|
||||||
|
char *name;
|
||||||
|
#endif
|
||||||
|
/* has_arg can't be an enum because some compilers complain about
|
||||||
|
type mismatches in all the code that assumes it is an int. */
|
||||||
|
int has_arg;
|
||||||
|
int *flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||||
|
|
||||||
|
#define no_argument 0
|
||||||
|
#define required_argument 1
|
||||||
|
#define optional_argument 2
|
||||||
|
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
/* Many other libraries have conflicting prototypes for getopt, with
|
||||||
|
differences in the consts, in stdlib.h. To avoid compilation
|
||||||
|
errors, only prototype getopt for the GNU C library. */
|
||||||
|
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||||
|
#else /* not __GNU_LIBRARY__ */
|
||||||
|
extern int getopt ();
|
||||||
|
#endif /* __GNU_LIBRARY__ */
|
||||||
|
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
extern int getopt_long_only (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
|
||||||
|
/* Internal only. Users should not call this directly. */
|
||||||
|
extern int _getopt_internal (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind,
|
||||||
|
int long_only);
|
||||||
|
#else /* not __STDC__ */
|
||||||
|
extern int getopt ();
|
||||||
|
extern int getopt_long ();
|
||||||
|
extern int getopt_long_only ();
|
||||||
|
|
||||||
|
extern int _getopt_internal ();
|
||||||
|
#endif /* __STDC__ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* getopt.h */
|
||||||
189
getopt1.c
Normal file
189
getopt1.c
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
|
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
|
later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "getopt.h"
|
||||||
|
|
||||||
|
#if !defined (__STDC__) || !__STDC__
|
||||||
|
/* This is a separate conditional since some stdc systems
|
||||||
|
reject `defined (const)'. */
|
||||||
|
#ifndef const
|
||||||
|
#define const
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
|
Library, but also included in many other GNU distributions. Compiling
|
||||||
|
and linking in this code is a waste when using the GNU C library
|
||||||
|
(especially if it is a shared library). Rather than having every GNU
|
||||||
|
program understand `configure --with-gnu-libc' and omit the object files,
|
||||||
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
|
#define GETOPT_INTERFACE_VERSION 2
|
||||||
|
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
|
||||||
|
#include <gnu-versions.h>
|
||||||
|
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||||
|
#define ELIDE_CODE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ELIDE_CODE
|
||||||
|
|
||||||
|
|
||||||
|
/* This needs to come after some library #include
|
||||||
|
to get __GNU_LIBRARY__ defined. */
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
getopt_long (argc, argv, options, long_options, opt_index)
|
||||||
|
int argc;
|
||||||
|
char *const *argv;
|
||||||
|
const char *options;
|
||||||
|
const struct option *long_options;
|
||||||
|
int *opt_index;
|
||||||
|
{
|
||||||
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||||
|
If an option that starts with '-' (not '--') doesn't match a long option,
|
||||||
|
but does match a short option, it is parsed as a short option
|
||||||
|
instead. */
|
||||||
|
|
||||||
|
int
|
||||||
|
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||||
|
int argc;
|
||||||
|
char *const *argv;
|
||||||
|
const char *options;
|
||||||
|
const struct option *long_options;
|
||||||
|
int *opt_index;
|
||||||
|
{
|
||||||
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* Not ELIDE_CODE. */
|
||||||
|
|
||||||
|
#ifdef TEST
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (argc, argv)
|
||||||
|
int argc;
|
||||||
|
char **argv;
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
int digit_optind = 0;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
int this_option_optind = optind ? optind : 1;
|
||||||
|
int option_index = 0;
|
||||||
|
static struct option long_options[] =
|
||||||
|
{
|
||||||
|
{"add", 1, 0, 0},
|
||||||
|
{"append", 0, 0, 0},
|
||||||
|
{"delete", 1, 0, 0},
|
||||||
|
{"verbose", 0, 0, 0},
|
||||||
|
{"create", 0, 0, 0},
|
||||||
|
{"file", 1, 0, 0},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||||
|
long_options, &option_index);
|
||||||
|
if (c == -1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
printf ("option %s", long_options[option_index].name);
|
||||||
|
if (optarg)
|
||||||
|
printf (" with arg %s", optarg);
|
||||||
|
printf ("\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '0':
|
||||||
|
case '1':
|
||||||
|
case '2':
|
||||||
|
case '3':
|
||||||
|
case '4':
|
||||||
|
case '5':
|
||||||
|
case '6':
|
||||||
|
case '7':
|
||||||
|
case '8':
|
||||||
|
case '9':
|
||||||
|
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||||
|
printf ("digits occur in two different argv-elements.\n");
|
||||||
|
digit_optind = this_option_optind;
|
||||||
|
printf ("option %c\n", c);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'a':
|
||||||
|
printf ("option a\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'b':
|
||||||
|
printf ("option b\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
printf ("option c with value `%s'\n", optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
printf ("option d with value `%s'\n", optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optind < argc)
|
||||||
|
{
|
||||||
|
printf ("non-option ARGV-elements: ");
|
||||||
|
while (optind < argc)
|
||||||
|
printf ("%s ", argv[optind++]);
|
||||||
|
printf ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* TEST */
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Configuring glob for GO32
|
echo Configuring glob for DJGPP
|
||||||
rem This batch file assumes a unix-type "sed" program
|
rem This batch file assumes a unix-type "sed" program
|
||||||
|
|
||||||
echo # Makefile generated by "configure.bat"> Makefile
|
echo # Makefile generated by "configure.bat"> Makefile
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/* 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
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
@@ -11,11 +12,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with this library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#if HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -37,7 +38,16 @@ Cambridge, MA 02139, USA. */
|
|||||||
program understand `configure --with-gnu-libc' and omit the object files,
|
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. */
|
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__
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
# ifndef errno
|
||||||
@@ -55,8 +65,8 @@ fnmatch (pattern, string, flags)
|
|||||||
register const char *p = pattern, *n = string;
|
register const char *p = pattern, *n = string;
|
||||||
register char c;
|
register char c;
|
||||||
|
|
||||||
/* Note that this evalutes C many times. */
|
/* Note that this evaluates C many times. */
|
||||||
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
|
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||||
|
|
||||||
while ((c = *p++) != '\0')
|
while ((c = *p++) != '\0')
|
||||||
{
|
{
|
||||||
@@ -225,6 +235,8 @@ fnmatch (pattern, string, flags)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return FNM_NOMATCH;
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
# undef FOLD
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||||
|
|||||||
@@ -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
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
published by the Free Software Foundation; either version 2 of the
|
published by the Free Software Foundation; either version 2 of the
|
||||||
License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _FNMATCH_H
|
#ifndef _FNMATCH_H
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
||||||
|| defined (WIN32))
|
|| defined (WINDOWS32))
|
||||||
#undef __P
|
#undef __P
|
||||||
#define __P(protos) protos
|
#define __P(protos) protos
|
||||||
#else /* Not C++ or ANSI C. */
|
#else /* Not C++ or ANSI C. */
|
||||||
|
|||||||
363
glob/glob.c
363
glob/glob.c
@@ -1,4 +1,4 @@
|
|||||||
/* 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
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
@@ -11,9 +11,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with this library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/* AIX requires this to be the first thing in the file. */
|
/* AIX requires this to be the first thing in the file. */
|
||||||
#if defined (_AIX) && !defined (__GNUC__)
|
#if defined (_AIX) && !defined (__GNUC__)
|
||||||
@@ -33,6 +33,10 @@ Cambridge, MA 02139, USA. */
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.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
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
actually compiling the library itself. This code is part of the GNU C
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
@@ -52,11 +56,11 @@ Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#ifndef ELIDE_CODE
|
#ifndef ELIDE_CODE
|
||||||
|
|
||||||
#ifdef STDC_HEADERS
|
#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__)
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#if defined HAVE_UNISTD_H || defined _LIBC
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifndef POSIX
|
#ifndef POSIX
|
||||||
#ifdef _POSIX_VERSION
|
#ifdef _POSIX_VERSION
|
||||||
@@ -65,13 +69,16 @@ Cambridge, MA 02139, USA. */
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined (_AMIGA) && !defined (VMS) && !defined(WIN32)
|
#if !defined (_AMIGA) && !defined (VMS) && !defined(WINDOWS32)
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||||
extern int errno;
|
extern int errno;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __set_errno
|
||||||
|
#define __set_errno(val) errno = (val)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
@@ -106,7 +113,7 @@ extern int errno;
|
|||||||
#endif
|
#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
|
/* Posix does not require that the d_ino field be present, and some
|
||||||
systems do not provide it. */
|
systems do not provide it. */
|
||||||
#define REAL_DIR_ENTRY(dp) 1
|
#define REAL_DIR_ENTRY(dp) 1
|
||||||
@@ -156,7 +163,7 @@ extern void bcopy ();
|
|||||||
((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
|
((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
|
||||||
#endif /* Not ANSI_STRING. */
|
#endif /* Not ANSI_STRING. */
|
||||||
|
|
||||||
#ifndef HAVE_STRCOLL
|
#if !defined HAVE_STRCOLL && !defined _LIBC
|
||||||
#define strcoll strcmp
|
#define strcoll strcmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -166,7 +173,7 @@ extern void bcopy ();
|
|||||||
__inline
|
__inline
|
||||||
#endif
|
#endif
|
||||||
#ifndef __SASC
|
#ifndef __SASC
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
static void *
|
static void *
|
||||||
#else
|
#else
|
||||||
static char *
|
static char *
|
||||||
@@ -196,11 +203,11 @@ my_realloc (p, n)
|
|||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#else /* Not HAVE_ALLOCA_H. */
|
#else /* Not HAVE_ALLOCA_H. */
|
||||||
#ifndef _AIX
|
#ifndef _AIX
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#else
|
#else
|
||||||
extern char *alloca ();
|
extern char *alloca ();
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
#endif /* Not _AIX. */
|
#endif /* Not _AIX. */
|
||||||
#endif /* sparc or HAVE_ALLOCA_H. */
|
#endif /* sparc or HAVE_ALLOCA_H. */
|
||||||
#endif /* GCC. */
|
#endif /* GCC. */
|
||||||
@@ -219,7 +226,7 @@ extern char *alloca ();
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STDC_HEADERS
|
#if !(defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
|
||||||
#undef size_t
|
#undef size_t
|
||||||
#define size_t unsigned int
|
#define size_t unsigned int
|
||||||
#endif
|
#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 prefix_array __P ((const char *prefix, char **array, size_t n));
|
||||||
static int collated_compare __P ((const __ptr_t, const __ptr_t));
|
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.
|
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||||
The bits defined above may be set in FLAGS.
|
The bits defined above may be set in FLAGS.
|
||||||
If a directory cannot be opened or read and ERRFUNC is not nil,
|
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)
|
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
|
||||||
{
|
{
|
||||||
errno = EINVAL;
|
__set_errno (EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,38 +335,59 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
const char *begin = strchr (pattern, '{');
|
const char *begin = strchr (pattern, '{');
|
||||||
if (begin != NULL)
|
if (begin != NULL)
|
||||||
{
|
{
|
||||||
|
/* Allocate working buffer large enough for our work. Note that
|
||||||
|
we have at least an opening and closing brace. */
|
||||||
int firstc;
|
int firstc;
|
||||||
size_t restlen;
|
char *alt_start;
|
||||||
const char *p, *end, *next;
|
const char *p;
|
||||||
unsigned int depth = 0;
|
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)
|
||||||
|
{
|
||||||
|
if (!(flags & GLOB_APPEND))
|
||||||
|
globfree (pglob);
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Find the end of the brace expression, by counting braces.
|
/* We know the prefix for all sub-patterns. */
|
||||||
While we're at it, notice the first comma at top brace level. */
|
memcpy (onealt, pattern, begin - pattern);
|
||||||
end = begin + 1;
|
alt_start = &onealt[begin - pattern];
|
||||||
next = NULL;
|
|
||||||
while (1)
|
/* 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)
|
||||||
{
|
{
|
||||||
switch (*end++)
|
/* It is an illegal expression. */
|
||||||
{
|
#ifndef __GNUC__
|
||||||
case ',':
|
free (onealt);
|
||||||
if (depth == 0 && next == NULL)
|
#endif
|
||||||
next = end;
|
|
||||||
continue;
|
|
||||||
case '{':
|
|
||||||
++depth;
|
|
||||||
continue;
|
|
||||||
case '}':
|
|
||||||
if (depth-- == 0)
|
|
||||||
break;
|
|
||||||
continue;
|
|
||||||
case '\0':
|
|
||||||
return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
|
return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
/* 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);
|
||||||
}
|
}
|
||||||
restlen = strlen (end) + 1;
|
}
|
||||||
if (next == NULL)
|
/* Please note that we now can be sure the brace expression
|
||||||
next = end;
|
is well-formed. */
|
||||||
|
rest_len = strlen (++rest) + 1;
|
||||||
|
|
||||||
/* We have a brace expression. BEGIN points to the opening {,
|
/* We have a brace expression. BEGIN points to the opening {,
|
||||||
NEXT points past the terminator of the first element, and END
|
NEXT points past the terminator of the first element, and END
|
||||||
@@ -331,72 +404,47 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
}
|
}
|
||||||
firstc = pglob->gl_pathc;
|
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;
|
p = begin + 1;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* Construct a whole name that is one of the brace
|
|
||||||
alternatives in a temporary buffer. */
|
|
||||||
int result;
|
int result;
|
||||||
size_t bufsz = (begin - pattern) + (next - 1 - p) + restlen;
|
|
||||||
#ifdef __GNUC__
|
/* Construct the new glob expression. */
|
||||||
char onealt[bufsz];
|
memcpy (alt_start, p, next - p);
|
||||||
#else
|
memcpy (&alt_start[next - p], rest, rest_len);
|
||||||
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);
|
|
||||||
result = glob (onealt,
|
result = glob (onealt,
|
||||||
((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) |
|
((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC))
|
||||||
GLOB_APPEND), errfunc, pglob);
|
| GLOB_APPEND), errfunc, pglob);
|
||||||
#ifndef __GNUC__
|
|
||||||
free (onealt);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If we got an error, return it. */
|
/* If we got an error, return it. */
|
||||||
if (result && result != GLOB_NOMATCH)
|
if (result && result != GLOB_NOMATCH)
|
||||||
{
|
{
|
||||||
|
#ifndef __GNUC__
|
||||||
|
free (onealt);
|
||||||
|
#endif
|
||||||
if (!(flags & GLOB_APPEND))
|
if (!(flags & GLOB_APPEND))
|
||||||
globfree (pglob);
|
globfree (pglob);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance past this alternative and process the next. */
|
if (*next == '}')
|
||||||
p = next;
|
/* We saw the last entry. */
|
||||||
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;
|
break;
|
||||||
goto scan;
|
|
||||||
}
|
p = next + 1;
|
||||||
|
next = next_brace_sub (p);
|
||||||
|
assert (next != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pglob->gl_pathc == firstc &&
|
#ifndef __GNUC__
|
||||||
!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
|
free (onealt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (pglob->gl_pathc != firstc)
|
||||||
|
/* We found some entries. */
|
||||||
|
return 0;
|
||||||
|
else if (!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
|
||||||
return GLOB_NOMATCH;
|
return GLOB_NOMATCH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -449,51 +497,123 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
if ((flags & GLOB_TILDE) && dirname[0] == '~')
|
if ((flags & GLOB_TILDE) && dirname[0] == '~')
|
||||||
{
|
{
|
||||||
if (dirname[1] == '\0')
|
if (dirname[1] == '\0' || dirname[1] == '/')
|
||||||
{
|
{
|
||||||
/* Look up home directory. */
|
/* Look up home directory. */
|
||||||
dirname = getenv ("HOME");
|
char *home_dir = getenv ("HOME");
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
if (dirname == NULL || dirname[0] == '\0')
|
if (home_dir == NULL || home_dir[0] == '\0')
|
||||||
dirname = "SYS:";
|
home_dir = "SYS:";
|
||||||
#else
|
#else
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (dirname == NULL || dirname[0] == '\0')
|
if (home_dir == NULL || home_dir[0] == '\0')
|
||||||
dirname = "c:/users/default"; /* poor default */
|
home_dir = "c:/users/default"; /* poor default */
|
||||||
#else
|
#else
|
||||||
if (dirname == NULL || dirname[0] == '\0')
|
if (home_dir == NULL || home_dir[0] == '\0')
|
||||||
{
|
{
|
||||||
extern char *getlogin __P ((void));
|
extern char *getlogin __P ((void));
|
||||||
char *name = getlogin ();
|
extern int getlogin_r __P ((char *, size_t));
|
||||||
if (name != NULL)
|
int success;
|
||||||
{
|
|
||||||
struct passwd *p = getpwnam (name);
|
#if defined HAVE_GETLOGIN_R || defined _LIBC
|
||||||
if (p != NULL)
|
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
|
||||||
dirname = p->pw_dir;
|
char *name;
|
||||||
}
|
|
||||||
}
|
if (buflen == 0)
|
||||||
if (dirname == NULL || dirname[0] == '\0')
|
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
|
||||||
dirname = (char *) "~"; /* No luck. */
|
a moderate value. */
|
||||||
#endif /* WIN32 */
|
buflen = 16;
|
||||||
|
name = __alloca (buflen);
|
||||||
|
|
||||||
|
success = getlogin_r (name, buflen) >= 0;
|
||||||
|
#else
|
||||||
|
char *name;
|
||||||
|
success = (name = getlogin ()) != NULL;
|
||||||
#endif
|
#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);
|
||||||
|
success = p != NULL;
|
||||||
|
#endif
|
||||||
|
if (success)
|
||||||
|
home_dir = p->pw_dir;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
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
|
else
|
||||||
{
|
{
|
||||||
#ifdef _AMIGA
|
char *newp;
|
||||||
if (dirname == NULL || dirname[0] == '\0')
|
size_t home_len = strlen (home_dir);
|
||||||
dirname = "SYS:";
|
newp = __alloca (home_len + dirlen);
|
||||||
#else
|
memcpy (newp, home_dir, home_len);
|
||||||
#ifdef WIN32
|
memcpy (&newp[home_len], &dirname[1], dirlen);
|
||||||
if (dirname == NULL || dirname[0] == '\0')
|
dirname = newp;
|
||||||
dirname = "c:/users/default"; /* poor default */
|
}
|
||||||
#else
|
}
|
||||||
|
#if !defined _AMIGA && !defined WINDOWS32
|
||||||
|
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. */
|
/* Look up specific user's home directory. */
|
||||||
struct passwd *p = getpwnam (dirname + 1);
|
{
|
||||||
|
#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)
|
if (p != NULL)
|
||||||
dirname = p->pw_dir;
|
home_dir = p->pw_dir;
|
||||||
#endif /* WIN32 */
|
else
|
||||||
|
home_dir = NULL;
|
||||||
#endif
|
#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. */
|
#endif /* Not VMS. */
|
||||||
|
|
||||||
@@ -880,7 +1000,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
(*pglob->gl_closedir) (stream);
|
(*pglob->gl_closedir) (stream);
|
||||||
else
|
else
|
||||||
closedir ((DIR *) stream);
|
closedir ((DIR *) stream);
|
||||||
errno = save;
|
__set_errno (save);
|
||||||
}
|
}
|
||||||
return nfound == 0 ? GLOB_NOMATCH : 0;
|
return nfound == 0 ? GLOB_NOMATCH : 0;
|
||||||
|
|
||||||
@@ -891,7 +1011,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
(*pglob->gl_closedir) (stream);
|
(*pglob->gl_closedir) (stream);
|
||||||
else
|
else
|
||||||
closedir ((DIR *) stream);
|
closedir ((DIR *) stream);
|
||||||
errno = save;
|
__set_errno (save);
|
||||||
}
|
}
|
||||||
while (names != NULL)
|
while (names != NULL)
|
||||||
{
|
{
|
||||||
@@ -903,4 +1023,3 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Not ELIDE_CODE. */
|
#endif /* Not ELIDE_CODE. */
|
||||||
|
|
||||||
|
|||||||
15
glob/glob.h
15
glob/glob.h
@@ -1,19 +1,22 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This file is part of the GNU C Library. Its master source is NOT part of
|
||||||
|
the C library, however. The master source lives in /gd/gnu/lib.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public License as
|
modify it under the terms of the GNU Library General Public License as
|
||||||
published by the Free Software Foundation; either version 2 of the
|
published by the Free Software Foundation; either version 2 of the
|
||||||
License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; see the file COPYING.LIB. If
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Cambridge, MA 02139, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _GLOB_H
|
#ifndef _GLOB_H
|
||||||
|
|
||||||
@@ -26,7 +29,7 @@ extern "C"
|
|||||||
|
|
||||||
#undef __ptr_t
|
#undef __ptr_t
|
||||||
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
||||||
|| defined (WIN32))
|
|| defined (WINDOWS32))
|
||||||
#undef __P
|
#undef __P
|
||||||
#define __P(protos) protos
|
#define __P(protos) protos
|
||||||
#define __ptr_t void *
|
#define __ptr_t void *
|
||||||
|
|||||||
@@ -349,9 +349,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|||||||
21
implicit.c
21
implicit.c
@@ -152,7 +152,7 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
register struct rule *rule;
|
register struct rule *rule;
|
||||||
register struct dep *dep;
|
register struct dep *dep;
|
||||||
|
|
||||||
char *p;
|
char *p, *vp;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (archive || ar_name (filename))
|
if (archive || ar_name (filename))
|
||||||
@@ -167,6 +167,17 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
lastslash = rindex (filename, ']');
|
lastslash = rindex (filename, ']');
|
||||||
#else
|
#else
|
||||||
lastslash = rindex (filename, '/');
|
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
|
#endif
|
||||||
if (lastslash != 0 && lastslash[1] == '\0')
|
if (lastslash != 0 && lastslash[1] == '\0')
|
||||||
lastslash = 0;
|
lastslash = 0;
|
||||||
@@ -388,10 +399,12 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
}
|
}
|
||||||
/* This code, given FILENAME = "lib/foo.o", dependency name
|
/* This code, given FILENAME = "lib/foo.o", dependency name
|
||||||
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
|
"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, "");
|
DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp);
|
||||||
found_files[deps_found++] = p;
|
strcpy(vp, p);
|
||||||
|
found_files[deps_found++] = vp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
410
job.c
410
job.c
@@ -25,26 +25,33 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
/* Default shell to use. */
|
/* Default shell to use. */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
char *default_shell = "sh.exe";
|
char *default_shell = "sh.exe";
|
||||||
int no_default_sh_exe = 1;
|
int no_default_sh_exe = 1;
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
#ifndef _AMIGA
|
#ifdef _AMIGA
|
||||||
char default_shell[] = "/bin/sh";
|
|
||||||
#else
|
|
||||||
char default_shell[] = "";
|
char default_shell[] = "";
|
||||||
extern int MyExecute (char **);
|
extern int MyExecute (char **);
|
||||||
#endif
|
#else
|
||||||
#endif /* WIN32 */
|
#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__
|
#ifdef __MSDOS__
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
static int execute_by_shell;
|
||||||
static int dos_pid = 123;
|
static int dos_pid = 123;
|
||||||
static int dos_status;
|
int dos_status;
|
||||||
static char *dos_bname;
|
int dos_command_running;
|
||||||
static char *dos_bename;
|
#endif /* __MSDOS__ */
|
||||||
static int dos_batch_file;
|
|
||||||
#endif /* MSDOS. */
|
|
||||||
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
@@ -61,7 +68,7 @@ static int amiga_batch_file;
|
|||||||
#include <lib$routines.h>
|
#include <lib$routines.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
@@ -73,7 +80,7 @@ static int amiga_batch_file;
|
|||||||
static char *dos_bname;
|
static char *dos_bname;
|
||||||
static char *dos_bename;
|
static char *dos_bename;
|
||||||
static int dos_batch_file;
|
static int dos_batch_file;
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <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. */
|
/* Chain of children waiting to run until the load average goes down. */
|
||||||
|
|
||||||
static struct child *waiting_jobs = 0;
|
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.
|
* 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);
|
return ((process_kill(pid, sig) == TRUE) ? 0 : -1);
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
/* Write an error message describing the exit status given in
|
/* Write an error message describing the exit status given in
|
||||||
EXIT_CODE, EXIT_SIG, and COREDUMP, for the target TARGET_NAME.
|
EXIT_CODE, EXIT_SIG, and COREDUMP, for the target TARGET_NAME.
|
||||||
@@ -342,7 +353,7 @@ reap_children (block, err)
|
|||||||
}
|
}
|
||||||
else if (pid == 0)
|
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. */
|
/* No remote children. Check for local children. */
|
||||||
|
|
||||||
if (any_local)
|
if (any_local)
|
||||||
@@ -396,13 +407,15 @@ reap_children (block, err)
|
|||||||
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
|
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
|
||||||
coredump = WCOREDUMP (status);
|
coredump = WCOREDUMP (status);
|
||||||
}
|
}
|
||||||
#else /* MSDOS, Amiga, WIN32. */
|
#else /* __MSDOS__, Amiga, WINDOWS32. */
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
/* Life is very different on MSDOS. */
|
/* Life is very different on MSDOS. */
|
||||||
pid = dos_pid - 1;
|
pid = dos_pid - 1;
|
||||||
status = dos_status;
|
status = dos_status;
|
||||||
exit_code = dos_status;
|
exit_code = WEXITSTATUS (status);
|
||||||
exit_sig = 0;
|
if (exit_code == 0xff)
|
||||||
|
exit_code = -1;
|
||||||
|
exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0;
|
||||||
coredump = 0;
|
coredump = 0;
|
||||||
#endif /* __MSDOS__ */
|
#endif /* __MSDOS__ */
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
@@ -413,7 +426,7 @@ reap_children (block, err)
|
|||||||
exit_sig = 0;
|
exit_sig = 0;
|
||||||
coredump = 0;
|
coredump = 0;
|
||||||
#endif /* _AMIGA */
|
#endif /* _AMIGA */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
{
|
{
|
||||||
HANDLE hPID;
|
HANDLE hPID;
|
||||||
int err;
|
int err;
|
||||||
@@ -429,7 +442,7 @@ reap_children (block, err)
|
|||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
fprintf(stderr, "make (e=%d): %s",
|
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);
|
exit_sig = process_signal(hPID);
|
||||||
|
|
||||||
@@ -446,8 +459,8 @@ reap_children (block, err)
|
|||||||
}
|
}
|
||||||
pid = (int) hPID;
|
pid = (int) hPID;
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
#endif /* Not MSDOS. */
|
#endif /* Not __MSDOS__ */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* We got a remote child. */
|
/* We got a remote child. */
|
||||||
@@ -655,13 +668,6 @@ block_sigs ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POSIX
|
#ifdef POSIX
|
||||||
#ifdef __MSDOS__
|
|
||||||
void
|
|
||||||
unblock_sigs ()
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void
|
void
|
||||||
unblock_sigs ()
|
unblock_sigs ()
|
||||||
{
|
{
|
||||||
@@ -670,7 +676,6 @@ unblock_sigs ()
|
|||||||
sigprocmask (SIG_SETMASK, &empty, (sigset_t *) 0);
|
sigprocmask (SIG_SETMASK, &empty, (sigset_t *) 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Start a job to run the commands specified in CHILD.
|
/* Start a job to run the commands specified in CHILD.
|
||||||
CHILD is updated to reflect the commands and ID of the child process.
|
CHILD is updated to reflect the commands and ID of the child process.
|
||||||
@@ -805,9 +810,10 @@ start_job_command (child)
|
|||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifndef _AMIGA
|
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
|
#ifndef WINDOWS32
|
||||||
|
#ifndef _AMIGA
|
||||||
|
#ifndef __MSDOS__
|
||||||
|
|
||||||
/* Set up a bad standard input that reads from a broken pipe. */
|
/* Set up a bad standard input that reads from a broken pipe. */
|
||||||
|
|
||||||
@@ -836,7 +842,8 @@ start_job_command (child)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !AMIGA */
|
#endif /* !AMIGA */
|
||||||
#endif /* !WIN32 */
|
#endif /* !WINDOWS32 */
|
||||||
|
#endif /* !__MSDOS__ */
|
||||||
|
|
||||||
/* Decide whether to give this child the `good' standard input
|
/* Decide whether to give this child the `good' standard input
|
||||||
(one that points to the terminal or whatever), or the `bad' one
|
(one that points to the terminal or whatever), or the `bad' one
|
||||||
@@ -856,7 +863,7 @@ start_job_command (child)
|
|||||||
child->environment = target_environment (child->file);
|
child->environment = target_environment (child->file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WIN32)
|
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
|
||||||
|
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
/* start_waiting_job has set CHILD->remote if we can start a remote job. */
|
/* start_waiting_job has set CHILD->remote if we can start a remote job. */
|
||||||
@@ -919,20 +926,55 @@ start_job_command (child)
|
|||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* MSDOS or Amiga. */
|
#else /* __MSDOS__ or Amiga or WINDOWS32 */
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
dos_status = spawnvpe (P_WAIT, argv[0], argv, child->environment);
|
{
|
||||||
|
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;
|
++dead_children;
|
||||||
child->pid = dos_pid++;
|
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);
|
|
||||||
}
|
}
|
||||||
#endif /* __MSDOS__ */
|
#endif /* __MSDOS__ */
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
@@ -945,8 +987,8 @@ start_job_command (child)
|
|||||||
amiga_batch_file = 0;
|
amiga_batch_file = 0;
|
||||||
DeleteFile (amiga_bname); /* Ignore errors. */
|
DeleteFile (amiga_bname); /* Ignore errors. */
|
||||||
}
|
}
|
||||||
#endif /* Not Amiga */
|
#endif /* Amiga */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
{
|
{
|
||||||
HANDLE hPID;
|
HANDLE hPID;
|
||||||
char* arg0;
|
char* arg0;
|
||||||
@@ -976,8 +1018,8 @@ start_job_command (child)
|
|||||||
fprintf(stderr, "\nCounted %d args in failed launch\n", i);
|
fprintf(stderr, "\nCounted %d args in failed launch\n", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
#endif /* Not MSDOS. */
|
#endif /* __MSDOS__ or Amiga or WINDOWS32 */
|
||||||
|
|
||||||
/* We are the parent side. Set the state to
|
/* We are the parent side. Set the state to
|
||||||
say the commands are running and return. */
|
say the commands are running and return. */
|
||||||
@@ -1101,7 +1143,7 @@ new_job (file)
|
|||||||
/* IN points to where in the line we are scanning.
|
/* IN points to where in the line we are scanning.
|
||||||
OUT points to where in the line we are writing.
|
OUT points to where in the line we are writing.
|
||||||
When we collapse a backslash-newline combination,
|
When we collapse a backslash-newline combination,
|
||||||
IN gets ahead out OUT. */
|
IN gets ahead of OUT. */
|
||||||
|
|
||||||
in = out = cmds->command_lines[i];
|
in = out = cmds->command_lines[i];
|
||||||
while ((ref = index (in, '$')) != 0)
|
while ((ref = index (in, '$')) != 0)
|
||||||
@@ -1295,7 +1337,7 @@ start_waiting_jobs ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WINDOWS32
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
#include <descrip.h>
|
#include <descrip.h>
|
||||||
#include <clidef.h>
|
#include <clidef.h>
|
||||||
@@ -1508,7 +1550,7 @@ child_execute_job (argv, child)
|
|||||||
|
|
||||||
#else /* !VMS */
|
#else /* !VMS */
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#if !defined (_AMIGA) && !defined (__MSDOS__)
|
||||||
/* UNIX:
|
/* UNIX:
|
||||||
Replace the current process with one executing the command in ARGV.
|
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
|
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. */
|
/* Run the command. */
|
||||||
exec_command (argv, envp);
|
exec_command (argv, envp);
|
||||||
}
|
}
|
||||||
#endif /* !AMIGA */
|
#endif /* !AMIGA && !__MSDOS__ */
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
#endif /* !WIN32 */
|
#endif /* !WINDOWS32 */
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
/* Replace the current process with one running the command in ARGV,
|
/* Replace the current process with one running the command in ARGV,
|
||||||
@@ -1614,7 +1656,7 @@ void clean_tmp (void)
|
|||||||
DeleteFile (amiga_bname);
|
DeleteFile (amiga_bname);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* An Amiga */
|
#endif /* On Amiga */
|
||||||
|
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
/* Figure out the argument list necessary to run LINE as a command. Try to
|
/* 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;
|
char *shell, *ifs;
|
||||||
{
|
{
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
static char sh_chars[] = "\"|<>";
|
/* MSDOS supports both the stock DOS shell and ports of Unixy shells.
|
||||||
static char *sh_cmds[] = { "break", "call", "cd", "chcp", "chdir", "cls",
|
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",
|
"copy", "ctty", "date", "del", "dir", "echo",
|
||||||
"erase", "exit", "for", "goto", "if", "if", "md",
|
"erase", "exit", "for", "goto", "if", "md",
|
||||||
"mkdir", "path", "pause", "prompt", "rem", "ren",
|
"mkdir", "path", "pause", "prompt", "rd",
|
||||||
"rename", "set", "shift", "time", "type",
|
"rmdir", "rem", "ren", "rename", "set",
|
||||||
"ver", "verify", "vol", ":", 0 };
|
"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
|
#else
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
static char sh_chars[] = "#;\"|<>()?*$`";
|
static char sh_chars[] = "#;\"|<>()?*$`";
|
||||||
@@ -1652,7 +1727,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
"unset", "unsetenv", "version",
|
"unset", "unsetenv", "version",
|
||||||
0 };
|
0 };
|
||||||
#else
|
#else
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
static char sh_chars_dos[] = "\"|<>";
|
static char sh_chars_dos[] = "\"|<>";
|
||||||
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
|
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
|
||||||
"copy", "ctty", "date", "del", "dir", "echo",
|
"copy", "ctty", "date", "del", "dir", "echo",
|
||||||
@@ -1668,23 +1743,23 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
"trap", "switch", "test", 0 };
|
"trap", "switch", "test", 0 };
|
||||||
char* sh_chars;
|
char* sh_chars;
|
||||||
char** sh_cmds;
|
char** sh_cmds;
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
static char sh_chars[] = "#;\"*?[]&|<>(){}$`^";
|
static char sh_chars[] = "#;\"*?[]&|<>(){}$`^";
|
||||||
static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
|
static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
|
||||||
"logout", "set", "umask", "wait", "while", "for",
|
"logout", "set", "umask", "wait", "while", "for",
|
||||||
"case", "if", ":", ".", "break", "continue",
|
"case", "if", ":", ".", "break", "continue",
|
||||||
"export", "read", "readonly", "shift", "times",
|
"export", "read", "readonly", "shift", "times",
|
||||||
"trap", "switch", 0 };
|
"trap", "switch", 0 };
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
#endif /* Amiga */
|
#endif /* Amiga */
|
||||||
#endif /* MSDOS */
|
#endif /* __MSDOS__ */
|
||||||
register int i;
|
register int i;
|
||||||
register char *p;
|
register char *p;
|
||||||
register char *ap;
|
register char *ap;
|
||||||
char *end;
|
char *end;
|
||||||
int instring, word_has_equals, seen_nonequals;
|
int instring, word_has_equals, seen_nonequals, last_argument_was_empty;
|
||||||
char **new_argv = 0;
|
char **new_argv = 0;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
int slow_flag = 0;
|
int slow_flag = 0;
|
||||||
|
|
||||||
if (no_default_sh_exe) {
|
if (no_default_sh_exe) {
|
||||||
@@ -1694,7 +1769,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
sh_cmds = sh_cmds_sh;
|
sh_cmds = sh_cmds_sh;
|
||||||
sh_chars = sh_chars_sh;
|
sh_chars = sh_chars_sh;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
if (restp != NULL)
|
if (restp != NULL)
|
||||||
*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. */
|
/* See if it is safe to parse commands internally. */
|
||||||
if (shell == 0)
|
if (shell == 0)
|
||||||
shell = default_shell;
|
shell = default_shell;
|
||||||
|
#ifdef WINDOWS32
|
||||||
else if (strcmp (shell, default_shell))
|
else if (strcmp (shell, default_shell))
|
||||||
#ifdef WIN32
|
|
||||||
{
|
{
|
||||||
char *s1 = _fullpath(NULL, shell, 0);
|
char *s1 = _fullpath(NULL, shell, 0);
|
||||||
char *s2 = _fullpath(NULL, default_shell, 0);
|
char *s2 = _fullpath(NULL, default_shell, 0);
|
||||||
@@ -1722,8 +1797,32 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
free(s2);
|
free(s2);
|
||||||
}
|
}
|
||||||
if (slow_flag)
|
if (slow_flag)
|
||||||
#endif /* WIN32 */
|
|
||||||
goto slow;
|
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)
|
if (ifs != 0)
|
||||||
for (ap = ifs; *ap != '\0'; ++ap)
|
for (ap = ifs; *ap != '\0'; ++ap)
|
||||||
@@ -1741,7 +1840,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
|
|
||||||
/* I is how many complete arguments have been found. */
|
/* I is how many complete arguments have been found. */
|
||||||
i = 0;
|
i = 0;
|
||||||
instring = word_has_equals = seen_nonequals = 0;
|
instring = word_has_equals = seen_nonequals = last_argument_was_empty = 0;
|
||||||
for (p = line; *p != '\0'; ++p)
|
for (p = line; *p != '\0'; ++p)
|
||||||
{
|
{
|
||||||
if (ap > end)
|
if (ap > end)
|
||||||
@@ -1753,7 +1852,11 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
/* Inside a string, just copy any char except a closing quote
|
/* Inside a string, just copy any char except a closing quote
|
||||||
or a backslash-newline combination. */
|
or a backslash-newline combination. */
|
||||||
if (*p == instring)
|
if (*p == instring)
|
||||||
|
{
|
||||||
instring = 0;
|
instring = 0;
|
||||||
|
if (*ap == '\0')
|
||||||
|
last_argument_was_empty = 1;
|
||||||
|
}
|
||||||
else if (*p == '\\' && p[1] == '\n')
|
else if (*p == '\\' && p[1] == '\n')
|
||||||
goto swallow_escaped_newline;
|
goto swallow_escaped_newline;
|
||||||
else if (*p == '\n' && restp != NULL)
|
else if (*p == '\n' && restp != NULL)
|
||||||
@@ -1763,8 +1866,10 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
goto end_of_line;
|
goto end_of_line;
|
||||||
}
|
}
|
||||||
/* Backslash, $, and ` are special inside double quotes.
|
/* Backslash, $, and ` are special inside double quotes.
|
||||||
If we see any of those, punt. */
|
If we see any of those, punt.
|
||||||
else if (instring == '"' && index ("\\$`", *p) != 0)
|
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;
|
goto slow;
|
||||||
else
|
else
|
||||||
*ap++ = *p;
|
*ap++ = *p;
|
||||||
@@ -1772,6 +1877,11 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
else if (index (sh_chars, *p) != 0)
|
else if (index (sh_chars, *p) != 0)
|
||||||
/* Not inside a string, but it's a special char. */
|
/* Not inside a string, but it's a special char. */
|
||||||
goto slow;
|
goto slow;
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
else if (*p == '.' && p[1] == '.' && p[2] == '.' && p[3] != '.')
|
||||||
|
/* `...' is a wildcard in DJGPP. */
|
||||||
|
goto slow;
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
/* Not a special char. */
|
/* Not a special char. */
|
||||||
switch (*p)
|
switch (*p)
|
||||||
@@ -1781,7 +1891,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
first word with no equals sign in it. This is not the case
|
first word with no equals sign in it. This is not the case
|
||||||
with sh -k, but we never get here when using nonstandard
|
with sh -k, but we never get here when using nonstandard
|
||||||
shell flags. */
|
shell flags. */
|
||||||
if (! seen_nonequals)
|
if (! seen_nonequals && unixy_shell)
|
||||||
goto slow;
|
goto slow;
|
||||||
word_has_equals = 1;
|
word_has_equals = 1;
|
||||||
*ap++ = '=';
|
*ap++ = '=';
|
||||||
@@ -1846,6 +1956,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
Terminate the text of the argument. */
|
Terminate the text of the argument. */
|
||||||
*ap++ = '\0';
|
*ap++ = '\0';
|
||||||
new_argv[++i] = ap;
|
new_argv[++i] = ap;
|
||||||
|
last_argument_was_empty = 0;
|
||||||
|
|
||||||
/* Update SEEN_NONEQUALS, which tells us if every word
|
/* Update SEEN_NONEQUALS, which tells us if every word
|
||||||
heretofore has contained an `='. */
|
heretofore has contained an `='. */
|
||||||
@@ -1887,7 +1998,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
/* Terminate the last argument and the argument list. */
|
/* Terminate the last argument and the argument list. */
|
||||||
|
|
||||||
*ap = '\0';
|
*ap = '\0';
|
||||||
if (new_argv[i][0] != '\0')
|
if (new_argv[i][0] != '\0' || last_argument_was_empty)
|
||||||
++i;
|
++i;
|
||||||
new_argv[i] = 0;
|
new_argv[i] = 0;
|
||||||
|
|
||||||
@@ -1914,58 +2025,11 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
free (new_argv[0]);
|
free (new_argv[0]);
|
||||||
free ((void *)new_argv);
|
free ((void *)new_argv);
|
||||||
}
|
}
|
||||||
#ifdef WIN32
|
|
||||||
/*
|
|
||||||
* Not eating this whitespace caused things like
|
|
||||||
*
|
|
||||||
* sh -c "\n"
|
|
||||||
*
|
|
||||||
* which gave the shell fits. I think we have to eat
|
|
||||||
* whitespace here, but this code should be considered
|
|
||||||
* suspicious if things start failing....
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Make sure not to bother processing an empty line. */
|
#ifdef __MSDOS__
|
||||||
while (isspace (*line))
|
execute_by_shell = 1; /* actually, call `system' if shell isn't unixy */
|
||||||
++line;
|
|
||||||
if (*line == '\0')
|
|
||||||
return 0;
|
|
||||||
#endif
|
#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
|
#ifdef _AMIGA
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
@@ -1993,14 +2057,56 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
new_argv[0] = buffer;
|
new_argv[0] = buffer;
|
||||||
new_argv[1] = 0;
|
new_argv[1] = 0;
|
||||||
}
|
}
|
||||||
#else /* Not MSDOS or Amiga */
|
#else /* Not Amiga */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* This is technically an else to the above 'if (no_default_sh_exe)',
|
* Not eating this whitespace caused things like
|
||||||
* but (IMHO) coding if-else across ifdef is dangerous.
|
*
|
||||||
|
* sh -c "\n"
|
||||||
|
*
|
||||||
|
* which gave the shell fits. I think we have to eat
|
||||||
|
* whitespace here, but this code should be considered
|
||||||
|
* suspicious if things start failing....
|
||||||
*/
|
*/
|
||||||
if (!no_default_sh_exe)
|
|
||||||
#endif
|
/* Make sure not to bother processing an empty line. */
|
||||||
|
while (isspace (*line))
|
||||||
|
++line;
|
||||||
|
if (*line == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* only come here if no sh.exe command
|
||||||
|
*/
|
||||||
|
if (no_default_sh_exe)
|
||||||
|
{
|
||||||
|
FILE *batch;
|
||||||
|
dos_batch_file = 1;
|
||||||
|
if (dos_bname == 0)
|
||||||
|
{
|
||||||
|
dos_bname = tempnam (".", "mk");
|
||||||
|
for (i = 0; dos_bname[i] != '\0'; ++i)
|
||||||
|
if (dos_bname[i] == '/')
|
||||||
|
dos_bname[i] = '\\';
|
||||||
|
dos_bename = (char *) xmalloc (strlen (dos_bname) + 5);
|
||||||
|
strcpy (dos_bename, dos_bname);
|
||||||
|
strcat (dos_bname, ".bat");
|
||||||
|
strcat (dos_bename, ".err");
|
||||||
|
}
|
||||||
|
batch = fopen (dos_bename, "w"); /* Create a file. */
|
||||||
|
if (batch != NULL)
|
||||||
|
fclose (batch);
|
||||||
|
batch = fopen (dos_bname, "w");
|
||||||
|
fputs ("@echo off\n", batch);
|
||||||
|
fputs (line, batch);
|
||||||
|
fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename);
|
||||||
|
fclose (batch);
|
||||||
|
new_argv = (char **) xmalloc(2 * sizeof(char *));
|
||||||
|
new_argv[0] = strdup (dos_bname);
|
||||||
|
new_argv[1] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
{
|
{
|
||||||
/* SHELL may be a multi-word command. Construct a command line
|
/* SHELL may be a multi-word command. Construct a command line
|
||||||
"SHELL -c LINE", with all special chars in LINE escaped.
|
"SHELL -c LINE", with all special chars in LINE escaped.
|
||||||
@@ -2038,27 +2144,57 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
since it was most likely used to line
|
since it was most likely used to line
|
||||||
up the continued line with the previous one. */
|
up the continued line with the previous one. */
|
||||||
if (*p == '\t')
|
if (*p == '\t')
|
||||||
strcpy (p, p + 1);
|
bcopy (p + 1, p, strlen (p));
|
||||||
|
|
||||||
p = next_token (p);
|
p = next_token (p);
|
||||||
--p;
|
--p;
|
||||||
|
if (unixy_shell)
|
||||||
*ap++ = '\\';
|
*ap++ = '\\';
|
||||||
*ap++ = ' ';
|
*ap++ = ' ';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*p == '\\' || *p == '\'' || *p == '"'
|
/* DOS shells don't know about backslash-escaping. */
|
||||||
|
if (unixy_shell &&
|
||||||
|
(*p == '\\' || *p == '\'' || *p == '"'
|
||||||
|| isspace (*p)
|
|| isspace (*p)
|
||||||
|| index (sh_chars, *p) != 0)
|
|| index (sh_chars, *p) != 0))
|
||||||
*ap++ = '\\';
|
*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;
|
*ap++ = *p;
|
||||||
}
|
}
|
||||||
|
if (ap == new_line + shell_len + sizeof (minus_c) - 1)
|
||||||
|
/* Line was empty. */
|
||||||
|
return 0;
|
||||||
*ap = '\0';
|
*ap = '\0';
|
||||||
|
|
||||||
|
if (unixy_shell)
|
||||||
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
|
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
|
||||||
(char *) 0, (char *) 0);
|
(char *) 0, (char *) 0);
|
||||||
|
#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 /* Not MSDOS nor Amiga. */
|
#endif
|
||||||
|
}
|
||||||
|
#endif /* ! AMIGA */
|
||||||
|
|
||||||
return new_argv;
|
return new_argv;
|
||||||
}
|
}
|
||||||
@@ -2090,7 +2226,7 @@ construct_command_argv (line, restp, file)
|
|||||||
warn_undefined_variables_flag = 0;
|
warn_undefined_variables_flag = 0;
|
||||||
|
|
||||||
shell = allocated_variable_expand_for_file ("$(SHELL)", file);
|
shell = allocated_variable_expand_for_file ("$(SHELL)", file);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Convert to forward slashes so that construct_command_argv_internal()
|
* Convert to forward slashes so that construct_command_argv_internal()
|
||||||
* is not confused.
|
* is not confused.
|
||||||
|
|||||||
253
main.c
253
main.c
@@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
# include <dos/dos.h>
|
# include <dos/dos.h>
|
||||||
# include <proto/dos.h>
|
# include <proto/dos.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -129,7 +129,7 @@ int just_print_flag;
|
|||||||
|
|
||||||
int debug_flag = 0;
|
int debug_flag = 0;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/* Suspend make in main for a short time to allow debugger to attach */
|
/* Suspend make in main for a short time to allow debugger to attach */
|
||||||
|
|
||||||
int suspend_flag = 0;
|
int suspend_flag = 0;
|
||||||
@@ -240,7 +240,7 @@ static const struct command_switch switches[] =
|
|||||||
{ 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
|
{ 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
|
||||||
"debug", 0,
|
"debug", 0,
|
||||||
"Print lots of debugging information" },
|
"Print lots of debugging information" },
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
{ 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
|
{ 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
|
||||||
"suspend-for-debug", 0,
|
"suspend-for-debug", 0,
|
||||||
"Suspend process to allow a debugger to attach" },
|
"Suspend process to allow a debugger to attach" },
|
||||||
@@ -450,6 +450,96 @@ debug_signal_handler (sig)
|
|||||||
debug_flag = ! debug_flag;
|
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
|
#ifndef _AMIGA
|
||||||
int
|
int
|
||||||
main (argc, argv, envp)
|
main (argc, argv, envp)
|
||||||
@@ -465,16 +555,30 @@ int main (int argc, char ** argv)
|
|||||||
char **p;
|
char **p;
|
||||||
struct dep *read_makefiles;
|
struct dep *read_makefiles;
|
||||||
PATH_VAR (current_directory);
|
PATH_VAR (current_directory);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
extern int no_default_sh_exe;
|
extern int no_default_sh_exe;
|
||||||
char *unix_path = NULL;
|
char *unix_path = NULL;
|
||||||
char *win32_path = NULL;
|
char *windows32_path = NULL;
|
||||||
|
|
||||||
|
SetUnhandledExceptionFilter(handle_runtime_exceptions);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default_goal_file = 0;
|
default_goal_file = 0;
|
||||||
reading_filename = 0;
|
reading_filename = 0;
|
||||||
reading_lineno_ptr = 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)
|
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
||||||
signame_init ();
|
signame_init ();
|
||||||
#endif
|
#endif
|
||||||
@@ -547,8 +651,16 @@ int main (int argc, char ** argv)
|
|||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
if (program == 0)
|
if (program == 0)
|
||||||
program = rindex (argv[0], '\\');
|
program = rindex (argv[0], '\\');
|
||||||
if (program == 0)
|
else
|
||||||
program = rindex (argv[0], ':');
|
{
|
||||||
|
/* 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
|
#endif
|
||||||
if (program == 0)
|
if (program == 0)
|
||||||
program = argv[0];
|
program = argv[0];
|
||||||
@@ -561,7 +673,7 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
/* Figure out where we are. */
|
/* Figure out where we are. */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
||||||
#else
|
#else
|
||||||
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
||||||
@@ -578,10 +690,14 @@ int main (int argc, char ** argv)
|
|||||||
else
|
else
|
||||||
directory_before_chdir = savestring (current_directory,
|
directory_before_chdir = savestring (current_directory,
|
||||||
strlen (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
|
/* 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
|
done before $(MAKE) is figured out so its definitions will not be
|
||||||
one from the environment. */
|
from the environment. */
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
for (i = 0; envp[i] != 0; ++i)
|
for (i = 0; envp[i] != 0; ++i)
|
||||||
@@ -589,11 +705,11 @@ int main (int argc, char ** argv)
|
|||||||
register char *ep = envp[i];
|
register char *ep = envp[i];
|
||||||
while (*ep != '=')
|
while (*ep != '=')
|
||||||
++ep;
|
++ep;
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (!strncmp(ep, "PATH", 4))
|
if (!unix_path && !strncmp(envp[i], "PATH=", 5))
|
||||||
unix_path = &ep[5];
|
unix_path = ep+1;
|
||||||
if (!strncmp(ep, "Path", 4))
|
if (!windows32_path && !strncmp(envp[i], "Path=", 5))
|
||||||
win32_path = &ep[5];
|
windows32_path = ep+1;
|
||||||
#endif
|
#endif
|
||||||
/* The result of pointer arithmetic is cast to unsigned int for
|
/* The result of pointer arithmetic is cast to unsigned int for
|
||||||
machines where ptrdiff_t is a different size that doesn't widen
|
machines where ptrdiff_t is a different size that doesn't widen
|
||||||
@@ -607,12 +723,12 @@ int main (int argc, char ** argv)
|
|||||||
be exported, because it was originally in the environment. */
|
be exported, because it was originally in the environment. */
|
||||||
->export = v_export;
|
->export = v_export;
|
||||||
}
|
}
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* PATH defaults to Path iff PATH not found and Path is found.
|
* PATH defaults to Path iff PATH not found and Path is found.
|
||||||
*/
|
*/
|
||||||
if (!unix_path && win32_path)
|
if (!unix_path && windows32_path)
|
||||||
define_variable("PATH", 4, win32_path, o_env, 1)->export = v_export;
|
define_variable("PATH", 4, windows32_path, o_env, 1)->export = v_export;
|
||||||
#endif
|
#endif
|
||||||
#else /* For Amiga, read the ENV: device, ignoring all dirs */
|
#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);
|
decode_env_switches ("MFLAGS", 6);
|
||||||
#endif
|
#endif
|
||||||
decode_switches (argc, argv, 0);
|
decode_switches (argc, argv, 0);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (suspend_flag) {
|
if (suspend_flag) {
|
||||||
fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId());
|
fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId());
|
||||||
fprintf(stderr, "%s is suspending for 30 seconds...", argv[0]);
|
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.
|
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
|
If it is a name with no slash, we can only hope that PATH did not
|
||||||
find it in the current directory.) */
|
find it in the current directory.) */
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Convert from backslashes to forward slashes for
|
* Convert from backslashes to forward slashes for
|
||||||
* programs like sh which don't like them. Shouldn't
|
* programs like sh which don't like them. Shouldn't
|
||||||
@@ -690,11 +806,11 @@ int main (int argc, char ** argv)
|
|||||||
strstr(argv[0], "..") ||
|
strstr(argv[0], "..") ||
|
||||||
!strncmp(argv[0], "//", 2))
|
!strncmp(argv[0], "//", 2))
|
||||||
argv[0] = strdup(w32ify(argv[0],1));
|
argv[0] = strdup(w32ify(argv[0],1));
|
||||||
#else /* WIN32 */
|
#else /* WINDOWS32 */
|
||||||
if (current_directory[0] != '\0'
|
if (current_directory[0] != '\0'
|
||||||
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
|
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
|
||||||
argv[0] = concat (current_directory, "/", argv[0]);
|
argv[0] = concat (current_directory, "/", argv[0]);
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The extra indirection through $(MAKE_COMMAND) is done
|
/* The extra indirection through $(MAKE_COMMAND) is done
|
||||||
@@ -767,7 +883,7 @@ int main (int argc, char ** argv)
|
|||||||
free (dir);
|
free (dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER
|
* THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER
|
||||||
* TO NOT CONFUSE THE DEPENDENCY CHECKING CODE IN implicit.c.
|
* 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. */
|
/* Figure out the level of recursion. */
|
||||||
{
|
{
|
||||||
struct variable *v = lookup_variable ("MAKELEVEL", 9);
|
struct variable *v = lookup_variable ("MAKELEVEL", 9);
|
||||||
@@ -868,7 +984,7 @@ int main (int argc, char ** argv)
|
|||||||
starting_directory = current_directory;
|
starting_directory = current_directory;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
||||||
#else
|
#else
|
||||||
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
||||||
@@ -985,7 +1101,7 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
define_makeflags (0, 0);
|
define_makeflags (0, 0);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Now that makefiles are parsed, see if a Makefile gave a
|
* Now that makefiles are parsed, see if a Makefile gave a
|
||||||
* value for SHELL and use that for default_shell instead if
|
* 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.");
|
error("Resetting make for single job mode.");
|
||||||
job_slots = 1;
|
job_slots = 1;
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
/* Define the default variables. */
|
/* Define the default variables. */
|
||||||
define_default_variables ();
|
define_default_variables ();
|
||||||
@@ -1042,6 +1158,28 @@ int main (int argc, char ** argv)
|
|||||||
read_makefiles
|
read_makefiles
|
||||||
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
|
= read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list);
|
||||||
|
|
||||||
|
#ifdef __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 switches again, in case the variables were set by the makefile. */
|
||||||
decode_env_switches ("MAKEFLAGS", 9);
|
decode_env_switches ("MAKEFLAGS", 9);
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1111,6 +1249,8 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
time_t *makefile_mtimes = 0;
|
time_t *makefile_mtimes = 0;
|
||||||
unsigned int mm_idx = 0;
|
unsigned int mm_idx = 0;
|
||||||
|
char **nargv = argv;
|
||||||
|
char nargc = argc;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
puts ("Updating makefiles....");
|
puts ("Updating makefiles....");
|
||||||
@@ -1193,11 +1333,9 @@ int main (int argc, char ** argv)
|
|||||||
in updating or could not be found at all. */
|
in updating or could not be found at all. */
|
||||||
int any_failed = 0;
|
int any_failed = 0;
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
|
struct dep *d;
|
||||||
|
|
||||||
for (i = 0; read_makefiles != 0; ++i)
|
for (i = 0, d = read_makefiles; d != 0; ++i, d = d->next)
|
||||||
{
|
|
||||||
struct dep *d = read_makefiles;
|
|
||||||
read_makefiles = d->next;
|
|
||||||
if (d->file->updated)
|
if (d->file->updated)
|
||||||
{
|
{
|
||||||
/* This makefile was updated. */
|
/* This makefile was updated. */
|
||||||
@@ -1237,9 +1375,6 @@ int main (int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free ((char *) d);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (any_remade)
|
if (any_remade)
|
||||||
goto re_exec;
|
goto re_exec;
|
||||||
else if (any_failed)
|
else if (any_failed)
|
||||||
@@ -1264,7 +1399,7 @@ int main (int argc, char ** argv)
|
|||||||
/* These names might have changed. */
|
/* These names might have changed. */
|
||||||
register unsigned int i, j = 0;
|
register unsigned int i, j = 0;
|
||||||
for (i = 1; i < argc; ++i)
|
for (i = 1; i < argc; ++i)
|
||||||
if (!strcmp (argv[i], "-f")) /* XXX */
|
if (!strncmp (argv[i], "-f", 2)) /* XXX */
|
||||||
{
|
{
|
||||||
char *p = &argv[i][2];
|
char *p = &argv[i][2];
|
||||||
if (*p == '\0')
|
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)
|
if (directories != 0 && directories->idx > 0)
|
||||||
{
|
{
|
||||||
char bad;
|
char bad;
|
||||||
@@ -1326,7 +1480,7 @@ int main (int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
char **p;
|
char **p;
|
||||||
fputs ("Re-executing:", stdout);
|
fputs ("Re-executing:", stdout);
|
||||||
for (p = argv; *p != 0; ++p)
|
for (p = nargv; *p != 0; ++p)
|
||||||
printf (" %s", *p);
|
printf (" %s", *p);
|
||||||
puts ("");
|
puts ("");
|
||||||
}
|
}
|
||||||
@@ -1335,9 +1489,9 @@ int main (int argc, char ** argv)
|
|||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
|
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
exec_command (argv, environ);
|
exec_command (nargv, environ);
|
||||||
#else
|
#else
|
||||||
exec_command (argv);
|
exec_command (nargv);
|
||||||
exit (0);
|
exit (0);
|
||||||
#endif
|
#endif
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
@@ -1514,6 +1668,29 @@ handle_non_switch_argument (arg, env)
|
|||||||
}
|
}
|
||||||
lastgoal->name = 0;
|
lastgoal->name = 0;
|
||||||
lastgoal->file = f;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
215
make-stds.texi
215
make-stds.texi
@@ -28,6 +28,8 @@ describes conventions for writing the Makefiles for GNU programs.
|
|||||||
* Command Variables:: Variables for Specifying Commands
|
* Command Variables:: Variables for Specifying Commands
|
||||||
* Directory Variables:: Variables for Installation Directories
|
* Directory Variables:: Variables for Installation Directories
|
||||||
* Standard Targets:: Standard Targets for Users
|
* Standard Targets:: Standard Targets for Users
|
||||||
|
* Install Command Categories:: Three categories of commands in the `install'
|
||||||
|
rule: normal, pre-install and post-install.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Makefile Basics
|
@node Makefile Basics
|
||||||
@@ -65,9 +67,10 @@ part of the make or @file{$(srcdir)/} if the file is an unchanging part
|
|||||||
of the source code. Without one of these prefixes, the current search
|
of the source code. Without one of these prefixes, the current search
|
||||||
path is used.
|
path is used.
|
||||||
|
|
||||||
The distinction between @file{./} and @file{$(srcdir)/} is important
|
The distinction between @file{./} (the @dfn{build directory}) and
|
||||||
when using the @samp{--srcdir} option to @file{configure}. A rule of
|
@file{$(srcdir)/} (the @dfn{source directory}) is important because
|
||||||
the form:
|
users can build in a separate directory using the @samp{--srcdir} option
|
||||||
|
to @file{configure}. A rule of the form:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
foo.1 : foo.man sedscript
|
foo.1 : foo.man sedscript
|
||||||
@@ -75,9 +78,8 @@ foo.1 : foo.man sedscript
|
|||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
will fail when the current directory is not the source directory,
|
will fail when the build directory is not the source directory, because
|
||||||
because @file{foo.man} and @file{sedscript} are not in the current
|
@file{foo.man} and @file{sedscript} are in the the source directory.
|
||||||
directory.
|
|
||||||
|
|
||||||
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
||||||
file will work in the case where there is a single dependency file,
|
file will work in the case where there is a single dependency file,
|
||||||
@@ -109,6 +111,18 @@ foo.1 : foo.man sedscript
|
|||||||
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
GNU distributions usually contain some files which are not source
|
||||||
|
files---for example, Info files, and the output from Autoconf, Automake,
|
||||||
|
Bison or Flex. Since these files normally appear in the source
|
||||||
|
directory, they should always appear in the source directory, not in the
|
||||||
|
build directory. So Makefile rules to update them should put the
|
||||||
|
updated files in the source directory.
|
||||||
|
|
||||||
|
However, if a file does not appear in the distribution, then the
|
||||||
|
Makefile should not put it in the source directory, because building a
|
||||||
|
program in ordinary circumstances should not modify the source directory
|
||||||
|
in any way.
|
||||||
|
|
||||||
Try to make the build and installation targets, at least (and all their
|
Try to make the build and installation targets, at least (and all their
|
||||||
subtargets) work correctly with a parallel @code{make}.
|
subtargets) work correctly with a parallel @code{make}.
|
||||||
|
|
||||||
@@ -122,11 +136,17 @@ special features of @code{ksh} or @code{bash}.
|
|||||||
The @code{configure} script and the Makefile rules for building and
|
The @code{configure} script and the Makefile rules for building and
|
||||||
installation should not use any utilities directly except these:
|
installation should not use any utilities directly except these:
|
||||||
|
|
||||||
|
@c dd find
|
||||||
|
@c gunzip gzip md5sum
|
||||||
|
@c mkfifo mknod tee uname
|
||||||
|
|
||||||
@example
|
@example
|
||||||
cat cmp cp echo egrep expr false grep
|
cat cmp cp diff echo egrep expr false grep install-info
|
||||||
ln mkdir mv pwd rm rmdir sed test touch true
|
ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
The compression program @code{gzip} can be used in the @code{dist} rule.
|
||||||
|
|
||||||
Stick to the generally supported options for these programs. For
|
Stick to the generally supported options for these programs. For
|
||||||
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
||||||
most systems don't support it.
|
most systems don't support it.
|
||||||
@@ -140,26 +160,33 @@ user can substitute alternatives. Here are some of the programs we
|
|||||||
mean:
|
mean:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ar bison cc flex install ld lex
|
ar bison cc flex install ld ldconfig lex
|
||||||
make makeinfo ranlib texi2dvi yacc
|
make makeinfo ranlib texi2dvi yacc
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Use the following @code{make} variables:
|
Use the following @code{make} variables to run those programs:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX)
|
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
|
||||||
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
|
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
When you use @code{ranlib}, you should make sure nothing bad happens if
|
When you use @code{ranlib} or @code{ldconfig}, you should make sure
|
||||||
the system does not have @code{ranlib}. Arrange to ignore an error
|
nothing bad happens if the system does not have the program in question.
|
||||||
from that command, and print a message before the command to tell the
|
Arrange to ignore an error from that command, and print a message before
|
||||||
user that failure of the @code{ranlib} command does not mean a problem.
|
the command to tell the user that failure of this command does not mean
|
||||||
(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.)
|
a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with
|
||||||
|
this.)
|
||||||
|
|
||||||
If you use symbolic links, you should implement a fallback for systems
|
If you use symbolic links, you should implement a fallback for systems
|
||||||
that don't have symbolic links.
|
that don't have symbolic links.
|
||||||
|
|
||||||
|
Additional utilities that can be used via Make variables are:
|
||||||
|
|
||||||
|
@example
|
||||||
|
chgrp chmod chown mknod
|
||||||
|
@end example
|
||||||
|
|
||||||
It is ok to use other utilities in Makefile portions (or scripts)
|
It is ok to use other utilities in Makefile portions (or scripts)
|
||||||
intended only for particular systems where you know those utilities
|
intended only for particular systems where you know those utilities
|
||||||
exist.
|
exist.
|
||||||
@@ -212,6 +239,9 @@ Put @code{CFLAGS} last in the compilation command, after other variables
|
|||||||
containing compiler options, so the user can use @code{CFLAGS} to
|
containing compiler options, so the user can use @code{CFLAGS} to
|
||||||
override the others.
|
override the others.
|
||||||
|
|
||||||
|
@code{CFLAGS} should be used in every invocation of the C compiler,
|
||||||
|
both those which do compilation and those which do linking.
|
||||||
|
|
||||||
Every Makefile should define the variable @code{INSTALL}, which is the
|
Every Makefile should define the variable @code{INSTALL}, which is the
|
||||||
basic command for installing a file into the system.
|
basic command for installing a file into the system.
|
||||||
|
|
||||||
@@ -328,14 +358,11 @@ files. This directory should normally be @file{/usr/local/etc}, but
|
|||||||
write it as @file{$(prefix)/etc}.
|
write it as @file{$(prefix)/etc}.
|
||||||
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
|
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
|
||||||
|
|
||||||
@c rewritten to avoid overfull hbox --tower
|
Do not install executables here in this directory (they probably belong
|
||||||
Do not install executables
|
in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install
|
||||||
@c here
|
files that are modified in the normal course of their use (programs
|
||||||
in this directory (they probably
|
whose purpose is to change the configuration of the system excluded).
|
||||||
belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not
|
Those probably belong in @file{$(localstatedir)}.
|
||||||
install files that are modified in the normal course of their use
|
|
||||||
(programs whose purpose is to change the configuration of the system
|
|
||||||
excluded). Those probably belong in @file{$(localstatedir)}.
|
|
||||||
|
|
||||||
@item sharedstatedir
|
@item sharedstatedir
|
||||||
The directory for installing architecture-independent data files which
|
The directory for installing architecture-independent data files which
|
||||||
@@ -388,7 +415,7 @@ should normally be @file{/usr/local/include}, but write it as
|
|||||||
@file{$(prefix)/include}.
|
@file{$(prefix)/include}.
|
||||||
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
|
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
|
||||||
|
|
||||||
Most compilers other than GCC do not look for header files in
|
Most compilers other than GCC do not look for header files in directory
|
||||||
@file{/usr/local/include}. So installing the header files this way is
|
@file{/usr/local/include}. So installing the header files this way is
|
||||||
only useful with GCC. Sometimes this is not a problem because some
|
only useful with GCC. Sometimes this is not a problem because some
|
||||||
libraries are only really intended to work with GCC. But some libraries
|
libraries are only really intended to work with GCC. But some libraries
|
||||||
@@ -541,6 +568,7 @@ Here is a sample rule to install an Info file:
|
|||||||
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
||||||
@smallexample
|
@smallexample
|
||||||
$(infodir)/foo.info: foo.info
|
$(infodir)/foo.info: foo.info
|
||||||
|
$(POST_INSTALL)
|
||||||
# There may be a newer info file in . than in srcdir.
|
# There may be a newer info file in . than in srcdir.
|
||||||
-if test -f foo.info; then d=.; \
|
-if test -f foo.info; then d=.; \
|
||||||
else d=$(srcdir); fi; \
|
else d=$(srcdir); fi; \
|
||||||
@@ -557,17 +585,24 @@ $(infodir)/foo.info: foo.info
|
|||||||
else true; fi
|
else true; fi
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
When writing the @code{install} target, you must classify all the
|
||||||
|
commands into three categories: normal ones, @dfn{pre-installation}
|
||||||
|
commands and @dfn{post-installation} commands. @xref{Install Command
|
||||||
|
Categories}.
|
||||||
|
|
||||||
@item uninstall
|
@item uninstall
|
||||||
Delete all the installed files that the @samp{install} target would
|
Delete all the installed files---the copies that the @samp{install}
|
||||||
create (but not the noninstalled files such as @samp{make all} would
|
target creates.
|
||||||
create).
|
|
||||||
|
|
||||||
This rule should not modify the directories where compilation is done,
|
This rule should not modify the directories where compilation is done,
|
||||||
only the directories where files are installed.
|
only the directories where files are installed.
|
||||||
|
|
||||||
|
The uninstallation commands are divided into three categories, just like
|
||||||
|
the installation commands. @xref{Install Command Categories}.
|
||||||
|
|
||||||
@item install-strip
|
@item install-strip
|
||||||
Like @code{install}, but strip the executable files while installing
|
Like @code{install}, but strip the executable files while installing
|
||||||
them. The definition of this target can be very simple:
|
them. In many cases, the definition of this target can be very simple:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
install-strip:
|
install-strip:
|
||||||
@@ -652,6 +687,12 @@ You must define the variable @code{MAKEINFO} in the Makefile. It should
|
|||||||
run the @code{makeinfo} program, which is part of the Texinfo
|
run the @code{makeinfo} program, which is part of the Texinfo
|
||||||
distribution.
|
distribution.
|
||||||
|
|
||||||
|
Normally a GNU distribution comes with Info files, and that means the
|
||||||
|
Info files are present in the source directory. Therefore, the Make
|
||||||
|
rule for an info file should update it in the source directory. When
|
||||||
|
users build the package, ordinarily Make will not update the Info files
|
||||||
|
because they will already be up to date.
|
||||||
|
|
||||||
@item dvi
|
@item dvi
|
||||||
Generate DVI files for all Texinfo documentation.
|
Generate DVI files for all Texinfo documentation.
|
||||||
For example:
|
For example:
|
||||||
@@ -734,3 +775,119 @@ installdirs: mkinstalldirs
|
|||||||
This rule should not modify the directories where compilation is done.
|
This rule should not modify the directories where compilation is done.
|
||||||
It should do nothing but create installation directories.
|
It should do nothing but create installation directories.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
@node Install Command Categories
|
||||||
|
@section Install Command Categories
|
||||||
|
|
||||||
|
@cindex pre-installation commands
|
||||||
|
@cindex post-installation commands
|
||||||
|
When writing the @code{install} target, you must classify all the
|
||||||
|
commands into three categories: normal ones, @dfn{pre-installation}
|
||||||
|
commands and @dfn{post-installation} commands.
|
||||||
|
|
||||||
|
Normal commands move files into their proper places, and set their
|
||||||
|
modes. They may not alter any files except the ones that come entirely
|
||||||
|
from the package they belong to.
|
||||||
|
|
||||||
|
Pre-installation and post-installation commands may alter other files;
|
||||||
|
in particular, they can edit global configuration files or data bases.
|
||||||
|
|
||||||
|
Pre-installation commands are typically executed before the normal
|
||||||
|
commands, and post-installation commands are typically run after the
|
||||||
|
normal commands.
|
||||||
|
|
||||||
|
The most common use for a post-installation command is to run
|
||||||
|
@code{install-info}. This cannot be done with a normal command, since
|
||||||
|
it alters a file (the Info directory) which does not come entirely and
|
||||||
|
solely from the package being installed. It is a post-installation
|
||||||
|
command because it needs to be done after the normal command which
|
||||||
|
installs the package's Info files.
|
||||||
|
|
||||||
|
Most programs don't need any pre-installation commands, but we have the
|
||||||
|
feature just in case it is needed.
|
||||||
|
|
||||||
|
To classify the commands in the @code{install} rule into these three
|
||||||
|
categories, insert @dfn{category lines} among them. A category line
|
||||||
|
specifies the category for the commands that follow.
|
||||||
|
|
||||||
|
A category line consists of a tab and a reference to a special Make
|
||||||
|
variable, plus an optional comment at the end. There are three
|
||||||
|
variables you can use, one for each category; the variable name
|
||||||
|
specifies the category. Category lines are no-ops in ordinary execution
|
||||||
|
because these three Make variables are normally undefined (and you
|
||||||
|
@emph{should not} define them in the makefile).
|
||||||
|
|
||||||
|
Here are the three possible category lines, each with a comment that
|
||||||
|
explains what it means:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$(PRE_INSTALL) # @r{Pre-install commands follow.}
|
||||||
|
$(POST_INSTALL) # @r{Post-install commands follow.}
|
||||||
|
$(NORMAL_INSTALL) # @r{Normal commands follow.}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
If you don't use a category line at the beginning of the @code{install}
|
||||||
|
rule, all the commands are classified as normal until the first category
|
||||||
|
line. If you don't use any category lines, all the commands are
|
||||||
|
classified as normal.
|
||||||
|
|
||||||
|
These are the category lines for @code{uninstall}:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.}
|
||||||
|
$(POST_UNINSTALL) # @r{Post-uninstall commands follow.}
|
||||||
|
$(NORMAL_UNINSTALL) # @r{Normal commands follow.}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
Typically, a pre-uninstall command would be used for deleting entries
|
||||||
|
from the Info directory.
|
||||||
|
|
||||||
|
If the @code{install} or @code{uninstall} target has any dependencies
|
||||||
|
which act as subroutines of installation, then you should start
|
||||||
|
@emph{each} dependency's commands with a category line, and start the
|
||||||
|
main target's commands with a category line also. This way, you can
|
||||||
|
ensure that each command is placed in the right category regardless of
|
||||||
|
which of the dependencies actually run.
|
||||||
|
|
||||||
|
Pre-installation and post-installation commands should not run any
|
||||||
|
programs except for these:
|
||||||
|
|
||||||
|
@example
|
||||||
|
[ basename bash cat chgrp chmod chown cmp cp dd diff echo
|
||||||
|
egrep expand expr false fgrep find getopt grep gunzip gzip
|
||||||
|
hostname install install-info kill ldconfig ln ls md5sum
|
||||||
|
mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
|
||||||
|
test touch true uname xargs yes
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@cindex binary packages
|
||||||
|
The reason for distinguishing the commands in this way is for the sake
|
||||||
|
of making binary packages. Typically a binary package contains all the
|
||||||
|
executables and other files that need to be installed, and has its own
|
||||||
|
method of installing them---so it does not need to run the normal
|
||||||
|
installation commands. But installing the binary package does need to
|
||||||
|
execute the pre-installation and post-installation commands.
|
||||||
|
|
||||||
|
Programs to build binary packages work by extracting the
|
||||||
|
pre-installation and post-installation commands. Here is one way of
|
||||||
|
extracting the pre-installation commands:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
make -n install -o all \
|
||||||
|
PRE_INSTALL=pre-install \
|
||||||
|
POST_INSTALL=post-install \
|
||||||
|
NORMAL_INSTALL=normal-install \
|
||||||
|
| gawk -f pre-install.awk
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
where the file @file{pre-install.awk} could contain this:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}
|
||||||
|
on @{print $0@}
|
||||||
|
$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
The resulting file of pre-installation commands is executed as a shell
|
||||||
|
script as part of installing the binary package.
|
||||||
|
|||||||
24
make.h
24
make.h
@@ -137,6 +137,19 @@ extern unsigned int get_path_max PARAMS ((void));
|
|||||||
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
||||||
#endif
|
#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 STAT_MACROS_BROKEN
|
||||||
#ifdef S_ISREG
|
#ifdef S_ISREG
|
||||||
#undef S_ISREG
|
#undef S_ISREG
|
||||||
@@ -202,8 +215,8 @@ extern void exit PARAMS ((int));
|
|||||||
#ifndef bzero
|
#ifndef bzero
|
||||||
#define bzero(s, n) memset ((s), 0, (n))
|
#define bzero(s, n) memset ((s), 0, (n))
|
||||||
#endif
|
#endif
|
||||||
#ifndef bcopy
|
#if defined(HAVE_MEMMOVE) && !defined(bcopy)
|
||||||
#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
#define bcopy(s, d, n) memmove ((d), (s), (n))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Not ANSI_STRING. */
|
#else /* Not ANSI_STRING. */
|
||||||
@@ -277,13 +290,13 @@ extern char *alloca ();
|
|||||||
#define ENUM_BITFIELD(bits)
|
#define ENUM_BITFIELD(bits)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__MSDOS__) || defined(WIN32)
|
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||||
#define PATH_SEPARATOR_CHAR ';'
|
#define PATH_SEPARATOR_CHAR ';'
|
||||||
#else
|
#else
|
||||||
#define PATH_SEPARATOR_CHAR ':'
|
#define PATH_SEPARATOR_CHAR ':'
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#define pipe(p) _pipe(p, 512, O_BINARY)
|
#define pipe(p) _pipe(p, 512, O_BINARY)
|
||||||
@@ -346,6 +359,7 @@ extern void create_pattern_rule ();
|
|||||||
extern void build_vpath_lists ();
|
extern void build_vpath_lists ();
|
||||||
extern void construct_vpath_list ();
|
extern void construct_vpath_list ();
|
||||||
extern int vpath_search ();
|
extern int vpath_search ();
|
||||||
|
extern int gpath_search ();
|
||||||
|
|
||||||
extern void construct_include_path ();
|
extern void construct_include_path ();
|
||||||
extern void uniquize_deps ();
|
extern void uniquize_deps ();
|
||||||
@@ -364,7 +378,7 @@ extern void child_access ();
|
|||||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||||
because such systems often declare the in header files anyway. */
|
because such systems often declare 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 ();
|
extern long int atol ();
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
|
|||||||
138
make.texinfo
138
make.texinfo
@@ -25,6 +25,11 @@
|
|||||||
@syncodeindex pg cp
|
@syncodeindex pg cp
|
||||||
|
|
||||||
@ifinfo
|
@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
|
This file documents the GNU Make utility, which determines
|
||||||
automatically which pieces of a large program need to be recompiled,
|
automatically which pieces of a large program need to be recompiled,
|
||||||
and issues the commands to recompile them.
|
and issues the commands to recompile them.
|
||||||
@@ -95,7 +100,7 @@ Cover art by Etienne Suvasa.
|
|||||||
@page
|
@page
|
||||||
|
|
||||||
@ifinfo
|
@ifinfo
|
||||||
@node Top, Overview, (dir), (dir)
|
@node Top, Overview, , (dir)
|
||||||
@top Make
|
@top Make
|
||||||
|
|
||||||
The GNU @code{make} utility automatically determines which pieces of a
|
The GNU @code{make} utility automatically determines which pieces of a
|
||||||
@@ -196,6 +201,7 @@ Searching Directories for Dependencies
|
|||||||
to every dependency.
|
to every dependency.
|
||||||
* Selective Search:: Specifying a search path
|
* Selective Search:: Specifying a search path
|
||||||
for a specified class of names.
|
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
|
* Commands/Search:: How to write shell commands that work together
|
||||||
with search paths.
|
with search paths.
|
||||||
* Implicit/Search:: How search paths affect implicit rules.
|
* Implicit/Search:: How search paths affect implicit rules.
|
||||||
@@ -239,6 +245,8 @@ How to Use Variables
|
|||||||
* Defining:: An alternate way to set a variable
|
* Defining:: An alternate way to set a variable
|
||||||
to a verbatim string.
|
to a verbatim string.
|
||||||
* Environment:: Variable values can come from the environment.
|
* Environment:: Variable values can come from the environment.
|
||||||
|
* Automatic:: Some special variables have predefined
|
||||||
|
meanings for use with implicit rules.
|
||||||
|
|
||||||
Advanced Features for Reference to Variables
|
Advanced Features for Reference to Variables
|
||||||
|
|
||||||
@@ -288,7 +296,7 @@ Using Implicit Rules
|
|||||||
* Last Resort:: How to defining commands for rules
|
* Last Resort:: How to defining commands for rules
|
||||||
which cannot find any.
|
which cannot find any.
|
||||||
* Suffix Rules:: The old-fashioned style of implicit rule.
|
* 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.
|
implicit rules.
|
||||||
|
|
||||||
Defining and Redefining Pattern Rules
|
Defining and Redefining Pattern Rules
|
||||||
@@ -307,6 +315,7 @@ Using @code{make} to Update Archive Files
|
|||||||
|
|
||||||
* Archive Members:: Archive members as targets.
|
* Archive Members:: Archive members as targets.
|
||||||
* Archive Update:: The implicit rule for archive member 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
|
* Archive Suffix Rules:: You can write a special kind of suffix rule
|
||||||
for updating archives.
|
for updating archives.
|
||||||
|
|
||||||
@@ -1645,6 +1654,7 @@ just the search paths.
|
|||||||
to every dependency.
|
to every dependency.
|
||||||
* Selective Search:: Specifying a search path
|
* Selective Search:: Specifying a search path
|
||||||
for a specified class of names.
|
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
|
* Commands/Search:: How to write shell commands that work together
|
||||||
with search paths.
|
with search paths.
|
||||||
* Implicit/Search:: How search paths affect implicit rules.
|
* 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
|
Thus, if a file that is listed as a target or dependency does not exist
|
||||||
in the current directory, @code{make} searches the directories listed in
|
in the current directory, @code{make} searches the directories listed in
|
||||||
@code{VPATH} for a file with that name. If a file is found in one of
|
@code{VPATH} for a file with that name. If a file is found in one of
|
||||||
them, that file becomes the dependency. Rules may then specify the
|
them, that file may become the dependency (see below). Rules may then
|
||||||
names of source files in the dependencies as if they all existed in the
|
specify the names of source files in the dependencies as if they all
|
||||||
current directory. @xref{Commands/Search, ,Writing Shell Commands with
|
existed in the current directory. @xref{Commands/Search, ,Writing Shell
|
||||||
Directory Search}.
|
Commands with Directory Search}.
|
||||||
|
|
||||||
In the @code{VPATH} variable, directory names are separated by colons or
|
In the @code{VPATH} variable, directory names are separated by colons or
|
||||||
blanks. The order in which directories are listed is the order followed
|
blanks. The order in which directories are listed is the order followed
|
||||||
@@ -1701,7 +1711,7 @@ foo.o : src/foo.c
|
|||||||
assuming the file @file{foo.c} does not exist in the current directory but
|
assuming the file @file{foo.c} does not exist in the current directory but
|
||||||
is found in the directory @file{src}.
|
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
|
@subsection The @code{vpath} Directive
|
||||||
@findex vpath
|
@findex vpath
|
||||||
|
|
||||||
@@ -1800,7 +1810,71 @@ vpath % blish
|
|||||||
will look for a file ending in @samp{.c} in @file{foo}, then
|
will look for a file ending in @samp{.c} in @file{foo}, then
|
||||||
@file{bar}, then @file{blish}.
|
@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
|
@subsection Writing Shell Commands with Directory Search
|
||||||
@cindex shell command, and directory search
|
@cindex shell command, and directory search
|
||||||
@cindex directory search (@code{VPATH}), and shell commands
|
@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).
|
which no rules are found (either explicit rules or implicit rules).
|
||||||
@xref{Last Resort}. If @code{.DEFAULT} commands are specified, every
|
@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
|
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}.
|
,Implicit Rule Search Algorithm}.
|
||||||
|
|
||||||
@findex .PRECIOUS
|
@findex .PRECIOUS
|
||||||
@@ -2409,6 +2483,8 @@ from the corresponding @file{.c} file:
|
|||||||
@group
|
@group
|
||||||
objects = foo.o bar.o
|
objects = foo.o bar.o
|
||||||
|
|
||||||
|
all: $(objects)
|
||||||
|
|
||||||
$(objects): %.o: %.c
|
$(objects): %.o: %.c
|
||||||
$(CC) -c $(CFLAGS) $< -o $@@
|
$(CC) -c $(CFLAGS) $< -o $@@
|
||||||
@end group
|
@end group
|
||||||
@@ -2603,7 +2679,8 @@ called @file{@var{name}.d} from a C source file called @file{@var{name}.c}:
|
|||||||
@group
|
@group
|
||||||
%.d: %.c
|
%.d: %.c
|
||||||
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
|
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
|
||||||
| sed '\''s/\($*\)\.o[ :]*/\1 $@@/g'\'' > $@@'
|
| sed '\''s/\($*\)\.o[ :]*/\1.o $@@ : /g'\'' > $@@; \
|
||||||
|
[ -s $@@ ] || rm -f $@@'
|
||||||
@end group
|
@end group
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@@ -5284,8 +5361,8 @@ was given to those two functions.@refill
|
|||||||
|
|
||||||
@item $(word @var{n},@var{text})
|
@item $(word @var{n},@var{text})
|
||||||
@findex word
|
@findex word
|
||||||
@cindex words, selecting
|
@cindex word, selecting a
|
||||||
@cindex selecting words
|
@cindex selecting a word
|
||||||
Returns the @var{n}th word of @var{text}. The legitimate values of
|
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
|
@var{n} start from 1. If @var{n} is bigger than the number of words
|
||||||
in @var{text}, the value is empty. For example,
|
in @var{text}, the value is empty. For example,
|
||||||
@@ -5297,6 +5374,25 @@ $(word 2, foo bar baz)
|
|||||||
@noindent
|
@noindent
|
||||||
returns @samp{bar}.
|
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
|
@c Following item phrased to prevent overfull hbox. --RJC 17 Jul 92
|
||||||
@item $(words @var{text})
|
@item $(words @var{text})
|
||||||
@findex words
|
@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,
|
Use the name of the goal as an argument. If you specify several goals,
|
||||||
@code{make} processes each of them in turn, in the order you name them.
|
@code{make} processes each of them in turn, in the order you name them.
|
||||||
|
|
||||||
|
@cindex @code{MAKECMDGOALS}
|
||||||
|
@vindex MAKECMDGOALS
|
||||||
|
@code{Make} will set the special variable @code{MAKECMDGOALS} to the
|
||||||
|
list of goals you specified on the command line. If no goals were given
|
||||||
|
on the command line, this variable is empty.
|
||||||
|
|
||||||
Any target in the makefile may be specified as a goal (unless it
|
Any target in the makefile may be specified as a goal (unless it
|
||||||
starts with @samp{-} or contains an @samp{=}, in which case it will be
|
starts with @samp{-} or contains an @samp{=}, in which case it will be
|
||||||
parsed as a switch or variable definition, respectively). Even
|
parsed as a switch or variable definition, respectively). Even
|
||||||
@@ -6312,7 +6414,7 @@ retained for compatibility.
|
|||||||
* Last Resort:: How to defining commands for rules
|
* Last Resort:: How to defining commands for rules
|
||||||
which cannot find any.
|
which cannot find any.
|
||||||
* Suffix Rules:: The old-fashioned style of implicit rule.
|
* 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.
|
implicit rules.
|
||||||
@end menu
|
@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
|
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
|
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,
|
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.
|
details of how the search is done.
|
||||||
|
|
||||||
Note that explicit dependencies do not influence implicit rule search.
|
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.
|
You can use a last-resort rule to override part of another makefile.
|
||||||
@xref{Overriding Makefiles, , Overriding 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
|
@section Old-Fashioned Suffix Rules
|
||||||
@cindex old-fashioned suffix rules
|
@cindex old-fashioned suffix rules
|
||||||
@cindex suffix rule
|
@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
|
with a rule for the special target @code{.SUFFIXES}, but that does not alter
|
||||||
this variable.
|
this variable.
|
||||||
|
|
||||||
@node Search Algorithm, , Suffix Rules, Implicit Rules
|
@node Implicit Rule Search, , Suffix Rules, Implicit Rules
|
||||||
@section Implicit Rule Search Algorithm
|
@section Implicit Rule Search Algorithm
|
||||||
@cindex implicit rule, search algorithm
|
@cindex implicit rule, search algorithm
|
||||||
@cindex search algorithm, implicit rule
|
@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
|
Keep track of the current level of @code{make} recursion using the
|
||||||
variable @code{MAKELEVEL}. @xref{Recursion, ,Recursive Use of @code{make}}.
|
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
|
@item
|
||||||
Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}.
|
Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}.
|
||||||
|
|
||||||
|
|||||||
2
misc.c
2
misc.c
@@ -397,7 +397,7 @@ end_of_token (s)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/*
|
/*
|
||||||
* Same as end_of_token, but take into account a stop character
|
* Same as end_of_token, but take into account a stop character
|
||||||
*/
|
*/
|
||||||
|
|||||||
129
read.c
129
read.c
@@ -30,7 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "glob/glob.h"
|
#include "glob/glob.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WINDOWS32
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
@@ -38,7 +38,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
struct passwd *getpwnam PARAMS ((char *name));
|
struct passwd *getpwnam PARAMS ((char *name));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif /* !WIN32 */
|
#endif /* !WINDOWS32 */
|
||||||
|
|
||||||
/* A `struct linebuffer' is a structure which holds a line of text.
|
/* A `struct linebuffer' is a structure which holds a line of text.
|
||||||
`readline' reads a line from a stream into a linebuffer
|
`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[] =
|
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 completly up to the user when they install MSVC or other packages.
|
||||||
* This is defined as a placeholder.
|
* This is defined as a placeholder.
|
||||||
@@ -271,6 +271,7 @@ read_makefile (filename, flags)
|
|||||||
unsigned int commands_started;
|
unsigned int commands_started;
|
||||||
register char *p;
|
register char *p;
|
||||||
char *p2;
|
char *p2;
|
||||||
|
int len;
|
||||||
int ignoring = 0, in_ignored_define = 0;
|
int ignoring = 0, in_ignored_define = 0;
|
||||||
int no_targets = 0; /* Set when reading a rule without targets. */
|
int no_targets = 0; /* Set when reading a rule without targets. */
|
||||||
char *passed_filename = filename;
|
char *passed_filename = filename;
|
||||||
@@ -283,7 +284,7 @@ read_makefile (filename, flags)
|
|||||||
char *pattern = 0, *pattern_percent;
|
char *pattern = 0, *pattern_percent;
|
||||||
|
|
||||||
int makefile_errno;
|
int makefile_errno;
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
int check_again;
|
int check_again;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -302,8 +303,9 @@ read_makefile (filename, flags)
|
|||||||
|
|
||||||
#ifdef lint /* Suppress `used before set' messages. */
|
#ifdef lint /* Suppress `used before set' messages. */
|
||||||
two_colon = 0;
|
two_colon = 0;
|
||||||
pattern_percent = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
pattern_percent = 0;
|
||||||
|
commands_started = lineno;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
{
|
{
|
||||||
@@ -452,8 +454,7 @@ read_makefile (filename, flags)
|
|||||||
remove_comments (collapsed);
|
remove_comments (collapsed);
|
||||||
|
|
||||||
/* strncmp is first to avoid dereferencing out into space. */
|
/* strncmp is first to avoid dereferencing out into space. */
|
||||||
#define word1eq(s, l) (!strncmp (s, p, l) \
|
#define word1eq(s, l) (len == l && !strncmp (s, p, l))
|
||||||
&& (p[l] == '\0' || isblank (p[l])))
|
|
||||||
p = collapsed;
|
p = collapsed;
|
||||||
while (isspace (*p))
|
while (isspace (*p))
|
||||||
++p;
|
++p;
|
||||||
@@ -461,6 +462,21 @@ read_makefile (filename, flags)
|
|||||||
/* This line is completely empty. */
|
/* This line is completely empty. */
|
||||||
continue;
|
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
|
/* We must first check for conditional and `define' directives before
|
||||||
ignoring anything, since they control what we will do with
|
ignoring anything, since they control what we will do with
|
||||||
following lines. */
|
following lines. */
|
||||||
@@ -578,7 +594,29 @@ read_makefile (filename, flags)
|
|||||||
v->export = v_noexport;
|
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))
|
|| word1eq ("sinclude", 8))
|
||||||
{
|
{
|
||||||
/* We have found an `include' line specifying a nested
|
/* We have found an `include' line specifying a nested
|
||||||
@@ -642,26 +680,6 @@ read_makefile (filename, flags)
|
|||||||
reading_filename = filename;
|
reading_filename = filename;
|
||||||
reading_lineno_ptr = &lineno;
|
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
|
#undef word1eq
|
||||||
else if (try_variable_definition (filename, lineno, p, o_file))
|
else if (try_variable_definition (filename, lineno, p, o_file))
|
||||||
/* This line has been dealt with. */
|
/* This line has been dealt with. */
|
||||||
@@ -764,11 +782,6 @@ read_makefile (filename, flags)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef __MSDOS__
|
|
||||||
/* For MS-DOS, skip a "C:\...". */
|
|
||||||
if (p != 0 && p[1] == '\\' && isalpha (p[-1]))
|
|
||||||
p = 0;
|
|
||||||
#endif
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
/* Here, the situation is quite complicated. Let's have a look
|
/* Here, the situation is quite complicated. Let's have a look
|
||||||
at a couple of targets:
|
at a couple of targets:
|
||||||
@@ -785,10 +798,10 @@ read_makefile (filename, flags)
|
|||||||
if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||||
p = 0;
|
p = 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
do {
|
do {
|
||||||
check_again = 0;
|
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])) {
|
if (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) {
|
||||||
p = index(p + 1, ':');
|
p = index(p + 1, ':');
|
||||||
check_again = 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
|
/* See if this is first target seen whose name does
|
||||||
not start with a `.', unless it contains a slash. */
|
not start with a `.', unless it contains a slash. */
|
||||||
if (default_goal_file == 0 && set_default
|
if (default_goal_file == 0 && set_default
|
||||||
&& (*name != '.' || index (name, '/') != 0))
|
&& (*name != '.' || index (name, '/') != 0
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
|| index (name, '\\') != 0
|
||||||
|
#endif
|
||||||
|
))
|
||||||
{
|
{
|
||||||
int reject = 0;
|
int reject = 0;
|
||||||
|
|
||||||
@@ -1622,9 +1639,11 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
*p =' ';
|
*p =' ';
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
/* For MS-DOS, skip a "C:\...". */
|
/* For MS-DOS, skip a "C:\..." or a "C:/..." until we find a
|
||||||
if (stopchar == ':' && p != 0 && p[1] == '\\' && isalpha (p[-1]))
|
first colon which isn't followed by a slash or a backslash. */
|
||||||
p = 0;
|
if (stopchar == ':')
|
||||||
|
while (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1]))
|
||||||
|
p = find_char_unquote (p + 1, stopchars, 1);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
if (stopchar == ':' && p && *p == ':' &&
|
if (stopchar == ':' && p && *p == ':' &&
|
||||||
@@ -1633,8 +1652,8 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
p = find_char_unquote (p+1, stopchars, 1);
|
p = find_char_unquote (p+1, stopchars, 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
/* For WIN32, skip a "C:\..." or "C:/...". */
|
/* For WINDOWS32, skip a "C:\..." or "C:/...". */
|
||||||
if (stopchar == ':' &&
|
if (stopchar == ':' &&
|
||||||
p != 0 &&
|
p != 0 &&
|
||||||
(p[1] == '\\' || p[1] == '/') &&
|
(p[1] == '\\' || p[1] == '/') &&
|
||||||
@@ -1943,6 +1962,10 @@ construct_include_path (arg_dirs)
|
|||||||
register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *));
|
register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *));
|
||||||
register unsigned int idx = 0;
|
register unsigned int idx = 0;
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
defsize++;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* First consider any dirs specified with -I switches.
|
/* First consider any dirs specified with -I switches.
|
||||||
Ignore dirs that don't exist. */
|
Ignore dirs that don't exist. */
|
||||||
|
|
||||||
@@ -1974,6 +1997,22 @@ construct_include_path (arg_dirs)
|
|||||||
|
|
||||||
/* Now add at the end the standard default 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)
|
for (i = 0; default_include_directories[i] != 0; ++i)
|
||||||
if (stat (default_include_directories[i], &stbuf) == 0
|
if (stat (default_include_directories[i], &stbuf) == 0
|
||||||
&& S_ISDIR (stbuf.st_mode))
|
&& S_ISDIR (stbuf.st_mode))
|
||||||
@@ -2029,7 +2068,7 @@ tilde_expand (name)
|
|||||||
free (home_dir);
|
free (home_dir);
|
||||||
home_dir = getenv ("HOME");
|
home_dir = getenv ("HOME");
|
||||||
}
|
}
|
||||||
#if !defined(_AMIGA) && !defined(WIN32)
|
#if !defined(_AMIGA) && !defined(WINDOWS32)
|
||||||
if (home_dir == 0 || home_dir[0] == '\0')
|
if (home_dir == 0 || home_dir[0] == '\0')
|
||||||
{
|
{
|
||||||
extern char *getlogin ();
|
extern char *getlogin ();
|
||||||
@@ -2042,7 +2081,7 @@ tilde_expand (name)
|
|||||||
home_dir = p->pw_dir;
|
home_dir = p->pw_dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !AMIGA && !WIN32 */
|
#endif /* !AMIGA && !WINDOWS32 */
|
||||||
if (home_dir != 0)
|
if (home_dir != 0)
|
||||||
{
|
{
|
||||||
char *new = concat (home_dir, "", name + 1);
|
char *new = concat (home_dir, "", name + 1);
|
||||||
@@ -2051,7 +2090,7 @@ tilde_expand (name)
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !defined(_AMIGA) && !defined(WIN32)
|
#if !defined(_AMIGA) && !defined(WINDOWS32)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct passwd *pwent;
|
struct passwd *pwent;
|
||||||
@@ -2069,7 +2108,7 @@ tilde_expand (name)
|
|||||||
else if (userend != 0)
|
else if (userend != 0)
|
||||||
*userend = '/';
|
*userend = '/';
|
||||||
}
|
}
|
||||||
#endif /* !AMIGA && !WIN32 */
|
#endif /* !AMIGA && !WINDOWS32 */
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
104
remake.c
104
remake.c
@@ -29,10 +29,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
#include "variable.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
#include <starlet.h>
|
#include <starlet.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -566,13 +570,63 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
if (!must_make)
|
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);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUGPR ("Must remake target `%s'.\n");
|
DEBUGPR ("Must remake target `%s'.\n");
|
||||||
|
|
||||||
|
/* It needs to be remade. If it's VPATH and not GPATH, toss the VPATH */
|
||||||
|
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. */
|
/* Now, take appropriate actions to remake the file. */
|
||||||
remake_file (file);
|
remake_file (file);
|
||||||
|
|
||||||
@@ -1003,7 +1057,7 @@ f_mtime (file, search)
|
|||||||
{
|
{
|
||||||
mtime = name_mtime (file->name);
|
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. */
|
/* If name_mtime failed, search VPATH. */
|
||||||
char *name = file->name;
|
char *name = file->name;
|
||||||
@@ -1016,9 +1070,9 @@ f_mtime (file, search)
|
|||||||
/* vpath_search and library_search store zero in MTIME
|
/* vpath_search and library_search store zero in MTIME
|
||||||
if they didn't need to do a stat call for their work. */
|
if they didn't need to do a stat call for their work. */
|
||||||
file->last_mtime = mtime;
|
file->last_mtime = mtime;
|
||||||
rename_file (file, name);
|
rehash_file (file, name);
|
||||||
check_renamed (file);
|
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
|
/* Files can have bogus timestamps that nothing newly made will be
|
||||||
"newer" than. Updating their dependents could just result in loops.
|
"newer" than. Updating their dependents could just result in loops.
|
||||||
So notify the user of the anomaly by treating future files as
|
So notify the user of the anomaly with a warning. */
|
||||||
unrecoverably absent. */
|
|
||||||
|
|
||||||
static time_t now;
|
static time_t now = 0;
|
||||||
if (mtime != -1 && mtime > now && ! file->updated)
|
if (mtime != -1 && mtime > now && ! file->updated)
|
||||||
{
|
{
|
||||||
/* This file's time appears to be in the future.
|
/* This file's time appears to be in the future.
|
||||||
@@ -1039,16 +1092,13 @@ f_mtime (file, search)
|
|||||||
static unsigned long vms_now[2]; /* assumes 32 bit long ! */
|
static unsigned long vms_now[2]; /* assumes 32 bit long ! */
|
||||||
sys$gettim (vms_now);
|
sys$gettim (vms_now);
|
||||||
now = ((vms_now[0]>>24) & 0xff) + ((vms_now[1]<<8) & 0xffffff00);
|
now = ((vms_now[0]>>24) & 0xff) + ((vms_now[1]<<8) & 0xffffff00);
|
||||||
if (mtime > now)
|
|
||||||
#else
|
#else
|
||||||
extern time_t time ();
|
extern time_t time ();
|
||||||
if (mtime > time (&now))
|
time (&now);
|
||||||
#endif
|
#endif
|
||||||
{
|
if (mtime > now)
|
||||||
error ("*** File `%s' has modification time in the future",
|
error ("*** Warning: File `%s' has modification time in the future",
|
||||||
file->name);
|
file->name);
|
||||||
file->update_status = 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1099,7 +1149,7 @@ library_search (lib, mtime_ptr)
|
|||||||
"/lib",
|
"/lib",
|
||||||
"/usr/lib",
|
"/usr/lib",
|
||||||
#endif
|
#endif
|
||||||
#if defined(WIN32) && !defined(LIBDIR)
|
#if defined(WINDOWS32) && !defined(LIBDIR)
|
||||||
/*
|
/*
|
||||||
* This is completely up to the user at product install time. Just define
|
* This is completely up to the user at product install time. Just define
|
||||||
* a placeholder.
|
* a placeholder.
|
||||||
@@ -1145,6 +1195,30 @@ library_search (lib, mtime_ptr)
|
|||||||
|
|
||||||
/* Now try the standard set of directories. */
|
/* 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)
|
for (dp = dirs; *dp != 0; ++dp)
|
||||||
{
|
{
|
||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
|
|||||||
25
signame.c
25
signame.c
@@ -1,19 +1,21 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU Library General Public License as
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
published by the Free Software Foundation; either version 2 of the
|
||||||
any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Library General Public
|
||||||
along with this program; see the file COPYING. If not, write to
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@@ -231,6 +233,9 @@ signame_init ()
|
|||||||
#if defined (SIGINFO)
|
#if defined (SIGINFO)
|
||||||
init_sig (SIGINFO, "INFO", "Information request");
|
init_sig (SIGINFO, "INFO", "Information request");
|
||||||
#endif
|
#endif
|
||||||
|
#if defined (SIGNOFP)
|
||||||
|
init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the abbreviation for signal NUMBER. */
|
/* Return the abbreviation for signal NUMBER. */
|
||||||
|
|||||||
24
signame.h
24
signame.h
@@ -1,19 +1,21 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU Library General Public License as
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
published by the Free Software Foundation; either version 2 of the
|
||||||
any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Library General Public
|
||||||
along with this program; see the file COPYING. If not, write to
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#if defined (__STDC__) && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
|
|
||||||
|
|||||||
1030
texinfo.tex
1030
texinfo.tex
File diff suppressed because it is too large
Load Diff
128
variable.c
128
variable.c
@@ -22,7 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ merge_variable_set_lists (setlist0, setlist1)
|
|||||||
void
|
void
|
||||||
define_automatic_variables ()
|
define_automatic_variables ()
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
extern char* default_shell;
|
extern char* default_shell;
|
||||||
#else
|
#else
|
||||||
extern char default_shell[];
|
extern char default_shell[];
|
||||||
@@ -373,12 +373,39 @@ define_automatic_variables ()
|
|||||||
? "" : remote_description);
|
? "" : remote_description);
|
||||||
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
(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
|
/* This won't override any definition, but it
|
||||||
will provide one if there isn't one there. */
|
will provide one if there isn't one there. */
|
||||||
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
||||||
v->export = v_export; /* Always export SHELL. */
|
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. */
|
/* Don't let SHELL come from the environment. */
|
||||||
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
|
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->origin = o_file;
|
||||||
v->value = savestring (default_shell, strlen (default_shell));
|
v->value = savestring (default_shell, strlen (default_shell));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure MAKEFILES gets exported if it is set. */
|
/* Make sure MAKEFILES gets exported if it is set. */
|
||||||
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
||||||
@@ -546,20 +574,20 @@ target_environment (file)
|
|||||||
&& v->origin != o_env && v->origin != o_env_override)
|
&& v->origin != o_env && v->origin != o_env_override)
|
||||||
{
|
{
|
||||||
char *value = recursively_expand (v);
|
char *value = recursively_expand (v);
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
if (strcmp(v->name, "Path") == 0 ||
|
if (strcmp(v->name, "Path") == 0 ||
|
||||||
strcmp(v->name, "PATH") == 0)
|
strcmp(v->name, "PATH") == 0)
|
||||||
convert_Path_to_win32(value, ';');
|
convert_Path_to_windows32(value, ';');
|
||||||
#endif
|
#endif
|
||||||
result[nvariables++] = concat (v->name, "=", value);
|
result[nvariables++] = concat (v->name, "=", value);
|
||||||
free (value);
|
free (value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
{
|
{
|
||||||
if (strcmp(v->name, "Path") == 0 ||
|
if (strcmp(v->name, "Path") == 0 ||
|
||||||
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);
|
result[nvariables++] = concat (v->name, "=", v->value);
|
||||||
}
|
}
|
||||||
#else
|
#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),
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
value, origin, flavor == recursive);
|
value, origin, flavor == recursive);
|
||||||
|
|
||||||
@@ -884,7 +994,7 @@ print_file_variables (file)
|
|||||||
print_variable_set (file->variables->set, "# ");
|
print_variable_set (file->variables->set, "# ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
void
|
void
|
||||||
sync_Path_environment(void)
|
sync_Path_environment(void)
|
||||||
{
|
{
|
||||||
@@ -902,9 +1012,9 @@ sync_Path_environment(void)
|
|||||||
free(environ_path);
|
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);
|
environ_path = concat("Path", "=", path);
|
||||||
putenv(environ_path);
|
putenv(environ_path);
|
||||||
free(path);
|
free(path);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
char *version_string = "3.75";
|
char *version_string = "3.75.1";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local variables:
|
Local variables:
|
||||||
|
|||||||
80
vpath.c
80
vpath.c
@@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
#include "pathstuff.h"
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -43,6 +43,10 @@ static struct vpath *vpaths;
|
|||||||
/* Structure for the general VPATH given in the variable. */
|
/* Structure for the general VPATH given in the variable. */
|
||||||
|
|
||||||
static struct vpath *general_vpath;
|
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));
|
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;
|
general_vpath = vpaths;
|
||||||
vpaths = save_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.
|
/* Construct the VPATH listing for the pattern and searchpath given.
|
||||||
@@ -173,8 +209,8 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
convert_vpath_to_win32(dirpath, ';');
|
convert_vpath_to_windows32(dirpath, ';');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Figure out the maximum number of VPATH entries and
|
/* Figure out the maximum number of VPATH entries and
|
||||||
@@ -209,6 +245,10 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
len = p - v;
|
len = p - v;
|
||||||
/* Make sure there's no trailing slash,
|
/* Make sure there's no trailing slash,
|
||||||
but still allow "/" as a directory. */
|
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] == '/')
|
if (len > 1 && p[-1] == '/')
|
||||||
--len;
|
--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
|
/* 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
|
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
|
the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is
|
||||||
@@ -287,7 +344,7 @@ vpath_search (file, mtime_ptr)
|
|||||||
there is nothing we can do. */
|
there is nothing we can do. */
|
||||||
|
|
||||||
if (**file == '/'
|
if (**file == '/'
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|| **file == '\\'
|
|| **file == '\\'
|
||||||
|| (*file)[1] == ':'
|
|| (*file)[1] == ':'
|
||||||
#endif
|
#endif
|
||||||
@@ -343,9 +400,13 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
pointer to the name-within-directory and FLEN is its length. */
|
pointer to the name-within-directory and FLEN is its length. */
|
||||||
|
|
||||||
n = rindex (*file, '/');
|
n = rindex (*file, '/');
|
||||||
#ifdef WIN32
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
if (!n)
|
/* We need the rightmost slash or backslash. */
|
||||||
n = rindex(*file,, '\\');
|
{
|
||||||
|
char *bslash = rindex(*file, '\\');
|
||||||
|
if (!n || bslash > n)
|
||||||
|
n = bslash;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
name_dplen = n != 0 ? n - *file : 0;
|
name_dplen = n != 0 ? n - *file : 0;
|
||||||
filename = name_dplen > 0 ? n + 1 : *file;
|
filename = name_dplen > 0 ? n + 1 : *file;
|
||||||
@@ -378,6 +439,11 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
n += name_dplen;
|
n += name_dplen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Cause the next if to treat backslash and slash alike. */
|
||||||
|
if (n != name && n[-1] == '\\' )
|
||||||
|
n[-1] = '/';
|
||||||
|
#endif
|
||||||
/* Now add the name-within-directory at the end of NAME. */
|
/* Now add the name-within-directory at the end of NAME. */
|
||||||
if (n != name && n[-1] != '/')
|
if (n != name && n[-1] != '/')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ closedir(DIR *pDir)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the WIN32 directory handle */
|
/* close the WINDOWS32 directory handle */
|
||||||
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||||
FindClose(pDir->dir_hDirHandle);
|
FindClose(pDir->dir_hDirHandle);
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ closedir(DIR *pDir)
|
|||||||
struct dirent *
|
struct dirent *
|
||||||
readdir(DIR* pDir)
|
readdir(DIR* pDir)
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA wfdFindData;
|
WINDOWS32_FIND_DATA wfdFindData;
|
||||||
|
|
||||||
if (!pDir) {
|
if (!pDir) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -134,7 +134,7 @@ rewinddir(DIR* pDir)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the WIN32 directory handle */
|
/* close the WINDOWS32 directory handle */
|
||||||
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||||
if (!FindClose(pDir->dir_hDirHandle))
|
if (!FindClose(pDir->dir_hDirHandle))
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
struct dirent
|
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];
|
char d_name[NAME_MAX+1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#ifndef _PATHSTUFF_H
|
#ifndef _PATHSTUFF_H
|
||||||
#define _PATHSTUFF_H
|
#define _PATHSTUFF_H
|
||||||
|
|
||||||
extern char * convert_Path_to_win32(char *Path, char to_delim);
|
extern char * convert_Path_to_windows32(char *Path, char to_delim);
|
||||||
extern char * convert_vpath_to_win32(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 * w32ify(char *file, int resolve);
|
||||||
extern char * getcwd_fs(char *buf, int len);
|
extern char * getcwd_fs(char *buf, int len);
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WINDOWS32
|
||||||
|
|
||||||
#define EXTERN_DECL(entry, args) extern entry args
|
#define EXTERN_DECL(entry, args) extern entry args
|
||||||
#define VOID_DECL void
|
#define VOID_DECL void
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
#define EXTERN_DECL(entry, args) entry args
|
#define EXTERN_DECL(entry, args) entry args
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EXTERN_DECL(char * map_win32_error_to_string, (DWORD error));
|
EXTERN_DECL(char * map_windows32_error_to_string, (DWORD error));
|
||||||
|
|
||||||
#endif /* !_W32ERR_H */
|
#endif /* !_W32ERR_H */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* Convert delimiter separated vpath to Canonical format.
|
* Convert delimiter separated vpath to Canonical format.
|
||||||
*/
|
*/
|
||||||
char *
|
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 */
|
char *etok; /* token separator for old Path */
|
||||||
|
|
||||||
@@ -19,14 +19,14 @@ convert_vpath_to_win32(char *Path, char to_delim)
|
|||||||
if (isblank(*etok))
|
if (isblank(*etok))
|
||||||
*etok = to_delim;
|
*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 *
|
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 *etok; /* token separator for old Path */
|
||||||
char *p; /* points to element of old Path */
|
char *p; /* points to element of old Path */
|
||||||
@@ -165,7 +165,7 @@ convert_path_to_nutc(char *path)
|
|||||||
p = ++etok;
|
p = ++etok;
|
||||||
continue;
|
continue;
|
||||||
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
|
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
|
||||||
break; /* thing found was a WIN32 pathname */
|
break; /* thing found was a WINDOWS32 pathname */
|
||||||
|
|
||||||
/* save separator */
|
/* save separator */
|
||||||
sep = *etok;
|
sep = *etok;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ CC = cl
|
|||||||
OUTDIR=.
|
OUTDIR=.
|
||||||
MAKEFILE=NMakefile
|
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_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
|
||||||
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
|
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D 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 WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _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 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 w32err.c
|
||||||
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
|
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
|
||||||
if not exist .\WinRel\nul mkdir .\WinRel
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D 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 WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
|
||||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D 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 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 w32err.c
|
||||||
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
|
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: Convert a NULL string terminated UNIX environment block to
|
* 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
|
* Returns: TRUE= success, FALSE=fail
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ process_begin(
|
|||||||
exec_handle = find_file(exec_path, &file_info);
|
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.
|
* to find and execute it.
|
||||||
*/
|
*/
|
||||||
if (exec_handle == (HANDLE)HFILE_ERROR) {
|
if (exec_handle == (HANDLE)HFILE_ERROR) {
|
||||||
@@ -578,7 +578,7 @@ proc_stdout_thread(sub_process *pproc)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
if (ReadFile( (HANDLE)pproc->sv_stdout[0], &c, 1, &nread, NULL)
|
if (ReadFile( (HANDLE)pproc->sv_stdout[0], &c, 1, &nread, NULL)
|
||||||
== FALSE) {
|
== FALSE) {
|
||||||
/* map_win32_error_to_string(GetLastError());*/
|
/* map_windows32_error_to_string(GetLastError());*/
|
||||||
_endthreadex(0);
|
_endthreadex(0);
|
||||||
}
|
}
|
||||||
if (nread == 0)
|
if (nread == 0)
|
||||||
@@ -609,7 +609,7 @@ proc_stderr_thread(sub_process *pproc)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (ReadFile( (HANDLE)pproc->sv_stderr[0], &c, 1, &nread, NULL) == FALSE) {
|
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);
|
_endthreadex(0);
|
||||||
}
|
}
|
||||||
if (nread == 0)
|
if (nread == 0)
|
||||||
@@ -718,7 +718,7 @@ process_pipe_io(
|
|||||||
one second to collect all remaining output */
|
one second to collect all remaining output */
|
||||||
|
|
||||||
if (wait_return == WAIT_FAILED) {
|
if (wait_return == WAIT_FAILED) {
|
||||||
/* map_win32_error_to_string(GetLastError());*/
|
/* map_windows32_error_to_string(GetLastError());*/
|
||||||
pproc->last_err = GetLastError();
|
pproc->last_err = GetLastError();
|
||||||
pproc->lerrno = E_SCALL;
|
pproc->lerrno = E_SCALL;
|
||||||
goto done;
|
goto done;
|
||||||
@@ -835,7 +835,7 @@ process_file_io(
|
|||||||
wait_return = WaitForSingleObject(childhand, INFINITE);
|
wait_return = WaitForSingleObject(childhand, INFINITE);
|
||||||
|
|
||||||
if (wait_return != WAIT_OBJECT_0) {
|
if (wait_return != WAIT_OBJECT_0) {
|
||||||
/* map_win32_error_to_string(GetLastError());*/
|
/* map_windows32_error_to_string(GetLastError());*/
|
||||||
pproc->last_err = GetLastError();
|
pproc->last_err = GetLastError();
|
||||||
pproc->lerrno = E_SCALL;
|
pproc->lerrno = E_SCALL;
|
||||||
goto done2;
|
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
|
* an argv vector and outputs a 'protected' string as a return
|
||||||
* value. The return code can be safely passed to CreateProcess().
|
* value. The return code can be safely passed to CreateProcess().
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "w32err.h"
|
#include "w32err.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: the win32 version of perror()
|
* Description: the windows32 version of perror()
|
||||||
*
|
*
|
||||||
* Returns: a pointer to a static error
|
* Returns: a pointer to a static error
|
||||||
*
|
*
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
* comp.os.ms-windows.programmer.win32
|
* comp.os.ms-windows.programmer.win32
|
||||||
*/
|
*/
|
||||||
char *
|
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) necessary if you will use multiple threads */
|
||||||
__declspec (thread) static char szMessageBuffer[128];
|
__declspec (thread) static char szMessageBuffer[128];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user