Imported Upstream version 4.2
[platform/upstream/make.git] / NMakefile
1 # -*-Makefile-*- to build GNU make with nmake
2 #
3 # NOTE: If you have no 'make' program at all to process this makefile,
4 # run 'build_w32.bat' instead.
5 #
6 # Copyright (C) 1996-2016 Free Software Foundation, Inc.
7 # This file is part of GNU Make.
8 #
9 # GNU Make is free software; you can redistribute it and/or modify it under
10 # the terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 3 of the License, or (at your option) any later
12 # version.
13 #
14 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17 # details.
18 #
19 # You should have received a copy of the GNU General Public License along with
20 # this program.  If not, see <http://www.gnu.org/licenses/>.
21
22 LINK = link
23 CC = cl
24 MAKE = nmake
25
26 OUTDIR=.
27 MAKEFILE=NMakefile
28 SUBPROC_MAKEFILE=NMakefile
29
30 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 CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
32 CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
33
34 LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
35         /STACK:0x400000 /INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
36 LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
37         /STACK:0x400000 /INCREMENTAL:no /OUT:WinRel/make.exe
38
39 all: config.h subproc Release Debug
40
41 #
42 # Make sure we build the subproc library first. It has it's own
43 # makefile. To be portable to Windows 95, we put the instructions
44 # on how to build the library into a batch file. On NT, we could
45 # simply have done foo && bar && dog, but this doesn't port.
46 #
47 subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
48
49 w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
50         subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
51         if exist WinDebug\make.exe erase WinDebug\make.exe
52         if exist WinRel\make.exe erase WinRel\make.exe
53
54 config.h: config.h.W32
55         copy $? $@
56
57 Release:
58         $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
59 Debug:
60         $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
61
62 clean:
63         if exist WinDebug\nul rmdir /s /q WinDebug
64         if exist WinRel\nul rmdir /s /q WinRel
65         if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
66         if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
67         if exist config.h erase config.h
68         erase *.pdb
69
70 $(OUTDIR):
71         if not exist .\$@\nul mkdir .\$@
72
73 LIBS = kernel32.lib user32.lib advapi32.lib
74
75 guile = $(OUTDIR)/guile.obj
76
77 OBJS = \
78         $(OUTDIR)/ar.obj \
79         $(OUTDIR)/arscan.obj \
80         $(OUTDIR)/commands.obj \
81         $(OUTDIR)/default.obj \
82         $(OUTDIR)/dir.obj \
83         $(OUTDIR)/expand.obj \
84         $(OUTDIR)/file.obj \
85         $(OUTDIR)/function.obj \
86         $(OUTDIR)/getloadavg.obj \
87         $(OUTDIR)/getopt.obj \
88         $(OUTDIR)/getopt1.obj \
89         $(OUTDIR)/hash.obj \
90         $(OUTDIR)/implicit.obj \
91         $(OUTDIR)/job.obj \
92         $(OUTDIR)/load.obj \
93         $(OUTDIR)/main.obj \
94         $(OUTDIR)/misc.obj \
95         $(OUTDIR)/output.obj \
96         $(OUTDIR)/read.obj \
97         $(OUTDIR)/remake.obj \
98         $(OUTDIR)/remote-stub.obj \
99         $(OUTDIR)/rule.obj \
100         $(OUTDIR)/signame.obj \
101         $(OUTDIR)/strcache.obj \
102         $(OUTDIR)/variable.obj \
103         $(OUTDIR)/version.obj \
104         $(OUTDIR)/vpath.obj \
105         $(OUTDIR)/glob.obj \
106         $(OUTDIR)/fnmatch.obj \
107         $(OUTDIR)/dirent.obj \
108         $(OUTDIR)/pathstuff.obj \
109         $(OUTDIR)/posixfcn.obj \
110         $(OUTDIR)/w32os.obj \
111         $(guile)
112
113 $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
114         $(LINK) @<<
115                 $(LDFLAGS) $(LIBS) $(OBJS)
116 <<
117
118 .c{$(OUTDIR)}.obj:
119         $(CC) $(CFLAGS) /c $<
120
121 $(OUTDIR)/glob.obj : glob/glob.c
122         $(CC) $(CFLAGS) /c $?
123 $(OUTDIR)/fnmatch.obj : glob/fnmatch.c
124         $(CC) $(CFLAGS) /c $?
125 $(OUTDIR)/dirent.obj : w32/compat/dirent.c
126         $(CC) $(CFLAGS) /c $?
127 $(OUTDIR)/posixfcn.obj : w32/compat/posixfcn.c
128         $(CC) $(CFLAGS) /c $?
129 $(OUTDIR)/pathstuff.obj : w32/pathstuff.c
130         $(CC) $(CFLAGS) /c $?
131 $(OUTDIR)/w32os.obj : w32/w32os.c
132         $(CC) $(CFLAGS) /c $?
133
134 # --------------- DEPENDENCIES
135 #
136
137 # .deps/alloca.Po
138 # dummy
139
140 # .deps/ar.Po
141 $(OUTDIR)/ar.obj: ar.c makeint.h config.h \
142  gnumake.h \
143  getopt.h \
144  gettext.h \
145  filedef.h hash.h dep.h
146
147 # .deps/arscan.Po
148 $(OUTDIR)/arscan.obj: arscan.c makeint.h config.h \
149  gnumake.h \
150  getopt.h \
151  gettext.h \
152
153 # .deps/commands.Po
154 $(OUTDIR)/commands.obj: commands.c makeint.h config.h \
155  gnumake.h \
156  getopt.h \
157  gettext.h \
158  filedef.h hash.h dep.h variable.h job.h output.h \
159  commands.h
160
161 # .deps/default.Po
162 $(OUTDIR)/default.obj: default.c makeint.h config.h \
163  gnumake.h \
164  getopt.h \
165  gettext.h \
166  filedef.h hash.h variable.h rule.h dep.h job.h \
167  output.h \
168  commands.h
169
170 # .deps/dir.Po
171 $(OUTDIR)/dir.obj: dir.c makeint.h config.h \
172  gnumake.h \
173  getopt.h \
174  gettext.h \
175  hash.h \
176  filedef.h dep.h \
177
178 # .deps/expand.Po
179 $(OUTDIR)/expand.obj: expand.c makeint.h config.h \
180  gnumake.h \
181  getopt.h \
182  gettext.h \
183  filedef.h hash.h job.h output.h \
184  commands.h variable.h rule.h
185
186 # .deps/file.Po
187 $(OUTDIR)/file.obj: file.c makeint.h config.h \
188  gnumake.h \
189  getopt.h \
190  gettext.h \
191  filedef.h hash.h dep.h job.h output.h \
192  commands.h variable.h \
193  debug.h
194
195 # .deps/function.Po
196 $(OUTDIR)/function.obj: function.c makeint.h config.h \
197  gnumake.h \
198  getopt.h \
199  gettext.h \
200  filedef.h hash.h variable.h dep.h job.h output.h \
201  commands.h debug.h
202
203 # .deps/getloadavg.Po
204 # dummy
205
206 # .deps/getopt.Po
207 $(OUTDIR)/getopt.obj: getopt.c config.h \
208
209 # .deps/getopt1.Po
210 $(OUTDIR)/getopt1.obj: getopt1.c config.h getopt.h \
211
212 # .deps/guile.Po
213 $(OUTDIR)/guile.obj: guile.c makeint.h config.h \
214  gnumake.h \
215  getopt.h \
216  gettext.h \
217  debug.h filedef.h hash.h dep.h variable.h \
218  gmk-default.h
219
220 # .deps/hash.Po
221 $(OUTDIR)/hash.obj: hash.c makeint.h config.h \
222  gnumake.h \
223  getopt.h \
224  gettext.h \
225  hash.h
226
227 # .deps/implicit.Po
228 $(OUTDIR)/implicit.obj: implicit.c makeint.h config.h \
229  gnumake.h \
230  getopt.h \
231  gettext.h \
232  filedef.h hash.h rule.h dep.h debug.h variable.h job.h output.h \
233  commands.h
234
235 # .deps/job.Po
236 $(OUTDIR)/job.obj: job.c makeint.h config.h \
237  gnumake.h \
238  getopt.h \
239  gettext.h \
240  job.h output.h \
241  debug.h filedef.h hash.h \
242  commands.h variable.h os.h
243
244 # .deps/load.Po
245 $(OUTDIR)/load.obj: load.c makeint.h config.h \
246  gnumake.h \
247  getopt.h \
248  gettext.h \
249  debug.h \
250  filedef.h hash.h variable.h
251
252 # .deps/loadapi.Po
253 $(OUTDIR)/loadapi.obj: loadapi.c makeint.h config.h \
254  gnumake.h \
255  getopt.h \
256  gettext.h \
257  filedef.h hash.h variable.h dep.h
258
259 # .deps/loadavg-getloadavg.Po
260 # dummy
261
262 # .deps/main.Po
263 $(OUTDIR)/main.obj: main.c makeint.h config.h \
264  gnumake.h \
265  getopt.h \
266  gettext.h \
267  os.h \
268  filedef.h hash.h dep.h variable.h job.h output.h \
269  commands.h rule.h debug.h \
270  getopt.h
271
272 # .deps/misc.Po
273 $(OUTDIR)/misc.obj: misc.c makeint.h config.h \
274  gnumake.h \
275  getopt.h \
276  gettext.h \
277  filedef.h hash.h dep.h debug.h \
278
279 # .deps/output.Po
280 $(OUTDIR)/output.obj: output.c makeint.h config.h \
281  gnumake.h \
282  getopt.h \
283  gettext.h \
284  job.h \
285  output.h \
286
287 # .deps/posixos.Po
288 $(OUTDIR)/posixos.obj: posixos.c makeint.h config.h \
289  gnumake.h \
290  getopt.h \
291  gettext.h \
292  debug.h job.h output.h os.h
293
294 # .deps/read.Po
295 $(OUTDIR)/read.obj: read.c makeint.h config.h \
296  gnumake.h \
297  getopt.h \
298  gettext.h \
299  filedef.h hash.h dep.h job.h output.h \
300  commands.h variable.h rule.h \
301  debug.h
302
303 # .deps/remake.Po
304 $(OUTDIR)/remake.obj: remake.c makeint.h config.h \
305  gnumake.h \
306  getopt.h \
307  gettext.h \
308  filedef.h hash.h job.h output.h \
309  commands.h dep.h variable.h \
310  debug.h
311
312 # .deps/remote-cstms.Po
313 # dummy
314
315 # .deps/remote-stub.Po
316 $(OUTDIR)/remote-stub.obj: remote-stub.c makeint.h \
317  config.h \
318  gnumake.h \
319  getopt.h \
320  gettext.h \
321  filedef.h hash.h job.h output.h \
322  commands.h
323
324 # .deps/rule.Po
325 $(OUTDIR)/rule.obj: rule.c makeint.h config.h \
326  gnumake.h \
327  getopt.h \
328  gettext.h \
329  filedef.h hash.h dep.h job.h output.h \
330  commands.h variable.h rule.h
331
332 # .deps/signame.Po
333 $(OUTDIR)/signame.obj: signame.c makeint.h config.h \
334  gnumake.h \
335  getopt.h \
336  gettext.h \
337
338 # .deps/strcache.Po
339 $(OUTDIR)/strcache.obj: strcache.c makeint.h config.h \
340  gnumake.h \
341  getopt.h \
342  gettext.h \
343  hash.h
344
345 # .deps/variable.Po
346 $(OUTDIR)/variable.obj: variable.c makeint.h config.h \
347  gnumake.h \
348  getopt.h \
349  gettext.h \
350  filedef.h hash.h dep.h job.h output.h \
351  commands.h variable.h rule.h
352
353 # .deps/version.Po
354 $(OUTDIR)/version.obj: version.c config.h
355
356 # .deps/vmsjobs.Po
357 # dummy
358
359 # .deps/vpath.Po
360 $(OUTDIR)/vpath.obj: vpath.c makeint.h config.h \
361  gnumake.h \
362  getopt.h \
363  gettext.h \
364  filedef.h hash.h variable.h