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