-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (41 loc) · 1.35 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# ---------------- configuration ----------------------
# if you have multiple SWI Prolog installations or an installation
# in a non-standard place, set PLLD to the appropriate plld invokation, eg
# PLLD=/usr/local/bin/plld -p /usr/local/bin/swipl
#PACKNAME=sparkle
#include ../Makefile.inc
SWIPL = swipl -p library=prolog
all: test
check:
install:
clean:
test: t-stopword t-term_regex
$(SWIPL) -l tests/tests.pl -g run_tests,halt
bigtest:
$(SWIPL) -l tests/bigtests.pl -g run_tests,halt
coverage:
$(SWIPL) -l tests/bigtests.pl -l tests/tests.pl -g "show_coverage(run_tests),halt"
t-%:
$(SWIPL) -l tests/$*_test.pl -g run_tests,halt
# --------------------
# Docker
# --------------------
# Get version from pack
VERSION = v$(shell swipl -l pack.pl -g "version(V),writeln(V),halt.")
show-version:
echo $(VERSION)
IM = cmungall/rdf_matcher
docker-all: docker-clean docker-build docker-run
docker-clean:
docker kill $(IM) || echo not running ;
docker rm $(IM) || echo not made
docker-build:
@docker build -t $(IM):$(VERSION) . \
&& docker tag $(IM):$(VERSION) $(IM):latest
docker-run:
docker run --name rdf_matcher $(IM)
test-docker-run:
docker run -v $$PWD/:/work -w /work --rm -ti $(IM) swipl -p library=prolog ./bin/rdfmatch -i tests/data/basic.ttl match
docker-publish: docker-build
@docker push $(IM):$(VERSION) \
&& docker push $(IM):latest