uCBQN/genRuntime
2022-11-17 23:20:07 +02:00

15 lines
583 B
Plaintext
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bqn
args←•args
"Usage: ./getRuntime.bqn path/to/mlochbaum/BQN output/path"!2≤≠args
bqnSrc‿outputPath←2↑•args
rtSrc ← ⊑(<"src")∊2↓•args
CC ← {𝕨 •FChars (⟨1,bqnSrc⟩∾(rtSrc/⟨"-i"⟩)∾⟨𝕩⟩) •Import "cc.bqn"}
(outputPath•file.At "gen/src" )•FChars "#define RT_SRC "∾('0'+rtSrc)∾@+10
(outputPath•file.At "gen/compiles" )CC"cc"
(outputPath•file.At "gen/runtime0" )CC"r0"
(outputPath•file.At "gen/runtime1" )CC"r1"
(outputPath•file.At "gen/formatter")CC"f"
(outputPath•file.At "gen/explain" )CC"eu"