-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
284 lines (208 loc) · 5.94 KB
/
Makefile
File metadata and controls
284 lines (208 loc) · 5.94 KB
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
# ======================================================================
# Makefile for GoDot v1.00
# ======================================================================
#
# directory structure of GoDot repository
#
MAINDIR = system
SYSTEMDIR = system
LIBDIR = libraries
DEVICEDIR = devices
EXTRADIR = extras
LOADERDIR = loaders
MODIFIERDIR = modifiers
SAVERDIR = savers
BUILDDIR = build
D81FILE = $(BUILDDIR)/tmp.d81
# ======================================================================
# configuration
# ======================================================================
ifeq ($(OS),Windows_NT)
# --- configuration for windows/dos ---
# the shell that the Maketool should use to execute commands
SHELL=cmd
# basedir of sourcefiles (with absolute path)
# SOURCEDIR = $(shell cd)
SOURCEDIR = $(shell cd)
# the assembler you want to use, if neccessary with full
# path. sourcecodes are in ACME syntax
ASS = acme
# additional options for the assembler
# AD: changed
ASSFLAGS = -I $(LIBDIR) -f cbm
# name of the c1541 tool from the vice/x64 package, if
# neccessary with path. only needed when you want
# to create diskimages.
C1541 = c1541
# name of the x64 emulator from the vice package, if
# neccessary with path. only needed when you want
# to start the emulator.
X64 = x64
# additional flags for the x64 emulator
# AD: changed +reu to -reu
X64FLAGS = -reu -reusize 512
# command that should be used to create directories
MKDIRCOMMAND = mkdir
# command that should be used to delete files
REMOVECOMMAND = del
DELPAR = /q
REMOVEDIRCOMMAND = rmdir
RMPAR = /s /q
# --- end of configuration for windows ---
else
# --- configuration for linux ---
SOURCEDIR = ${PWD}
ASS = acme
ASSFLAGS = -I $(LIBDIR) -f cbm
C1541 = c1541
X64 = \x64
X64FLAGS = -reu -reusize 512
MKDIRCOMMAND = mkdir -p
REMOVECOMMAND = \rm -f
# --- end of configuration for linux ---
endif
# ======================================================================
# some macros
# ======================================================================
#
# the libraries of godot. don't need to be assembled on their own
# but other sourcecodes depend on them
#
GODOTLIBS = $(LIBDIR)/godotkernal.lib $(LIBDIR)/godotlib.lib
INPUTLIB = $(LIBDIR)/input.inc
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for the mainfile
#
MAINSRCS = $(MAINDIR)/godot.a
MAINOBJS = $(MAINSRCS:$(MAINDIR)/%.a=$(BUILDDIR)/%)
MAINDEPS = $(GODOTLIBS)
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for systemfiles
#
SYSTEMSRCS = $(wildcard $(SYSTEMDIR)/gd_*.a)
SYSTEMOBJS = $(SYSTEMSRCS:$(SYSTEMDIR)/gd_%.a=$(BUILDDIR)/god.%)
SYSTEMDEPS = $(GODOTLIBS)
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for devicedrivers
#
DEVICESRCS = $(wildcard $(DEVICEDIR)/d_*.a)
DEVICEOBJS = $(DEVICESRCS:$(DEVICEDIR)/d_%.a=$(BUILDDIR)/dev.%)
DEVICEDEPS = $(GODOTLIBS)
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for extras
#
EXTRASRCS = $(wildcard $(EXTRADIR)/*.a)
EXTRAOBJS = $(EXTRASRCS:$(EXTRADIR)/%.a=$(BUILDDIR)/%)
#EXTRADEPS = $(GODOTLIBS)
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for loaders
#
LOADERSRCS = $(wildcard $(LOADERDIR)/l_*.a)
LOADEROBJS = $(LOADERSRCS:$(LOADERDIR)/l_%.a=$(BUILDDIR)/ldr.%)
LOADERDEPS = $(GODOTLIBS)
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for modifiers
#
MODIFIERSRCS = $(wildcard $(MODIFIERDIR)/m_*.a)
MODIFIEROBJS = $(MODIFIERSRCS:$(MODIFIERDIR)/m_%.a=$(BUILDDIR)/mod.%)
MODIFIERDEPS = $(GODOTLIBS)
#
# lists of filenames for sourcecodes, objectcodes and dependencies
# for savers
#
SAVERSRCS = $(wildcard $(SAVERDIR)/s_*.a)
SAVEROBJS = $(SAVERSRCS:$(SAVERDIR)/s_%.a=$(BUILDDIR)/svr.%)
SAVERDEPS = $(GODOTLIBS) $(INPUTLIB)
#
# list of all objectcodes that need to be assembled
#
OBJS = $(MAINOBJS) $(SYSTEMOBJS) $(DEVICEOBJS) $(EXTRAOBJS) $(LOADEROBJS) $(MODIFIEROBJS) $(SAVEROBJS)
#
# list of targets that should be built
#
ALLTARGETS = $(BUILDDIR) $(OBJS)
# ======================================================================
# rules
# ======================================================================
.PHONY: all start d81 clean rebuild
#
# build all targets
#
all: $(ALLTARGETS)
files: all
#
# assemble main
#
$(BUILDDIR)/godot: $(MAINSRCS) $(MAINDEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# assemble a system file
#
$(BUILDDIR)/god.%: $(SYSTEMDIR)/gd_%.a $(SYSTEMDEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# assemble a device
#
$(BUILDDIR)/dev.%: $(DEVICEDIR)/d_%.a $(DEVICEDEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# assemble an extra
#
$(BUILDDIR)/%: $(EXTRADIR)/%.a $(EXTRADEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# assemble a loader
#
$(BUILDDIR)/ldr.%: $(LOADERDIR)/l_%.a $(LOADERDEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# assemble a modifier
#
$(BUILDDIR)/mod.%: $(MODIFIERDIR)/m_%.a $(MODIFIERDEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# assemble a saver
#
$(BUILDDIR)/svr.%: $(SAVERDIR)/s_%.a $(SAVERDEPS)
$(ASS) $(ASSFLAGS) -o $@ $<
#
# create $(BUILDDIR)
#
$(BUILDDIR):
$(MKDIRCOMMAND) $(BUILDDIR)
#
# start godot in x64 emulator
#
start: d81
$(X64) $(X64FLAGS) -drive8type 1581 -truedrive -8 -autostart $(BUILDDIR)/tmp.d81
#
# create a d81 image
#
d81: $(BUILDDIR)/tmp.d81
$(BUILDDIR)/tmp.d81: $(ALLTARGETS)
cd $(BUILDDIR) && $(C1541) -format godot,21 d81 tmp.d81
cd $(BUILDDIR) && $(C1541) -attach tmp.d81 $(notdir $(OBJS:%= -write %)) -write ../$(EXTRADIR)/god.set god.set -write ../$(EXTRADIR)/god.ini god.ini
$(REMOVECOMMAND) labels.txt $(DELPAR) $(subst /,\,$(OBJS))
#
# clean up temporary files
#
ifeq ($(OS),Windows_NT)
clean:
$(REMOVECOMMAND) $(DELPAR) labels.txt $(subst /,\,$(OBJS)) $(subst /,\,$(D81FILE))
else
clean:
$(REMOVECOMMAND) labels.txt $(OBJS) $(BUILDDIR)/tmp.d81
endif
#
# clean and build
#
rebuild: clean start
# ======================================================================
# by: Rapid Eraser (and a little finetuning by $AD)
# ======================================================================