-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (38 loc) · 1.49 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
AS = tools/as6809-wrapper -oxlsw
6809_SERIAL = /dev/ttyS1
BIN = main.bin
AREA_BASES = -b VECTORS=0xfff0 -b ROM=0xc000 -b DEBUGMSG=0xf800 -b RAM=0x0000
INCS = $(addprefix include/, ascii.inc debug.inc hardware.inc \
minix.inc scancodes.inc system.inc v99lowlevel.inc version.inc)
SYSTEMVARS_REL = main/systemvars.rel
SUBTABLE_REL = main/subtable.rel
SYSTEMVARS_INC = user/include/systemvars.inc
include $(addsuffix Makefile, main/ drivers/ executive/ fs/ lib/ misc/ \
tasks/ monitor/)
all: $(BIN) $(SYSTEMVARS_INC)
$(BIN): main.ihx
objcopy -I ihex $< -O binary $@
main.ihx: $(RELS) $(MAIN_REL) $(SYSTEMVARS_REL) $(SUBTABLE_REL)
aslink $(AREA_BASES) -onmuwi main.ihx \
$(SYSTEMVARS_REL) $(SUBTABLE_REL) $(RELS)
%.rel: %.asm $(INCS)
$(AS) $@ $<
main/subtable.rel: main/subtable.asm
$(AS) -g $@ $<
clean: $(CLEANDIRS)
rm -f $(MAIN_REL) $(RELS) $(BIN) *.ihx *.map
flasher:
tools/flasher -f $(BIN) -s $(6809_SERIAL)
$(SYSTEMVARS_INC): $(BIN)
# Create the systemvars include for user functions.
tools/map2systemvars-inc.pl < main.map > $@
subtable:
# Re-read the current subtable vector table and append any new in
# ROM external globals
tools/makesubtable.pl main/subtable.asm < main.map
# Create the file of user equates, one for each external global
tools/asm2subtable-inc.pl < main/subtable.asm > user/include/subtable.inc
subtable-init:
# Setup the subtable. This will rejig all the vectors, breaking
# binary compatability in user code.
/bin/echo -e "\t\t.area ROM" > main/subtable.asm