1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-17 00:33:22 +00:00
PDP-10.its/Makefile
Adam Sampson a209c97ec1 Add reconstructed Muddle 54, for running old Muddle images.
This source was reconstructed to match MUDSAV; TS MUD54 from 1977-07-02,
using a combination of all the surviving Muddle source files. The memory
layout and pure code is the same.

No AGC MUD54 has survived, so the AGC code was adjusted to match the
TOPS-20 agc.mud104 from Chicago that Rich Alderson provided (the only
ITS conditional is the page size). There's a one-instruction difference
in the symbol positions, which I've converted into a patch at the end of
the code to maintain the original layout on ITS.

The INITM code, which doesn't appear in the final executable, is
a best guess but it's probably fairly close, since it generates objects
in the right order and locations, and the symbol locations match the
original.

The 1977 executable has a very large number of patches, which I've
replicated in MUD54 INIT. The code that the patches were replacing --
marked with "XXX patched" in the source -- is also a best guess.

I haven't checked that the TOPS-20 code is correct; it could be adjusted
to match mdl104.exe in the future. It would need STENEX, which could be
linked from MUDSYS;.
2020-09-14 11:28:51 +01:00

318 lines
9.3 KiB
Makefile

# Some important environment variables
EMULATOR ?= simh
# Sometimes you _really_ need to use a different `touch` or `rm`.
TOUCH ?= touch
MKDIR ?= mkdir -p
EXPECT ?= expect
CP ?= cp
RM ?= rm
LN ?= ln
SED ?= sed
TEST ?= test
GIT ?= git
CAT ?= cat
include conf/network
# The directores listed in SRC, DOC, and BIN are put on the sources tape.
SRC = syseng sysen1 sysen2 sysen3 sysnet kshack dragon channa \
_teco_ emacs emacs1 rms klh syshst sra mrc ksc eak gren \
bawden _mail_ l lisp libdoc comlap lspsrc nilcom rwk chprog rg \
inquir acount gz sys decsys ecc alan sail kcc kcc_sy c games archy dcp \
spcwar rwg libmax rat z emaxim rz maxtul aljabr cffk das ell ellen \
jim jm jpg macrak maxdoc maxsrc mrg munfas paulw reh rlb rlb% share \
tensor transl wgd zz graphs lmlib pratt quux scheme gsb ejs mudsys \
draw wl taa tj6 budd sharem ucode rvb kldcp math as imsrc gls demo \
macsym lmcons dmcg hibou agb gt40 rug maeda ms kle aap common \
fonts lcf 11logo kmp info aplogo bkph bbn pdp11 chsncp sca music1 \
moon teach ken lmio1 llogo a2deh chsgtv clib sys3 lmio turnip \
mits_s rab stan_k bs cstacy kp dcp2 -pics- victor imlac rjl mb bh \
lars drnil radia gjd maint bolio cent shrdlu vis cbf digest prs jsf \
decus bsg muds54
DOC = info _info_ sysdoc sysnet syshst kshack _teco_ emacs emacs1 c kcc \
chprog sail draw wl pc tj6 share _glpr_ _xgpr_ inquir mudman system \
xfont maxout ucode moon acount alan channa fonts games graphs humor \
kldcp libdoc lisp _mail_ midas quux scheme manual wp chess ms macdoc \
aplogo _temp_ pdp11 chsncp cbf rug bawden llogo eak clib teach pcnet \
combat pdl minits mits_s chaos hal -pics- imlac maint cent ksc klh \
digest prs decus bsg
BIN = sys sys1 sys2 emacs _teco_ lisp liblsp alan inquir sail comlap \
c decsys graphs draw datdrw fonts fonts1 fonts2 games macsym \
maint _www_ gt40 llogo bawden sysbin -pics- lmman r shrdlu imlac \
pdp10
MINSRC = midas system $(DDT) $(SALV) $(KSFEDR) $(DUMP)
# These are not included on the tape.
DOCIGNORE=-e '\.(jpeg|pdf|info|md)$$' -e '^(dcg|github)$$'
# These are on the minsys tape.
BINIGNORE=-e '^(ka10|kl10|ks10|minsys)$$'
# These are on the minsrc tape.
SRCIGNORE=-e '^(system|midas)$$'
SUBMODULES = dasm itstar klh10 mldev simh sims supdup tapeutils tv11 pdp6 vt05 tek4010
# These files are used to create bootable tape images.
RAM = bin/ks10/boot/ram.262
NSALV = bin/ks10/boot/salv.rp06
DSKDMP = bin/ks10/boot/dskdmp.rp06
KLH10=tools/klh10/tmp/bld-ks-its/kn10-ks-its
SIMH=tools/simh/BIN/pdp10
KA10=tools/sims/BIN/pdp10-ka
KL10=tools/sims/BIN/pdp10-kl
ITSTAR=tools/itstar/itstar
WRITETAPE=tools/tapeutils/tapewrite
MAGFRM=tools/dasm/magfrm
GT40=tools/simh/BIN/pdp11 $(OUT)/bootvt.img
TV11=tools/tv11/tv11
PDP6=tools/pdp6/emu/pdp6
KLFEDR=tools/dasm/klfedr
DATAPOINT=tools/vt05/dp3300
VT52=tools/vt05/vt52
TEK=tools/tek4010/tek4010
H3TEXT=$(shell cd build; ls h3text.*)
DDT=$(shell cd src; ls sysen1/ddt.* syseng/lsrtns.* syseng/msgs.* syseng/datime.* syseng/ntsddt.*)
SALV=$(shell cd src; ls kshack/nsalv.* syseng/format.* syseng/rfn.*)
KSFEDR=$(shell cd src; ls kshack/ksfedr.*)
DUMP=$(shell cd src; ls syseng/dump.* sysnet/netwrk.*)
SMF:=$(addprefix tools/,$(addsuffix /.gitignore,$(SUBMODULES)))
OUT=out/$(EMULATOR)
all: its $(OUT)/emulators tools/supdup/supdup
its: $(SMF) $(OUT)/stamp
check: all check-dirs
out/klh10/stamp: $(OUT)/rp0.dsk
$(TOUCH) $@
out/klh10/emulators:
$(TOUCH) $@
out/simh/stamp: $(OUT)/rp0.dsk
$(TOUCH) $@
out/simh/emulators: $(GT40) $(VT52)
$(TOUCH) $@
out/pdp10-ka/stamp: $(OUT)/rp03.2 $(OUT)/rp03.3
$(TOUCH) $@
out/pdp10-ka/emulators: $(GT40) $(TV11) $(PDP6) $(DATAPOINT) $(VT52) $(TEK)
$(TOUCH) $@
out/pdp10-kl/stamp: $(OUT)/rp04.1
$(TOUCH) $@
out/pdp10-kl/emulators: $(VT52) $(TEK)
$(TOUCH) $@
$(OUT)/rp0.dsk: build/simh/init $(OUT)/minsys.tape $(OUT)/minsrc.tape $(OUT)/salv.tape $(OUT)/dskdmp.tape build/build.tcl $(OUT)/sources.tape build/$(EMULATOR)/stamp
PATH="$(CURDIR)/tools/simh/BIN:$$PATH" expect -f build/$(EMULATOR)/build.tcl $(IP) $(GW)
$(OUT)/rp03.2 $(OUT)/rp03.3: $(OUT)/ka-minsys.tape $(OUT)/minsrc.tape $(OUT)/magdmp.tap $(OUT)/sources.tape
$(EXPECT) -f build/$(EMULATOR)/build.tcl $(IP) $(GW)
$(OUT)/rp04.1: $(OUT)/kl-minsys.tape $(OUT)/minsrc.tape $(OUT)/kl-magdmp.tap $(OUT)/sources.tape
$(EXPECT) -f build/$(EMULATOR)/build.tcl $(IP) $(GW)
$(OUT)/magdmp.tap: $(MAGFRM)
cd bin/ka10/boot; ../../../$(MAGFRM) magdmp.bin @.ddt @.salv > ../../../$@
$(OUT)/kl-magdmp.tap: $(MAGFRM)
cd bin/kl10/boot; ../../../$(MAGFRM) magdmp.bin @.ddt salv.bin > ../../../$@
$(OUT)/minsrc.tape: $(ITSTAR)
$(MKDIR) $(OUT)
$(ITSTAR) -cf $@ -C src $(MINSRC)
$(ITSTAR) -rf $@ -C $(OUT) system
$(OUT)/minsys.tape: $(ITSTAR) $(OUT)/system
$(MKDIR) $(OUT)
$(ITSTAR) -cf $@ -C bin/ks10 _ sys
$(ITSTAR) -rf $@ -C bin/minsys sys
$(OUT)/ka-minsys.tape: $(ITSTAR) $(OUT)/system
$(MKDIR) $(OUT)
$(ITSTAR) -cf $@ -C bin/ka10 _ sys
$(ITSTAR) -rf $@ -C bin/minsys sys
leftparen:=(
rightparen:=)
KLDCPDIR=$(OUT)/_klfe_/kldcp.$(leftparen)dir$(rightparen)
$(OUT)/kl-minsys.tape: $(ITSTAR) $(OUT)/system $(KLDCPDIR)
$(MKDIR) $(OUT)
$(ITSTAR) -cf $@ -C $(OUT) _klfe_
$(ITSTAR) -rf $@ -C bin/kl10 _ sys
$(ITSTAR) -rf $@ -C bin/minsys sys
$(KLDCPDIR): $(KLFEDR)
$(MKDIR) $(OUT)/_klfe_
$(KLFEDR) > "$(OUT)/_klfe_/kldcp.$(leftparen)dir$(rightparen)"
$(OUT)/sources.tape: $(ITSTAR) build/$(EMULATOR)/stamp $(OUT)/syshst/$(H3TEXT)
$(MKDIR) $(OUT)
$(RM) -f src/*/*~
$(TOUCH) -t 198110061903.37 'bin/emacs/einit.:ej'
$(TOUCH) -t 198109192142.56 'bin/emacs/[pure].162'
$(TOUCH) -t 198103312041.45 'bin/emacs/[prfy].173'
$(ITSTAR) -cf $@ -C src $(SRC)
$(ITSTAR) -rf $@ -C doc $(DOC)
$(ITSTAR) -rf $@ -C bin $(BIN)
$(ITSTAR) -rf $@ -C $(OUT) syshst
-cd user; ../$(ITSTAR) -rf ../$@ *
$(OUT)/salv.tape: $(WRITETAPE) $(RAM) $(NSALV)
$(MKDIR) $(OUT)
$(WRITETAPE) -n 2560 $@ $(RAM) $(NSALV)
$(OUT)/dskdmp.tape: $(WRITETAPE) $(RAM) $(DSKDMP)
$(MKDIR) $(OUT)
$(WRITETAPE) -n 2560 $@ $(RAM) $(DSKDMP)
$(OUT)/bootvt.bin $(OUT)/aplogo.ptp: $(OUT)/output.tape
$(RM) -rf $(OUT)/tmp
$(MKDIR) -p $(OUT)/tmp
$(ITSTAR) -xf $< -C $(OUT)/tmp
$(CP) $(OUT)/tmp/gt40/bootvt.bin $(OUT)/bootvt.bin
-$(CP) $(OUT)/tmp/aplogo/logo.ptp $(OUT)/aplogo.ptp
$(RM) -rf $(OUT)/tmp
tools/dasm/palx: tools/dasm/palx.c
$(MAKE) -C tools/dasm palx
$(OUT)/bootvt.img: $(OUT)/bootvt.bin tools/dasm/palx
$(MKDIR) out/gt40
tools/dasm/palx -I < $< > $@
start: build/$(EMULATOR)/start
$(LN) -s $< $*
build/klh10/stamp: $(KLH10) start build/klh10/dskdmp.ini
$(TOUCH) $@
build/simh/stamp: $(SIMH) start
$(TOUCH) $@
build/pdp10-ka/stamp: $(KA10) start
$(TOUCH) $@
build/pdp10-kl/stamp: $(KL10) start
$(TOUCH) $@
out/klh10/system:
$(MKDIR) $(OUT)/system
cp=0; ca=0; \
$(TEST) $(CHAOS) != no && cp=1 && ca=$(CHAOS); \
x=`echo $(IP) | tr . ,`; \
$(SED) -e "s/%IP%/$$x/" \
-e 's/%NETMASK%/$(NETMASK)/' \
-e "s/%CHAOSP%/$$cp/" \
-e "s/%CHAOSA%/$$ca/" < build/klh10/config.203 > $(OUT)/system/config.203
out/simh/system:
$(MKDIR) $(OUT)/system
cp build/simh/config.* $(OUT)/system
out/pdp10-ka/system:
$(MKDIR) $(OUT)/system
cp build/pdp10-ka/config.* $(OUT)/system
out/pdp10-kl/system:
$(MKDIR) $(OUT)/system
cp build/pdp10-kl/config.* $(OUT)/system
build/klh10/dskdmp.ini: build/klh10/dskdmp.txt Makefile
cp=';'; ca=''; \
$(TEST) $(CHAOS) != no && cp='' && ca='myaddr=$(CHAOS) $(CHAFRIENDS)'; \
$(SED) -e 's/%IP%/$(IP)/' \
-e 's/%GW%/$(GW)/' \
-e "s/%CHAOSP%/$$cp/" \
-e "s|%CHAOSA%|$$ca|" < $< > $@
$(OUT)/syshst/$(H3TEXT): build/$(H3TEXT)
$(MKDIR) $(OUT)/syshst
$(TEST) $(CHAOS) != no && c="CHAOS $(CHAOS), "; \
$(SED) -e 's/%IP%/$(IP)/' \
-e 's/%HOSTNAME%/$(HOSTNAME)/' \
-e "s/%CHAOS%/$$c/" < $< > $@
$(CAT) conf/hosts >> $@
$(KLH10):
cd tools/klh10; \
$(RM) -rf tmp; \
./autogen.sh; \
$(MKDIR) tmp; \
cd tmp; \
export CONFFLAGS_USR="-DKLH10_DEV_DPTM03=0 $$CONFFLAGS_USR"; \
../configure --enable-lights --bindir="$(CURDIR)/build/klh10"; \
$(MAKE) -C bld-ks-its; \
$(MAKE) -C bld-ks-its install
$(SIMH):
$(MAKE) -C tools/simh pdp10
$(KA10):
$(MAKE) -C tools/sims pdp10-ka
$(KL10):
$(MAKE) -C tools/sims pdp10-kl
$(ITSTAR):
$(MAKE) -C tools/itstar
$(WRITETAPE):
$(MAKE) -C tools/tapeutils
$(MAGFRM) $(KLFEDR):
$(MAKE) -C tools/dasm
$(TV11):
$(MAKE) -C tools/tv11 tv11 CFLAGS=-O3
$(MAKE) -C tools/tv11/tvcon
$(PDP6):
$(MAKE) -C tools/pdp6/emu
$(DATAPOINT):
$(MAKE) -C tools/vt05 dp3300
$(VT52):
$(MAKE) -C tools/vt05 vt52
tek-hack:
rm $(TEK)
$(TEK): tek-hack
$(MAKE) -C tools/tek4010 tek4010
tools/supdup/supdup:
$(MAKE) -C tools/supdup
$(SMF):
$(GIT) submodule sync `dirname $@`
$(GIT) submodule update --init `dirname $@`
tools/simh/BIN/pdp11:
$(MAKE) -C tools/simh pdp11
check-dirs: Makefile
mkdir -p $(OUT)/check
echo $(SRC) | tr ' ' '\n' | sort > $(OUT)/check/src1
cd src; ls -1 | egrep -v $(SRCIGNORE) > ../$(OUT)/check/src2
diff -u $(OUT)/check/src1 $(OUT)/check/src2 > $(OUT)/check/src.diff
echo $(DOC) | tr ' ' '\n' | sort > $(OUT)/check/doc1
cd doc; ls -1d -- */ | tr -d / | sort | \
egrep -v $(DOCIGNORE) > ../$(OUT)/check/doc2
diff -u $(OUT)/check/doc1 $(OUT)/check/doc2 > $(OUT)/check/doc.diff
echo $(BIN) | tr ' ' '\n' | sort > $(OUT)/check/bin1
cd bin; ls -1 | egrep -v $(BINIGNORE) > ../$(OUT)/check/bin2
diff -u $(OUT)/check/bin1 $(OUT)/check/bin2 > $(OUT)/check/bin.diff
clean:
$(RM) -rf out start build/*/stamp