From fc9496f66e213dcc48f80b41dff0e0252c1846e6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 Jun 2024 12:51:57 -0500 Subject: Improve! --- Makefile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7ecdf53..9d87ce2 100644 --- a/Makefile +++ b/Makefile @@ -2,30 +2,33 @@ NAME = scramble CSC = /usr/bin/csc -CSC_OPTIONS = -setup-mode -host -I $(PWD) -C -I$(PWD) +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: $(BUILD) - cd $(BUILD) && $(TEST_ENV) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) +test: all + cd $(BUILD) && \ + $(TEST_ENV) $(TEST_ENV_EXTRA) \ + $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) clean: - -rm -rf $(BUILD) *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.static.o + -rm -rf $(BUILD) $(ARTEFACTS) install: chicken-install -s + @-rm -rf $(ARTEFACTS) uninstall: - chicken-uninstall -s + chicken-uninstall -s $(NAME) # scramble -$(BUILD): - -mkdir $(BUILD) -build/scramble: scramble.scm $(BUILD) - cd $(BUILD) && \ - $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) - @if test -f scramble.import.scm;then mv scramble.import.scm $(BUILD)/;echo mv scramble.import.scm $(BUILD)/; fi +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 -- cgit 1.4.1-21-gabe81