forked from mdaines/viz-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (37 loc) · 1.98 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
PREFIX = $(abspath ./prefix)
.PHONY: all clean clobber expat graphviz
all: expat graphviz viz.js
clean:
rm -f module.js viz.js
clobber: | clean
rm -rf build prefix
viz.js: src/pre.js module.js src/post.js
cat $^ > $@
module.js: src/viz.c
emcc -v -O2 --memory-init-file 0 -s USE_ZLIB=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS="['_vizRenderFromString', '_aglasterr', '_dtextract', '_Dtqueue']" -o $@ $< -I$(PREFIX)/include -I$(PREFIX)/include/graphviz -L$(PREFIX)/lib -L$(PREFIX)/lib/graphviz -lgvplugin_core -lgvplugin_dot_layout -lgvplugin_neato_layout -lcdt -lcgraph -lgvc -lgvpr -lpathplan -lexpat -lxdot -lz
$(PREFIX):
mkdir -p $(PREFIX)
expat: | build/expat-2.1.0 $(PREFIX)
cd build/expat-2.1.0 && emconfigure ./configure --disable-shared --prefix=$(PREFIX)
cd build/expat-2.1.0 && emmake make buildlib installlib
graphviz: | build/graphviz-2.38.0 $(PREFIX)
cd build/graphviz-2.38.0 && ./configure
cd build/graphviz-2.38.0/lib/gvpr && make mkdefs
mkdir -p build/graphviz-2.38.0/FEATURE
cp hacks/FEATURE/sfio hacks/FEATURE/vmalloc build/graphviz-2.38.0/FEATURE
cd build/graphviz-2.38.0 && emconfigure ./configure --disable-ltdl --enable-static --disable-shared --prefix=$(PREFIX)
cd build/graphviz-2.38.0 && emmake make CFLAGS="-fno-common -Wno-implicit-function-declaration -Wno-warn-absolute-paths"
cd build/graphviz-2.38.0/lib && emmake make install
cd build/graphviz-2.38.0/plugin && emmake make install
build:
mkdir -p build
build/expat-2.1.0: sources/expat-2.1.0.tar.gz | build
tar -xf sources/expat-2.1.0.tar.gz -C build
build/graphviz-2.38.0: sources/graphviz-2.38.0.tar.gz | build
tar -xf sources/graphviz-2.38.0.tar.gz -C build
sources:
mkdir -p sources
sources/expat-2.1.0.tar.gz: | sources
curl -L "http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download" -o sources/expat-2.1.0.tar.gz
sources/graphviz-2.38.0.tar.gz: | sources
curl -L "http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz" -o sources/graphviz-2.38.0.tar.gz