forked from rwl/llvm-j
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.libraries
49 lines (38 loc) · 1.53 KB
/
Makefile.libraries
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
LLVM_VERSION ?= 10
UBUNTU_VERSION ?= bionic
BUILD_DIR=build-lib
TARGET=lib/native
_LLVM_PACKAGES := Packages.gz
${TARGET}/libLLVM-$(LLVM_VERSION).so: ${TARGET}/libbsd.so.0 ${TARGET}/libedit.so.2 ${TARGET}/libtinfo.so.5 ${TARGET}/libffi.so.6
build/download_lib.sh ${LLVM_VERSION} ${UBUNTU_VERSION}
mv $(@F) ${TARGET}/
clean:
rm -rf ${BUILD_DIR}
rm -f ${TARGET}/libLLVM-$(LLVM_VERSION).so
rm -f ${TARGET}/libbsd.so.0
rm -f ${TARGET}/libedit.so.2
rm -f ${TARGET}/libtinfo.so.5
rm -f ${TARGET}/libffi.so.6
${TARGET}/libbsd.so.0: ${BUILD_DIR}/libbsd0.deb
${TARGET}/libedit.so.2: ${BUILD_DIR}/libedit2.deb
${TARGET}/libtinfo.so.5: ${BUILD_DIR}/libtinfo5.deb
${TARGET}/libffi.so.6: ${BUILD_DIR}/libffi6.deb
${TARGET}/%:
mkdir -p ${BUILD_DIR}
cd $(BUILD_DIR) && \
ar x $(<F) data.tar.xz && \
tar xf data.tar.xz --wildcards '*$(@F)*' --transform='s/.*\///'
patchelf --set-rpath '$$ORIGIN' ${BUILD_DIR}/$(@F)
cp -L ${BUILD_DIR}/$(@F) ${TARGET}
${BUILD_DIR}/libbsd0.deb:
mkdir -p ${BUILD_DIR}
wget "http://archive.ubuntu.com/ubuntu/pool/main/libb/libbsd/libbsd0_0.8.7-1ubuntu0.1_amd64.deb" -O $@
${BUILD_DIR}/libedit2.deb:
mkdir -p ${BUILD_DIR}
wget "http://archive.ubuntu.com/ubuntu/pool/main/libe/libedit/libedit2_3.1-20170329-1_amd64.deb" -O $@
${BUILD_DIR}/libtinfo5.deb:
mkdir -p ${BUILD_DIR}
wget "http://archive.ubuntu.com/ubuntu/pool/main/n/ncurses/libtinfo5_6.1-1ubuntu1.18.04_amd64.deb" -O $@
${BUILD_DIR}/libffi6.deb:
mkdir -p ${BUILD_DIR}
wget "http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb" -O $@