|Add cross-compile mode to bin/cc8-to-os8
|Version Found In:
tangent added on 2019-02-19 19:27:44:
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, 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:
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.