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, 2007 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
|
---|
11 | # the terms of the GNU General Public License as published by the Free Software
|
---|
12 | # Foundation; either version 3 of the License, or (at your option) any later
|
---|
13 | # version.
|
---|
14 | #
|
---|
15 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
16 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
---|
18 | # details.
|
---|
19 | #
|
---|
20 | # You should have received a copy of the GNU General Public License along with
|
---|
21 | # this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
22 |
|
---|
23 | LINK = link
|
---|
24 | CC = cl
|
---|
25 | MAKE = nmake
|
---|
26 |
|
---|
27 | OUTDIR=.
|
---|
28 | MAKEFILE=NMakefile
|
---|
29 | SUBPROC_MAKEFILE=NMakefile
|
---|
30 |
|
---|
31 | CFLAGS_any = /nologo /MT /W4 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
|
---|
32 | CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
---|
33 | CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
---|
34 |
|
---|
35 | LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
---|
36 | /INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
|
---|
37 | /OUT:WinDebug/make.exe /DEBUG
|
---|
38 | LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
---|
39 | /INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
|
---|
40 |
|
---|
41 | all: config.h subproc Release Debug
|
---|
42 |
|
---|
43 | #
|
---|
44 | # Make sure we build the subproc library first. It has it's own
|
---|
45 | # makefile. To be portable to Windows 95, we put the instructions
|
---|
46 | # on how to build the library into a batch file. On NT, we could
|
---|
47 | # simply have done foo && bar && dog, but this doesn't port.
|
---|
48 | #
|
---|
49 | subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
---|
50 |
|
---|
51 | w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
|
---|
52 | subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
|
---|
53 | if exist WinDebug\make.exe erase WinDebug\make.exe
|
---|
54 | if exist WinRel\make.exe erase WinRel\make.exe
|
---|
55 |
|
---|
56 | config.h: config.h.W32
|
---|
57 | copy $? $@
|
---|
58 |
|
---|
59 | Release:
|
---|
60 | $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
---|
61 | Debug:
|
---|
62 | $(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
---|
63 |
|
---|
64 | clean:
|
---|
65 | if exist WinDebug\nul rmdir /s /q WinDebug
|
---|
66 | if exist WinRel\nul rmdir /s /q WinRel
|
---|
67 | if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
|
---|
68 | if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
|
---|
69 | if exist config.h erase config.h
|
---|
70 | erase *.pdb
|
---|
71 |
|
---|
72 | $(OUTDIR):
|
---|
73 | if not exist .\$@\nul mkdir .\$@
|
---|
74 |
|
---|
75 | LIBS = kernel32.lib user32.lib advapi32.lib
|
---|
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)/read.obj \
|
---|
95 | $(OUTDIR)/remake.obj \
|
---|
96 | $(OUTDIR)/remote-stub.obj \
|
---|
97 | $(OUTDIR)/rule.obj \
|
---|
98 | $(OUTDIR)/signame.obj \
|
---|
99 | $(OUTDIR)/strcache.obj \
|
---|
100 | $(OUTDIR)/variable.obj \
|
---|
101 | $(OUTDIR)/version.obj \
|
---|
102 | $(OUTDIR)/vpath.obj \
|
---|
103 | $(OUTDIR)/glob.obj \
|
---|
104 | $(OUTDIR)/fnmatch.obj \
|
---|
105 | $(OUTDIR)/dirent.obj \
|
---|
106 | $(OUTDIR)/pathstuff.obj
|
---|
107 |
|
---|
108 | $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
---|
109 | $(LINK) @<<
|
---|
110 | $(LDFLAGS) $(LIBS) $(OBJS)
|
---|
111 | <<
|
---|
112 |
|
---|
113 | .c{$(OUTDIR)}.obj:
|
---|
114 | $(CC) $(CFLAGS) /c $<
|
---|
115 |
|
---|
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 $?
|
---|