Release GNU make 3.81.
[make.git] / README.W32.template
blob5d30eac7652b0baa61c2a79b3afd649b6c04a07e
1 This version of GNU make has been tested on Microsoft Windows 2000/XP/2003.
2 It has also been used on Windows 95/98/NT, and on OS/2.
4 It builds natively with MSVC 2.x, 4.x, 5.x, 6.x, and 2003 as well as
5 .NET 7.x and .NET 2003.
7 It builds with the MinGW port of GCC 3.x (tested with GCC 3.4.2).
9 The Windows 32-bit port of GNU make is maintained jointly by various
10 people.  It was originally made by Rob Tulloh.
13 Do this first, regardless of the build method you choose:
14 ---------------------------------------------------------
16  1. At the Windows command prompt run:
18       if not exist NMakefile copy NMakefile.template NMakefile
19       if not exist config.h copy config.h.W32 config.h
21     Then edit config.h to your liking (especially the few shell-related
22     defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
23     to './configure --enable-case-insensitive-file-system').
26 Using make_msvc_net2003.vcproj
27 ------------------------------
29  2. Open make_msvc_net2003.vcproj in MSVS71 or MSVC71 or any compatible IDE,
30     then build this project as usual.
33 Building with (MinGW-)GCC using build_w32.bat
34 ---------------------------------------------
36  2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
37     correct PATH and other environment variables for it, then execute ...
39         build_w32.bat gcc
41     This produces gnumake.exe in the current directory.
44 Building with (MSVC++-)cl using build_w32.bat or NMakefile
45 ----------------------------------------------------------
47  2. Open a W32 command prompt for your installed (MSVC++-)cl, setup a
48     correct PATH and other environment variables for it (usually via
49     executing vcvars32.bat or vsvars32.bat from the cl-installation,
50     e.g. "%VS71COMNTOOLS%vsvars32.bat"; or using a corresponding start
51     menue entry from the cl-installation), then execute EITHER ...
53         build_w32.bat
55     (this produces WinDebug/gnumake.exe and WinRel/gnumake.exe)
57     ... OR ...
59         nmake /f NMakefile
61     (this produces WinDebug/make.exe and WinRel/make.exe).
64 -------------------
65 -- Notes/Caveats --
66 -------------------
68 GNU make on Windows 32-bit platforms:
70         This version of make is ported natively to Windows32 platforms
71         (Windows NT 3.51, Windows NT 4.0, Windows 95, and Windows 98). It
72         does not rely on any 3rd party software or add-on packages for
73         building. The only thing needed is a version of Visual C++,
74         which is the predominant compiler used on Windows32 platforms.
76         Do not confuse this port of GNU make with other Windows32 projects
77         which provide a GNU make binary. These are separate projects
78         and are not connected to this port effort.
80 GNU make and sh.exe:
82         This port prefers you have a working sh.exe somewhere on your
83         system. If you don't have sh.exe, the port falls back to
84         MSDOS mode for launching programs (via a batch file).
85         The MSDOS mode style execution has not been tested that
86         carefully though (The author uses GNU bash as sh.exe).
88         There are very few true ports of Bourne shell for NT right now.
89         There is a version of GNU bash available from Cygnus "Cygwin"
90         porting effort (http://www.cygwin.com/).
91         Other possibilities are the MKS version of sh.exe, or building
92         your own with a package like NutCracker (DataFocus) or Portage
93         (Consensys).  Also MinGW includes sh (http://mingw.org/).
95 GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
97         Some versions of Bourne shell do not behave well when invoked
98         as 'sh -c' from CreateProcess().  The main problem is they seem
99         to have a hard time handling quoted strings correctly. This can
100         be circumvented by writing commands to be executed to a batch
101         file and then executing the command by calling 'sh file'.
103         To work around this difficulty, this version of make supports
104         a batch mode.  When BATCH_MODE_ONLY_SHELL is defined at compile
105         time, make forces all command lines to be executed via script
106         files instead of by command line.  In this mode you must have a
107         working sh.exe in order to use parallel builds (-j).
109         A native Windows32 system with no Bourne shell will also run
110         in batch mode.  All command lines will be put into batch files
111         and executed via $(COMSPEC) (%COMSPEC%).  Note that parallel
112         builds (-j) require a working Bourne shell; they will not work
113         with COM.
115 GNU make and Cygnus GNU Windows32 tools:
117         Good news! Make now has native support for Cygwin sh. To enable,
118         define the HAVE_CYGWIN_SHELL in config.h and rebuild make
119         from scratch. This version of make tested with B20.1 of Cygwin.
120         Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
122 GNU make and the MKS shell:
124         There is now semi-official support for the MKS shell. To turn this
125         support on, define HAVE_MKS_SHELL in the config.h.W32 before you
126         build make.  Do not define BATCH_MODE_ONLY_SHELL if you turn
127         on HAVE_MKS_SHELL.
129 GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
131         There is a caveat that should be noted with respect to handling
132         single character pathnames on Windows systems.  When colon is
133         used in PATH variables, make tries to be smart about knowing when
134         you are using colon as a separator versus colon as a drive
135         letter.  Unfortunately, something as simple as the string 'x:/'
136         could be interpreted 2 ways: (x and /) or (x:/).
138         Make chooses to interpret a letter plus colon (e.g. x:/) as a
139         drive letter pathname.  If it is necessary to use single
140         character directories in paths (VPATH, vpath, Path, PATH), the
141         user must do one of two things:
143          a. Use semicolon as the separator to disambiguate colon. For
144             example use 'x;/' if you want to say 'x' and '/' are
145             separate components.
147          b. Qualify the directory name so that there is more than
148             one character in the path(s) used. For example, none
149             of these settings are ambiguous:
151               ./x:./y
152               /some/path/x:/some/path/y
153               x:/some/path/x:x:/some/path/y
155         Please note that you are free to mix colon and semi-colon in the
156         specification of paths.  Make is able to figure out the intended
157         result and convert the paths internally to the format needed
158         when interacting with the operating system, providing the path
159         is not within quotes, e.g. "x:/test/test.c".
161         You are encouraged to use colon as the separator character.
162         This should ease the pain of deciding how to handle various path
163         problems which exist between platforms.  If colon is used on
164         both Unix and Windows systems, then no ifdef'ing will be
165         necessary in the makefile source.
167 GNU make test suite:
169         I verified all functionality with a slightly modified version
170         of make-test-%VERSION% (modifications to get test suite to run
171         on Windows NT). All tests pass in an environment that includes
172         sh.exe.  Tests were performed on both Windows NT and Windows 95.
174 Building GNU make on Windows NT and Windows 95/98 with Microsoft Visual C:
176         I did not provide a Visual C project file with this port as
177         the project file would not be considered freely distributable
178         (or so I think). It is easy enough to create one, though, if
179         you know how to use Visual C.
181         I build the program statically to avoid problems locating DLL's
182         on machines that may not have MSVC runtime installed. If you
183         prefer, you can change make to build with shared libraries by
184         changing /MT to /MD in the NMakefile (or in build_w32.bat).
186         The program has not been built for non-Intel architectures (yet).
188         I have not tried to build with any other compilers than MSVC. I
189         have heard that this is possible though so don't be afraid to
190         notify me of your successes!
192 Pathnames and white space:
194         Unlike Unix, Windows 95/NT systems encourage pathnames which
195         contain white space (e.g. C:\Program Files\). These sorts of
196         pathnames are legal under Unix too, but are never encouraged.
197         There is at least one place in make (VPATH/vpath handling) where
198         paths containing white space will simply not work. There may be
199         others too. I chose to not try and port make in such a way so
200         that these sorts of paths could be handled. I offer these
201         suggestions as workarounds:
203                 1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
204                    "x:\longpathtest".  Type "dir /x" to view these filenames
205                    within the cmd.exe shell.
206                 2. Rename the directory so it does not contain white space.
208         If you are unhappy with this choice, this is free software
209         and you are free to take a crack at making this work. The code
210         in w32/pathstuff.c and vpath.c would be the places to start.
212 Pathnames and Case insensitivity:
214         Unlike Unix, Windows 95/NT systems are case insensitive but case
215         preserving.  For example if you tell the file system to create a
216         file named "Target", it will preserve the case.  Subsequent access to
217         the file with other case permutations will succeed (i.e. opening a
218         file named "target" or "TARGET" will open the file "Target").
220         By default, GNU make retains its case sensitivity when comparing
221         target names and existing files or directories.  It can be
222         configured, however, into a case preserving and case insensitive
223         mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
224         config.h.W32.
226         For example, the following makefile will create a file named
227         Target in the directory subdir which will subsequently be used
228         to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
229         Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
230         will not be made:
232         subdir/Target:
233                 touch $@
235         SUBDIR/DepTarget: SubDir/TARGET
236                 cp $^ $@
238         Reliance on this behavior also eliminates the ability of GNU make
239         to use case in comparison of matching rules.  For example, it is
240         not possible to set up a C++ rule using %.C that is different
241         than a C rule using %.c.  GNU make will consider these to be the
242         same rule and will issue a warning.
244 SAMBA/NTFS/VFAT:
246         I have not had any success building the debug version of this
247         package using SAMBA as my file server. The reason seems to be
248         related to the way VC++ 4.0 changes the case name of the pdb
249         filename it is passed on the command line. It seems to change
250         the name always to to lower case. I contend that the VC++
251         compiler should not change the casename of files that are passed
252         as arguments on the command line. I don't think this was a
253         problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
255         The package builds fine on VFAT and NTFS filesystems.
257         Most all of the development I have done to date has been using
258         NTFS and long file names. I have not done any considerable work
259         under VFAT. VFAT users may wish to be aware that this port of
260         make does respect case sensitivity.
262 FAT:
264         Version 3.76 added support for FAT filesystems. Make works
265         around some difficulties with stat'ing of files and caching of
266         filenames and directories internally.
268 Bug reports:
270         Please submit bugs via the normal bug reporting mechanism which
271         is described in the GNU make manual and the base README.
273 -------------------------------------------------------------------------------
274 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
275 2006 Free Software Foundation, Inc.
276 This file is part of GNU Make.
278 GNU Make is free software; you can redistribute it and/or modify it under the
279 terms of the GNU General Public License as published by the Free Software
280 Foundation; either version 2, or (at your option) any later version.
282 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
283 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
284 A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
286 You should have received a copy of the GNU General Public License along with
287 GNU Make; see the file COPYING.  If not, write to the Free Software
288 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.