diff options
author | dan <[email protected]> | 2023-05-31 22:27:40 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-05-31 22:27:40 -0400 |
commit | 558b0646c5580454dd35a6bdee07bcc711db134e (patch) | |
tree | 03261d9d270c946feb68e046dd3cd2b8ab98b8fe | |
parent | c737bfb388a0bc591e6f677b714e28ab7f3799d8 (diff) | |
download | forth-558b0646c5580454dd35a6bdee07bcc711db134e.tar.gz forth-558b0646c5580454dd35a6bdee07bcc711db134e.tar.bz2 forth-558b0646c5580454dd35a6bdee07bcc711db134e.zip |
refactor: neaten makefile
-rw-r--r-- | makefile | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -1,8 +1,16 @@ +srcfiles := forth.c optable.c stack.c + +nativeexe := ./forth + +ifneq (, $(shell which clang)) + CC := clang +endif + build: - clang forth.c optable.c stack.c -o ./forth -Wall + ${CC} ${srcfiles} -o ${nativeexe} -Wall run: - ./forth + ${nativeexe} run-rlwrap: - rlwrap -r -f rlwrapcompletions.forth ./forth + rlwrap -r -f rlwrapcompletions.forth ${nativeexe} build-wasm: - emcc forth.c optable.c stack.c -Wall -o forthlib.js -s NO_EXIT_RUNTIME=1 -s "EXPORTED_RUNTIME_METHODS=['ccall']" + emcc ${srcfiles} -Wall -o forthlib.js -s NO_EXIT_RUNTIME=1 -s "EXPORTED_RUNTIME_METHODS=['ccall']" |