From 815e669310f5e73d13cc121bd7f6cdaec5b6ec0d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 26 May 2024 22:49:44 -0500 Subject: Updates! I totally forgot to actually commit things for a while, so uh Updates!!! --- Makefile | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0b8e141..2be0ca1 100644 --- a/Makefile +++ b/Makefile @@ -1,40 +1,63 @@ NAME = jimmy +LIBS = read emit util + +BUILD = $(PWD)/build +SRC = $(PWD)/src + CSC = /usr/bin/csc CSI = /usr/bin/csi CSC_OPTIONS = \ + -setup-mode \ -host \ -D compiling-extension \ -emit-all-import-libraries \ -dynamic \ -regenerate-import-libraries \ - -setup-mode \ -I $(PWD) \ - -C -I$(PWD) \ + -C -I$(PWD) CSC_OPTIONS_EXTRA = \ -X utf8 \ -X module-declarations -BUILD = $(PWD)/build +## 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: all test -build: $(patsubst src/%.scm,$(BUILD)/%.so,$(wildcard src/*.scm)) +.PHONY: build test clean +build: $(LIBS_) + -mv *.import.scm build/ test: build - $(CSI) -s $(PWD)/tests/run.scm $(NAME) + cd $(BUILD) && \ + $(CSI) -setup-mode -s tests/run.scm $(NAME) -# Program! +clean: + -rm -rf $(BUILD) -# Libraries! +install: + chicken-install -s + +uninstall: + chicken-uninstall -s -$(BUILD)/%.so: src/%.scm +# Scm -> So + +$(BUILD)/$(NAME).%.so: src/%.scm mkdir -p "$(dir $@)" $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ -## Library dependency graph -# here's a convenience macro -lib = $(BUILD)/$(NAME).$(1).so +# Libraries! +$(call lib,util): $(call src,util) -$(call lib,read): $(call lib,util) -$(call lib,emit): $(call lib,util) +$(call lib,read): $(call src,read) $(call lib,util) +$(call lib,emit): $(call src,emit) $(call lib,util) + +# Program! -- cgit 1.4.1-21-gabe81