From 6a093401f02b0a3aa9c4468042a05db9f8439ad7 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 5 May 2022 15:52:46 +0530 Subject: Compile scheme sources. * Makefile (GUILD, top_level_module_dir, sources, objects): New variables. (all, %.go, clean): New targets. * pre-inst-env: Use built object files. --- Makefile | 19 +++++++++++++++++++ pre-inst-env | 6 +++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 32d4ca5..87618c1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,24 @@ +GUILD = guild RUN64 = guile-run64 +top_level_module_dir = dump +sources = $(wildcard $(top_level_module_dir)/*.scm) +objects = $(sources:.scm=.go) + +# Build + +all: $(objects) + +%.go: %.scm + $(GUILD) compile -L . -o $@ $< + +# Tests + .PHONY: check check: tests.scm GUILE_LOAD_PATH=$(GUILE_LOAD_PATH):. $(RUN64) $^ + +# Clean + +clean: + rm -f $(objects) diff --git a/pre-inst-env b/pre-inst-env index f83ded1..0d6e2d5 100755 --- a/pre-inst-env +++ b/pre-inst-env @@ -10,7 +10,11 @@ '())) ":"))) -(prepend-path-environment! "GUILE_LOAD_PATH" (dirname (current-filename))) +(define %source-dir + (dirname (current-filename))) + +(prepend-path-environment! "GUILE_LOAD_PATH" %source-dir) +(prepend-path-environment! "GUILE_LOAD_COMPILED_PATH" %source-dir) (match (command-line) ((_ command args ...) -- cgit v1.2.3