1 # NOTE: If you have no `make' program at all to process this makefile, run
2 # `build_w32.bat' instead.
4 # Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
5 # This file is part of GNU Make.
7 # GNU Make is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # GNU Make is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Make; see the file COPYING. If not, write to
19 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 # Boston, MA 02111-1307, USA.
23 # NMakefile for GNU Make
31 SUBPROC_MAKEFILE=NMakefile
33 CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
34 CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
35 CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
37 LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
38 /INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
39 /OUT:WinDebug/make.exe /DEBUG
40 LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
41 /INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
43 all: config.h subproc Release Debug
46 # Make sure we build the subproc library first. It has it's own
47 # makefile. To be portable to Windows 95, we put the instructions
48 # on how to build the library into a batch file. On NT, we could
49 # simply have done foo && bar && dog, but this doesn't port.
51 subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
53 w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
54 subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
55 if exist WinDebug\make.exe erase WinDebug\make.exe
56 if exist WinRel\make.exe erase WinRel\make.exe
58 config.h: config.h.W32
62 $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
64 $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
67 if exist WinDebug\nul rmdir /s /q WinDebug
68 if exist WinRel\nul rmdir /s /q WinRel
69 if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
70 if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
71 if exist config.h erase config.h
75 if not exist .\$@\nul mkdir .\$@
77 LIBS = kernel32.lib user32.lib advapi32.lib
81 $(OUTDIR)/arscan.obj \
82 $(OUTDIR)/commands.obj \
83 $(OUTDIR)/default.obj \
85 $(OUTDIR)/expand.obj \
87 $(OUTDIR)/function.obj \
88 $(OUTDIR)/getloadavg.obj \
89 $(OUTDIR)/getopt.obj \
90 $(OUTDIR)/getopt1.obj \
91 $(OUTDIR)/implicit.obj \
96 $(OUTDIR)/remake.obj \
97 $(OUTDIR)/remote-stub.obj \
99 $(OUTDIR)/signame.obj \
100 $(OUTDIR)/variable.obj \
101 $(OUTDIR)/version.obj \
102 $(OUTDIR)/vpath.obj \
104 $(OUTDIR)/fnmatch.obj \
105 $(OUTDIR)/dirent.obj \
106 $(OUTDIR)/pathstuff.obj
108 $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
110 $(LDFLAGS) $(LIBS) $(OBJS)
114 $(CC) $(CFLAGS) /c $<
116 $(OUTDIR)/glob.obj : glob/glob.c
117 $(CC) $(CFLAGS) /c $?
118 $(OUTDIR)/fnmatch.obj : glob/fnmatch.c
119 $(CC) $(CFLAGS) /c $?
120 $(OUTDIR)/dirent.obj : w32/compat/dirent.c
121 $(CC) $(CFLAGS) /c $?
122 $(OUTDIR)/pathstuff.obj : w32/pathstuff.c
123 $(CC) $(CFLAGS) /c $?
125 # --------------- DEPENDENCIES
130 ar.c make.h config.h \
132 gettext.h filedef.h \
135 arscan.c make.h config.h \
140 commands.c make.h config.h \
143 filedef.h hash.h variable.h job.h commands.h
145 default.c make.h config.h \
148 dep.h filedef.h hash.h job.h commands.h variable.h
150 dir.c make.h config.h \
155 expand.c make.h config.h \
158 filedef.h hash.h job.h commands.h variable.h \
161 file.c make.h config.h \
164 dep.h filedef.h hash.h job.h commands.h \
167 function.c make.h config.h \
169 gettext.h filedef.h \
170 hash.h variable.h dep.h job.h commands.h debug.h
175 getopt1.c config.h getopt.h \
178 hash.c make.h config.h \
182 implicit.c make.h config.h \
185 dep.h filedef.h hash.h debug.h
187 job.c make.h config.h \
190 job.h debug.h filedef.h hash.h commands.h \
193 loadavg-loadavg.o : \
200 main.c make.h config.h \
203 filedef.h hash.h variable.h job.h commands.h rule.h debug.h \
206 misc.c make.h config.h \
211 read.c make.h config.h \
214 dep.h filedef.h hash.h \
215 job.h commands.h variable.h rule.h debug.h
217 remake.c make.h config.h \
219 gettext.h filedef.h \
220 hash.h job.h commands.h dep.h variable.h debug.h \
224 remote-stub.c make.h config.h \
226 gettext.h filedef.h \
227 hash.h job.h commands.h
229 rule.c make.h config.h \
232 filedef.h hash.h job.h commands.h variable.h rule.h
234 signame.c make.h config.h \
238 variable.c make.h config.h \
241 filedef.h hash.h job.h commands.h variable.h rule.h
245 vpath.c make.h config.h \
247 gettext.h filedef.h \