packaging: Initial packaging
[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-2013 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         /INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
36 LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
37         /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)/main.obj \
93         $(OUTDIR)/misc.obj \
94         $(OUTDIR)/output.obj \
95         $(OUTDIR)/read.obj \
96         $(OUTDIR)/remake.obj \
97         $(OUTDIR)/remote-stub.obj \
98         $(OUTDIR)/rule.obj \
99         $(OUTDIR)/signame.obj \
100         $(OUTDIR)/strcache.obj \
101         $(OUTDIR)/variable.obj \
102         $(OUTDIR)/version.obj \
103         $(OUTDIR)/vpath.obj \
104         $(OUTDIR)/glob.obj \
105         $(OUTDIR)/fnmatch.obj \
106         $(OUTDIR)/dirent.obj \
107         $(OUTDIR)/pathstuff.obj \
108         $(guile)
109
110 $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
111         $(LINK) @<<
112                 $(LDFLAGS) $(LIBS) $(OBJS)
113 <<
114
115 .c{$(OUTDIR)}.obj:
116         $(CC) $(CFLAGS) /c $<
117
118 $(OUTDIR)/glob.obj : glob/glob.c
119         $(CC) $(CFLAGS) /c $?
120 $(OUTDIR)/fnmatch.obj : glob/fnmatch.c
121         $(CC) $(CFLAGS) /c $?
122 $(OUTDIR)/dirent.obj : w32/compat/dirent.c
123         $(CC) $(CFLAGS) /c $?
124 $(OUTDIR)/pathstuff.obj : w32/pathstuff.c
125         $(CC) $(CFLAGS) /c $?
126
127 # --------------- DEPENDENCIES
128 #
129
130 # .deps/alloca.Po
131 # dummy
132
133 # .deps/ar.Po
134 $(OUTDIR)/ar.obj: ar.c makeint.h config.h \
135  gnumake.h \
136  getopt.h \
137  gettext.h \
138  filedef.h hash.h dep.h \
139
140 # .deps/arscan.Po
141 $(OUTDIR)/arscan.obj: arscan.c makeint.h config.h \
142  gnumake.h \
143  getopt.h \
144  gettext.h \
145
146 # .deps/commands.Po
147 $(OUTDIR)/commands.obj: commands.c \
148  makeint.h config.h \
149  gnumake.h \
150  getopt.h \
151  gettext.h \
152  filedef.h hash.h dep.h \
153  variable.h job.h output.h \
154  commands.h
155
156 # .deps/default.Po
157 $(OUTDIR)/default.obj: default.c makeint.h config.h \
158  gnumake.h \
159  getopt.h \
160  gettext.h \
161  filedef.h hash.h variable.h rule.h dep.h job.h output.h \
162  commands.h
163
164 # .deps/dir.Po
165 $(OUTDIR)/dir.obj: dir.c makeint.h config.h \
166  gnumake.h \
167  getopt.h \
168  gettext.h \
169  hash.h filedef.h dep.h \
170
171 # .deps/expand.Po
172 $(OUTDIR)/expand.obj: expand.c makeint.h config.h \
173  gnumake.h \
174  getopt.h \
175  gettext.h \
176  filedef.h hash.h job.h output.h \
177  commands.h variable.h rule.h
178
179 # .deps/file.Po
180 $(OUTDIR)/file.obj: file.c makeint.h config.h \
181  gnumake.h \
182  getopt.h \
183  gettext.h \
184  filedef.h hash.h dep.h job.h output.h \
185  commands.h variable.h \
186  debug.h
187
188 # .deps/function.Po
189 $(OUTDIR)/function.obj: function.c makeint.h config.h \
190  gnumake.h \
191  getopt.h \
192  gettext.h \
193  filedef.h hash.h \
194  variable.h dep.h job.h output.h \
195  commands.h debug.h
196
197 # .deps/getloadavg.Po
198 # dummy
199
200 # .deps/getopt.Po
201 $(OUTDIR)/getopt.obj: getopt.c config.h \
202
203 # .deps/getopt1.Po
204 $(OUTDIR)/getopt1.obj: getopt1.c config.h getopt.h \
205
206 # .deps/guile.Po
207 $(OUTDIR)/guile.obj: guile.c makeint.h config.h \
208  gnumake.h \
209  getopt.h \
210  gettext.h \
211  debug.h filedef.h hash.h \
212  dep.h variable.h \
213  gmk-default.h
214
215 # .deps/hash.Po
216 $(OUTDIR)/hash.obj: hash.c makeint.h config.h \
217  gnumake.h \
218  getopt.h \
219  gettext.h \
220  hash.h
221
222 # .deps/implicit.Po
223 $(OUTDIR)/implicit.obj: implicit.c makeint.h config.h \
224  gnumake.h \
225  getopt.h \
226  gettext.h \
227  filedef.h hash.h rule.h \
228  dep.h debug.h variable.h job.h output.h \
229  commands.h
230
231 # .deps/job.Po
232 $(OUTDIR)/job.obj: job.c makeint.h config.h \
233  gnumake.h \
234  getopt.h \
235  gettext.h \
236  job.h output.h \
237  debug.h filedef.h hash.h \
238  commands.h variable.h
239
240 # .deps/load.Po
241 $(OUTDIR)/load.obj: load.c makeint.h config.h \
242  gnumake.h \
243  getopt.h \
244  gettext.h \
245  debug.h filedef.h hash.h \
246  variable.h
247
248 # .deps/loadapi.Po
249 $(OUTDIR)/loadapi.obj: loadapi.c makeint.h config.h \
250  gnumake.h \
251  getopt.h \
252  gettext.h \
253  filedef.h hash.h \
254  variable.h dep.h
255
256 # .deps/loadavg-getloadavg.Po
257 # dummy
258
259 # .deps/main.Po
260 $(OUTDIR)/main.obj: main.c makeint.h config.h \
261  gnumake.h \
262  getopt.h \
263  gettext.h \
264  filedef.h hash.h dep.h \
265  variable.h job.h output.h \
266  commands.h rule.h debug.h \
267  getopt.h
268
269 # .deps/misc.Po
270 $(OUTDIR)/misc.obj: misc.c makeint.h config.h \
271  gnumake.h \
272  getopt.h \
273  gettext.h \
274  filedef.h hash.h dep.h \
275  debug.h \
276
277 # .deps/output.Po
278 $(OUTDIR)/output.obj: output.c makeint.h config.h \
279  gnumake.h \
280  getopt.h \
281  gettext.h \
282  job.h output.h \
283
284 # .deps/read.Po
285 $(OUTDIR)/read.obj: read.c makeint.h config.h \
286  gnumake.h \
287  getopt.h \
288  gettext.h \
289  filedef.h hash.h dep.h job.h output.h \
290  commands.h variable.h rule.h \
291  debug.h
292
293 # .deps/remake.Po
294 $(OUTDIR)/remake.obj: remake.c makeint.h config.h \
295  gnumake.h \
296  getopt.h \
297  gettext.h \
298  filedef.h hash.h job.h \
299  output.h \
300  commands.h dep.h variable.h \
301  debug.h
302
303 # .deps/remote-cstms.Po
304 # dummy
305
306 # .deps/remote-stub.Po
307 $(OUTDIR)/remote-stub.obj: remote-stub.c makeint.h config.h \
308  gnumake.h \
309  getopt.h \
310  gettext.h \
311  filedef.h hash.h job.h \
312  output.h \
313  commands.h
314
315 # .deps/rule.Po
316 $(OUTDIR)/rule.obj: rule.c makeint.h config.h \
317  gnumake.h \
318  getopt.h \
319  gettext.h \
320  filedef.h hash.h dep.h job.h output.h \
321  commands.h variable.h rule.h
322
323 # .deps/signame.Po
324 $(OUTDIR)/signame.obj: signame.c makeint.h config.h \
325  gnumake.h \
326  getopt.h \
327  gettext.h \
328
329 # .deps/strcache.Po
330 $(OUTDIR)/strcache.obj: strcache.c makeint.h config.h \
331  gnumake.h \
332  getopt.h \
333  gettext.h \
334  hash.h
335
336 # .deps/variable.Po
337 $(OUTDIR)/variable.obj: variable.c makeint.h config.h \
338  gnumake.h \
339  getopt.h \
340  gettext.h \
341  filedef.h hash.h dep.h job.h output.h \
342  commands.h variable.h rule.h
343
344 # .deps/version.Po
345 $(OUTDIR)/version.obj: version.c config.h
346
347 # .deps/vmsjobs.Po
348 # dummy
349
350 # .deps/vpath.Po
351 $(OUTDIR)/vpath.obj: vpath.c makeint.h config.h \
352  gnumake.h \
353  getopt.h \
354  gettext.h \
355  filedef.h hash.h \
356  variable.h