-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
77 lines (58 loc) · 2.06 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
# Set the name of the output ROM.
name = Test
# Set the output file extension. Some emulators look for specific extension.
extension = o
# Set the console type, based on the directories in tms9918lib.
console = HBC56
# Set the ROM and RAM start addresses
cseg = FFFA-FFFF,8000-FFF9
dseg = 0200-7EFF
zseg = 20
# Set the tools path.
TOOLS_PATH = ../../Tools
# Set the CATE compiler path. Bin and lib are expected to exist inside the directory.
CATE_PATH = $(TOOLS_PATH)/Cate
BIN_PATH = $(CATE_PATH)/bin
LIB_PATH = $(CATE_PATH)/lib
# CATE/ASM8/Lib compile ID. (ie CATEXX.exe)
compileType = 65
# Customize the processor type and the TMS-9918 interface type, if needed.
Shared_S = $(wildcard SystemLib/6502/Decompression/*.s)
Shared_S += $(wildcard SystemLib/6502/Graphics/Graphics/*.s)
Shared_S += $(wildcard SystemLib/6502/Graphics/Sprite/*.s)
Shared_S += $(wildcard SystemLib/6502/Shared/*.s)
Shared_S += $(wildcard SystemLib/6502/Sound/AY38910/*.s)
System_S = $(wildcard SystemLib/$(console)/crt0/Rom.s)
System_S += $(wildcard SystemLib/$(console)/*.s)
System_S += $(wildcard System/*.s)
Game_C = $(wildcard Game/*.c)
Graphics_S = $(wildcard Graphics/*.s)
Vectors_S = $(wildcard SystemLib/$(console)/Vectors/Vectors.s)
system = $(System_S:.s=.obj)
vectors = $(Vectors_S:.s=.obj)
objects = $(Shared_S:.s=.obj)
objects += $(Game_C:.c=.obj)
graphics = $(Graphics_S:.s=.obj)
libs = $(LIB_PATH)/cate$(compileType).lib
lists = $(System_S:.s=.lst)
lists += $(Vectors_S:.s=.lst)
lists += $(Shared_S:.s=.lst)
lists += $(Game_C:.c=.lst)
lists += $(Graphics_S:.s=.lst)
all: $(name).$(extension)
clean:
rm -f $(system)
rm -f $(vectors)
rm -f $(objects)
rm -f $(graphics)
rm -f $(lists)
rm -f $(name).$(extension)
rm -f $(name).symbols.txt
%.asm: %.c
$(BIN_PATH)/Cate$(compileType) $<
%.obj: %.asm
$(BIN_PATH)/Asm$(compileType) $<
%.obj: %.s
$(BIN_PATH)/Asm$(compileType) -65C02 $<
$(name).$(extension): $(vectors) $(system) $(objects) $(graphics)
$(BIN_PATH)/LinkLE $(name).$(extension) $(cseg) $(dseg) $(zseg) $(vectors) $(system) $(objects) $(graphics) $(libs)