diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-04-10 22:23:08 +0300 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-04-10 22:23:08 +0300 |
commit | 7628ce2432108ae6306457f242e7cc3ac75b9ac0 (patch) | |
tree | 32a7b59f0e91b4c82bdeb4de3f75c1a04cc247da /scripts | |
parent | 0ba52d9043985baff61d4fae225420274d9ad9ab (diff) | |
parent | 531d307d310881e69efc8ae8c8119f5f5799e0f9 (diff) | |
download | ejit-7628ce2432108ae6306457f242e7cc3ac75b9ac0.tar.gz ejit-7628ce2432108ae6306457f242e7cc3ac75b9ac0.zip |
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gen-tests | 4 | ||||
-rw-r--r-- | scripts/makefile | 24 | ||||
-rwxr-xr-x | scripts/select-compile | 5 |
3 files changed, 24 insertions, 9 deletions
diff --git a/scripts/gen-tests b/scripts/gen-tests index 5521006..47ff9c9 100755 --- a/scripts/gen-tests +++ b/scripts/gen-tests @@ -11,5 +11,7 @@ do echo "${dep}:" >> tests.mk echo "-include ${dep}" >> tests.mk echo "${exe}: ${s} libejit.a" >> tests.mk - echo " \$(COMPILE_TEST) ${s} libejit.a -o ${exe}" >> tests.mk + echo " \$(COMPILE_TEST) ${s} libejit.a -o ${exe} -lm" >> tests.mk + echo " ./${exe} \t# bytecode" >> tests.mk + echo " ./${exe} 1\t# jit" >> tests.mk done diff --git a/scripts/makefile b/scripts/makefile index 3a4f200..dbb7a1c 100644 --- a/scripts/makefile +++ b/scripts/makefile @@ -29,16 +29,21 @@ OBJCOPY != [ "$(LLVM)" != "0" ] \ && echo llvm-objcopy \ || echo $(CROSS_COMPILE)objcopy -COMPILER != [ "$(LLVM)" != "0" ] \ - && echo clang --target="$(CROSS_COMPILE)" \ - || echo $(CROSS_COMPILE)gcc +COMPILER != [ -n "$(CROSS_COMPILE)" ] \ + && { \ + [ "$(LLVM)" != "0" ] \ + && echo clang --target="$(CROSS_COMPILE)" \ + || echo $(CROSS_COMPILE)gcc \ + ; \ + } \ + || echo $(CC) OBFLAGS := -g WARNFLAGS := -Wall -Wextra COMPILE_FLAGS := $(CFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(LTOFLAGS) \ - $(OBFLAGS) $(ASSERTFLAGS) $(DEBUGFLAGS) + $(OBFLAGS) $(DEBUGFLAGS) INCLUDE_FLAGS := -I include @@ -60,16 +65,19 @@ COMPILE_EJIT = $(COMPILE) $(EJIT_FLAGS) libejit.a: $(EJIT_OBJS) $(CROSS_COMPILE)ar rcs libejit.a $(EJIT_OBJS) -examples: examples/loop examples/fib examples/matrix_mult +examples: examples/loop examples/fib examples/sum examples/matrix_mult examples/matrix_mult: examples/matrix_mult.c libejit.a - $(COMPILE_EJIT) examples/matrix_mult.c libejit.a -o $@ + $(COMPILE_EJIT) examples/matrix_mult.c libejit.a -o $@ -lm examples/loop: examples/loop.c libejit.a - $(COMPILE_EJIT) examples/loop.c libejit.a -o $@ + $(COMPILE_EJIT) examples/loop.c libejit.a -o $@ -lm examples/fib: examples/fib.c libejit.a - $(COMPILE_EJIT) examples/fib.c libejit.a -o $@ + $(COMPILE_EJIT) examples/fib.c libejit.a -o $@ -lm + +examples/sum: examples/sum.c libejit.a + $(COMPILE_EJIT) examples/sum.c libejit.a -o $@ -lm # might lint some common things twice .PHONY: diff --git a/scripts/select-compile b/scripts/select-compile index fca7350..37c67a1 100755 --- a/scripts/select-compile +++ b/scripts/select-compile @@ -9,6 +9,11 @@ JIT="src/compile/compile.c" NOJIT="src/compile/nocompile.c" case "$ARCH" in + powerpc64le) echo "$JIT" ;; + mips64el) echo "$JIT" ;; + aarch64) echo "$JIT" ;; + mipsel) echo "$JIT" ;; + armhf) echo "$JIT" ;; amd64) echo "$JIT" ;; x86*) echo "$JIT" ;; *) echo "$NOJIT" ;; |