aboutsummaryrefslogtreecommitdiffstats
path: root/data/Makefile
blob: cd05483dea788531c2d4edde7fc57a8c6ffab556 (plain)
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
PERL	= perl
BIN2MIF = bin2mif.pl
Z80ASM  = ../tools/z80asm/z80asm

.SUFFIXES: .bdf .asm .obj .bin .mif .bas .rom .pl .inc .abs .bac .lst

.asm.bin:
	$(Z80ASM) -o$@ -l$*.lst $<

all :	keyboard.mif abc80rom.bin basic80.mif \
	mmu.mif chargen.mif videoram.mif fgcol.mif sddrom.mif \
	abcsefi.bas abcdkno.bas abcintl.bas cpm.bas cpm.abs cpm.bac

abc80rom.bin : buildrom.pl abcbasic.rom ufddos.bin printer.bin
	$(PERL) buildrom.pl $@ 32768 \
		abcbasic.rom=0,16384 ufddos.bin=0x6000,4096 \
		printer.bin=0x7800

ufddos.bin : ufddos.rom ufdpatch.pl
	$(PERL) ufdpatch.pl $< $@

keyboard.mif : keyboard.bin $(BIN2MIF)
	$(PERL) $(BIN2MIF) 2048 8 < $< > $@ || ( rm -f $@ ; exit 1 )

basic80.mif : munge_basic.pl
	$(PERL) munge_basic.pl || ( rm -f $@ ; exit 1 )

abcbasic.mif : abcbasic.rom $(BIN2MIF)
	$(PERL) $(BIN2MIF) 16384 8 < $< > $@ || ( rm -f $@ ; exit 1 )

abcdos.mif : ufddos.rom $(BIN2MIF)
	$(PERL) $(BIN2MIF) 4096 8 < $< > $@ || ( rm -f $@ ; exit 1 )

videoram.mif : videoram.bin $(BIN2MIF)
	$(PERL) $(BIN2MIF) 2048 8 < $< > $@ || ( rm -f $@ ; exit 1 )

sddrom.mif : sddrom.bin $(BIN2MIF)
	$(PERL) $(BIN2MIF) 1024 8 < $< > $@ || ( rm -f $@ ; exit 1 )

printer.mif : printer.bin $(BIN2MIF)
	$(PERL) $(BIN2MIF) 768 8 < $< > $@ || ( rm -f $@ ; exit 1 )

mmu.mif : mmuinit.pl
	$(PERL) mmuinit.pl > $@ || ( rm -f $@ ; exit 1 )

FONT    = 6x10-abc-l1.bdf
CHARSET = abcsefi
# These are the sizes in ROM, not the actual font
SIZES   = 8 16
chargen.bin : $(FONT) bdf2bin.pl
	$(PERL) bdf2bin.pl $(CHARSET) $(SIZES) < $< > $@ || ( rm -f $@ ; exit 1 )

chargen.mif : chargen.bin $(BIN2MIF)
	$(PERL) $(BIN2MIF) 2048 8 < $< > $@ || ( rm -f $@ ; exit 1 )

videoram.bin: video.txt genvideo.pl
	$(PERL) genvideo.pl -40 < $< > $@ || ( rm -f $@ ; exit 1 )

cpm.bin: cpm.asm cbios.bin stripzero.pl
	$(Z80ASM) -o$@ -l$*.lst $<
	$(PERL) stripzero.pl $@

cpm.bas: cpm.bin
	$(PERL) bin2poke.pl $< 32768 100 'Z%=CALL(32768%)' > $@ \
		|| ( rm -f $@ ; exit 1 )

cpm.abs: cpm.bin
	$(PERL) bin2abs.pl $< 32768 > $@ || ( rm -f $@ ; exit 1 )

cpm.bac: cpm.bin
	$(PERL) bin2bac.pl $< 32768 32768 > $@ || ( rm -f $@ ; exit 1 )

.bin.bas:
	$(PERL) bin2poke.pl $< 16384 100 RETURN | cat charpoke.bah - > $@ \
		|| ( rm -f $@ ; exit 1 )

abcsefi.bin : $(FONT) bdf2bin.pl
	$(PERL) bdf2bin.pl abcsefi $(SIZES) < $< > $@ || ( rm -f $@ ; exit 1 )

abcdkno.bin : $(FONT) bdf2bin.pl
	$(PERL) bdf2bin.pl abcdkno $(SIZES) < $< > $@ || ( rm -f $@ ; exit 1 )

abcintl.bin : $(FONT) bdf2bin.pl
	$(PERL) bdf2bin.pl abcintl $(SIZES) < $< > $@ || ( rm -f $@ ; exit 1 )

fgcol.mif : fgcol.pl
	$(PERL) fgcol.pl > $@ || ( rm -f $@ ; exit 1 )

clean:
	rm -f *.obj *.bin *.mif *.bas *.abs *.bac *.lst

dist: all
	rm -f *.obj
	rm -f $(filter-out abc80rom.bin,$(wildcard *.bin))

sddrom.bin: sddrom.asm led.inc