Add project-local dependencies installation
This commit is contained in:
28
Makefile
28
Makefile
@@ -1,9 +1,22 @@
|
|||||||
CHICKEN_C = csc
|
CHICKEN_C = csc
|
||||||
CSC_FLAGS += -K prefix
|
CSC_FLAGS += -K prefix
|
||||||
|
CHICKEN_INSTALL = chicken-install
|
||||||
|
|
||||||
MODULES = sexc fmt-c fmt-c-writer semen sex-macros sex-modules sex-reader utils
|
MODULES = sexc fmt-c fmt-c-writer semen sex-macros sex-modules sex-reader utils
|
||||||
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: main.o $(OBJ)
|
sexc: main.o $(OBJ)
|
||||||
$(CHICKEN_C) $(CSC_FLAGS) $^ -o $@
|
$(CHICKEN_C) $(CSC_FLAGS) $^ -o $@
|
||||||
|
|
||||||
@@ -17,5 +30,20 @@ sex-tests: $(OBJ) tests/*.scm
|
|||||||
cd ./tests && $(CHICKEN_C) $(CSC_FLAGS) run.scm -c -o sex-tests.o
|
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
|
$(CHICKEN_C) $(CSC_FLAGS) $(OBJ) ./tests/sex-tests.o -o sex-tests
|
||||||
|
|
||||||
|
run-tests: sex-tests
|
||||||
|
./sex-tests
|
||||||
|
|
||||||
|
.eggs.lock: $(DEPSFILE)
|
||||||
|
env | grep CHICKEN
|
||||||
|
$(CHICKEN_INSTALL) $(DEPENDENCIES)
|
||||||
|
touch $(DEPSLOCK)
|
||||||
|
|
||||||
|
deps: $(DEPSLOCK)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ) sexc sex-tests main.o ./tests/sex-tests.o
|
rm -f $(OBJ) sexc sex-tests main.o ./tests/sex-tests.o
|
||||||
|
|
||||||
|
depclean:
|
||||||
|
rm -rf .eggs $(DEPSLOCK)
|
||||||
|
|
||||||
|
.PHONY: all deps depclean clean
|
||||||
|
|||||||
Reference in New Issue
Block a user