-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
180 lines (130 loc) · 4.46 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
180
all: phase1/phase1.tap
TOPS20_7:= bb-h137f-bm:install \
bb-ev83b-bm_longer:tcpip \
bb-h138f-bm:dist1 \
bb-lw55a-bm:dist2 \
bb-m780d-sm:monsrc \
bb-gs97b-sm:execsrc \
bb-m080z-sm:monsrcmod.4 \
bb-m081z-sm:execsrcmod.4 \
bb-penea-bm:tsu04.1 \
bb-kl11m-bm:tsu04.2 \
bb-m836d-bm:tools
# getting these from trailing-edge.com because it's mysteriously more
# complete than bitsavers
TOPS20_BASE:=http://pdp-10.trailing-edge.com/tapes/
dec-7.0-tapes: tapes/dec
for tape_name in $(TOPS20_7); do \
oIFS="$$IFS" ;\
IFS=: ;\
set $$tape_name ;\
IFS="$$oIFS" ;\
tapenumber=$$(echo $$1 | tr A-Z a-z) ;\
tapefunction=$$2 ;\
$(RM) tapes/dec/$${tapefunction}.tap.bz2 ;\
wget \
-O tapes/dec/$${tapefunction}.tap.bz2 \
$(TOPS20_BASE)/$${tapenumber}.tap.bz2 \
;\
bunzip2 tapes/dec/$${tapefunction}.tap.bz2 ;\
done
tapes/dec/install.tap: dec-7.0-tapes
tapes/dec:
mkdir -p tapes/dec
clean::
$(RM) -r tapes/dec
pexpect-venv/bin/python3:
python3 -m venv pexpect-venv
pexpect-venv/bin/pip install --upgrade pip
pexpect-venv/bin/pip install pexpect
pexpect-venv: pexpect-venv/bin/python3
clean::
$(RM) -r pexpect-venv __pycache__
bin:
mkdir bin
clean::
$(RM) -r bin
build:
mkdir build
clean::
$(RM) -r build
build/klh10:: build
mkdir build/klh10
clean::
$(RM) -r build/klh10
build/klh10/bld-kl/kn10-kl: tools/klh10/autogen.sh
mkdir -p build/klh10
(cd tools/klh10; ./autogen.sh)
(cd build/klh10; ../../tools/klh10/configure --bindir=$(CURDIR)/bin)
make -C build/klh10/bld-kl
tools/klh10/autogen.sh:
git submodule update --init tools/klh10
bin/kn10-kl: bin build/klh10/bld-kl/kn10-kl
make -C build/klh10/bld-kl install
phase0: clean-phase0
mkdir phase0
clean-phase0:
$(RM) -r phase0
clean:: clean-phase0
phase0/phase0.tap: phase0 pexpect-venv/bin/python3 tapes/dec/install.tap bin/kn10-kl config/config.tap phase0.py
(cd phase0; script -c '../pexpect-venv/bin/python3 ../phase0.py' phase0.out)
bzip2 -fk phase0/phase0.tap
cp -v phase0/phase0.tap.bz2 tapes/bootstrap.tap.bz2
tapes/bootstrap.tap: tapes/bootstrap.tap.bz2
bunzip2 -fk tapes/bootstrap.tap.bz2
clean::
$(RM) tapes/bootstrap.tap
phase1: clean-phase1
mkdir phase1
clean-phase1:
$(RM) -r phase1
clean:: clean-phase1
phase1/phase1.tap: phase1 pexpect-venv/bin/python3 tapes/bootstrap.tap bin/kn10-kl config/config.tap phase1.py src/monitor.tap src/exec.tap src/midas.tap src/iddt.tap src/pcl.tap src/operator.tap
(cd phase1; script -c '../pexpect-venv/bin/python3 ../phase1.py' phase1.out)
tools/back10/back10: tools/back10/back10.c tools/back10/back10.h
make -C tools/back10 all
clean::
make -C tools/back10 clean
CONFIG_SRC := 7-config.cmd 7-ptycon.ato 7-sysjob.run
CONFIG_DEP := $(addprefix config/,$(CONFIG_SRC))
config/config.tap: $(CONFIG_DEP) tools/back10/back10
(cd config; ../tools/back10/back10 -c -f config.tap -i $(CONFIG_SRC))
clean::
$(RM) config/config.tap
MONITOR_DEP := $(wildcard src/monitor/*)
MONITOR_SRC := $(notdir $(MONITOR_DEP))
src/monitor.tap: $(MONITOR_DEP) tools/back10/back10
(cd src/monitor; ../../tools/back10/back10 -c -f ../monitor.tap -i $(MONITOR_SRC))
clean::
$(RM) src/monitor.tap
EXEC_DEP := $(wildcard src/exec/*)
EXEC_SRC := $(notdir $(EXEC_DEP))
src/exec.tap: $(EXEC_DEP) tools/back10/back10
(cd src/exec; ../../tools/back10/back10 -c -f ../exec.tap -i $(EXEC_SRC))
clean::
$(RM) src/exec.tap
src/midas: $(wildcard ref/its/midas/*)
$(RM) -r src/midas src/-midas
mkdir src/-midas
for i in ref/its/src/midas/*; do echo $$i | sed -Ee 's;(.*/)([^.]*)\.(.*);perl -p -e '\''s/\\000//g'\'' \1\2.\3 | perl -p -e '\''s/$$/\\r/'\'' > src/-midas/\2.mid.\3;' | sh -x; done
ls src/-midas
mv src/-midas src/midas
clean::
$(RM) -r src/midas src/-midas
src/midas.tap: src/midas tools/back10/back10
(cd src/midas; ../../tools/back10/back10 -c -f ../midas.tap -i $(notdir $(wildcard src/midas/*.mid.*)))
clean::
$(RM) src/midas.tap
src/iddt.tap: $(wildcard src/iddt/*.mac) tools/back10/back10
(cd src/iddt; ../../tools/back10/back10 -c -f ../iddt.tap -i $(notdir $(wildcard src/iddt/*.mac)))
clean::
$(RM) src/iddt.tap
src/operator.tap: $(wildcard src/operator/*.cmd) tools/back10/back10
(cd src/operator; ../../tools/back10/back10 -c -f ../operator.tap -i $(notdir $(wildcard src/operator/*.cmd)))
clean::
$(RM) src/operator.tap
src/pcl.tap: $(wildcard src/pcl/*.cmd) tools/back10/back10
(cd src/pcl; ../../tools/back10/back10 -c -f ../pcl.tap -i $(notdir $(wildcard src/pcl/*.pcl)))
clean::
$(RM) src/pcl.tap
.PHONEY: dec-7.0-tapes clean clean-phase0 clean-phase1