about summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0b8e141 --- /dev/null +++ b/Makefile
@@ -0,0 +1,40 @@
1NAME = jimmy
2
3CSC = /usr/bin/csc
4CSI = /usr/bin/csi
5CSC_OPTIONS = \
6 -host \
7 -D compiling-extension \
8 -emit-all-import-libraries \
9 -dynamic \
10 -regenerate-import-libraries \
11 -setup-mode \
12 -I $(PWD) \
13 -C -I$(PWD) \
14
15CSC_OPTIONS_EXTRA = \
16 -X utf8 \
17 -X module-declarations
18
19BUILD = $(PWD)/build
20
21.PHONY: all test
22build: $(patsubst src/%.scm,$(BUILD)/%.so,$(wildcard src/*.scm))
23
24test: build
25 $(CSI) -s $(PWD)/tests/run.scm $(NAME)
26
27# Program!
28
29# Libraries!
30
31$(BUILD)/%.so: src/%.scm
32 mkdir -p "$(dir $@)"
33 $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@
34
35## Library dependency graph
36# here's a convenience macro
37lib = $(BUILD)/$(NAME).$(1).so
38
39$(call lib,read): $(call lib,util)
40$(call lib,emit): $(call lib,util)