diff options
author | Case Duckworth | 2024-05-18 21:15:54 -0500 |
---|---|---|
committer | Case Duckworth | 2024-05-18 21:15:54 -0500 |
commit | 727995a409632d4c143ba4b6b088c7df40f074e7 (patch) | |
tree | 3b2f291b2353314971288c0c3ad86d3825c6f825 /Makefile | |
parent | Remove old code (diff) | |
download | jimmy-727995a409632d4c143ba4b6b088c7df40f074e7.tar.gz jimmy-727995a409632d4c143ba4b6b088c7df40f074e7.zip |
Scheme bit!
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 40 |
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 @@ | |||
1 | NAME = jimmy | ||
2 | |||
3 | CSC = /usr/bin/csc | ||
4 | CSI = /usr/bin/csi | ||
5 | CSC_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 | |||
15 | CSC_OPTIONS_EXTRA = \ | ||
16 | -X utf8 \ | ||
17 | -X module-declarations | ||
18 | |||
19 | BUILD = $(PWD)/build | ||
20 | |||
21 | .PHONY: all test | ||
22 | build: $(patsubst src/%.scm,$(BUILD)/%.so,$(wildcard src/*.scm)) | ||
23 | |||
24 | test: 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 | ||
37 | lib = $(BUILD)/$(NAME).$(1).so | ||
38 | |||
39 | $(call lib,read): $(call lib,util) | ||
40 | $(call lib,emit): $(call lib,util) | ||