-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
115 lines (85 loc) · 3.57 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
releases: main.dsk main.xex main.ssd main.prg main.hex
# main.o is generated by cl65 as a byproduct of assembly, and each
# target overwrites it with its own version.
#
clean:
rm -f main.o \
main.dsk main.as tools/a2in \
main.xex \
main.ssd main.bbc main.inf main !boot !boot.inf \
main.prg \
main-plus4.prg \
main.hex main.rc6 \
main.o \
#
####################################################################
# Run, release and build targets
#
# The first target for every machine is usually a "run" target
# that uses a simulator or sends the program to the real machine.
#
# The second is the target to build the release version (often
# a disk image.)
#
##############################
# Apple II
apple2: main.dsk
@if linapple --help >/dev/null 2>&1; \
then linapple --d1 main.dsk; \
else open ~/Applications/Virtual\ \]\[.app; \
fi
main.dsk: main.as tools/a2in tools/blank.dsk
cp ./tools/blank.dsk main.dsk && ./tools/a2in -r b main.dsk MAIN main.as
main.as: main.s apple2_rand.inc my_apple2.inc MyA2.cfg minesweeper.inc apple_symbols.inc apple2_rc6502_visuals.inc
cl65 -t apple2 -C MyA2.cfg main.s -o main.as
tools/a2in: tools/a2tools.c
cd tools && gcc -DUNIX a2tools.c -o a2in
##############################
# Atari
atari: main.xex
~/Applications/Atari800MacX/Atari800MacX.app/Contents/MacOS/Atari800MacX main.xex
main.xex: main.s MyAtari.cfg my_atari.inc minesweeper.inc atari_c64_c16_visuals.inc chars_hires-charset.bin chars_4c.bin
cl65 -t atari -C MyAtari.cfg main.s -o main.xex
##############################
# BBC
bbc: main.ssd
~/Applications/b2.app/Contents/MacOS/b2 -b -0 main.ssd
main.ssd: main.bbc main.inf tools/!boot tools/!boot.inf
rm -f main.ssd
cp main.bbc main \
&& cp tools/!boot* . \
&& tools/beebtools/beeb blank_ssd main.ssd \
&& tools/beebtools/beeb putfile main.ssd main !boot \
&& tools/beebtools/beeb opt4 main.ssd 3
main.bbc: main.s MyBBC.cfg my_bbc.inc minesweeper.inc bbc_symbols.inc bbc_symbols2.inc
cl65 -t bbc -C MyBBC.cfg --no-target-lib main.s -o main.bbc
main.inf: main.bbc
tools/generate_inf.sh main.bbc MAIN 001900 001900 0 1 main.inf
##############################
# Commodore 64
c64: main.prg
~/Applications/VICE.app/Contents/Resources/bin/x64sc main.prg
main.prg: main.s MyC64.cfg my_c64.inc minesweeper.inc atari_c64_c16_visuals.inc c64_c16_common.inc chars_hires-charset.bin
cl65 -t c64 -C MyC64.cfg -u __EXEHDR__ main.s -o main.prg
##############################
# Commodore 16 and Plus/4
plus4: main-plus4.prg
~/Applications/VICE.app/Contents/Resources/bin/xplus4 main-plus4.prg
main-plus4.prg: main.s MyPlus4.cfg my_plus4.inc minesweeper.inc atari_c64_c16_visuals.inc c64_c16_common.inc chars_hires-charset.bin
cl65 -t plus4 -C MyPlus4.cfg -u __EXEHDR__ main.s -o main-plus4.prg
##############################
# Commodore VIC-20 (cartridge)
vic20: main.crt
~/Applications/VICE.app/Contents/Resources/bin/xvic -cartA main.crt
main.crt: main.s MyVIC20.cfg my_vic20.inc minesweeper.inc chars_vic20-charset.bin vic20_header.inc vic20_visuals.inc
cl65 -t vic20 -C MyVIC20.cfg -u __EXEHDR__ main.s -o main.crt
##############################
# RC6502
# https://github.com/tebl/RC6502-Apple-1-Replica
rc6502: main.hex
python3 test.py
main.hex: main.rc6
printf "0300" > main.hex
hexdump -v -e '8/1 " %02X" "\n"' main.rc6 | sed 's/^/:/g' >> main.hex
main.rc6: main.s MyRC6502.cfg my_rc6502.inc minesweeper.inc apple2_rand.inc apple2_rc6502_visuals.inc rc6502_symbols.inc
cl65 --asm-define __RC6502__ -t none -C MyRC6502.cfg --no-target-lib main.s -o main.rc6