From ba571949b1cfbc4401cf9157e76d717648a0edc0 Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 18 Nov 2022 00:25:54 +0200 Subject: [PATCH] move build utils to within build/ --- README.md | 6 +++--- cc.bqn => build/cc.bqn | 0 genRuntime => build/genRuntime | 2 +- genRuntimeSrc => build/genRuntimeSrc | 0 SingeliMake.bqn => build/singeliMake.bqn | 11 ++++++----- makefile | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) rename cc.bqn => build/cc.bqn (100%) rename genRuntime => build/genRuntime (90%) rename genRuntimeSrc => build/genRuntimeSrc (100%) rename SingeliMake.bqn => build/singeliMake.bqn (73%) diff --git a/README.md b/README.md index e812abea..24a85b15 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ By default, the CBQN will use [precompiled bytecode](https://github.com/dzaima/c 1. get another BQN implementation; [dzaima/BQN](https://github.com/dzaima/BQN) is one that is completely implemented in Java (clone it & run `./build`). 2. clone [mlochbaum/BQN](https://github.com/mlochbaum/BQN). -2. From within CBQNs directory, run `mkdir -p build/bytecodeLocal/gen` -3. Run `said-other-bqn-impl ./genRuntime path/to/mlochbaum/BQN build/bytecodeLocal` - In the case of the Java impl, `java -jar path/to/dzaima/BQN/BQN.jar ./genRuntime ~/git/BQN build/bytecodeLocal` +3. From within CBQNs directory, run `mkdir -p build/bytecodeLocal/gen` +4. Run `said-other-bqn-impl ./build/genRuntime path/to/mlochbaum/BQN build/bytecodeLocal` + In the case of the Java impl, `java -jar path/to/dzaima/BQN/BQN.jar ./build/genRuntime ~/git/BQN build/bytecodeLocal` ## macOS diff --git a/cc.bqn b/build/cc.bqn similarity index 100% rename from cc.bqn rename to build/cc.bqn diff --git a/genRuntime b/build/genRuntime similarity index 90% rename from genRuntime rename to build/genRuntime index a75972fb..e0774858 100755 --- a/genRuntime +++ b/build/genRuntime @@ -1,7 +1,7 @@ #!/usr/bin/env bqn args←•args "Usage: ./getRuntime.bqn path/to/mlochbaum/BQN output/path"!2≤≠args -bqnSrc‿outputPath←2↑•args +bqnSrc‿outputPath ← •wdpath⊸•file.At¨ 2↑•args rtSrc ← ⊑(<"src")∊2↓•args diff --git a/genRuntimeSrc b/build/genRuntimeSrc similarity index 100% rename from genRuntimeSrc rename to build/genRuntimeSrc diff --git a/SingeliMake.bqn b/build/singeliMake.bqn similarity index 73% rename from SingeliMake.bqn rename to build/singeliMake.bqn index 48407e30..4245589d 100755 --- a/SingeliMake.bqn +++ b/build/singeliMake.bqn @@ -3,12 +3,13 @@ # resolve arguments & files siDirR‿srcfileR‿resfileR‿buildDir ← •args filename ← (⊐⟜'/'↑⊢)⌾⌽ srcfileR -siDir ← •file.At siDirR +At ← •wdpath⊸•file.At +siDir ← At siDirR -srcfile ← •file.At srcfileR -resfile ← •file.At resfileR -tmpfile ← (•file.At buildDir) •file.At filename∾".d.orig" -depfile ← (•file.At buildDir) •file.At filename∾".d" +srcfile ← At srcfileR +resfile ← At resfileR +tmpfile ← (At buildDir) •file.At filename∾".d.orig" +depfile ← (At buildDir) •file.At filename∾".d" prefix ← "si_"∾ (∧`'.'⊸≠)⊸/ •file.Name srcfile # invoke singeli, which creates the result file diff --git a/makefile b/makefile index 504bfd68..280d44a3 100644 --- a/makefile +++ b/makefile @@ -257,7 +257,7 @@ build_singeli: ${addprefix src/singeli/gen/, cmp.c dyarith.c copy.c equal.c sque @echo $(postmsg) src/singeli/gen/%.c: src/singeli/src/%.singeli preSingeliBin @echo $< | cut -c 17- | sed 's/^/ /' - @build/obj/presingeli/BQN SingeliMake.bqn "$(SINGELI_DIR)" $< $@ "build/obj/singeli/" + @build/obj/presingeli/BQN build/singeliMake.bqn "$(SINGELI_DIR)" $< $@ "build/obj/singeli/" ifeq (${i_singeli}, 1) # arithmetic table generator