1 Port of GNU make to Windows NT and Windows 95
2 Builds natively with MSVC 2.x or MSVC 4.x compilers.
3 Should also build fine with MSVC 5.x and 6.x (though not confirmed).
5 This Windows 32-bit port of GNU make is maintained primarily by Rob
6 Tulloh, who is also the author of this README.
8 To build with nmake on Windows NT, Windows 95, or Windows 98:
10 1. Make sure cl.exe is in your %Path%. Example:
12 set Path=%Path%;c:/msdev/bin
14 2. Make sure %include% is set to msvc include directory. Example:
16 set include=c:/msdev/include
18 3. Make sure %lib% is set to msvc lib directory. Example:
25 A short cut to steps 1, 2, and 3 is to run VCVARS32.bat before
26 invoking namke. For example:
31 cd \path\to\make-%VERSION%
34 There is a bat file (build_w32.bat) for folks who have fear of nmake.
44 GNU make on Windows 32-bit platforms:
46 This version of make is ported natively to Windows32 platforms
47 (Windows NT 3.51, Windows NT 4.0, Windows 95, and Windows 98). It
48 does not rely on any 3rd party software or add-on packages for
49 building. The only thing needed is a version of Visual C++,
50 which is the predominant compiler used on Windows32 platforms.
52 Do not confuse this port of GNU make with other Windows32 projects
53 which provide a GNU make binary. These are separate projects
54 and are not connected to this port effort.
58 This port prefers you have a working sh.exe somewhere on your
59 system. If you don't have sh.exe, the port falls back to
60 MSDOS mode for launching programs (via a batch file).
61 The MSDOS mode style execution has not been tested that
62 carefully though (The author uses GNU bash as sh.exe).
64 There are very few true ports of Bourne shell for NT right now.
65 There is a version of GNU bash available from Cygnus "Cygwin"
66 porting effort (http://sourceware.cygnus.com/cygwin).
67 Other possibilities are the MKS version of sh.exe, or building
68 your own with a package like NutCracker (DataFocus) or Portage
71 GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
73 Some versions of Bourne shell do not behave well when invoked
74 as 'sh -c' from CreateProcess(). The main problem is they seem
75 to have a hard time handling quoted strings correctly. This can
76 be circumvented by writing commands to be executed to a batch
77 file and then executing the command by calling 'sh file'.
79 To work around this difficulty, this version of make supports
80 a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
81 time, make forces all command lines to be executed via script
82 files instead of by command line.
84 A native Windows32 system with no Bourne shell will also run
85 in batch mode. All command lines will be put into batch files
86 and executed via $(COMSPEC) (%COMSPEC%). Note that parallel
87 builds (-j) require a working Bourne shell; they will not work
90 GNU make and Cygnus GNU Windows32 tools:
92 Good news! Make now has native support for Cygwin sh. To enable,
93 define the HAVE_CYGWIN_SHELL in config.h and rebuild make
94 from scratch. This version of make tested with B20.1 of Cygwin.
95 Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
97 GNU make and the MKS shell:
99 There is now semi-official support for the MKS shell. To turn this
100 support on, define HAVE_MKS_SHELL in the config.h.W32 before you
101 build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
104 GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
106 There is a caveat that should be noted with respect to handling
107 single character pathnames on Windows systems. When colon is
108 used in PATH variables, make tries to be smart about knowing when
109 you are using colon as a separator versus colon as a drive
110 letter. Unfortunately, something as simple as the string 'x:/'
111 could be interpreted 2 ways: (x and /) or (x:/).
113 Make chooses to interpret a letter plus colon (e.g. x:/) as a
114 drive letter pathname. If it is necessary to use single
115 character directories in paths (VPATH, vpath, Path, PATH), the
116 user must do one of two things:
118 a. Use semicolon as the separator to disambiguate colon. For
119 example use 'x;/' if you want to say 'x' and '/' are
122 b. Qualify the directory name so that there is more than
123 one character in the path(s) used. For example, none
124 of these settings are ambiguous:
127 /some/path/x:/some/path/y
128 x:/some/path/x:x:/some/path/y
130 Please note that you are free to mix colon and semi-colon in the
131 specification of paths. Make is able to figure out the intended
132 result and convert the paths internally to the format needed
133 when interacting with the operating system.
135 You are encouraged to use colon as the separator character.
136 This should ease the pain of deciding how to handle various path
137 problems which exist between platforms. If colon is used on
138 both Unix and Windows systems, then no ifdef'ing will be
139 necessary in the makefile source.
143 I verified all functionality with a slightly modified version
144 of make-test-%VERSION% (modifications to get test suite to run
145 on Windows NT). All tests pass in an environment that includes
146 sh.exe. Tests were performed on both Windows NT and Windows 95.
148 Building GNU make on Windows NT and Windows 95/98 with Microsoft Visual C:
150 I did not provide a Visual C project file with this port as
151 the project file would not be considered freely distributable
152 (or so I think). It is easy enough to create one, though, if
153 you know how to use Visual C.
155 I build the program statically to avoid problems locating DLL's
156 on machines that may not have MSVC runtime installed. If you
157 prefer, you can change make to build with shared libraries by
158 changing /MT to /MD in the NMakefile (or in build_w32.bat).
160 The program has not been built for non-Intel architectures (yet).
162 I have not tried to build with any other compilers than MSVC. I
163 have heard that this is possible though so don't be afraid to
164 notify me of your successes!
166 Pathnames and white space:
168 Unlike Unix, Windows 95/NT systems encourage pathnames which
169 contain white space (e.g. C:\Program Files\). These sorts of pathnames
170 are legal under Unix too, but are never encouraged. There is
171 at least one place in make (VPATH/vpath handling) where paths
172 containing white space will simply not work. There may be others
173 too. I chose to not try and port make in such a way so that
174 these sorts of paths could be handled. I offer these suggestions
178 2. Rename the directory so it does not contain white space.
180 If you are unhappy with this choice, this is free software
181 and you are free to take a crack at making this work. The code
182 in w32/pathstuff.c and vpath.c would be the places to start.
184 Pathnames and Case insensitivity:
186 Unlike Unix, Windows 95/NT systems are case insensitive but case
187 preserving. For example if you tell the file system to create a
188 file named "Target", it will preserve the case. Subsequent access to
189 the file with other case permutations will succeed (i.e. opening a
190 file named "target" or "TARGET" will open the file "Target").
192 By default, GNU make retains its case sensitivity when comparing
193 target names and existing files or directories. It can be
194 configured, however, into a case preserving and case insensitive
195 mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
198 For example, the following makefile will create a file named
199 Target in the directory subdir which will subsequently be used
200 to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
201 Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
207 SUBDIR/DepTarget: SubDir/TARGET
210 Reliance on this behavior also eliminates the ability of GNU make
211 to use case in comparison of matching rules. For example, it is
212 not possible to set up a C++ rule using %.C that is different
213 than a C rule using %.c. GNU make will consider these to be the
214 same rule and will issue a warning.
218 I have not had any success building the debug version of this
219 package using SAMBA as my file server. The reason seems to be
220 related to the way VC++ 4.0 changes the case name of the pdb
221 filename it is passed on the command line. It seems to change
222 the name always to to lower case. I contend that
223 the VC++ compiler should not change the casename of files that
224 are passed as arguments on the command line. I don't think this
225 was a problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
227 The package builds fine on VFAT and NTFS filesystems.
229 Most all of the development I have done to date has been using
230 NTFS and long file names. I have not done any considerable work
231 under VFAT. VFAT users may wish to be aware that this port
232 of make does respect case sensitivity.
236 Version 3.76 added support for FAT filesystems. Make
237 works around some difficulties with stat'ing of
238 files and caching of filenames and directories internally.
242 Please submit bugs via the normal bug reporting mechanism which
243 is described in the GNU make manual and the base README.