From 727995a409632d4c143ba4b6b088c7df40f074e7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 18 May 2024 21:15:54 -0500 Subject: Scheme bit! --- Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0b8e141 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +NAME = jimmy + +CSC = /usr/bin/csc +CSI = /usr/bin/csi +CSC_OPTIONS = \ + -host \ + -D compiling-extension \ + -emit-all-import-libraries \ + -dynamic \ + -regenerate-import-libraries \ + -setup-mode \ + -I $(PWD) \ + -C -I$(PWD) \ + +CSC_OPTIONS_EXTRA = \ + -X utf8 \ + -X module-declarations + +BUILD = $(PWD)/build + +.PHONY: all test +build: $(patsubst src/%.scm,$(BUILD)/%.so,$(wildcard src/*.scm)) + +test: build + $(CSI) -s $(PWD)/tests/run.scm $(NAME) + +# Program! + +# Libraries! + +$(BUILD)/%.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 + +$(call lib,read): $(call lib,util) +$(call lib,emit): $(call lib,util) -- cgit 1.4.1-21-gabe81