From 97cc42cb894a0975f94725faef1638594b6b0400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 18 Dec 2022 18:08:11 +0100 Subject: [PATCH] waforthc,standalone: Add sieve example --- src/standalone/.gitignore | 1 + src/standalone/Makefile | 8 +++++++- src/waforthc/.gitignore | 1 + src/waforthc/Makefile | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/standalone/.gitignore b/src/standalone/.gitignore index 290c0e5..dfdcf12 100644 --- a/src/standalone/.gitignore +++ b/src/standalone/.gitignore @@ -3,3 +3,4 @@ /wasm-micro-runtime /wasmtime-* /*.tgz +/run_sieve.f diff --git a/src/standalone/Makefile b/src/standalone/Makefile index e5ec8aa..43a7710 100644 --- a/src/standalone/Makefile +++ b/src/standalone/Makefile @@ -120,7 +120,13 @@ check: grep "Hello, Forth" test.out rm test.out - +run_sieve.f: ../examples/sieve.f + (cat $< && echo "90000000 sieve") > $@ + +.PHONY: run-sieve +run-sieve: run_sieve.f + ./waforth $< + .PHONY: clean clean: -rm -f waforth_core.wasm waforth_core.h $(OBJECTS) waforth *.exe *.tgz *.zip test.out diff --git a/src/waforthc/.gitignore b/src/waforthc/.gitignore index 740efa2..c480ca0 100644 --- a/src/waforthc/.gitignore +++ b/src/waforthc/.gitignore @@ -3,3 +3,4 @@ /_waforth* /hello /waforth*.tgz +/sieve diff --git a/src/waforthc/Makefile b/src/waforthc/Makefile index 640449a..a652344 100644 --- a/src/waforthc/Makefile +++ b/src/waforthc/Makefile @@ -94,6 +94,9 @@ waforth_core.wasm: ../waforth.wat .PHONY: package +sieve: + ./waforthc --ccflag=-O2 --output=sieve --init="90000000 sieve" ../examples/sieve.f + .PHONY: check check: -rm -f test test.out