-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
179 lines (131 loc) · 3.72 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
AS=aztec34_as
CC=aztec34_cc
AR=aztec34_lib
MASM=pcdev_masm
LINK=pcdev_link
EXE2BIN=pcdev_exe2bin
CFLAGS=-I. -B +0 -D__CPM86__
STRIP=aztec34_sqz
LDFLAGS=-lc86
LD=aztec34_link
LINK86=pcdev_linkcmd
RASM86=pcdev_rasm86
TOOLS=rm.cmd more.cmd write.cmd dump.cmd mode.cmd ls.cmd \
cls.cmd pause.cmd reboot.cmd tod.cmd ver.cmd touch.cmd wc.cmd \
atinit.cmd attime.cmd rtcinit.cmd rtctime.cmd ciotest.cmd ball.cmd getch.cmd \
printenv.cmd mem.cmd dosver.com
EXTRAS=clsansi.cmd rtctime.cmd rtcinit.cmd
PCETOOLS=pce/pceexit.cmd pce/pcever.cmd pce/pcemnt.cmd pce/pcetime.cmd \
pce/pceinit.cmd
all: binaries
binaries: $(TOOLS) $(EXTRAS)
(cd pce;make binaries)
dist: hack-bin.zip pce-bin.zip hack.img
hack-bin.zip pce-bin.zip: binaries
rm -f pce-bin.zip
zip pce-bin.zip $(PCETOOLS)
rm -f hack-bin.zip
zip hack-bin.zip $(TOOLS)
hack.img: cpmtest.img
cp $< $@
wc.cmd: wc.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
printenv.cmd: printenv.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
getch.cmd: getch.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
ls.cmd: ls.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
ciotest.cmd: ciotest.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
cp.cmd: cp.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
touch.cmd: touch.o
$(LD) -o $@ $^ $(LDFLAGS)
rm.cmd: rm.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
write.cmd: write.o
$(LD) -o $@ $< $(LDFLAGS)
dump.cmd: dump.o
$(LD) -o $@ $< $(LDFLAGS)
ball.cmd: ball.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
mode.cmd: mode.o util.lib
$(LD) -o $@ $^ $(LDFLAGS)
more.cmd: more.o
$(LD) -o $@ $< $(LDFLAGS)
util.lib: util.o conio.o dirent.o dpb.o debug.o os.o gfx.o
rm -f $@
$(AR) $@ $^
gfx.o: gfx.asm
$(AS) $<
$(STRIP) $@
os.o: os.asm
$(AS) $<
$(STRIP) $@
ls.c: dirent.h debug.h
dirent.c: dirent.h debug.h
debug.c: debug.h
rm.c: dirent.h
tod.obj: tod.a86 baselib.a86 tinylib.a86
ver.obj: ver.a86 tinylib.a86
attime.obj: time.a86 baselib.a86 tinylib.a86 clock.a86
$(RASM86) $< $$ pz sz iatdef.a86
mv time.obj attime.obj
rtctime.obj: time.a86 baselib.a86 tinylib.a86 clock.a86
$(RASM86) $< $$ pz sz irtcdef.a86
mv time.obj rtctime.obj
mem.obj: mem.a86 tinylib.a86
atinit.obj: init.a86 baselib.a86 tinylib.a86 clock.a86
$(RASM86) $< $$ pz sz iatdef.a86
mv init.obj atinit.obj
rtcinit.obj: init.a86 baselib.a86 tinylib.a86 clock.a86
$(RASM86) $< $$ pz sz irtcdef.a86
mv init.obj rtcinit.obj
dosver.com: dosver.exe
$(EXE2BIN) dosver.exe dosver.com
dosver.exe: dosver.obj
$(LINK) dosver \;
dosver.obj: dosver.asm
$(MASM) dosver \;
%.cmd: %.obj
$(LINK86) $* '[$$sz]'
%.obj: %.a86
$(RASM86) $< $$ pz sz
%.o: %.c
$(CC) $(CFLAGS) $<
$(STRIP) $@
clean:
$(RM) *.o *.h86 *.log *.sym *.prn *.lst *.obj $(TOOLS) util.lib
$(RM) dosver.exe $(EXTRAS)
$(RM) cpmtest.img ccpmtest.img dostest.img hack.img
(cd pce;make clean)
dostest.img: binaries Makefile test.txt env.dat
(cd pce;make binaries)
cp dosbase.img dostest.img
-for i in $(PCETOOLS) $(TOOLS) $(EXTRAS);do \
mcopy -o -i dostest.img $$i ::`basename $$i|tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ; \
done
mcopy -o -i dostest.img test.txt ::TEST.TXT
mcopy -o -i dostest.img env.dat ::ENV.DAT
mdir -w -i dostest.img ::*.*
ccpmtest.img: binaries cpmtest.img startup.0
(cd pce;make binaries)
cp cpmtest.img ccpmtest.img
cpmcp -f ibmpc-514ss ccpmtest.img startup.0 0:
cpmtest.img: binaries Makefile test.txt env.dat
(cd pce;make binaries)
cp cpmbase.img cpmtest.img
cpmcp -f ibmpc-514ss cpmtest.img $(PCETOOLS) 0:
cpmcp -f ibmpc-514ss cpmtest.img $(TOOLS) 0:
cpmcp -f ibmpc-514ss cpmtest.img $(EXTRAS) 0:
cpmcp -f ibmpc-514ss cpmtest.img test.txt 0:
cpmcp -f ibmpc-514ss cpmtest.img env.dat 0:
cpmls -F -f ibmpc-514ss cpmtest.img 0:*.*
test: cpmtest
ccpmtest: ccpmtest.img
@./ccpm86
cpmtest: cpmtest.img
@./cpm86
dostest: dostest.img
@./dos