-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·194 lines (132 loc) · 4.59 KB
/
Makefile
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
# Makefile for mz800em
INSTALLPREFIX = /usr/local
#FAST=1
#STRANGEMAGIC=1
#USE_MZ80=1
#USE_RAWKEY=1
#VIDEOFLAGS=-DHAVE_640X480X256
## No user-serviceable parts below
VERSION=0.8.1
ifdef FAST
# This will make the Z80 kernel faster, BUT you will lose speed
# control (which is very important for games), correctness of
# unaligned memory accesses; compiling z80.c will yield a warning
# about register use, and the whole thing will hardly compile on
# low-memory systems.
CFLAGS:=$(CFLAGS) -O2 -Wall
Z80FLAGS=-DCOPY_BANKSWITCH -DHEAVY_LOAD -DSLOPPY_2 -DUSE_REGS \
-DNO_COUNT_TSTATES -DRISKY_REGS -DWIN95PROOF \
-DDELAYED_UPDATE -DTWO_Z80_COPIES
SUFFIX=-fast
else
# This is the normal setting.
Z80FLAGS=-DCOPY_BANKSWITCH -DUSE_REGS -DWIN95PROOF
CFLAGS:=$(CFLAGS) -O -m486 -Wall
endif
ifdef USE_RAWKEY
# This will make the emulator use Russell's librawkey, as the original
# mz700em did. I switched over to using the keyboard functions of
# svgalib instead, since I had several problems with librawkey.
RAWKEYLIB=librawkey.a
RAWKEYFLAGS=-DUSE_RAWKEY
else
# This is the default setting: Use svgalib keyboard functions.
RAWKEYLIB=
RAWKEYFLAGS=
endif
ifdef DEBUG
CFLAGS:=$(CFLAGS) -g
endif
ifdef STRANGEMAGIC
PRINTFLAGS=-DPRINT_INVOKES_ENSCRIPT
# -DMZISHPRINTER
endif
CFLAGS:=$(CFLAGS) -I. $(INCLUDE) $(RAWKEYFLAGS) $(Z80FLAGS) $(VIDEOFLAGS) $(PRINTFLAGS)
#### Targets ####
ifdef USE_MZ80
## Use Neil Bradley's multi-Z80 emulator
Z80_OBJS = mz80/mz80.o mz80/mz80f.o mz80supp.o
CFLAGS := $(CFLAGS) -DUSE_MZ80
mz80/mz80.o mz80/mz80f.o: mz80/makez80.c
$(MAKE) -C mz80 mz80.o mz80f.o
else
## Default: Use Ian Collier's Z80 emulator (with mkoeppe's changes)
Z80_OBJS = z80.o
endif
MZ800EM_OBJS=$(Z80_OBJS) main.o disk.o graphics.o mzterm.o
MZ800VGA_OBJS=$(MZ800EM_OBJS) mz800vga.o pckey.o
MZ800WIN_OBJS=$(MZ800EM_OBJS) mz800win.o pckey.o
MZ800GTK_OBJS=$(MZ800EM_OBJS) mz800gtk.o
.PHONY: all install clean tgz
all: mz800em$(SUFFIX) mzget mzextract gmz800em$(SUFFIX)
z80.o: z80.c z80.h cbops.c edops.c z80ops.c
$(CC) -c $(CFLAGS) z80.c -o $@
mz800win.o: mz800win.c mz800win.h
$(CC) -c $(CFLAGS) $< -o $@
mzterm.o: mzterm.c mz800win.h
$(CC) -c $(CFLAGS) $< -o $@
main.o: main.c mz800win.h
$(CC) -c $(CFLAGS) $< -o $@
GTKCFLAGS=`gtk-config --cflags`
mz800gtk.o: mz800gtk.c
$(CC) -c $(CFLAGS) $(GTKCFLAGS) $< -o $@
mz800em$(SUFFIX): $(MZ800VGA_OBJS)
$(CC) $(CFLAGS) -o $@ $(MZ800VGA_OBJS) -lvga $(RAWKEYLIB) -lm
gmz800em$(SUFFIX): $(MZ800GTK_OBJS)
$(CC) $(CFLAGS) -o $@ $(MZ800GTK_OBJS) `gtk-config --libs`
mz800em.exe: $(MZ800WIN_OBJS)
$(CC) $(CFLAGS) -o mz800em.exe $(MZ800WIN_OBJS) -lm -mwindows
mzget: mzget.o
$(CC) $(CFLAGS) -o mzget mzget.o
mzextract: mzextract.o
$(CC) $(CFLAGS) -o mzextract mzextract.o
# You also have to edit `main.c' if you want a different target directory.
install:
install -o root -m 4555 -s mz800em$(SUFFIX) $(INSTALLPREFIX)/bin
install -m 555 gmz800em$(SUFFIX) -s $(INSTALLPREFIX)/bin
install -m 555 -s mzget mzextract $(INSTALLPREFIX)/bin
install -m 555 mzjoinimage $(INSTALLPREFIX)/bin
install -m 444 mz700.rom mz700fon.dat mz800.rom $(INSTALLPREFIX)/lib
#install -m 555 mzprint $(INSTALLPREFIX)/bin
change:
$(RM) -f main.o mz800em mz800em-fast gmz800em gmz800em-fast mz800em.exe
clean:
$(RM) -f *.o *~ *.bak *.s *.i mz800em mz800em-fast gmz800em-fast gzm800em mz800em.exe mzextract mzget
#### Distribution section ####
CYGFILES = mz800win.c mz800win.h scancode.h mz.dll
MZ80FILES = mz80/Makefile mz80/makez80.c.dif mz80/README \
mz80/makez80.c-2.6-orig \
mz80/mz80.h mz80/mz80.txt mz80/z80stb.h
# mz80/mz80.o mz80/mz80f.o
FILES = COPYING ChangeLog Makefile README README-700 TODO BUGS \
cbops.c edops.c font.txt \
librawkey.a main.c mz700em.h mzextract.c mzget.c mzjoinimage \
rawkey.h unpix.c z80.c z80.h z80ops.c disk.c graphics.h \
pckey.c mz800gtk.c mz800vga.c \
graphics.c mzterm.c mzmagic mzcat mzprint mzprintw \
$(CYGFILES) $(MZ80FILES) \
mz800em.btx
## not distributed (SHARP copyright)
ROMS = mz700.rom mz800.rom mz700fon.dat
## Source distribution
tgz:
$(RM) /tmp/mz800em-$(VERSION)
ln -s `pwd` /tmp/mz800em-$(VERSION)
tar --directory=/tmp --create --file=/tmp/mz800em-$(VERSION).tar.gz \
--gzip $(addprefix mz800em-$(VERSION)/, $(FILES))
$(RM) /tmp/mz800em-$(VERSION)
## Binary distribution
share.tgz:
tar cfz share.tgz share bin --exclude="*tar.exe" \
--exclude="*gunzip.exe"
bindist1: share.tgz
mkdir -p a:/mz/bin
cp cygwin1.dll a:/mz
cp bin/tar.exe bin/gunzip.exe a:/mz/bin
cp install.bat a:/mz
cp share.tgz a:/mz
bindist2:
mkdir -p a:/mz
cp COPYING MZ.DLL README cygwin1.dll basick.mzf basic.bat \
mz800em.exe mzprintw \
a:/mz