master^2
Harry Cheng 5 years ago
parent bbcee244e8
commit b055c8df62

@ -28,7 +28,7 @@ cmake_build_args += -DCMAKE_BUILD_TYPE=Release
endif
.PHONY: all clean build rust ucore biscuit bin busybox nginx redis alpine iperf3
.PHONY: all clean build rust ucore biscuit bin busybox nginx redis alpine iperf3 python
all: build
@ -82,6 +82,14 @@ ifneq ($(shell uname), Darwin)
@cp nginx/nginx.conf $(out_dir)/usr/local/nginx/conf
endif
python:
ifneq ($(shell uname), Darwin)
@echo Building Python
@mkdir -p $(out_dir)
@cd python && make arch=$(arch) all
@cp -r python/build/$(arch)/target $(out_dir)/python
endif
redis:
ifneq ($(shell uname), Darwin)
@echo Building redis
@ -120,7 +128,7 @@ ifeq ($(arch), $(filter $(arch), x86_64 aarch64))
@cp -r testsuits_alpine $(out_dir)/test
endif
build: rust ucore biscuit $(busybox) nginx redis iperf3 test
build: rust ucore biscuit $(busybox) nginx redis iperf3 python test
sfsimg: $(out_qcow2)

@ -0,0 +1,55 @@
python_version := 3.7.0
python_tarball := Python-$(python_version).tar.xz
python_tarball_path := src/$(python_tarball)
build_dir := build/$(arch)
python_dir := $(build_dir)/Python-$(python_version)
prefix := $(arch)-linux-musl-
prefix_dir := build/$(arch)/target
bin_unstripped := $(prefix_dir)/bin/python3.7_unstripped
bin := $(prefix_dir)/bin/python3.7
ifeq ($(arch), mipsel)
prefix := mipsel-linux-musln32-
endif
cc := $(prefix)gcc
strip := $(prefix)strip
$(python_tarball_path):
wget https://www.python.org/ftp/python/$(python_version)/$(python_tarball) -O $(python_tarball_path)
$(python_dir): $(python_tarball_path)
mkdir -p $(build_dir)
cd $(build_dir) && tar xvf ../../$(python_tarball_path)
$(bin): $(python_dir)
cd $(python_dir) && ./configure \
CC=$(cc) \
--host=$(arch)-linux-musl \
--target=$(arch)-linux-musl \
--build=x86_64-linux-gnu \
--disable-ipv6 \
--without-ensurepip \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_have_long_long_format=yes \
--prefix=`realpath ../target`
cd $(python_dir) && make -j8 build_all
mkdir -p $(prefix_dir)
cd $(python_dir) && make -j8 altinstall
# $(bin_unstripped): $(prefix_dir)/bin/python3.7
# cp $(bin) $(bin_unstripped)
# $(bin): $(bin_unstripped)
# cp $(bin_unstripped) $(bin)
# $(strip) $(bin)
.PHONY: all clean
all: $(bin)
clean:
rm -rf build/$(arch)

@ -0,0 +1 @@
*.tar.xz
Loading…
Cancel
Save