1 |
578 |
markom |
# Visual C++ 2.x and 4.0 makefile
|
2 |
|
|
#
|
3 |
|
|
# See the file "license.terms" for information on usage and redistribution
|
4 |
|
|
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
5 |
|
|
#
|
6 |
|
|
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
7 |
|
|
# SCCS: @(#) makefile.vc 1.8 98/07/29 13:14:52
|
8 |
|
|
|
9 |
|
|
# Does not depend on the presence of any environment variables in
|
10 |
|
|
# order to compile tcl; all needed information is derived from
|
11 |
|
|
# location of the compiler directories.
|
12 |
|
|
#
|
13 |
|
|
# NOTE: Be sure to modify the "makefile.vc" file in the toplevel directory
|
14 |
|
|
# for the itcl distribution. Include the location of your VC++ development
|
15 |
|
|
# tools and the installation directory.
|
16 |
|
|
|
17 |
|
|
!include "..\..\makefile.vc"
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
# ROOT = top of source tree
|
21 |
|
|
#
|
22 |
|
|
# TMPDIR = location where .obj files should be stored during build
|
23 |
|
|
|
24 |
|
|
ROOT = ..
|
25 |
|
|
ITCLDIR = ..\..\itcl
|
26 |
|
|
|
27 |
|
|
######################################################################
|
28 |
|
|
# Do not modify below this line
|
29 |
|
|
######################################################################
|
30 |
|
|
|
31 |
|
|
ITKNAMEPREFIX = itk
|
32 |
|
|
WISHNAMEPREFIX = itkwish
|
33 |
|
|
VERSION = 30
|
34 |
|
|
DOTVERSION = 3.0
|
35 |
|
|
|
36 |
|
|
BINROOT = .
|
37 |
|
|
!IF "$(NODEBUG)" == "1"
|
38 |
|
|
TMPDIR = $(BINROOT)\Release
|
39 |
|
|
DBGX =
|
40 |
|
|
!ELSE
|
41 |
|
|
TMPDIR = $(BINROOT)\Debug
|
42 |
|
|
DBGX = d
|
43 |
|
|
!ENDIF
|
44 |
|
|
OUTDIR = $(TMPDIR)
|
45 |
|
|
|
46 |
|
|
ITKDLLNAME = $(ITKNAMEPREFIX)$(VERSION)$(DBGX).dll
|
47 |
|
|
ITKDLL = $(OUTDIR)\$(ITKDLLNAME)
|
48 |
|
|
ITKLIB = $(OUTDIR)\$(ITKNAMEPREFIX)$(VERSION)$(DBGX).lib
|
49 |
|
|
|
50 |
|
|
ITKWISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe
|
51 |
|
|
DUMPEXTS = $(TMPDIR)\dumpexts.exe
|
52 |
|
|
|
53 |
|
|
LIB_INSTALL_DIR = $(INSTALLDIR)\lib
|
54 |
|
|
BIN_INSTALL_DIR = $(INSTALLDIR)\bin
|
55 |
|
|
SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\itk$(DOTVERSION)
|
56 |
|
|
INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
|
57 |
|
|
|
58 |
|
|
ITKWISHOBJS = \
|
59 |
|
|
$(TMPDIR)\winMain.obj \
|
60 |
|
|
$(TMPDIR)\tkConsole.obj
|
61 |
|
|
|
62 |
|
|
ITKOBJS = \
|
63 |
|
|
$(TMPDIR)\itk_archetype.obj \
|
64 |
|
|
$(TMPDIR)\itk_cmds.obj \
|
65 |
|
|
$(TMPDIR)\itk_option.obj \
|
66 |
|
|
$(TMPDIR)\itk_util.obj \
|
67 |
|
|
$(TMPDIR)\dllEntryPoint.obj
|
68 |
|
|
|
69 |
|
|
cc32 = $(TOOLS32)\bin\cl.exe
|
70 |
|
|
link32 = $(TOOLS32)\bin\link.exe
|
71 |
|
|
rc32 = $(TOOLS32_rc)\bin\rc.exe
|
72 |
|
|
include32 = -I$(TOOLS32)\include
|
73 |
|
|
|
74 |
|
|
WINDIR = $(ROOT)\win
|
75 |
|
|
GENERICDIR = $(ROOT)\generic
|
76 |
|
|
RCDIR = $(WINDIR)\rc
|
77 |
|
|
|
78 |
|
|
TCLBUILDDIR = $(TCLDIR)\win\$(OUTDIR)
|
79 |
|
|
TCLLIB = $(TCLBUILDDIR)\tcl80$(DBGX).lib
|
80 |
|
|
TCLDLL = $(TCLBUILDDIR)\tcl80$(DBGX).dll
|
81 |
|
|
TKBUILDDIR = $(TKDIR)\win\$(OUTDIR)
|
82 |
|
|
TKLIB = $(TKBUILDDIR)\tk80$(DBGX).lib
|
83 |
|
|
TKDLL = $(TKBUILDDIR)\tk80$(DBGX).dll
|
84 |
|
|
ITCLBUILDDIR = $(ITCLDIR)\win\$(OUTDIR)
|
85 |
|
|
ITCLLIB = $(ITCLBUILDDIR)\itcl$(VERSION)$(DBGX).lib
|
86 |
|
|
ITCLDLL = $(ITCLBUILDDIR)\itcl$(VERSION)$(DBGX).dll
|
87 |
|
|
|
88 |
|
|
ITK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) \
|
89 |
|
|
-I$(TCLDIR)\generic -I$(TKDIR)\generic -I$(TKDIR)\xlib -I$(ITCLDIR)\generic
|
90 |
|
|
ITK_DEFINES = -DBUILD_itk $(DEBUGDEFINES)
|
91 |
|
|
|
92 |
|
|
ITK_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
|
93 |
|
|
$(ITK_INCLUDES) $(ITK_DEFINES)
|
94 |
|
|
|
95 |
|
|
######################################################################
|
96 |
|
|
# Link flags
|
97 |
|
|
######################################################################
|
98 |
|
|
|
99 |
|
|
!IF "$(NODEBUG)" == "1"
|
100 |
|
|
ldebug = /RELEASE
|
101 |
|
|
!ELSE
|
102 |
|
|
ldebug = -debug:full -debugtype:cv
|
103 |
|
|
!ENDIF
|
104 |
|
|
|
105 |
|
|
# declarations common to all linker options
|
106 |
|
|
lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
|
107 |
|
|
|
108 |
|
|
# declarations for use on Intel i386, i486, and Pentium systems
|
109 |
|
|
!IF "$(MACHINE)" == "IX86"
|
110 |
|
|
DLLENTRY = @12
|
111 |
|
|
lflags = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
|
112 |
|
|
!ELSE
|
113 |
|
|
lflags = $(lcommon) /MACHINE:$(MACHINE)
|
114 |
|
|
!ENDIF
|
115 |
|
|
|
116 |
|
|
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
117 |
|
|
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
118 |
|
|
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
|
119 |
|
|
|
120 |
|
|
!IF "$(MACHINE)" == "PPC"
|
121 |
|
|
libc = libc.lib
|
122 |
|
|
libcdll = crtdll.lib
|
123 |
|
|
!ELSE
|
124 |
|
|
libc = libc.lib oldnames.lib
|
125 |
|
|
libcdll = msvcrt.lib oldnames.lib
|
126 |
|
|
!ENDIF
|
127 |
|
|
|
128 |
|
|
baselibs = kernel32.lib $(optlibs) advapi32.lib
|
129 |
|
|
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
130 |
|
|
guilibs = $(libc) $(winlibs)
|
131 |
|
|
|
132 |
|
|
guilibsdll = $(libcdll) $(winlibs)
|
133 |
|
|
|
134 |
|
|
######################################################################
|
135 |
|
|
# Compile flags
|
136 |
|
|
######################################################################
|
137 |
|
|
|
138 |
|
|
!IF "$(NODEBUG)" == "1"
|
139 |
|
|
!IF "$(MACHINE)" == "ALPHA"
|
140 |
|
|
# MSVC on Alpha doesn't understand -Ot
|
141 |
|
|
cdebug = -O2i -Gs -GD
|
142 |
|
|
!ELSE
|
143 |
|
|
cdebug = -Oti -Gs -GD
|
144 |
|
|
!ENDIF
|
145 |
|
|
!ELSE
|
146 |
|
|
cdebug = -Z7 -Od -WX
|
147 |
|
|
!ENDIF
|
148 |
|
|
|
149 |
|
|
# declarations common to all compiler options
|
150 |
|
|
ccommon = -c -W3 -nologo -Fp$(TMPDIR)\ -YX
|
151 |
|
|
|
152 |
|
|
!IF "$(MACHINE)" == "IX86"
|
153 |
|
|
cflags = $(ccommon) -D_X86_=1
|
154 |
|
|
!ELSE
|
155 |
|
|
!IF "$(MACHINE)" == "MIPS"
|
156 |
|
|
cflags = $(ccommon) -D_MIPS_=1
|
157 |
|
|
!ELSE
|
158 |
|
|
!IF "$(MACHINE)" == "PPC"
|
159 |
|
|
cflags = $(ccommon) -D_PPC_=1
|
160 |
|
|
!ELSE
|
161 |
|
|
!IF "$(MACHINE)" == "ALPHA"
|
162 |
|
|
cflags = $(ccommon) -D_ALPHA_=1
|
163 |
|
|
!ENDIF
|
164 |
|
|
!ENDIF
|
165 |
|
|
!ENDIF
|
166 |
|
|
!ENDIF
|
167 |
|
|
|
168 |
|
|
cvars = -DWIN32 -D_WIN32
|
169 |
|
|
cvarsmt = $(cvars) -D_MT
|
170 |
|
|
cvarsdll = $(cvarsmt) -D_DLL
|
171 |
|
|
|
172 |
|
|
!IF "$(NODEBUG)" == "1"
|
173 |
|
|
cvarsdll = $(cvars) -MD
|
174 |
|
|
!ELSE
|
175 |
|
|
cvarsdll = $(cvars) -MDd
|
176 |
|
|
!ENDIF
|
177 |
|
|
|
178 |
|
|
CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
|
179 |
|
|
|
180 |
|
|
######################################################################
|
181 |
|
|
# Project specific targets
|
182 |
|
|
######################################################################
|
183 |
|
|
|
184 |
|
|
all: setup $(ITKWISH)
|
185 |
|
|
test: setup $(ITKWISH)
|
186 |
|
|
-@copy $(TCLDLL) $(TMPDIR)
|
187 |
|
|
-@copy $(TKDLL) $(TMPDIR)
|
188 |
|
|
-@copy $(ITCLDLL) $(TMPDIR)
|
189 |
|
|
$(ITKWISH)
|
190 |
|
|
|
191 |
|
|
setup:
|
192 |
|
|
if not exist $(TMPDIR) mkdir $(TMPDIR)
|
193 |
|
|
if not exist $(OUTDIR) mkdir $(OUTDIR)
|
194 |
|
|
|
195 |
|
|
$(ITKLIB): $(ITKDLL)
|
196 |
|
|
|
197 |
|
|
$(ITKDLL): $(ITKOBJS) $(TMPDIR)\itk.res $(TMPDIR)\itkvc.def
|
198 |
|
|
set LIB=$(TOOLS32)\lib
|
199 |
|
|
$(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\itkvc.def \
|
200 |
|
|
-out:$@ $(TMPDIR)\itk.res $(TCLLIB) $(TKLIB) $(ITCLLIB) \
|
201 |
|
|
$(guilibsdll) @<<
|
202 |
|
|
$(ITKOBJS)
|
203 |
|
|
<<
|
204 |
|
|
|
205 |
|
|
$(ITKWISH): $(ITKWISHOBJS) $(ITKLIB) $(TMPDIR)\itkwish.res
|
206 |
|
|
set LIB=$(TOOLS32)\lib
|
207 |
|
|
$(link32) $(ldebug) $(guilflags) $(TMPDIR)\itkwish.res -out:$@ \
|
208 |
|
|
$(guilibsdll) $(TCLLIB) $(TKLIB) $(ITCLLIB) $(ITKLIB) $(ITKWISHOBJS)
|
209 |
|
|
|
210 |
|
|
$(TMPDIR)\itkvc.def: $(DUMPEXTS) $(ITKOBJS)
|
211 |
|
|
$(DUMPEXTS) -o $@ $(ITKDLLNAME) @<<
|
212 |
|
|
$(ITKOBJS)
|
213 |
|
|
<<
|
214 |
|
|
|
215 |
|
|
$(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c
|
216 |
|
|
$(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
|
217 |
|
|
set LIB=$(TOOLS32)\lib
|
218 |
|
|
$(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \
|
219 |
|
|
$(TMPDIR)\winDumpExts.obj
|
220 |
|
|
|
221 |
|
|
install: all
|
222 |
|
|
if not exist $(INSTALLDIR) mkdir $(INSTALLDIR)
|
223 |
|
|
if not exist $(BIN_INSTALL_DIR) mkdir $(BIN_INSTALL_DIR)
|
224 |
|
|
if not exist $(LIB_INSTALL_DIR) mkdir $(LIB_INSTALL_DIR)
|
225 |
|
|
if not exist $(SCRIPT_INSTALL_DIR) mkdir $(SCRIPT_INSTALL_DIR)
|
226 |
|
|
if not exist $(INCLUDE_INSTALL_DIR) mkdir $(INCLUDE_INSTALL_DIR)
|
227 |
|
|
copy $(ITKWISH) "$(BIN_INSTALL_DIR)"
|
228 |
|
|
copy $(ITKDLL) "$(BIN_INSTALL_DIR)"
|
229 |
|
|
copy $(ROOT)\generic\itk.h "$(INCLUDE_INSTALL_DIR)"
|
230 |
|
|
copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)"
|
231 |
|
|
copy $(ROOT)\win\*.tcl "$(SCRIPT_INSTALL_DIR)"
|
232 |
|
|
|
233 |
|
|
#
|
234 |
|
|
# Special case object file targets
|
235 |
|
|
#
|
236 |
|
|
|
237 |
|
|
$(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c
|
238 |
|
|
$(cc32) -DBUILD_tcl -DBUILD_tk $(ITK_CFLAGS) -Fo$@ $?
|
239 |
|
|
|
240 |
|
|
$(TMPDIR)\tkConsole.obj: $(TKDIR)\generic\tkConsole.c
|
241 |
|
|
$(cc32) -DBUILD_tcl -DBUILD_tk $(ITK_CFLAGS) -Fo$@ $?
|
242 |
|
|
|
243 |
|
|
#
|
244 |
|
|
# Implicit rules
|
245 |
|
|
#
|
246 |
|
|
|
247 |
|
|
{$(GENERICDIR)}.c{$(TMPDIR)}.obj:
|
248 |
|
|
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
|
249 |
|
|
|
250 |
|
|
{$(WINDIR)}.c{$(TMPDIR)}.obj:
|
251 |
|
|
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
|
252 |
|
|
|
253 |
|
|
{$(ROOT)\unix}.c{$(TMPDIR)}.obj:
|
254 |
|
|
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
|
255 |
|
|
|
256 |
|
|
{$(RCDIR)}.rc{$(TMPDIR)}.res:
|
257 |
|
|
$(rc32) -fo $@ -r -i $(GENERICDIR) -i $(TCLDIR)\generic -i $(ITCLDIR)\generic $<
|
258 |
|
|
|
259 |
|
|
clean:
|
260 |
|
|
-@del $(OUTDIR)\*.exp
|
261 |
|
|
-@del $(OUTDIR)\*.lib
|
262 |
|
|
-@del $(OUTDIR)\*.dll
|
263 |
|
|
-@del $(OUTDIR)\*.exe
|
264 |
|
|
-@del $(OUTDIR)\*.pdb
|
265 |
|
|
-@del $(TMPDIR)\*.pch
|
266 |
|
|
-@del $(TMPDIR)\*.obj
|
267 |
|
|
-@del $(TMPDIR)\*.res
|
268 |
|
|
-@del $(TMPDIR)\*.def
|
269 |
|
|
-@del $(TMPDIR)\*.exe
|
270 |
|
|
-@rmdir $(OUTDIR)
|
271 |
|
|
-@rmdir $(TMPDIR)
|