forked from qno/rack-plugin-toolchain-ctng-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (75 loc) · 1.88 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Installation path for executables
LOCAL_DIR := $(PWD)/local
# Local programs should have higher path priority than system-installed programs
export PATH := $(LOCAL_DIR)/bin:$(PATH)
# Allow specifying the number of jobs for toolchain build for systems that need it.
# Due to different build systems used in the toolchain build, just `make -j` won't work here.
# Note: Plugin build uses `$(MAKE)` to inherit `-j` argument from command line.
ifdef JOBS
export JOBS := $(JOBS)
# Define number of jobs for crosstool-ng (uses different argument format)
export JOBS_CT_NG := .$(JOBS)
else
# If `JOBS` is not specified, default to max number of jobs.
export JOBS :=
export JOBS_CT_NG :=
endif
WGET := wget --continue
UNTAR := tar -x -f
UNZIP := unzip
# Toolchain build
crosstool-ng := $(LOCAL_DIR)/bin/ct-ng
$(crosstool-ng):
git clone https://github.com/crosstool-ng/crosstool-ng.git
cd crosstool-ng && git checkout 4dc87d49b02fa6bf1698deeb1fabb4106662dca9
cd crosstool-ng && ./bootstrap
cd crosstool-ng && ./configure --prefix="$(LOCAL_DIR)"
cd crosstool-ng && make -j $(JOBS)
cd crosstool-ng && make install -j $(JOBS)
rm -rf crosstool-ng
toolchain-win := $(LOCAL_DIR)/x86_64-w64-mingw32
toolchain-win: $(toolchain-win)
$(toolchain-win): $(crosstool-ng)
ct-ng x86_64-w64-mingw32
CT_PREFIX="$(LOCAL_DIR)" ct-ng build$(JOBS_CT_NG)
rm -rf .build .config build.log /home/build/src
# Docker helpers
dep-ubuntu:
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
git \
build-essential \
autoconf \
automake \
bison \
flex \
gawk \
libtool-bin \
libncurses5-dev \
unzip \
zip \
jq \
libgl-dev \
libglu-dev \
git \
wget \
curl \
cmake \
nasm \
xz-utils \
file \
python3 \
libxml2-dev \
libssl-dev \
texinfo \
help2man \
libz-dev \
rsync \
xxd \
perl \
coreutils \
zstd \
markdown \
libarchive-tools
.NOTPARALLEL: