From 423ac382f9e73bf1ca7fc6b400f98db087cd7d22 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 Jun 2024 09:21:25 -0500 Subject: Write executable This involved moving `src' to `lib' and making `bin'. `bin' holds the program, which only imports `jimmy.main' from lib. --- Makefile | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8eead3a..d2a1003 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ NAME = jimmy CSC = /usr/bin/csc -CSC_OPTIONS = -setup-mode -host -I $(PWD) -C -I$(PWD) +CSC_OPTIONS = -setup-mode -host -I $(PWD) -C -I$(BUILD) 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 @@ -12,7 +12,7 @@ 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 +all: build/jimmy.util.so build/jimmy.read.so build/jimmy.emit.so build/jimmy.html.so build/jimmy.wrap.so build/jimmy.main.so build/jimmy test: all cd $(BUILD) && $(TEST_ENV) $(TEST_ENV_EXTRA) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) clean: @@ -24,28 +24,38 @@ uninstall: # jimmy -build/jimmy.util.so: src/util.scm +build/jimmy.util.so: lib/util.scm @mkdir -p $(BUILD) - cd $(BUILD) && \ - $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ @test -f jimmy.util.import.scm &&mv jimmy.util.import.scm $(BUILD)/||true -build/jimmy.read.so: src/read.scm src/util.scm + +build/jimmy.read.so: lib/read.scm lib/util.scm @mkdir -p $(BUILD) - cd $(BUILD) && \ - $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ @test -f jimmy.read.import.scm &&mv jimmy.read.import.scm $(BUILD)/||true -build/jimmy.emit.so: src/emit.scm src/util.scm + +build/jimmy.emit.so: lib/emit.scm lib/util.scm @mkdir -p $(BUILD) - cd $(BUILD) && \ - $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ @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 + +build/jimmy.html.so: lib/html.scm lib/util.scm lib/emit.scm @mkdir -p $(BUILD) - cd $(BUILD) && \ - $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ @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 + +build/jimmy.wrap.so: lib/wrap.scm lib/util.scm lib/emit.scm @mkdir -p $(BUILD) - cd $(BUILD) && \ - $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ @test -f jimmy.wrap.import.scm &&mv jimmy.wrap.import.scm $(BUILD)/||true + +build/jimmy.main.so: lib/main.scm lib/util.scm lib/emit.scm lib/read.scm lib/wrap.scm + @mkdir -p $(BUILD) + $(CSC) $(CSC_OPTIONS) $(CSC_LIB_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ + @test -f jimmy.main.import.scm &&mv jimmy.main.import.scm $(BUILD)/||true + +build/jimmy: bin/jimmy.scm lib/main.scm + @mkdir -p $(BUILD) + $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ + @test -f jimmy.import.scm &&mv jimmy.import.scm $(BUILD)/||true + -- cgit 1.4.1-21-gabe81