forked from alex-eg/sex
Add project-local dependencies installation
This commit is contained in:
25
Makefile
25
Makefile
@@ -11,6 +11,7 @@ CSC_FLAGS += -K prefix -static
|
|||||||
# "during expansion of (import ...) - cannot import from undefined module: sex-macros"
|
# "during expansion of (import ...) - cannot import from undefined module: sex-macros"
|
||||||
# error.
|
# error.
|
||||||
# -c: Stop after compilation to object files. This one is obvious.
|
# -c: Stop after compilation to object files. This one is obvious.
|
||||||
|
CHICKEN_INSTALL = chicken-install
|
||||||
|
|
||||||
MODULE_FLAGS = -emit-all-import-libraries -module-registration -c
|
MODULE_FLAGS = -emit-all-import-libraries -module-registration -c
|
||||||
|
|
||||||
@@ -18,6 +19,18 @@ MODULE_FLAGS = -emit-all-import-libraries -module-registration -c
|
|||||||
MODULES = utils types sex-macros reader sex-modules semen sex-fmt-c fmt-c-writer sexc
|
MODULES = utils types sex-macros reader sex-modules semen sex-fmt-c fmt-c-writer sexc
|
||||||
OBJ = $(MODULES:%=%.o)
|
OBJ = $(MODULES:%=%.o)
|
||||||
|
|
||||||
|
DEPSFILE = dependencies.txt
|
||||||
|
DEPSLOCK = .eggs.lock
|
||||||
|
|
||||||
|
DEPENDENCIES = $(shell cat $(DEPSFILE))
|
||||||
|
CHICKEN_EXTERNAL_REPOSITORY := $(shell chicken-install -repository)
|
||||||
|
|
||||||
|
export CHICKEN_EGG_CACHE=$(abspath .eggs)/cache
|
||||||
|
export CHICKEN_REPOSITORY_PATH=$(abspath .eggs):$(CHICKEN_EXTERNAL_REPOSITORY)
|
||||||
|
export CHICKEN_INSTALL_REPOSITORY=$(abspath .eggs)
|
||||||
|
|
||||||
|
all: sexc
|
||||||
|
|
||||||
sexc: $(OBJ) main.scm
|
sexc: $(OBJ) main.scm
|
||||||
$(CHICKEN_C) $(CSC_FLAGS) main.scm -o sexc-tmp -link sexc
|
$(CHICKEN_C) $(CSC_FLAGS) main.scm -o sexc-tmp -link sexc
|
||||||
# otherwise csc hangs, probably because it tries to compile to sexc.o first
|
# otherwise csc hangs, probably because it tries to compile to sexc.o first
|
||||||
@@ -74,6 +87,16 @@ check-exit-code: sexc
|
|||||||
run-tests: sexc sex-tests sextest
|
run-tests: sexc sex-tests sextest
|
||||||
./sex-tests && ./sextest --sexc=./sexc $(SEX_TEST_PROGRAMS:%=./tests/sex-programs/%.sex) && $(MAKE) check-modules && $(MAKE) check-exit-code
|
./sex-tests && ./sextest --sexc=./sexc $(SEX_TEST_PROGRAMS:%=./tests/sex-programs/%.sex) && $(MAKE) check-modules && $(MAKE) check-exit-code
|
||||||
|
|
||||||
|
run-tests: sex-tests
|
||||||
|
./sex-tests
|
||||||
|
|
||||||
|
.eggs.lock: $(DEPSFILE)
|
||||||
|
env | grep CHICKEN
|
||||||
|
$(CHICKEN_INSTALL) $(DEPENDENCIES)
|
||||||
|
touch $(DEPSLOCK)
|
||||||
|
|
||||||
|
deps: $(DEPSLOCK)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ) main.o
|
rm -f $(OBJ) main.o
|
||||||
rm -f *.import.scm
|
rm -f *.import.scm
|
||||||
@@ -81,4 +104,4 @@ clean:
|
|||||||
rm -f sexc sex-tests sextest
|
rm -f sexc sex-tests sextest
|
||||||
$(MAKE) -C ./tests/modules clean
|
$(MAKE) -C ./tests/modules clean
|
||||||
|
|
||||||
.PHONY: clean run-tests sex-tests sextest check-modules check-exit-code
|
.PHONY: clean depclean deps run-tests sex-tests sextest check-modules check-exit-code
|
||||||
|
|||||||
Reference in New Issue
Block a user