PiDP-8/I Software

View Ticket
Log In
Ticket Hash: e1f6a5e4fee74b237721551d6c9ee64575e56194
Title: Add cross-compile mode to bin/cc8-to-os8
Status: Verified Type: Feature Request
Severity: Minor Priority: Medium
Subsystem: CC8 Resolution: Open
Last Modified: 2019-02-20 02:44:31
Version Found In:
User Comments:
tangent added on 2019-02-19 19:27:44: (text/x-fossil-plain)
This script is currently just a format converter for using the native CC8 compiler on a C file kept on the host, but it could also automate the process of cross-compiling that same C file, copying the resulting SABR file, not the host-side C file. Call this the -c option, for the sake of discussion, at least.

The disk pack it uses should depend on how you call it. If it sees that it's been called from the PiDP-8/I source tree, it should modify bin/v3d.rk05. Otherwise, it should have the $os8mo variable subbed in from auto.def, so it can check that directory to see that there's a disk pack there, and if so, use that instead.

It should also choose whether to call bin/cc8 via the PATH or via an explicit path using the same logic: if we're working in the PiDP-8/I source tree, we most likely either require it to use the in-tree bin/cc8 in preference to the one in the PATH, or we don't care.

Then depending on which disk pack it modified, when run in -c mode, it should either exec "make run" or "pidp8i start" as its last step.

--------

Niggly details:

1. Don't get fooled by the --prefix=inst case: the script can't just check whether it was called as "bin/pidp8i" to determine whether it's called from within the source tree, because it might just not be in the shell's PATH. It should still use the installed disk image, not go looking for one alongside it in bin/.

2. Some OSes (FreeBSD?) pass only the basename in argv[0], regardless of whether the program was found via the PATH or via an explicit path, so inferring the mode on that won't be portable anyway.

poetnerd added on 2019-02-20 02:44:31: (text/x-fossil-plain)
Point of information:

After I un-broke the script, I quit using it.  Makefile uses sed to strip out #include instead
of calling the script.