-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (40 loc) · 1.25 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
# Makefile adapted from sid-player SIDtracker64 prototype
.SILENT:
.PHONY: all dev dist clean test testdist gen_files
GAME = example
DEV_IMAGE = "bin/$(GAME)_dev.d64"
DIST_IMAGE = "bin/$(GAME).d64"
CC = cl65
CFLAGS = -g -Ln bin/$(GAME).sym -u __EXEHDR__ -t c64
C1541 = c1541
X64 = x64
EXOMIZER = exomizer
PRG = bin/$(GAME).prg
SYM = bin/$(GAME).sym
PACKED_PRG = bin/$(GAME)_exo.prg
SPEC = src/$(GAME).yaml
SRC = src/main.c src/game.c src/cmds.c
BUILD = src/build.rb
all: $(PRG)
# TODO: Use Exomizer correctly
dev: $(DEV_IMAGE)
dist: $(DIST_IMAGE)
$(DEV_IMAGE): $(PRG)
$(C1541) -format "pvmadv,02" d64 $(DEV_IMAGE)
$(C1541) $(DEV_IMAGE) -write $(PRG)
$(C1541) $(DEV_IMAGE) -list
$(DIST_IMAGE): $(PRG)
$(EXOMIZER) sfx sys -o $(PACKED_PRG) $(PRG)
$(C1541) -format "pvmadv dist,02" d64 $(DIST_IMAGE)
$(C1541) $(DIST_IMAGE) -write $(PACKED_PRG) "pvmadv $(GAME)"
$(C1541) $(DIST_IMAGE) -list
$(PRG): $(SRC) $(wildcard src/*.h) gen_files
$(CC) $(CFLAGS) -o $(PRG) $(SRC)
clean:
rm -f bin/*.o $(PRG) $(DEV_IMAGE) $(DIST_IMAGE) $(SYM) src/main.s
test: $(DEV_IMAGE)
x64 -moncommands $(SYM) +confirmexit $(DEV_IMAGE)
testdist: $(DIST_IMAGE)
x64 -moncommands $(SYM) +confirmexit $(DIST_IMAGE)
gen_files: $(BUILD) $(SPEC) $(wildcard src/*.erb)
$(BUILD) $(SPEC)