ADDITIONAL_MODULES=modules/sbml/sbml_utils.pl MODULES=$(shell sed -n -E 's/^[+-] (.*\.pl)$$/\1/p' toc.org) \ $(ADDITIONAL_MODULES) # load_test_files/1 should make this useless, but I cannot find how to use it TEST_MODULES=$(wildcard $(MODULES:.pl=.plt)) $(foreach var, CC PLBASE PLCFLAGS PLLDFLAGS PLLIB, \ $(eval \ $(shell \ swipl -dump-runtime-variables | \ grep ^$(var)= | \ sed -E 's/="/=/;s/";$$//'))) INCLUDEDIRS=modules/graphviz modules/sbml $(PLBASE)/include CFLAGS=$(addprefix -I, $(INCLUDEDIRS)) $(PLCFLAGS) LDFLAGS=$(PLLDFLAGS) $(addprefix -L, $(dir $(wildcard $(PLBASE)/lib/*/))) LDLIBS=$(PLLIB) `pkg-config --libs libgvc libsbml` SWIPL=$(PWD)/swipl-biocham all: biocham biocham_debug test doc .PHONY: test doc clean biocham: platform/current swipl-biocham $(MODULES) toc.org Makefile $(SWIPL) -o biocham \ --goal=start --toplevel=toplevel -c $(MODULES) biocham_debug: platform/current swipl-biocham $(MODULES) $(TEST_MODULES) \ toc.org Makefile $(SWIPL) -o biocham_debug \ --goal=initialize -c $(MODULES) $(TEST_MODULES) swipl-biocham: swipl-biocham.o \ modules/graphviz/graphviz_swiprolog.o \ modules/sbml/sbml_swiprolog.o swipl-biocham.o: swipl-biocham.c modules/graphviz/graphviz_swiprolog.o: make -C modules/graphviz modules/sbml/sbml_swiprolog.o: make -C modules/sbml platform/current: - rm platform/current ln -s `uname` platform/current test: biocham_tests ./biocham_tests doc: biocham ./biocham --generate-doc biocham_tests: swipl-biocham $(MODULES) $(TEST_MODULES) Makefile $(SWIPL) -o biocham_tests \ --goal="call_cleanup((run_tests, halt(0)), halt(1))" \ -c $(MODULES) $(TEST_MODULES) clean: - make -C modules/graphviz clean - make -C modules/sbml clean - rm platform/current - rm biocham - rm biocham_debug - rm biocham_tests - rm swipl-biocham - rm swipl-biocham.o