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