about summary refs log tree commit diff stats
path: root/Makefile
blob: 0b8e1415a1552a033800b77b29eaebd140b5a66c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
NAME = jimmy

CSC = /usr/bin/csc
CSI = /usr/bin/csi
CSC_OPTIONS = \
	-host \
	-D compiling-extension \
	-emit-all-import-libraries \
	-dynamic \
	-regenerate-import-libraries \
	-setup-mode \
	-I $(PWD) \
	-C -I$(PWD) \

CSC_OPTIONS_EXTRA = \
	-X utf8 \
	-X module-declarations

BUILD = $(PWD)/build

.PHONY: all test
build: $(patsubst src/%.scm,$(BUILD)/%.so,$(wildcard src/*.scm))

test: build
	$(CSI) -s $(PWD)/tests/run.scm $(NAME)

# Program!

# Libraries!

$(BUILD)/%.so: src/%.scm
	mkdir -p "$(dir $@)"
	$(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@

## Library dependency graph
# here's a convenience macro
lib = $(BUILD)/$(NAME).$(1).so

$(call lib,read): $(call lib,util)
$(call lib,emit): $(call lib,util)