1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267 | ###############################################################################
# Copyright (c) 2007-2024 by Altair Engineering, Inc.
# All rights reserved.
#
# Altair Engineering, Inc. makes this software available as part of the Vision
# tool platform. As long as you are a licensee of the Vision tool platform
# you may make copies of the software and modify it to be used within the
# Vision tool platform, but you must include all of this notice on any copy.
# Redistribution without written permission to any third party, with or
# without modification, is not permitted.
# Altair Engineering, Inc. does not warrant that this software is error free
# or fit for any purpose. Altair Engineering, Inc. disclaims any liability for
# all claims, expenses, losses, damages and costs any user may incur as a
# result of using, copying or modifying the software.
# =============================================================================
#
# This makefile can be used to build the C-API example files
# using nmake and cl on Windows.
#
# You need to run vcvars.bat from Developer Studio first
# to setup the environment.
#
# Prefix to Tcl/Tk installation.
TCL_PREFIX = C:\tcltk-8.6.10
ZINC = ..\..\..\include
BINDIR = ..\..\..\win64
STARVISION = $(BINDIR)\starvisionpro.exe
STARSH = $(BINDIR)\starsh.exe
# ZOS link libraries.
ZOS_LIB = $(BINDIR)\zos.lib
CE_UTILITIES_LIB = $(BINDIR)\ce_utilities.lib
CE_UTILITIES_STUB = $(BINDIR)\ce_utilitiesstub.lib
# UTIL link libraries.
UTIL_STUB = $(BINDIR)\zlicenseOEMstub.lib
# ZDB link libraries.
ZDB_LIB = $(BINDIR)\zdb.lib
ZDB_STUB = $(BINDIR)\zdbstub.lib
TCL_INCL = $(TCL_PREFIX)\include
TCL_STUB = $(TCL_PREFIX)\lib\tclstub86.lib
STD_LIBS = user32.lib
LINK_LIBS = $(STD_LIBS) $(ZDB_LIB) $(ZOS_LIB) $(CE_UTILITIES_LIB)
STUB_LIBS = $(ZDB_STUB) $(UTIL_STUB) $(CE_UTILITIES_STUB) \
$(TCL_STUB)
INC_DIRS = /I$(ZINC) /I$(TCL_INCL)
CC = cl /nologo /MT /W3 /GL /c /DWINDOWS /D_CRT_SECURE_NO_WARNINGS
LD = link /nologo /LTCG
RM = @del /f /s /q
RMDIR = @rmdir /s /q
MKDIR = @mkdir
# =============================================================================
# Build everything.
# =============================================================================
#
all : createZdb_example zdbDump_example userware_example skeleton_example \
createFlat_example extract_example debugZdb_example useOids_example
# =============================================================================
# Rules to make the Userware example.
# =============================================================================
#
userware_example : userware.dll
userware.dll : userware.obj
$(LD) /DLL /OUT:userware.dll /PDB:userware.pdb userware.obj $(STUB_LIBS)
userware.obj : userware.c
$(CC) -c $(INC_DIRS) /Fouserware.obj /Fduserware.pdb /Tcuserware.c
run_userware_gui : userware.tcl test.zdb userware.dll
$(STARVISION) -binfile test.zdb -userware userware.tcl
run_userware_sh : userware.tcl test.zdb userware.dll
$(STARSH) userware.tcl test.zdb
test.zdb : createZdb.c
$(CC) -c $(INC_DIRS) /FocreateUserwareZdb.obj /FdcreateUserwareZdb.pdb \
/TccreateZdb.c
$(LD) /SUBSYSTEM:CONSOLE /OUT:createUserwareZdb.exe \
/PDB:createUserwareZdb.pdb \
createUserwareZdb.obj $(LINK_LIBS)
./createUserwareZdb.exe test.zdb
clean_userware :
$(RM) userware.obj userware.dll userware.dll.manifest
$(RM) userware.lib userware.exp
$(RM) test.zdb
$(RM) createUserwareZdb.exe createUserwareZdb.obj
# =============================================================================
# Rules to make the fillflat example.
# =============================================================================
#
fillflat_example : fillflat.dll
fillflat.dll : fillflat.obj
$(LD) /DLL /OUT:fillflat.dll /PDB:fillflat.pdb fillflat.obj $(STUB_LIBS)
fillflat.obj : fillflat.c
$(CC) -c $(INC_DIRS) /Fofillflat.obj /Fdfillflat.pdb /Tcfillflat.c
run_fillflat_sh : fillflat.tcl test.zdb fillflat.dll fillflat.txt
$(STARSH) fillflat.tcl test.zdb fillflat.txt
clean_fillflat :
$(RM) fillflat.obj fillflat.dll fillflat.dll.manifest
$(RM) fillflat.lib fillflat.exp
$(RM) test.zdb
$(RM) createUserwareZdb.exe createUserwareZdb.obj
# =============================================================================
# Rules to make the createZdb example.
# =============================================================================
#
createZdb_example : createZdb.exe
createZdb.exe : createZdb.obj
$(LD) /SUBSYSTEM:CONSOLE /OUT:createZdb.exe /PDB:createZdb.pdb \
createZdb.obj $(LINK_LIBS)
createZdb.obj : createZdb.c
$(CC) -c $(INC_DIRS) /FocreateZdb.obj /FdcreateZdb.pdb /TccreateZdb.c
clean_createZdb :
$(RM) createZdb.exe createZdb.obj
# =============================================================================
# Rules to make the zdbDump example.
# =============================================================================
#
zdbDump_example : zdbDump.exe
zdbDump.exe : zdbDump.obj
$(LD) /SUBSYSTEM:CONSOLE /OUT:zdbDump.exe /PDB:zdbDump.pdb zdbDump.obj \
$(LINK_LIBS)
zdbDump.obj : zdbDump.c
$(CC) -c $(INC_DIRS) /FozdbDump.obj /FdzdbDump.pdb /TczdbDump.c
clean_zdbDump :
$(RM) zdbDump.exe zdbDump.obj
# =============================================================================
# Rules to make the skeleton example.
# =============================================================================
#
skeleton_example : skeleton.obj
skeleton.obj : skeleton.c
$(CC) -c $(INC_DIRS) /Foskeleton.obj /Fdskeleton.pdb /Tcskeleton.c
clean_skeleton :
$(RM) skeleton.obj
# =============================================================================
# Rules to make the createFlat example.
# =============================================================================
#
run_createFlat : createFlat.exe
./createFlat.exe test.zdb
createFlat.exe : createFlat.obj
$(LD) /SUBSYSTEM:CONSOLE /OUT:createFlat.exe /PDB:createFlat.pdb \
createFlat.obj $(LINK_LIBS)
createFlat.obj : createFlat.c
$(CC) -c $(INC_DIRS) /FocreateFlat.obj /FdcreateFlat.pdb /TccreateFlat.c
clean_createFlat :
$(RM) createFlat.exe createFlat.obj
# =============================================================================
# Rules to make the extract example.
# =============================================================================
#
extract_example : extract.exe
run_extract : extract.exe test.zdb
-$(RMDIR) outdir
$(MKDIR) outdir
./extract.exe test.zdb outdir A i2.y
run_extract_sh : extract.tcl run_extract
$(STARSH) extract.tcl outdir 1
run_extract_gui : extract.tcl run_extract
$(STARVISION) -binfile outdir/out.zdb -userware2 extract.tcl outdir
extract.exe : extract.obj
$(LD) /SUBSYSTEM:CONSOLE /OUT:extract.exe /PDB:extract.pdb \
extract.obj $(LINK_LIBS)
extract.obj : extract.c
$(CC) -c $(INC_DIRS) /Foextract.obj /Fdextract.pdb /Tcextract.c
clean_extract :
$(RM) extract.exe extract.obj test.zdb
$(RMDIR) outdir
# =============================================================================
# Rules to make the debugZdb example.
# =============================================================================
#
debugZdb_example : debugZdb.exe
run_debugZdb : debugZdb.exe test.zdb
./debugZdb.exe test.zdb \
-logfile debugZdb.log -timesteps on -debugflag all
debugZdb.exe : debugZdb.obj
$(LD) /SUBSYSTEM:CONSOLE /OUT:debugZdb.exe /PDB:debugZdb.pdb \
debugZdb.obj $(LINK_LIBS)
debugZdb.obj : debugZdb.c
$(CC) -c $(INC_DIRS) /FodebugZdb.obj /FddebugZdb.pdb /TcdebugZdb.c
clean_debugZdb :
$(RM) debugZdb.exe debugZdb.obj test.zdb debugZdb.log
# =============================================================================
# Rules to make the useOids example.
# =============================================================================
#
useOids_example : useOids.exe
run_useOids : useOids.exe
./useOids.exe
useOids.exe : useOids.obj
$(LD) /SUBSYSTEM:CONSOLE /OUT:useOids.exe /PDB:useOids.pdb \
useOids.obj $(LINK_LIBS)
useOids.obj : useOids.c
$(CC) -c $(INC_DIRS) /FouseOids.obj /FduseOids.pdb /TcuseOids.c
clean_useOids :
$(RM) useOids.exe useOids.obj
# =============================================================================
# Clean everything.
# =============================================================================
#
clean : clean_userware clean_createZdb clean_zdbDump clean_skeleton \
clean_fillflat clean_createFlat clean_extract clean_debugZdb
|