From ed4e86f47935994fb424c977e4123bde625ddff1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jun 2024 16:56:30 -0500 Subject: Fix html/other sourcing; re-scramble Makefile --- Makefile | 93 ++++++++++++++++++++++++++++------------------------------------ 1 file changed, 40 insertions(+), 53 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b4f54b6..8eead3a 100644 --- a/Makefile +++ b/Makefile @@ -1,64 +1,51 @@ -NAME = jimmy - -LIBS = read emit util - -BUILD = $(PWD)/build -SRC = $(PWD)/src -TESTS = $(PWD)/tests +# Automatically generated by scramble +NAME = jimmy CSC = /usr/bin/csc +CSC_OPTIONS = -setup-mode -host -I $(PWD) -C -I$(PWD) +CSC_LIB_OPTIONS = -D compiling-extension -emit-all-import-libraries -dynamic -regenerate-import-libraries +CSC_OPTIONS_EXTRA = -X utf8 -X module-declarations CSI = /usr/bin/csi -CSC_OPTIONS = \ - -setup-mode \ - -host \ - -D compiling-extension \ - -emit-all-import-libraries \ - -dynamic \ - -regenerate-import-libraries \ - -I $(SRC) \ - -C -I$(SRC) - -CSC_OPTIONS_EXTRA = \ - -X utf8 \ - -X module-declarations - -## Library dependency graph -# here's a convenience macro -lib = $(BUILD)/$(NAME).$(1).so -# and another -src = $(SRC)/$(1).scm - -LIBS_ = $(foreach l,$(LIBS),$(call lib,$(l))) - -## Phonies - -.PHONY: build test clean -build: $(LIBS_) - -mv *.import.scm build/ - -test: build - cd $(BUILD) && \ - $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) +BUILD = $(PWD)/build +TESTS = $(PWD)/tests +TEST_ENV = env BUILD=$(BUILD) TESTS=$(TESTS) +TEST_ENV_EXTRA = TEST_USE_ANSI=0 +.PHONY: all test clean install uninstall +all: build/jimmy.util.so build/jimmy.read.so build/jimmy.emit.so build/jimmy.html.so build/jimmy.wrap.so +test: all + cd $(BUILD) && $(TEST_ENV) $(TEST_ENV_EXTRA) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) clean: - -rm -rf $(BUILD) - + -rm -rf $(BUILD) *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.static.o install: chicken-install -s - uninstall: chicken-uninstall -s -# Scm -> So - -$(BUILD)/$(NAME).%.so: src/%.scm - mkdir -p "$(dir $@)" - $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ - -# Libraries! -$(call lib,util): $(call src,util) +# jimmy -$(call lib,read): $(call src,read) $(call lib,util) -$(call lib,emit): $(call src,emit) $(call lib,util) - -# Program! +build/jimmy.util.so: src/util.scm + @mkdir -p $(BUILD) + cd $(BUILD) && \ + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + @test -f jimmy.util.import.scm &&mv jimmy.util.import.scm $(BUILD)/||true +build/jimmy.read.so: src/read.scm src/util.scm + @mkdir -p $(BUILD) + cd $(BUILD) && \ + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + @test -f jimmy.read.import.scm &&mv jimmy.read.import.scm $(BUILD)/||true +build/jimmy.emit.so: src/emit.scm src/util.scm + @mkdir -p $(BUILD) + cd $(BUILD) && \ + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + @test -f jimmy.emit.import.scm &&mv jimmy.emit.import.scm $(BUILD)/||true +build/jimmy.html.so: src/html.scm src/util.scm src/emit.scm + @mkdir -p $(BUILD) + cd $(BUILD) && \ + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + @test -f jimmy.html.import.scm &&mv jimmy.html.import.scm $(BUILD)/||true +build/jimmy.wrap.so: src/wrap.scm src/util.scm src/emit.scm + @mkdir -p $(BUILD) + cd $(BUILD) && \ + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + @test -f jimmy.wrap.import.scm &&mv jimmy.wrap.import.scm $(BUILD)/||true -- cgit 1.4.1-21-gabe81