Makefile 722 Bytes
Newer Older
Thierry Martinez's avatar
Thierry Martinez committed
1
CC=swipl-ld
Thierry Martinez's avatar
Thierry Martinez committed
2
CFLAGS=`pkg-config --cflags libgvc`
Thierry Martinez's avatar
Thierry Martinez committed
3
LDFLAGS=-shared
Thierry Martinez's avatar
Thierry Martinez committed
4
5
6
7
8
9
10
11
LDLIBS=`pkg-config --libs libgvc`

$(foreach var, PLSOEXT, \
  $(eval \
    $(shell \
      swipl -dump-runtime-variables | \
      grep ^$(var)= | \
      sed -E 's/="/=/;s/";$$//')))
Thierry Martinez's avatar
Thierry Martinez committed
12
13
14
15
16
17

all: graphviz_swiprolog test

.PHONY: clean test

clean:
Thierry Martinez's avatar
Thierry Martinez committed
18
19
	- rm graphviz_swiprolog
	- rm graphviz_swiprolog.o
Thierry Martinez's avatar
Thierry Martinez committed
20
21

graphviz_swiprolog: graphviz_swiprolog.o
Thierry Martinez's avatar
Thierry Martinez committed
22
23
	swipl-ld -shared -o graphviz_swiprolog graphviz_swiprolog.o $(LDLIBS)
	mv graphviz_swiprolog.$(PLSOEXT) graphviz_swiprolog
Thierry Martinez's avatar
Thierry Martinez committed
24
25
26
27

graphviz_swiprolog.o: graphviz_swiprolog.c

test:
28
29
	LD_LIBRARY_PATH=$$LD_LIBRARY_PATH$${LD_LIBRARY_PATH:+:}$$PWD \
	swipl -g "\
Thierry Martinez's avatar
Thierry Martinez committed
30
31
	  call_cleanup((['graphviz.plt'], run_tests, halt(0)), halt(1))\
	"