diff options
| -rw-r--r-- | Makefile | 22 | ||||
| -rw-r--r-- | Readme.md | 7 |
2 files changed, 4 insertions, 25 deletions
@@ -1,10 +1,9 @@ mode ?= debug cc = gcc -includes = -DWITHREADLINE -Ilibs/ +includes = -DWITHREADLINE -libs = libs/algds/libalgds.a -ldflags = -lm -lreadline +ldflags = -lm -lreadline -lalgds ifeq ($(mode), debug) cflags = $(includes) \ -g \ @@ -21,31 +20,18 @@ tests_bin=$(tests:.c=.bin) all: bamboo-lisp -staticlib: libbamboo-lisp.a - -web: web-bamboo-lisp.js - -web-bamboo-lisp.js: $(src) - -rm web-* - emcc -Ilibs/ $(src) libs/algds/*.c -o web-bamboo-lisp.js \ - -s EXPORTED_FUNCTIONS="['_print_lisp_error', '_malloc', '_free', '_new_interp', '_lisp_to_string', _Interp_eval_string]" -s WASM=1 -s EXPORTED_RUNTIME_METHODS="['stringToUTF8', 'UTF8ToString']" - install: bamboo-lisp sudo cp bamboo-lisp /usr/local/bin/bamboo prelude.c: prelude.lisp cat prelude.lisp | python scripts/genprelude.py > prelude.c -bamboo-lisp: $(obj) main.o libs/algds/libalgds.a +bamboo-lisp: $(obj) main.o gcc $(cflags) -o $@ $^ $(ldflags) libbamboo-lisp.a: $(obj) ar cr $@ $^ -libs/algds/libalgds.a: - cd libs/algds && \ - make profile=$(mode) - test: bamboo-lisp $(tests_bin) @echo @echo "Run tests:" @@ -67,9 +53,7 @@ $(tests_bin):%.bin:%.c $(obj) $(libs) clean: -rm $(shell find tests/ -name '*.bin') -rm $(shell find . -name '*.o' -or -name '*.a' -or -name '*.d') - -rm web-bamboo-lisp* -rm bamboo-lisp - -cd libs/algds && make clean DEPS := $(shell find . -name '*.d') ifneq ($(DEPS),) @@ -11,7 +11,6 @@ There is a WebAssembly build, you can [try it online](https://mistivia.github.io - The interpreter part is ~2500 LOC (excluding built-in functions) - Tail call optimization - Any C99 compiler should work -- Depends only on C standard library - A simple mark-sweep GC - Writing macro is easy with quasiquote, unquote, and slicing-unquote - No global state, you can run multiple interpreters in multiple threads @@ -28,11 +27,7 @@ To keep simplicity, Bamboo Lisp is a VERY SLOW tree-walking interpreter. The per ## Build -Init submodule: - -```bash -git submodule update --init --recursive -``` +Install dependency first, see [algds](https://github.com/mistivia/algds) for details. Debug: |
