This repository was archived by the owner on Sep 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (49 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
66 lines (49 loc) · 1.58 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
# Assembler, linker and scripts
AS = ca65
LD = ld65
RELIST = scripts/relist.py
FINDSYM = scripts/findsymbols
LOADTRIM = scripts/loadtrim.py
TTY_DEVICE = /dev/ttyUSB0
# Assembler flags
ASFLAGS += -I inc -g --feature labels_without_colons --cpu 65C02 --feature string_escapes
# Set DEBUG=1 for debugging.
DEBUG = -D DEBUG=0
# Set CFG to the config for size of rom
CFG = rom_8k.cfg
SFM_LOAD_ADDR = 8000
# Where should the builds be placed
BUILD_DIR = build
# Sources and objects
BIOS_SOURCES = \
bios/bios.s \
bios/acia.s \
bios/sdcard.s \
bios/sn76489.s \
bios/zerobss.s \
bios/vectors.s \
BIOS_OBJS = $(addprefix $(BUILD_DIR)/, $(BIOS_SOURCES:.s=.o))
SFOS_SOURCES = \
sfos/sfos.s
SFOS_OBJS = $(addprefix $(BUILD_DIR)/, $(SFOS_SOURCES:.s=.o))
SFCP_SOURCES = \
sfcp/sfcp.s
SFCP_OBJS = $(addprefix $(BUILD_DIR)/, $(SFCP_SOURCES:.s=.o))
all: clean $(BUILD_DIR)/rom.bin
clean:
rm -fr $(BUILD_DIR)/*
$(BUILD_DIR)/%.o: %.s
@mkdir -p $$(dirname $@)
$(AS) $(ASFLAGS) $(DEBUG) -l $(BUILD_DIR)/$*.lst $< -o $@
$(BUILD_DIR)/rom.raw: $(SFCP_OBJS) $(SFOS_OBJS) $(BIOS_OBJS)
@mkdir -p $$(dirname $@)
$(LD) -C config/$(CFG) $^ -o $@ -m $(BUILD_DIR)/rom.map -Ln $(BUILD_DIR)/rom.sym
$(RELIST) $(BUILD_DIR)/rom.map $(BUILD_DIR)/bios
$(RELIST) $(BUILD_DIR)/rom.map $(BUILD_DIR)/sfos
$(RELIST) $(BUILD_DIR)/rom.map $(BUILD_DIR)/sfcp
$(BUILD_DIR)/rom.bin: $(BUILD_DIR)/rom.raw
$(LOADTRIM) build/rom.raw build/rom.img $(SFM_LOAD_ADDR)
grep:
grep bios_boot $(BUILD_DIR)/rom.sym
lines:
cloc --exclude-dir=py_sfs_v2,.gitignore,scripts,msbasic,ehbasic .