-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
86 lines (67 loc) · 2.17 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
CONFIG ?= config.default
-include $(CONFIG)
OUT ?= engine
D64 ?= $(OUT).d64
KRILL ?= ./krill
KRILL_URL ?= "http://csdb.dk/getinternalfile.php/196649/loader-v184.zip"
INC ?= $(KRILL)/loader/build/loadersymbols-c64.inc
CC1541 ?= $(KRILL)/loader/tools/cc1541/cc1541
EXO ?= $(KRILL)/loader/tools/exomizer-3/src/exomizer
TC ?= $(KRILL)/loader/tools/tinycrunch_v1.2/tc_encode.py
ENGINE_ACME := engine.acme
ENGINE_OBJ := $(filter %.obj, $(ENGINE_ACME:.acme=.obj))
ENGINE_EXO := $(filter %.exo, $(ENGINE_OBJ:.obj=.exo))
ENGINE_BIN := $(wildcard *.bin)
ENGINE_PRG := $(filter %.prg, $(ENGINE_BIN:.bin=.prg))
ENGINE_TC := $(filter %.tc, $(ENGINE_PRG:.prg=.tc))
map.bin.addr := '\x00\x30'
colors.bin.addr := '\x00\x90'
screen.bin.addr := '\x00\x96'
pixels.bin.addr := '\x00\x9c'
# use 'make Q=' to get a verbose output of all commands
Q ?= @
all: $(D64)
$(INC):
@echo '===> INSTALL KRILL LOADER'
$(Q)$(WGET) $(KRILL_URL) -O krill.zip
$(Q)$(MKDIR) $(KRILL)
$(Q)$(UNZIP) krill.zip -d $(KRILL)
$(Q)$(MAKE) -C $(KRILL)/loader
$(CC1541): $(INC)
@echo '===> INSTALL CC1541'
$(Q)$(MAKE) -C $(KRILL)/loader/tools/cc1541
$(EXO): $(INC)
@echo '===> INSTALL EXOMIZER'
$(Q)$(MAKE) -C $(KRILL)/loader/tools/exomizer-3/src
%.obj: %.acme $(INC)
@echo '===> ACME $<'
$(Q)$(ACME) -f cbm -DSYSTEM=64 -o $@ $<
%.exo: %.obj $(EXO)
@echo '===> EXO $<'
$(EXO) sfx sys $< -B -x1 -o $@
%.prg: %.bin
@echo '===> BIN to PRG $<'
$(Q)printf $($(<).addr) | cat - $< > $@
%.tc: %.prg $(INC)
@echo '===> TC $<'
$(Q)$(TC) -i $< $@
$(D64): $(CC1541) $(ENGINE_TC) $(ENGINE_EXO)
@echo '===> CC1541 $@'
$(Q)$(CC1541) -n $(OUT) -f "$(OUT)#a0,8,1" -w $(ENGINE_EXO) -f map -w map.tc -f colors -w colors.tc -f screen -w screen.tc -f pixels -w pixels.tc $(D64)
clean:
@echo '===> CLEAN'
$(Q)rm -f $(D64) $(ENGINE_EXO) $(ENGINE_TC) krill.zip
distclean: clean
@echo '===> DISTCLEAN'
$(Q)rm -rf $(KRILL)
run: $(D64)
@echo '===> RUN $<'
$(Q)$(X64) -device8 0 +iecdevice8 -drive8truedrive -8 $(D64)
dev:
@echo '===> DEV'
rm -f engine.prg
$(Q)$(ACME) -DSYSTEM=64 -DDEVELOP=1 -DDEBUG=1 engine.acme
prg:
@echo '===> PRG'
rm -f engine.prg
$(Q)$(ACME) -DSYSTEM=64 -DDEVELOP=1 engine.acme