forked from SDL-Hercules-390/hyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.w32
426 lines (331 loc) · 7.85 KB
/
makefile.w32
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
#
# Makefile for Hercules S/370, ESA/390 and z/Architecture emulator
# modified to build hercules under windows (VB)
# modified to build external GUI compatible version under Windows (Fish)
# modified to be useful (hopefully) for Linux AND windows (VB)
# Added LINKMAP option (Fish)
# Support for version >= 1.3.3 of Cygwin = built-in pthreads (Fish)
#
#### VERSION #####
ifndef VER
VER=2.14a
endif
# Change the following to yes/no depending on whether
# or not you're using Cygwin version 1.3.3 or higher
CYGWIN_133_OR_HIGHER=yes
# Change the following to yes/no to
# generate a link map for debugging
LINKMAP=no
WIN=NO
THEOS=$(OSTYPE)
ifeq ($(THEOS),cygwin)
WIN=yes
endif
ifndef HOST_ARCH
HOST_ARCH=pentium
endif
VERSION = $(VER)_$(HOST_ARCH)
# Set the default directory where you want to install the Hercules executables somewhere
# besides /usr/bin. The $PREFIX (which defaults to nothing) can be
# overridden in the make command line, as in "PREFIX=/foo make install"
# (the directory is only used when installing).
ifeq ($(WIN),yes)
DESTDIR = $(PREFIX)/hercules2
else
DESTDIR = $(prefix)/usr/bin
endif
# The default installation directory can be overridden by the DEST= keyword
# when executing the make utility
ifndef DEST
DEST = $(DESTDIR)
endif
# Standard compiler flags used for all architectures
CFLAGS = -Wall
CFLAGS += -fomit-frame-pointer
CFLAGS += -DVERSION=$(VERSION)
CFLAGS += -DNO_IEEE_SUPPORT
#CFLAGS += -DNO_ATTR_REGPARM
ifeq ($(WIN),yes)
ifeq ($(CYGWIN_133_OR_HIGHER),yes)
CC = gcc
else
# Directory where the pthreads-win32 library was installed.
PTHREADS_W32DIR = /usr
CC = gcc -I$(PTHREADS_W32DIR)/Pthreads
endif
CC = gcc
endif
ifeq ($(WIN),yes)
CFLAGS += -DWIN32
CFLAGS += -DNO_BYTESWAP_H
CFLAGS += -DNO_SETUID
CFLAGS += -DHAVE_U_INT
CFLAGS += -DHAVE_SETRESUID
endif
#set compiler flags depending on HOST_ARCH
ifeq ($(HOST_ARCH),i386)
CFLAGS += -O3
CFLAGS += -malign-double
CFLAGS += -DNO_ASM_BYTESWAP
endif
ifeq ($(HOST_ARCH),i586)
CFLAGS += -O3
CFLAGS += -malign-double
CFLAGS += -march=pentium
endif
ifeq ($(HOST_ARCH),pentium)
CFLAGS += -O3
CFLAGS += -malign-double
CFLAGS += -march=pentium
endif
ifeq ($(HOST_ARCH),i686)
CFLAGS += -O3
CFLAGS += -malign-double
CFLAGS += -march=pentiumpro
endif
ifeq ($(HOST_ARCH),pentiumpro)
CFLAGS += -O3
CFLAGS += -malign-double
CFLAGS += -march=pentiumpro
endif
ifeq ($(HOST_ARCH),alpha)
CFLAGS += -O2
CFLAGS += -DNO_ASM_BYTESWAP
endif
ifeq ($(HOST_ARCH),other)
CFLAGS += -O3
CFLAGS += -DNO_ASM_BYTESWAP
endif
# For Linux/390 use:
#CFLAGS += -DNO_ASM_BYTESWAP
#
# The sigabend handler has not yet been tested with windows *JJ
CFLAGS += -DNO_SIGABEND_HANDLER
ifeq ($(WIN),yes)
ifeq ($(CYGWIN_133_OR_HIGHER),yes)
LFLAGS =
else
LFLAGS = -L$(PTHREADS_W32DIR)/DLL -lpthreadw32
endif
else
LFLAGS = -lpthread
endif
# Comment out the line below to build a console-mode only
# (i.e. NON-external GUI compatible) version of Hercules
#
# Note: the external GUI compatible version of Hercules
# (which is the default) can be run in both console mode
# or external GUI mode, whereas a NON-external GUI compatible
# version can ONLY be run in console (non-GUI) mode.
CFLAGS += -DEXTERNALGUI
# Change the value below to YES to enable compresion
# to NO to disable compression
CCKD=YES
# Change the value below to YES to use bzip2 compression
# to NO to use standard compression
BZIP2=YES
ifeq ($(CCKD),YES)
LFLAGS += -lz
else
CFLAGS += -DNO_CCKD
endif
ifeq ($(BZIP2),YES)
CFLAGS += -DCCKD_BZIP2
CFLAGS += -DHET_BZIP2
LFLAGS += -lbz2
endif
ifeq ($(LINKMAP),no)
else
LFLAGS += -Xlinker -Map -Xlinker hercules.map
endif
EXEFILES = hercules \
dasdinit \
dasdisup \
dasdload \
dasdls \
dasdpdsu \
tapecopy \
tapemap \
tapesplt \
cckd2ckd \
cckdcdsk \
ckd2cckd \
cckdcomp \
hetget \
hetinit \
hetmap \
hetupd \
dmap2hrc
ifeq ($(WIN),yes)
else
EXEFILES += hercifc
endif
TARFILES = makefile \
*.c \
*.h \
hercules.cnf \
tapeconv.jcl \
util/dasdlist \
html \
zzsa.cnf \
zzsacard.bin
HRC_OBJS = impl.o \
config.o \
panel.o \
version.o \
ipl.o \
assist.o \
dat.o \
stack.o \
cpu.o \
vstore.o \
general1.o \
general2.o \
plo.o \
control.o \
io.o \
decimal.o \
service.o \
opcode.o \
diagnose.o \
diagmssf.o \
vm.o \
channel.o \
ckddasd.o \
fbadasd.o \
tapedev.o \
cardrdr.o \
cardpch.o \
printer.o \
console.o \
external.o \
float.o \
ctcadpt.o \
trace.o \
machchk.o \
vector.o \
xstore.o \
cmpsc.o \
sie.o \
timer.o \
esame.o \
cckddasd.o \
cckdcdsx.o \
parser.o \
hetlib.o \
ieee.o
ifeq ($(WIN),yes)
else
HIFC_OBJ = hercifc.o version.o
endif
DIN_OBJS = dasdinit.o dasdutil.o version.o
DIS_OBJS = dasdisup.o dasdutil.o version.o
DLD_OBJS = dasdload.o dasdutil.o version.o
DLS_OBJS = dasdls.o dasdutil.o version.o
DPU_OBJS = dasdpdsu.o dasdutil.o version.o
TCY_OBJS = tapecopy.o version.o
TMA_OBJS = tapemap.o version.o
TSP_OBJS = tapesplt.o version.o
CCHK_OBJ = cckdcdsk.o version.o
COMP_OBJ = cckdcomp.o cckdcdsx.o version.o
C2CC_OBJ = ckd2cckd.o version.o
CC2C_OBJ = cckd2ckd.o version.o
HGT_OBJS = hetget.o hetlib.o sllib.o version.o
HIN_OBJS = hetinit.o hetlib.o sllib.o version.o
HMA_OBJS = hetmap.o hetlib.o sllib.o version.o
HUP_OBJS = hetupd.o hetlib.o sllib.o version.o
D2H_OBJS = dmap2hrc.o version.o
HEADERS = feat370.h \
feat390.h \
feat900.h \
featall.h \
featchk.h \
features.h \
esa390.h \
opcode.h \
hercules.h \
inline.h \
dat.h \
vstore.h \
byteswap.h \
dasdblks.h \
hetlib.h \
version.h
#HEADERS = esa390.h version.h inline.h
all: $(EXEFILES)
hercules: $(HRC_OBJS)
$(CC) -o hercules $(HRC_OBJS) $(LFLAGS)
$(HRC_OBJS): %.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -o $@ -c $<
ifeq ($(WIN),yes)
else
hercifc: $(HIFC_OBJ)
$(CC) -o hercifc $(HIFC_OBJ)
endif
dasdinit: $(DIN_OBJS)
$(CC) -o dasdinit $(DIN_OBJS)
dasdisup: $(DIS_OBJS)
$(CC) -o dasdisup $(DIS_OBJS)
dasdload: $(DLD_OBJS)
$(CC) -o dasdload $(DLD_OBJS)
dasdls: $(DLS_OBJS)
$(CC) -o dasdls $(DLS_OBJS)
dasdpdsu: $(DPU_OBJS)
$(CC) -o dasdpdsu $(DPU_OBJS)
tapecopy: $(TCY_OBJS)
$(CC) -o tapecopy $(TCY_OBJS)
tapemap: $(TMA_OBJS)
$(CC) -o tapemap $(TMA_OBJS)
tapesplt: $(TSP_OBJS)
$(CC) -o tapesplt $(TSP_OBJS)
hetget: $(HGT_OBJS)
$(CC) -o hetget $(HGT_OBJS) $(LFLAGS)
hetinit: $(HIN_OBJS)
$(CC) -o hetinit $(HIN_OBJS) $(LFLAGS)
hetmap: $(HMA_OBJS)
$(CC) -o hetmap $(HMA_OBJS) $(LFLAGS)
hetupd: $(HUP_OBJS)
$(CC) -o hetupd $(HUP_OBJS) $(LFLAGS)
dmap2hrc: $(D2H_OBJS)
$(CC) -o dmap2hrc $(D2H_OBJS) $(LFLAGS)
dasdinit.o: dasdinit.c $(HEADERS) dasdblks.h
dasdisup.o: dasdisup.c $(HEADERS) dasdblks.h
dasdload.o: dasdload.c $(HEADERS) dasdblks.h
dasdls.o: dasdls.c $(HEADERS) dasdblks.h
dasdpdsu.o: dasdpdsu.c $(HEADERS) dasdblks.h
dasdutil.o: dasdutil.c $(HEADERS) dasdblks.h
tapecopy.o: tapecopy.c $(HEADERS)
tapemap.o: tapemap.c $(HEADERS)
tapesplt.o: tapesplt.c $(HEADERS)
cckdcdsk: $(CCHK_OBJ)
$(CC) -o cckdcdsk $(CCHK_OBJ) $(LFLAGS)
cckdcomp: $(COMP_OBJ)
$(CC) -o cckdcomp $(COMP_OBJ) $(LFLAGS)
cckd2ckd: $(CC2C_OBJ)
$(CC) -o cckd2ckd $(CC2C_OBJ) $(LFLAGS)
ckd2cckd: $(C2CC_OBJ)
$(CC) -o ckd2cckd $(C2CC_OBJ) $(LFLAGS)
hetget.o: hetget.c hetlib.h sllib.h
hetinit.o: hetinit.c hetlib.h sllib.h
hetmap.o: hetmap.c hetlib.h sllib.h
hetupd.o: hetupd.c hetlib.h sllib.h
dmap2hrc.o: dmap2hrc.c $(HEADERS)
cckd: cckd2ckd cckdcdsk ckd2cckd cckdcomp
clean:
rm -rf $(EXEFILES) *.o
tar: clean
(cd ..; tar cvzf hercules-$(VERSION).tar.gz hercules-$(VERSION))
install: $(EXEFILES)
mkdir -p $(DEST)
ifeq ($(WIN),yes)
cp *.exe $(DEST)
rm -f $(DEST)/dasdlist*
cp util/dasdlist* $(DEST)
else
cp $(EXEFILES) $(DEST)
cp util/dasdlist $(DEST)
chown root $(DEST)/hercifc
chmod 0751 $(DEST)/hercifc
chmod +s $(DEST)/hercifc
rm hercifc
endif