Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ else
else
LDFLAGS += -pthread -Wl,--no-as-needed
endif

endif

HOSTCC = gcc
Expand Down Expand Up @@ -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 '/<!-- FORMATSSTART -->/' '%<!-- FORMATSEND -->%'
@(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
5 changes: 5 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 6 additions & 1 deletion build/_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)


Expand Down
15 changes: 7 additions & 8 deletions build/ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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("")


Expand Down
2 changes: 1 addition & 1 deletion build/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions build/toolchain.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import platform

_is_windows = (platform.system() == "Windows")

class Toolchain:
PREFIX = ""
EXE = ".exe" if _is_windows else ""


class HostToolchain(Toolchain):
Expand Down
7 changes: 6 additions & 1 deletion scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
Loading