1 1.1 christos # -*-Makefile-*- to build GNU make with nmake 2 1.1 christos # 3 1.1 christos # NOTE: If you have no 'make' program at all to process this makefile, 4 1.1 christos # run 'build_w32.bat' instead. 5 1.1 christos # 6 1.1 christos # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 7 1.1 christos # 2006 Free Software Foundation, Inc. 8 1.1 christos # This file is part of GNU Make. 9 1.1 christos # 10 1.1 christos # GNU Make is free software; you can redistribute it and/or modify it under the 11 1.1 christos # terms of the GNU General Public License as published by the Free Software 12 1.1 christos # Foundation; either version 2, or (at your option) any later version. 13 1.1 christos # 14 1.1 christos # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 15 1.1 christos # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 1.1 christos # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 1.1 christos # 18 1.1 christos # You should have received a copy of the GNU General Public License along with 19 1.1 christos # GNU Make; see the file COPYING. If not, write to the Free Software 20 1.1 christos # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21 1.1 christos 22 1.1 christos LINK = link 23 1.1 christos CC = cl 24 1.1 christos MAKE = nmake 25 1.1 christos 26 1.1 christos OUTDIR=. 27 1.1 christos MAKEFILE=NMakefile 28 1.1 christos SUBPROC_MAKEFILE=NMakefile 29 1.1 christos 30 1.1 christos CFLAGS_any = /nologo /MT /W4 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H 31 1.1 christos CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb 32 1.1 christos CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/ 33 1.1 christos 34 1.1 christos LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\ 35 1.1 christos /INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \ 36 1.1 christos /OUT:WinDebug/make.exe /DEBUG 37 1.1 christos LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\ 38 1.1 christos /INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe 39 1.1 christos 40 1.1 christos all: config.h subproc Release Debug 41 1.1 christos 42 1.1 christos # 43 1.1 christos # Make sure we build the subproc library first. It has it's own 44 1.1 christos # makefile. To be portable to Windows 95, we put the instructions 45 1.1 christos # on how to build the library into a batch file. On NT, we could 46 1.1 christos # simply have done foo && bar && dog, but this doesn't port. 47 1.1 christos # 48 1.1 christos subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib 49 1.1 christos 50 1.1 christos w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c 51 1.1 christos subproc.bat $(SUBPROC_MAKEFILE) $(MAKE) 52 1.1 christos if exist WinDebug\make.exe erase WinDebug\make.exe 53 1.1 christos if exist WinRel\make.exe erase WinRel\make.exe 54 1.1 christos 55 1.1 christos config.h: config.h.W32 56 1.1 christos copy $? $@ 57 1.1 christos 58 1.1 christos Release: 59 1.1 christos $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe 60 1.1 christos Debug: 61 1.1 christos $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe 62 1.1 christos 63 1.1 christos clean: 64 1.1 christos if exist WinDebug\nul rmdir /s /q WinDebug 65 1.1 christos if exist WinRel\nul rmdir /s /q WinRel 66 1.1 christos if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug 67 1.1 christos if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel 68 1.1 christos if exist config.h erase config.h 69 1.1 christos erase *.pdb 70 1.1 christos 71 1.1 christos $(OUTDIR): 72 1.1 christos if not exist .\$@\nul mkdir .\$@ 73 1.1 christos 74 1.1 christos LIBS = kernel32.lib user32.lib advapi32.lib 75 1.1 christos 76 1.1 christos OBJS = \ 77 1.1 christos $(OUTDIR)/ar.obj \ 78 1.1 christos $(OUTDIR)/arscan.obj \ 79 1.1 christos $(OUTDIR)/commands.obj \ 80 1.1 christos $(OUTDIR)/default.obj \ 81 1.1 christos $(OUTDIR)/dir.obj \ 82 1.1 christos $(OUTDIR)/expand.obj \ 83 1.1 christos $(OUTDIR)/file.obj \ 84 1.1 christos $(OUTDIR)/function.obj \ 85 1.1 christos $(OUTDIR)/getloadavg.obj \ 86 1.1 christos $(OUTDIR)/getopt.obj \ 87 1.1 christos $(OUTDIR)/getopt1.obj \ 88 1.1 christos $(OUTDIR)/hash.obj \ 89 1.1 christos $(OUTDIR)/implicit.obj \ 90 1.1 christos $(OUTDIR)/job.obj \ 91 1.1 christos $(OUTDIR)/main.obj \ 92 1.1 christos $(OUTDIR)/misc.obj \ 93 1.1 christos $(OUTDIR)/read.obj \ 94 1.1 christos $(OUTDIR)/remake.obj \ 95 1.1 christos $(OUTDIR)/remote-stub.obj \ 96 1.1 christos $(OUTDIR)/rule.obj \ 97 1.1 christos $(OUTDIR)/signame.obj \ 98 1.1 christos $(OUTDIR)/strcache.obj \ 99 1.1 christos $(OUTDIR)/variable.obj \ 100 1.1 christos $(OUTDIR)/version.obj \ 101 1.1 christos $(OUTDIR)/vpath.obj \ 102 1.1 christos $(OUTDIR)/glob.obj \ 103 1.1 christos $(OUTDIR)/fnmatch.obj \ 104 1.1 christos $(OUTDIR)/dirent.obj \ 105 1.1 christos $(OUTDIR)/pathstuff.obj 106 1.1 christos 107 1.1 christos $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS) 108 1.1 christos $(LINK) @<< 109 1.1 christos $(LDFLAGS) $(LIBS) $(OBJS) 110 1.1 christos << 111 1.1 christos 112 1.1 christos .c{$(OUTDIR)}.obj: 113 1.1 christos $(CC) $(CFLAGS) /c $< 114 1.1 christos 115 1.1 christos $(OUTDIR)/glob.obj : glob/glob.c 116 1.1 christos $(CC) $(CFLAGS) /c $? 117 1.1 christos $(OUTDIR)/fnmatch.obj : glob/fnmatch.c 118 1.1 christos $(CC) $(CFLAGS) /c $? 119 1.1 christos $(OUTDIR)/dirent.obj : w32/compat/dirent.c 120 1.1 christos $(CC) $(CFLAGS) /c $? 121 1.1 christos $(OUTDIR)/pathstuff.obj : w32/pathstuff.c 122 1.1 christos $(CC) $(CFLAGS) /c $? 123 1.1 christos 124 1.1 christos # --------------- DEPENDENCIES 125 1.1 christos # 126 1.1 christos 127 1.1 christos # .deps/alloca.Po 128 1.1 christos # dummy 129 1.1 christos 130 1.1 christos # .deps/ar.Po 131 1.1 christos ar.o ar.o: ar.c make.h config.h \ 132 1.1 christos getopt.h \ 133 1.1 christos gettext.h filedef.h hash.h dep.h \ 134 1.1 christos 135 1.1 christos # .deps/arscan.Po 136 1.1 christos arscan.o arscan.o: arscan.c make.h config.h \ 137 1.1 christos getopt.h \ 138 1.1 christos gettext.h \ 139 1.1 christos 140 1.1 christos # .deps/commands.Po 141 1.1 christos commands.o commands.o: commands.c make.h config.h \ 142 1.1 christos getopt.h \ 143 1.1 christos gettext.h dep.h filedef.h hash.h variable.h \ 144 1.1 christos job.h commands.h 145 1.1 christos 146 1.1 christos # .deps/default.Po 147 1.1 christos default.o default.o: default.c make.h config.h \ 148 1.1 christos getopt.h \ 149 1.1 christos gettext.h filedef.h hash.h variable.h rule.h \ 150 1.1 christos dep.h job.h commands.h 151 1.1 christos 152 1.1 christos # .deps/dir.Po 153 1.1 christos dir.o dir.o: dir.c make.h config.h \ 154 1.1 christos getopt.h \ 155 1.1 christos gettext.h hash.h \ 156 1.1 christos 157 1.1 christos # .deps/expand.Po 158 1.1 christos expand.o expand.o: expand.c make.h config.h \ 159 1.1 christos getopt.h \ 160 1.1 christos gettext.h filedef.h hash.h \ 161 1.1 christos job.h commands.h \ 162 1.1 christos variable.h rule.h 163 1.1 christos 164 1.1 christos # .deps/file.Po 165 1.1 christos file.o file.o: file.c make.h config.h \ 166 1.1 christos getopt.h \ 167 1.1 christos gettext.h dep.h filedef.h \ 168 1.1 christos hash.h job.h commands.h \ 169 1.1 christos variable.h debug.h 170 1.1 christos 171 1.1 christos # .deps/function.Po 172 1.1 christos function.o function.o: function.c make.h config.h \ 173 1.1 christos getopt.h \ 174 1.1 christos gettext.h filedef.h hash.h variable.h dep.h \ 175 1.1 christos job.h commands.h debug.h 176 1.1 christos 177 1.1 christos # .deps/getloadavg.Po 178 1.1 christos # dummy 179 1.1 christos 180 1.1 christos # .deps/getopt.Po 181 1.1 christos getopt.o getopt.o: getopt.c config.h \ 182 1.1 christos 183 1.1 christos # .deps/getopt1.Po 184 1.1 christos getopt1.o getopt1.o: getopt1.c config.h getopt.h \ 185 1.1 christos 186 1.1 christos # .deps/hash.Po 187 1.1 christos hash.o hash.o: hash.c make.h config.h \ 188 1.1 christos getopt.h \ 189 1.1 christos gettext.h hash.h 190 1.1 christos 191 1.1 christos # .deps/implicit.Po 192 1.1 christos implicit.o implicit.o: implicit.c make.h config.h \ 193 1.1 christos getopt.h \ 194 1.1 christos gettext.h filedef.h hash.h rule.h dep.h debug.h \ 195 1.1 christos variable.h job.h \ 196 1.1 christos commands.h 197 1.1 christos 198 1.1 christos # .deps/job.Po 199 1.1 christos job.o job.o: job.c make.h config.h \ 200 1.1 christos getopt.h \ 201 1.1 christos gettext.h job.h \ 202 1.1 christos debug.h filedef.h hash.h \ 203 1.1 christos commands.h variable.h \ 204 1.1 christos 205 1.1 christos # .deps/loadavg-getloadavg.Po 206 1.1 christos loadavg-getloadavg.o loadavg-getloadavg.o: getloadavg.c config.h \ 207 1.1 christos make.h \ 208 1.1 christos getopt.h \ 209 1.1 christos gettext.h \ 210 1.1 christos 211 1.1 christos # .deps/main.Po 212 1.1 christos main.o main.o: main.c make.h config.h \ 213 1.1 christos getopt.h \ 214 1.1 christos gettext.h dep.h filedef.h hash.h variable.h \ 215 1.1 christos job.h commands.h rule.h \ 216 1.1 christos debug.h getopt.h \ 217 1.1 christos 218 1.1 christos # .deps/misc.Po 219 1.1 christos misc.o misc.o: misc.c make.h config.h \ 220 1.1 christos getopt.h \ 221 1.1 christos gettext.h dep.h debug.h 222 1.1 christos 223 1.1 christos # .deps/read.Po 224 1.1 christos read.o read.o: read.c make.h config.h \ 225 1.1 christos getopt.h \ 226 1.1 christos gettext.h \ 227 1.1 christos dep.h filedef.h hash.h job.h \ 228 1.1 christos commands.h variable.h rule.h debug.h \ 229 1.1 christos 230 1.1 christos # .deps/remake.Po 231 1.1 christos remake.o remake.o: remake.c make.h config.h \ 232 1.1 christos getopt.h \ 233 1.1 christos gettext.h filedef.h hash.h job.h \ 234 1.1 christos commands.h dep.h \ 235 1.1 christos variable.h debug.h 236 1.1 christos 237 1.1 christos # .deps/remote-cstms.Po 238 1.1 christos # dummy 239 1.1 christos 240 1.1 christos # .deps/remote-stub.Po 241 1.1 christos remote-stub.o remote-stub.o: remote-stub.c make.h config.h \ 242 1.1 christos getopt.h \ 243 1.1 christos gettext.h filedef.h hash.h job.h \ 244 1.1 christos commands.h 245 1.1 christos 246 1.1 christos # .deps/rule.Po 247 1.1 christos rule.o rule.o: rule.c make.h config.h \ 248 1.1 christos getopt.h \ 249 1.1 christos gettext.h dep.h filedef.h hash.h job.h \ 250 1.1 christos commands.h variable.h \ 251 1.1 christos rule.h 252 1.1 christos 253 1.1 christos # .deps/signame.Po 254 1.1 christos signame.o signame.o: signame.c make.h config.h \ 255 1.1 christos getopt.h \ 256 1.1 christos gettext.h 257 1.1 christos 258 1.1 christos # .deps/strcache.Po 259 1.1 christos strcache.o strcache.o: strcache.c make.h config.h \ 260 1.1 christos getopt.h \ 261 1.1 christos gettext.h hash.h 262 1.1 christos 263 1.1 christos # .deps/variable.Po 264 1.1 christos variable.o variable.o: variable.c make.h config.h \ 265 1.1 christos getopt.h \ 266 1.1 christos gettext.h dep.h filedef.h \ 267 1.1 christos hash.h job.h commands.h \ 268 1.1 christos variable.h rule.h 269 1.1 christos 270 1.1 christos # .deps/version.Po 271 1.1 christos version.o version.o: version.c config.h 272 1.1 christos 273 1.1 christos # .deps/vmsjobs.Po 274 1.1 christos # dummy 275 1.1 christos 276 1.1 christos # .deps/vpath.Po 277 1.1 christos vpath.o vpath.o: vpath.c make.h config.h \ 278 1.1 christos getopt.h \ 279 1.1 christos gettext.h filedef.h hash.h variable.h 280