Skip to content

Commit 3a42911

Browse files
committed
Update ab.
1 parent 8e5d52f commit 3a42911

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

build/ab.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,17 @@ def emit_rule(self, ins, outs, cmds=[], label=None):
501501

502502
emit(f"OUTS_{outsn}", "=", *fouts, into=lines)
503503
emit(f"INS_{insn}", "=", *fins, into=lines)
504-
emit(name, ":", f"$(OUTS_{outsn})")
505-
emit(hashfile, ":")
506-
emit(f"\t@mkdir -p {self.dir}")
507-
emit(f"\t@touch {hashfile}")
508-
emit(f"$(OUTS_{outsn})", "&:",f"$(INS_{insn})", hashfile, into=lines)
504+
emit(name, ":", f"$(OUTS_{outsn})", into=lines)
505+
emit(hashfile, ":", into=lines)
506+
emit(f"\t@mkdir -p {self.dir}", into=lines)
507+
emit(f"\t@touch {hashfile}", into=lines)
508+
emit(
509+
f"$(OUTS_{outsn})",
510+
"&:" if len(fouts) > 1 else ":",
511+
f"$(INS_{insn})",
512+
hashfile,
513+
into=lines,
514+
)
509515

510516
if label:
511517
emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO)" + label, into=lines)

build/c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def programimpl(
444444
simplerule(
445445
replaces=self,
446446
ins=cfiles + libs,
447-
outs=[f"={self.localname}$(EXT)"],
447+
outs=[f"={self.localname}{toolchain.EXE}"],
448448
deps=deps,
449449
label=label,
450450
commands=commands,

build/toolchain.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import platform
2+
3+
_is_windows = (platform.system() == "Windows")
4+
15
class Toolchain:
26
PREFIX = ""
7+
EXE = ".exe" if _is_windows else ""
38

49

510
class HostToolchain(Toolchain):

0 commit comments

Comments
 (0)