aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-05-05 15:52:46 +0530
committerArun Isaac2022-05-05 15:54:34 +0530
commit6a093401f02b0a3aa9c4468042a05db9f8439ad7 (patch)
treeb2c710bb43de5487246aa96d19a9a0d33dc21f3e
parent30c47a64da943d74f1de94f5d128ea9f166d66fa (diff)
downloadgn-transform-databases-6a093401f02b0a3aa9c4468042a05db9f8439ad7.tar.gz
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.
-rw-r--r--Makefile19
-rwxr-xr-xpre-inst-env6
2 files changed, 24 insertions, 1 deletions
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 ...)