1 This version of GNU make has been tested on
2 Microsoft Windows 2000/XP/2003/Vista/7/2008.
3 It has also been used on Windows 95/98/NT, and on OS/2.
5 It builds with the MinGW port of GCC (tested with GCC 3.4.2).
7 It also builds with MSVC 2.x, 4.x, 5.x, 6.x, and 2003 as well as
8 with .NET 7.x and .NET 2003.
10 As of version 3.83, a build with Guile is supported (tested with Guile
11 2.0.3). To build with Guile, you will need, in addition to Guile
12 itself, its dependency libraries and the pkg-config program. The
13 latter is used to figure out which compilation and link switches and
14 libraries need to be mentioned on the compiler command lines to
15 correctly link with Guile. A Windows port of pkg-config can be found
16 on the Windows download page of the GTK+ project:
18 http://www.gtk.org/download/win32.php
20 The libraries on which Guile depends can vary depending on your
21 version and build of Guile. At the very least, the Boehm's GC library
22 will be needed, and typically also GNU MP, libffi, libunistring, and
23 libtool's libltdl. Whoever built the port of Guile you have should
24 also provide you with these dependencies or a URL where to download
27 The Windows 32-bit port of GNU make is maintained jointly by various
28 people. It was originally made by Rob Tulloh.
31 Do this first, regardless of the build method you choose:
32 ---------------------------------------------------------
34 1. At the Windows command prompt run:
36 if not exist NMakefile copy NMakefile.template NMakefile
37 if not exist config.h copy config.h.W32 config.h
39 Then edit config.h to your liking (especially the few shell-related
40 defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
41 to './configure --enable-case-insensitive-file-system').
44 Using make_msvc_net2003.vcproj
45 ------------------------------
47 2. Open make_msvc_net2003.vcproj in MSVS71 or MSVC71 or any compatible IDE,
48 then build this project as usual. There's also a solution file for
52 Building with (MinGW-)GCC using build_w32.bat
53 ---------------------------------------------
55 2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
56 correct PATH and other environment variables for it, then execute ...
60 This produces gnumake.exe in the current directory.
62 The batch file will probe for Guile installation, and will build
63 gnumake.exe with Guile if it finds it. If you have Guile
64 installed, but want to build Make without Guile support, type
66 build_w32.bat --without-guile gcc
69 Building with (MSVC++-)cl using build_w32.bat or NMakefile
70 ----------------------------------------------------------
72 2. Open a W32 command prompt for your installed (MSVC++-)cl, setup a
73 correct PATH and other environment variables for it (usually via
74 executing vcvars32.bat or vsvars32.bat from the cl-installation,
75 e.g. "%VS71COMNTOOLS%vsvars32.bat"; or using a corresponding start
76 menue entry from the cl-installation), then execute EITHER ...
80 (this produces WinDebug/gnumake.exe and WinRel/gnumake.exe)
86 (this produces WinDebug/make.exe and WinRel/make.exe).
88 The batch file will probe for Guile installation, and will build
89 gnumake.exe with Guile if it finds it. If you have Guile
90 installed, but want to build Make without Guile support, type
92 build_w32.bat --without-guile
98 GNU make on Windows 32-bit platforms:
100 This version of make is ported natively to Windows32 platforms
101 (Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
102 Windows 95, and Windows 98). It does not rely on any 3rd party
103 software or add-on packages for building. The only thing
104 needed is a Windows compiler. Two compilers supported
105 officially are the MinGW port of GNU GCC, and the various
106 versions of the Microsoft C compiler.
108 Do not confuse this port of GNU make with other Windows32 projects
109 which provide a GNU make binary. These are separate projects
110 and are not connected to this port effort.
114 This port prefers if you have a working sh.exe somewhere on
115 your system. If you don't have sh.exe, the port falls back to
116 MSDOS mode for launching programs (via a batch file). The
117 MSDOS mode style execution has not been tested that carefully
118 though (The author uses GNU bash as sh.exe).
120 There are very few true ports of Bourne shell for NT right now.
121 There is a version of GNU bash available from Cygnus "Cygwin"
122 porting effort (http://www.cygwin.com/).
123 Other possibilities are the MKS version of sh.exe, or building
124 your own with a package like NutCracker (DataFocus) or Portage
125 (Consensys). Also MinGW includes sh (http://mingw.org/).
127 GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
129 Some versions of Bourne shell do not behave well when invoked
130 as 'sh -c' from CreateProcess(). The main problem is they seem
131 to have a hard time handling quoted strings correctly. This can
132 be circumvented by writing commands to be executed to a batch
133 file and then executing the command by calling 'sh file'.
135 To work around this difficulty, this version of make supports
136 a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
137 time, make forces all command lines to be executed via script
138 files instead of by command line. In this mode you must have a
139 working sh.exe in order to use parallel builds (-j).
141 A native Windows32 system with no Bourne shell will also run
142 in batch mode. All command lines will be put into batch files
143 and executed via $(COMSPEC) (%COMSPEC%). However, parallel
144 builds ARE supported with Windows shells (cmd.exe and
145 command.com). See the next section about some peculiarities
146 of parallel builds on Windows.
148 Support for parallel builds
150 Parallel builds (-jN) are supported in this port, with 1
151 limitation: The number of concurrent processes has a hard
152 limit of 64, due to the way this port implements waiting for
155 GNU make and Cygnus GNU Windows32 tools:
157 Good news! Make now has native support for Cygwin sh. To enable,
158 define the HAVE_CYGWIN_SHELL in config.h and rebuild make
159 from scratch. This version of make tested with B20.1 of Cygwin.
160 Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
162 GNU make and the MKS shell:
164 There is now semi-official support for the MKS shell. To turn this
165 support on, define HAVE_MKS_SHELL in the config.h.W32 before you
166 build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
169 GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
171 There is a caveat that should be noted with respect to handling
172 single character pathnames on Windows systems. When colon is
173 used in PATH variables, make tries to be smart about knowing when
174 you are using colon as a separator versus colon as a drive
175 letter. Unfortunately, something as simple as the string 'x:/'
176 could be interpreted 2 ways: (x and /) or (x:/).
178 Make chooses to interpret a letter plus colon (e.g. x:/) as a
179 drive letter pathname. If it is necessary to use single
180 character directories in paths (VPATH, vpath, Path, PATH), the
181 user must do one of two things:
183 a. Use semicolon as the separator to disambiguate colon. For
184 example use 'x;/' if you want to say 'x' and '/' are
187 b. Qualify the directory name so that there is more than
188 one character in the path(s) used. For example, none
189 of these settings are ambiguous:
192 /some/path/x:/some/path/y
193 x:/some/path/x:x:/some/path/y
195 Please note that you are free to mix colon and semi-colon in the
196 specification of paths. Make is able to figure out the intended
197 result and convert the paths internally to the format needed
198 when interacting with the operating system, providing the path
199 is not within quotes, e.g. "x:/test/test.c".
201 You are encouraged to use colon as the separator character.
202 This should ease the pain of deciding how to handle various path
203 problems which exist between platforms. If colon is used on
204 both Unix and Windows systems, then no ifdef'ing will be
205 necessary in the makefile source.
209 I verified all functionality with a slightly modified version
210 of make-test-%VERSION% (modifications to get test suite to run
211 on Windows NT). All tests pass in an environment that includes
212 sh.exe. Tests were performed on both Windows NT and Windows 95.
214 Pathnames and white space:
216 Unlike Unix, Windows 95/NT systems encourage pathnames which
217 contain white space (e.g. C:\Program Files\). These sorts of
218 pathnames are valid on Unix too, but are never encouraged.
219 There is at least one place in make (VPATH/vpath handling) where
220 paths containing white space will simply not work. There may be
221 others too. I chose to not try and port make in such a way so
222 that these sorts of paths could be handled. I offer these
223 suggestions as workarounds:
225 1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
226 "x:\longpathtest". Type "dir /x" to view these filenames
227 within the cmd.exe shell.
228 2. Rename the directory so it does not contain white space.
230 If you are unhappy with this choice, this is free software
231 and you are free to take a crack at making this work. The code
232 in w32/pathstuff.c and vpath.c would be the places to start.
234 Pathnames and Case insensitivity:
236 Unlike Unix, Windows 95/NT systems are case insensitive but case
237 preserving. For example if you tell the file system to create a
238 file named "Target", it will preserve the case. Subsequent access to
239 the file with other case permutations will succeed (i.e. opening a
240 file named "target" or "TARGET" will open the file "Target").
242 By default, GNU make retains its case sensitivity when comparing
243 target names and existing files or directories. It can be
244 configured, however, into a case preserving and case insensitive
245 mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
248 For example, the following makefile will create a file named
249 Target in the directory subdir which will subsequently be used
250 to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
251 Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
257 SUBDIR/DepTarget: SubDir/TARGET
260 Reliance on this behavior also eliminates the ability of GNU make
261 to use case in comparison of matching rules. For example, it is
262 not possible to set up a C++ rule using %.C that is different
263 than a C rule using %.c. GNU make will consider these to be the
264 same rule and will issue a warning.
268 I have not had any success building the debug version of this
269 package using SAMBA as my file server. The reason seems to be
270 related to the way VC++ 4.0 changes the case name of the pdb
271 filename it is passed on the command line. It seems to change
272 the name always to to lower case. I contend that the VC++
273 compiler should not change the casename of files that are passed
274 as arguments on the command line. I don't think this was a
275 problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
277 The package builds fine on VFAT and NTFS filesystems.
279 Most all of the development I have done to date has been using
280 NTFS and long file names. I have not done any considerable work
281 under VFAT. VFAT users may wish to be aware that this port of
282 make does respect case sensitivity.
286 Version 3.76 added support for FAT filesystems. Make works
287 around some difficulties with stat'ing of files and caching of
288 filenames and directories internally.
292 Please submit bugs via the normal bug reporting mechanism which
293 is described in the GNU make manual and the base README.
295 -------------------------------------------------------------------------------
296 Copyright (C) 1996-2012 Free Software Foundation, Inc.
297 This file is part of GNU Make.
299 GNU Make is free software; you can redistribute it and/or modify it under the
300 terms of the GNU General Public License as published by the Free Software
301 Foundation; either version 3 of the License, or (at your option) any later
304 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
305 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
306 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
308 You should have received a copy of the GNU General Public License along with
309 this program. If not, see <http://www.gnu.org/licenses/>.