From 7eff4597545bc67827decc8a0a939747e42f47ff Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Wed, 16 Nov 2022 19:49:20 -0500 Subject: [PATCH] rsvp: Add build recipe for a compiled `rsvp` binary This involved: * Using "include" instead of "load" (to include the code at runtime) * Adding a chicken-csc recipe --- .gitignore | 2 ++ Makefile | 5 ++++- src/handler.scm | 2 +- src/prod.scm | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/prod.scm diff --git a/.gitignore b/.gitignore index 41c5d7b..40b4d78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.html !footer.html !header.html +rsvp +rsvp.sqlite3 diff --git a/Makefile b/Makefile index 1b1d7f1..ddfb9c9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ HTML != for f in *.tmpl; do echo $$(basename $$f tmpl)html; done +SCHEME != find . -name '*.scm' .PHONY: build -build: $(HTML) +build: $(HTML) rsvp .PHONY: clean clean: @@ -13,3 +14,5 @@ clean: $(HTML): header.html footer.html Makefile +rsvp: $(SCHEME) + (cd src; chicken-csc prod.scm -o ../$@) diff --git a/src/handler.scm b/src/handler.scm index 0624555..d8c5e62 100644 --- a/src/handler.scm +++ b/src/handler.scm @@ -8,7 +8,7 @@ (chicken string) (chicken condition)) -(load "db.scm") +(include "db.scm") (define email '(a (@ (href "mailto:rsvp@jennex.org")) "rsvp@jennex.org")) diff --git a/src/prod.scm b/src/prod.scm new file mode 100644 index 0000000..5a8b733 --- /dev/null +++ b/src/prod.scm @@ -0,0 +1,3 @@ +;; prod.scm -- runs main from main.scm (for compiled binary) +(include "main.scm") +(main '()) -- libgit2 1.1.1