From 41c3f3bd981cb889ca1752e513e462e30c108706 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Sun, 3 Aug 2025 21:44:43 +0300 Subject: [PATCH] make fmt-c a unit --- Makefile | 10 +++++----- fmt-c.scm | 2 ++ sexc.scm | 3 +-- tests/run.scm | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a0827ec..200ed3e 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,19 @@ CHICKEN_C = csc -MODULES = sexc modules templates utils +MODULES = sexc modules templates utils fmt-c OBJ = $(MODULES:%=%.o) -# chicken flags -CFLAGS = -compile-syntax - sexc: main.o $(OBJ) $(CHICKEN_C) $^ -o $@ main.o: main.scm $(CHICKEN_C) $< -c -o $@ +templates.o: templates.scm + $(CHICKEN_C) $< -c -o $@ -compile-syntax + %.o: %.scm - $(CHICKEN_C) $< -e -c -o $@ $(CFLAGS) + $(CHICKEN_C) $< -e -c -o $@ sex-tests: $(OBJ) tests/run.scm $(CHICKEN_C) tests/run.scm -c -o sex-tests.o diff --git a/fmt-c.scm b/fmt-c.scm index 03b1635..5c8036b 100644 --- a/fmt-c.scm +++ b/fmt-c.scm @@ -6,6 +6,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; additional state information +(declare (unit fmt-c)) + (import fmt) (define (fmt-in-macro? st) (fmt-ref st 'in-macro?)) diff --git a/sexc.scm b/sexc.scm index 70b0378..a8d4164 100644 --- a/sexc.scm +++ b/sexc.scm @@ -1,11 +1,10 @@ (declare (unit sexc) (uses sex-modules + fmt-c templates)) (include "utils.macros.scm") -(load "fmt-c.scm") - (import brev-separate (chicken file) (chicken pathname) diff --git a/tests/run.scm b/tests/run.scm index 6aa900e..e786828 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -33,4 +33,5 @@ (test 'a.b (make-field-access '(.b a))) (test 'a.b.c (make-field-access '(.c a.b))) +;;; Should be the last in the test suite (test-exit)