Makefile 791 Bytes
Newer Older
Thierry Martinez's avatar
Thierry Martinez committed
1
MODULES=$(shell sed -n -E 's/^- (.*\.pl)$$/\1/p' toc.org)
2 3
# load_test_files/1 should make this useless, but I cannot find how to use it
TEST_MODULES=$(wildcard $(MODULES:.pl=.plt))
Thierry Martinez's avatar
Thierry Martinez committed
4

Thierry Martinez's avatar
Thierry Martinez committed
5 6
all: biocham biocham_debug tests doc

SOLIMAN Sylvain's avatar
SOLIMAN Sylvain committed
7
.PHONY: tests doc clean
Thierry Martinez's avatar
Thierry Martinez committed
8

Thierry Martinez's avatar
Thierry Martinez committed
9
biocham: $(MODULES) toc.org Makefile
SOLIMAN Sylvain's avatar
SOLIMAN Sylvain committed
10
	@echo $(MODULES)
Thierry Martinez's avatar
Thierry Martinez committed
11
	swipl -o biocham --goal=start --toplevel=toplevel -c $(MODULES)
Thierry Martinez's avatar
Thierry Martinez committed
12

Thierry Martinez's avatar
Thierry Martinez committed
13 14
biocham_debug: $(MODULES) $(TEST_MODULES) toc.org Makefile
	swipl -o biocham_debug --goal=initialize -c $(MODULES) $(TEST_MODULES)
Thierry Martinez's avatar
Thierry Martinez committed
15 16 17 18

tests: biocham_tests
	./biocham_tests

Thierry Martinez's avatar
Thierry Martinez committed
19 20 21
doc: biocham
	./biocham --generate-doc

22
biocham_tests: $(MODULES) $(TEST_MODULES) Makefile
Thierry Martinez's avatar
Thierry Martinez committed
23
	swipl -o biocham_tests \
24
		--goal="call_cleanup((run_tests, halt(0)), halt(1))" -c $(MODULES) $(TEST_MODULES)
SOLIMAN Sylvain's avatar
SOLIMAN Sylvain committed
25 26 27

clean:
	-rm -f biocham biocham_debug biocham_tests