about summary refs log tree commit diff stats
path: root/Makefile
blob: 9d87ce27c762b30cba7a88d09e0132599f79a437 (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
# Automatically generated by scramble

NAME = scramble
CSC = /usr/bin/csc
CSC_OPTIONS = -setup-mode -host -I $(BUILD) -C -I$(BUILD)
CSC_LIB_OPTIONS = -D compiling-extension -emit-all-import-libraries -dynamic -regenerate-import-libraries
CSC_OPTIONS_EXTRA = -X utf8
CSI = /usr/bin/csi
BUILD = $(PWD)/build
TESTS = $(PWD)/tests
TEST_ENV = env BUILD=$(BUILD) TESTS=$(TESTS)
TEST_ENV_EXTRA = TEST_USE_ANSI=0
ARTEFACTS = *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.o

.PHONY: all test clean install uninstall
all: build/scramble
test: all
	cd $(BUILD) && \
	$(TEST_ENV) $(TEST_ENV_EXTRA) \
	$(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME)
clean:
	-rm -rf $(BUILD) $(ARTEFACTS)
install:
	chicken-install -s
	@-rm -rf $(ARTEFACTS)
uninstall:
	chicken-uninstall -s $(NAME)

# scramble

build/scramble: scramble.scm
	@mkdir -p $(BUILD)
	$(CSC) $(CSC_OPTIONS)  $(CSC_OPTIONS_EXTRA) $< -o $@
	@test -f scramble.import.scm && mv scramble.import.scm $(BUILD)/ ||true