diff options
author | Case Duckworth | 2024-06-03 16:56:30 -0500 |
---|---|---|
committer | Case Duckworth | 2024-06-03 16:56:30 -0500 |
commit | ed4e86f47935994fb424c977e4123bde625ddff1 (patch) | |
tree | fa7e3b16c1e66741cef68d29e72b7e762ff2f8bd /Makefile | |
parent | Fix emit and read, add imports, fix makefile (diff) | |
download | jimmy-ed4e86f47935994fb424c977e4123bde625ddff1.tar.gz jimmy-ed4e86f47935994fb424c977e4123bde625ddff1.zip |
Fix html/other sourcing; re-scramble Makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 93 |
1 files changed, 40 insertions, 53 deletions
diff --git a/Makefile b/Makefile index b4f54b6..8eead3a 100644 --- a/Makefile +++ b/Makefile | |||
@@ -1,64 +1,51 @@ | |||
1 | NAME = jimmy | 1 | # Automatically generated by scramble |
2 | |||
3 | LIBS = read emit util | ||
4 | |||
5 | BUILD = $(PWD)/build | ||
6 | SRC = $(PWD)/src | ||
7 | TESTS = $(PWD)/tests | ||
8 | 2 | ||
3 | NAME = jimmy | ||
9 | CSC = /usr/bin/csc | 4 | CSC = /usr/bin/csc |
5 | CSC_OPTIONS = -setup-mode -host -I $(PWD) -C -I$(PWD) | ||
6 | CSC_LIB_OPTIONS = -D compiling-extension -emit-all-import-libraries -dynamic -regenerate-import-libraries | ||
7 | CSC_OPTIONS_EXTRA = -X utf8 -X module-declarations | ||
10 | CSI = /usr/bin/csi | 8 | CSI = /usr/bin/csi |
11 | CSC_OPTIONS = \ | 9 | BUILD = $(PWD)/build |
12 | -setup-mode \ | 10 | TESTS = $(PWD)/tests |
13 | -host \ | 11 | TEST_ENV = env BUILD=$(BUILD) TESTS=$(TESTS) |
14 | -D compiling-extension \ | 12 | TEST_ENV_EXTRA = TEST_USE_ANSI=0 |
15 | -emit-all-import-libraries \ | ||
16 | -dynamic \ | ||
17 | -regenerate-import-libraries \ | ||
18 | -I $(SRC) \ | ||
19 | -C -I$(SRC) | ||
20 | |||
21 | CSC_OPTIONS_EXTRA = \ | ||
22 | -X utf8 \ | ||
23 | -X module-declarations | ||
24 | |||
25 | ## Library dependency graph | ||
26 | # here's a convenience macro | ||
27 | lib = $(BUILD)/$(NAME).$(1).so | ||
28 | # and another | ||
29 | src = $(SRC)/$(1).scm | ||
30 | |||
31 | LIBS_ = $(foreach l,$(LIBS),$(call lib,$(l))) | ||
32 | |||
33 | ## Phonies | ||
34 | |||
35 | .PHONY: build test clean | ||
36 | build: $(LIBS_) | ||
37 | -mv *.import.scm build/ | ||
38 | |||
39 | test: build | ||
40 | cd $(BUILD) && \ | ||
41 | $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) | ||
42 | 13 | ||
14 | .PHONY: all test clean install uninstall | ||
15 | all: build/jimmy.util.so build/jimmy.read.so build/jimmy.emit.so build/jimmy.html.so build/jimmy.wrap.so | ||
16 | test: all | ||
17 | cd $(BUILD) && $(TEST_ENV) $(TEST_ENV_EXTRA) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) | ||
43 | clean: | 18 | clean: |
44 | -rm -rf $(BUILD) | 19 | -rm -rf $(BUILD) *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.static.o |
45 | |||
46 | install: | 20 | install: |
47 | chicken-install -s | 21 | chicken-install -s |
48 | |||
49 | uninstall: | 22 | uninstall: |
50 | chicken-uninstall -s | 23 | chicken-uninstall -s |
51 | 24 | ||
52 | # Scm -> So | 25 | # jimmy |
53 | |||
54 | $(BUILD)/$(NAME).%.so: src/%.scm | ||
55 | mkdir -p "$(dir $@)" | ||
56 | $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ | ||
57 | |||
58 | # Libraries! | ||
59 | $(call lib,util): $(call src,util) | ||
60 | 26 | ||
61 | $(call lib,read): $(call src,read) $(call lib,util) | 27 | build/jimmy.util.so: src/util.scm |
62 | $(call lib,emit): $(call src,emit) $(call lib,util) | 28 | @mkdir -p $(BUILD) |
63 | 29 | cd $(BUILD) && \ | |
64 | # Program! | 30 | $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) |
31 | @test -f jimmy.util.import.scm &&mv jimmy.util.import.scm $(BUILD)/||true | ||
32 | build/jimmy.read.so: src/read.scm src/util.scm | ||
33 | @mkdir -p $(BUILD) | ||
34 | cd $(BUILD) && \ | ||
35 | $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) | ||
36 | @test -f jimmy.read.import.scm &&mv jimmy.read.import.scm $(BUILD)/||true | ||
37 | build/jimmy.emit.so: src/emit.scm src/util.scm | ||
38 | @mkdir -p $(BUILD) | ||
39 | cd $(BUILD) && \ | ||
40 | $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) | ||
41 | @test -f jimmy.emit.import.scm &&mv jimmy.emit.import.scm $(BUILD)/||true | ||
42 | build/jimmy.html.so: src/html.scm src/util.scm src/emit.scm | ||
43 | @mkdir -p $(BUILD) | ||
44 | cd $(BUILD) && \ | ||
45 | $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) | ||
46 | @test -f jimmy.html.import.scm &&mv jimmy.html.import.scm $(BUILD)/||true | ||
47 | build/jimmy.wrap.so: src/wrap.scm src/util.scm src/emit.scm | ||
48 | @mkdir -p $(BUILD) | ||
49 | cd $(BUILD) && \ | ||
50 | $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) | ||
51 | @test -f jimmy.wrap.import.scm &&mv jimmy.wrap.import.scm $(BUILD)/||true | ||