Files
sex/tests/Makefile
alex-eg 69b38e7c9f make each compiler module one file, built once
A module was a body plus a (module ...) wrapper naming its exports, and
the wrapper came in up to three copies: the root's, a test one that
exported everything, and sextest's, each recompiling the same body.

csc -module makes a file a module by itself, with export forms in its
body, so the wrappers are gone. tests/ and tools/sextest/ link what the
root built, finding it on the repository path; the tests see what a
module exports, and the names only they need are exported as such.
2026-10-15 15:07:04 +03:00

22 lines
710 B
Makefile

CHICKEN_C = csc
CSC_FLAGS += -K prefix -static
# The compiler's modules are built once, in the root; their import
# libraries and objects are found there through the repository path
ROOT = ..
export CHICKEN_REPOSITORY_PATH := $(abspath $(ROOT)):$(or $(CHICKEN_REPOSITORY_PATH),$(shell chicken-install -repository))
MODULES = utils types infer sex-macros reader sex-modules semen sex-fmt-c fmt-c-writer sexc
TESTS = basic semen reader fmt-c-writer utils line-directives codegen encapsulation args module-path types infer
TEST_SRCS = $(TESTS:%=%.scm)
sex-tests: run.scm $(TEST_SRCS) $(MODULES:%=$(ROOT)/%.o)
$(CHICKEN_C) $(CSC_FLAGS) run.scm -o sex-tests -link sexc
clean:
rm -f sex-tests
.PHONY: clean