-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.libhext
42 lines (36 loc) · 1.36 KB
/
Makefile.libhext
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
# Build libhext
VERSION=1.0.12
SHA256=a8145379525d98e9f325114b54406c22a6fc6dfa084c01b04d063889b7c5515f
BASE=${PWD}
all: build/v${VERSION}.tar.gz \
build/hext-${VERSION} \
build-dep/libhext/lib/libhext.a
build/v${VERSION}.tar.gz:
cd build && \
wget https://github.com/html-extract/hext/archive/refs/tags/v${VERSION}.tar.gz
build/hext-${VERSION}:
cd build && \
echo '${SHA256} v${VERSION}.tar.gz' | sha256sum -c && \
tar xf v${VERSION}.tar.gz
# CMAKE_PREFIX_PATH is ignored, unless CMAKE_FIND_ROOT_PATH_MODE_{LIBRARY,INCLUDE,PACKAGE}
# are set to "BOTH". If unset, the emscripten toolchain module sets them to "ONLY", breaking
# CMAKE_PREFIX_PATH.
build-dep/libhext/lib/libhext.a:
cd build/hext-${VERSION}/libhext/build && \
CMAKE_PREFIX_PATH="${BASE}/build-dep/boost:${BASE}/build-dep/gumbo" emcmake cmake \
-DCMAKE_AR=$(shell which emar) \
-DCMAKE_RANLIB=$(shell which emranlib) \
-DCMAKE_MAKE_PROGRAM=$(shell which emmake) \
-DCMAKE_C_COMPILER=$(shell which emcc) \
-DCMAKE_CXX_COMPILER=$(shell which em++) \
-DCMAKE_INSTALL_PREFIX="${BASE}/build-dep/libhext" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
.. && \
emmake make install VERBOSE=1
clean:
rm -rf build-dep/libhext
rm -rf build/v${VERSION}.tar.gz
rm -rf build/hext-${VERSION}