diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Makefile b/Makefile index 7ecdf53..9d87ce2 100644 --- a/Makefile +++ b/Makefile | |||
@@ -2,30 +2,33 @@ | |||
2 | 2 | ||
3 | NAME = scramble | 3 | NAME = scramble |
4 | CSC = /usr/bin/csc | 4 | CSC = /usr/bin/csc |
5 | CSC_OPTIONS = -setup-mode -host -I $(PWD) -C -I$(PWD) | 5 | CSC_OPTIONS = -setup-mode -host -I $(BUILD) -C -I$(BUILD) |
6 | CSC_LIB_OPTIONS = -D compiling-extension -emit-all-import-libraries -dynamic -regenerate-import-libraries | 6 | CSC_LIB_OPTIONS = -D compiling-extension -emit-all-import-libraries -dynamic -regenerate-import-libraries |
7 | CSC_OPTIONS_EXTRA = -X utf8 | 7 | CSC_OPTIONS_EXTRA = -X utf8 |
8 | CSI = /usr/bin/csi | 8 | CSI = /usr/bin/csi |
9 | BUILD = $(PWD)/build | 9 | BUILD = $(PWD)/build |
10 | TESTS = $(PWD)/tests | 10 | TESTS = $(PWD)/tests |
11 | TEST_ENV = env BUILD=$(BUILD) TESTS=$(TESTS) | 11 | TEST_ENV = env BUILD=$(BUILD) TESTS=$(TESTS) |
12 | TEST_ENV_EXTRA = TEST_USE_ANSI=0 | ||
13 | ARTEFACTS = *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.o | ||
12 | 14 | ||
13 | .PHONY: all test clean install uninstall | 15 | .PHONY: all test clean install uninstall |
14 | all: build/scramble | 16 | all: build/scramble |
15 | test: $(BUILD) | 17 | test: all |
16 | cd $(BUILD) && $(TEST_ENV) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) | 18 | cd $(BUILD) && \ |
19 | $(TEST_ENV) $(TEST_ENV_EXTRA) \ | ||
20 | $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) | ||
17 | clean: | 21 | clean: |
18 | -rm -rf $(BUILD) *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.static.o | 22 | -rm -rf $(BUILD) $(ARTEFACTS) |
19 | install: | 23 | install: |
20 | chicken-install -s | 24 | chicken-install -s |
25 | @-rm -rf $(ARTEFACTS) | ||
21 | uninstall: | 26 | uninstall: |
22 | chicken-uninstall -s | 27 | chicken-uninstall -s $(NAME) |
23 | 28 | ||
24 | # scramble | 29 | # scramble |
25 | 30 | ||
26 | $(BUILD): | 31 | build/scramble: scramble.scm |
27 | -mkdir $(BUILD) | 32 | @mkdir -p $(BUILD) |
28 | build/scramble: scramble.scm $(BUILD) | 33 | $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ |
29 | cd $(BUILD) && \ | 34 | @test -f scramble.import.scm && mv scramble.import.scm $(BUILD)/ ||true |
30 | $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) | ||
31 | @if test -f scramble.import.scm;then mv scramble.import.scm $(BUILD)/;echo mv scramble.import.scm $(BUILD)/; fi | ||