You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

6 years ago
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
.PHONY: all clean
all: $(bin)
clean:
rm -rf build/$(arch)