modularize sex
Some checks failed
Sex CI / build-linux (pull_request) Has been cancelled
Sex CI / build-macos (pull_request) Has been cancelled

This commit is contained in:
2026-02-17 16:11:56 +03:00
parent f5b3fcb399
commit 65964f2aa0
16 changed files with 1846 additions and 1785 deletions

View File

@@ -1,21 +1,24 @@
CHICKEN_C = csc
CSC_FLAGS += -K prefix
MODULES = sexc fmt-c fmt-c-writer semen sex-macros sex-modules sex-reader utils
# Order matters
MODULES = utils macros reader module-system semen sex-fmt-c fmt-c-writer sexc
OBJ = $(MODULES:%=%.o)
sexc: main.o $(OBJ)
sexc: $(OBJ) main.o
$(CHICKEN_C) $(CSC_FLAGS) $^ -o $@
main.o: main.scm
$(CHICKEN_C) $(CSC_FLAGS) $< -c -o $@
%.o: %.scm
$(CHICKEN_C) $(CSC_FLAGS) $< -e -c -o $@
$(CHICKEN_C) $(CSC_FLAGS) $< -e -c -J -o $@ -unit $(@:%.o=%)
sex-tests: $(OBJ) tests/*.scm
cd ./tests && $(CHICKEN_C) $(CSC_FLAGS) run.scm -c -o sex-tests.o
$(CHICKEN_C) $(CSC_FLAGS) $(OBJ) ./tests/sex-tests.o -o sex-tests
clean:
rm -f $(OBJ) sexc sex-tests main.o ./tests/sex-tests.o
rm -f $(OBJ) main.o ./tests/sex-tests.o
rm -f $(IMPORTS)
rm -f sexc sex-tests