PDP-10 / its

Incompatible Timesharing System
Other
868 stars 84 forks source link

gmake EMULATOR=klh10 fails if out/klh10/ndskdmp.tape already exists #2055

Open Rhialto opened 3 years ago

Rhialto commented 3 years ago

I had some old tree from a couple of years ago that I just updated, and I tried gmake EMULATOR=klh10. It ended like this:

 6.  "Hardware Programming Documentation"
(Heading "Hardware Programming Documentation"
  truncated to "Hardware Programming...")
 7.  "Using Chaosnet in ITS"
 8.  "Using Chaosnet in TOPS-20"
 9.  "Using Chaosnet in Lisp Machine"
 10.  "Design Issues"
 11.  "Writing an NCP"
Table of Contents
; Runtime = 0.171 seconds (plus 0.006 gctime)
; 27 swap-in requests; thrash coefficient = 152.470
; No errors, LOG file deleted.

NIL

:KILL
*:otj6

TJ6.120
_hur;ddtmem

_
241)   .IOT 1,1   :kill
*:tj6
TJ6 30
_lmdoc;paper_lmdoc;paper
29 pages
:KILL
*:link kshack;good ram,.;ram ram
*:link kshack;ddt bin,.;@ ddt
*[HALTED: FE interrupt]
KLH10> devmo mta0 /mnt/vol1/rhialto/cvs/other/its/out/klh10/ndskdmp.tape create
[TM03: Tape data file "/mnt/vol1/rhialto/cvs/other/its/out/klh10/ndskdmp.tape" already exists]
No tape mounted.
KLH10> c
Continuing KN10 at loc 05600...
:kshack;mtboot
KS10 ITS Bootload Generator.
Write a tape?  (Y or N) y
Rewind tape first?  (Y or N) y
ERROR: OPEN:  MT0: WL; @ @ - DEVICE NOT READY
142>>.CALL 2217 (OPEN)
The last command timed out.
gmake: *** [Makefile:140: out/klh10/rp0.dsk] Error 1
murthe.7:.../cvs/other/its$

Also I noticed that the programs in build/klh10 were not updated, even though they were quite old Oct 22 2017 kn10-ks-its and the latest commit in tools/klh10 was from Sat Sep 15 21:18:04 2018 +0200 and the latest source file in its/tools/klh10/src was from Aug 8 2019 klh10.c.

larsbrinkhoff commented 3 years ago

The Makefile doesn't update submodules or check dependencies there, so the emulator will not be rebuilt automatically.

As for ndskdmp.tape. I don't think KLH10 has a way to mount a tape in a mode where it will use an existing file or else create one. Hmm, I suppose this could be worked around by having the expect script check the file leave off create if necessary.

larsbrinkhoff commented 3 years ago

In general, the build system doesn't really support incremental builds. This could be improved somewhat, but for now the preferred way to rebuild is "make clean all ...".

Rhialto commented 3 years ago

Yes I forced some rebuilds myself, and started clean, and that worked at least. Stuff mostly works on NetBSD :) Although in tools/tapeutils I had to add a bit:

+ifeq ($(UNAME),NetBSD)
+       LIBS=-lcompat
+endif
Rhialto commented 3 years ago

After forcibly updating submodules (the text from make normally suggests that that is done, but apparently it indeed isn't), I'm trying my way through removing all of the tools and re-building them. Some of the ones using SDL don't find their headers (those that aren't simh in some form), and for tools/dasm/klfedr and other tools in that directory I get

gmake[1]: *** No rule to make target 'lodepng/lodepng.h', needed by 'lodepng.h'.  Stop.

I guess it would be convenient to have a make target to remove and to rebuild KLH10 SIMH KA10 KL10 etc.

I also got surprised by this in the Makefile:

EMULATOR ?= pdp10-ka

which somehow doesn't mean you can just do gmake rather than gmake EMULATOR=pdp10-ka.

oh well, enough rambling for today :)

larsbrinkhoff commented 3 years ago

As you have seen, the Makefile is indeed messy and has some flaws. It only works reliably for a fresh clone. Any submodule updates has to be done manually. Really, using make here doesn't have many upsides. It could just as well be a script. But now we have it, and I'm not sure it's worth the effort to change. If you want to build ITS, it's assumed you can either

  1. debug problems and fix them, or
  2. just make a fresh clone and rebuild from scratch.
larsbrinkhoff commented 3 years ago

Lodepng is brought in when building a fresh clone. If that's not the case, use git submodule update --init --recursive. The recursive part handles submodules of submodules.

larsbrinkhoff commented 3 years ago

It was my intent that EMULATOR ?= pdp10-ka would make this the default emulator for a plain make. But somehow it doesn't work fully. Maybe because EMULATOR needs to be set in the environment as well as a make variable?