From 4fb44325dee8d2ea4acbe2a9a7fa0b392accc3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Mon, 31 Mar 2025 19:54:16 +0200 Subject: [PATCH] Make it compile. --- backend/.gitignore | 3 +++ backend/Makefile | 21 +++++++++++++++++++-- backend/brminv.scm | 1 + tools/schemify-tree.scm | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/backend/.gitignore b/backend/.gitignore index 6b15819..773dbf1 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1 +1,4 @@ frontend.scm +*.import.scm +*.o +*.link diff --git a/backend/Makefile b/backend/Makefile index f16a2f8..e2469f5 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,11 +1,28 @@ +.PHONY: default +default: ../brminv + +SCRP=$(shell chicken-install -repository) +CSC=CHICKEN_REPOSITORY_PATH=../eggs:$(SCRP) csc + BRMINV_SOURCES=brminv.scm frontend.import.scm +BRMINV_OBJS=brminv.o frontend.o -../brminv: $(BRMINV_SOURCES) - touch ../brminv +%.o: %.scm + $(CSC) -c -static $< + +%.import.scm: %.scm + $(CSC) -regenerate-import-libraries -P -J $< + +../brminv: $(BRMINV_OBJS) + $(CSC) -L --no-lto -L -Wl,-static -L -Wl,-lsqlite3 -L -Wl,-Bdynamic -strip -static -o $@ $(BRMINV_OBJS) frontend.o: frontend.import.scm frontend.import.scm: frontend.scm .PHONY: frontend.scm frontend.scm: cd ../frontend && npm run build && cd ../backend && csi -b -q ../tools/schemify-tree.scm -- ../frontend/dist frontend frontend-lookup + +BRMINV_SOURCES=brminv.scm frontend.import.scm + +brminv.o: $(BRMINV_SOURCES) diff --git a/backend/brminv.scm b/backend/brminv.scm index 26e22de..63d2387 100644 --- a/backend/brminv.scm +++ b/backend/brminv.scm @@ -1,3 +1,4 @@ +(import frontend) (display "brminv") (newline) diff --git a/tools/schemify-tree.scm b/tools/schemify-tree.scm index 46acd37..b88e539 100644 --- a/tools/schemify-tree.scm +++ b/tools/schemify-tree.scm @@ -77,6 +77,8 @@ (define (compile-tree-module dir name getter) (with-output-to-file (format "~a.scm" name) (lambda () + (display `(declare (unit ,name))) + (newline) (write (make-tree-module dir name getter)) (newline))))