diff --git a/Makefile b/Makefile index fc436956..7f37aed9 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,6 @@ else else LDFLAGS += -pthread -Wl,--no-as-needed endif - endif HOSTCC = gcc @@ -85,7 +84,7 @@ binaries: all tests: all README.md: $(OBJ)/scripts/+mkdocindex/mkdocindex$(EXT) - @echo $(PROGRESSINFO) MKDOC $@ + @echo $(PROGRESSINFO)MKDOC $@ @csplit -s -f$(OBJ)/README. README.md '//' '%%' @(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md diff --git a/README.md b/README.md index 73665387..9798c8e7 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ choices because they can store multiple types of file system. | [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | | [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | | [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | +| [`juku`](doc/disk-juku.md) | Juku E5104: CP/M | | | CPMFS | | [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | | [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | | [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | diff --git a/build.py b/build.py index 3b543cfe..de13a623 100644 --- a/build.py +++ b/build.py @@ -7,6 +7,11 @@ import config import re +# Hack for building on Fedora/WSL; executables get the .exe extension, +# build the build system detects it as Linux. +import build.toolchain +toolchain.Toolchain.EXE = "$(EXT)" + package(name="protobuf_lib", package="protobuf") package(name="z_lib", package="zlib") package(name="fmt_lib", package="fmt", fallback="dep/fmt") diff --git a/build/_sandbox.py b/build/_sandbox.py index 2450c537..f7667a68 100644 --- a/build/_sandbox.py +++ b/build/_sandbox.py @@ -26,7 +26,7 @@ def main(): print("link", sf) os.makedirs(dirname(sf), exist_ok=True) try: - os.link(abspath(f), sf) + os.symlink(abspath(f), sf) except PermissionError: shutil.copy(f, sf) @@ -38,6 +38,11 @@ def main(): df = dirname(f) if df: os.makedirs(df, exist_ok=True) + + try: + os.remove(f) + except FileNotFoundError: + pass os.rename(sf, f) diff --git a/build/ab.py b/build/ab.py index bbf947a6..f4e424d6 100644 --- a/build/ab.py +++ b/build/ab.py @@ -501,15 +501,17 @@ def emit_rule(self, ins, outs, cmds=[], label=None): emit(f"OUTS_{outsn}", "=", *fouts, into=lines) emit(f"INS_{insn}", "=", *fins, into=lines) + emit(name, ":", f"$(OUTS_{outsn})", into=lines) + emit(hashfile, ":", into=lines) + emit(f"\t@mkdir -p {self.dir}", into=lines) + emit(f"\t@touch {hashfile}", into=lines) emit( - name, - ":", - hashfile, f"$(OUTS_{outsn})", + "&:" if len(fouts) > 1 else ":", + f"$(INS_{insn})", + hashfile, into=lines, ) - emit(f"$(OUTS_{outsn})", ":", hashfile, into=lines) - emit(hashfile, ":", f"$(INS_{insn})", into=lines) if label: emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO)" + label, into=lines) @@ -537,9 +539,6 @@ def emit_rule(self, ins, outs, cmds=[], label=None): emit(name, ":", *fins, into=lines) outputFp.write("".join(lines)) - - if outs: - emit(f"\t$(hide) touch {hashfile}") emit("") diff --git a/build/c.py b/build/c.py index 21050393..1a07a3e8 100644 --- a/build/c.py +++ b/build/c.py @@ -444,7 +444,7 @@ def programimpl( simplerule( replaces=self, ins=cfiles + libs, - outs=[f"={self.localname}$(EXT)"], + outs=[f"={self.localname}{toolchain.EXE}"], deps=deps, label=label, commands=commands, diff --git a/build/toolchain.py b/build/toolchain.py index b47d3e8a..021ad76d 100644 --- a/build/toolchain.py +++ b/build/toolchain.py @@ -1,5 +1,10 @@ +import platform + +_is_windows = (platform.system() == "Windows") + class Toolchain: PREFIX = "" + EXE = ".exe" if _is_windows else "" class HostToolchain(Toolchain): diff --git a/scripts/build.py b/scripts/build.py index f9a664cc..aee9e639 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -30,7 +30,12 @@ def protoencode_single(self, name, srcs: Targets, proto, symbol): ins=srcs, outs=[f"={name}.cc"], deps=[r], - commands=["$[deps[0]] $[ins] $[outs] " + symbol], + commands=[ + # Materialise symbolic links (for Windows). + "cp -L $[ins[0]] $[ins[0]].real", + "mv $[ins[0]].real $[ins[0]]", + "$[deps[0]] $[ins] $[outs] " + symbol + ], label="PROTOENCODE", )