]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/python3
core140: ship glibc built with new gcc
[ipfire-2.x.git] / lfs / python3
CommitLineData
2b6cce9b
JS
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
eee037b8 4# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
2b6cce9b
JS
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
6ede1975 27VER = 3.8.1
2b6cce9b
JS
28
29THISAPP = Python-$(VER)
30DL_FILE = $(THISAPP).tar.xz
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33TARGET = $(DIR_INFO)/$(THISAPP)
408330e4 34PROG = python3
408330e4
MT
35
36DEPS = ""
2b6cce9b 37
46bbc13b
MT
38# Normal build or $(TOOLS_DIR) build.
39#
40ifeq "$(ROOT)" ""
41 TARGET = $(DIR_INFO)/$(THISAPP)
42 CONFIGURE_ARGS = \
43 --prefix=/usr \
44 --enable-shared \
45 --with-system-expat \
46 --with-system-ffi \
47 --with-ensurepip
48else
49 TARGET = $(DIR_INFO)/$(THISAPP)-tools
50 CONFIGURE_ARGS = \
51 --prefix=$(TOOLS_DIR) \
52 --without-ensurepip
53endif
54
2b6cce9b
JS
55###############################################################################
56# Top-level Rules
57###############################################################################
58
59objects = $(DL_FILE)
60
61$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
62
6ede1975 63$(DL_FILE)_MD5 = b3fb85fd479c0bf950c626ef80cacb57
2b6cce9b
JS
64
65install : $(TARGET)
66
67check : $(patsubst %,$(DIR_CHK)/%,$(objects))
68
69download :$(patsubst %,$(DIR_DL)/%,$(objects))
70
71md5 : $(subst %,%_MD5,$(objects))
72
408330e4
MT
73dist:
74 @$(PAK)
75
2b6cce9b
JS
76###############################################################################
77# Downloading, checking, md5sum
78###############################################################################
79
80$(patsubst %,$(DIR_CHK)/%,$(objects)) :
81 @$(CHECK)
82
83$(patsubst %,$(DIR_DL)/%,$(objects)) :
84 @$(LOAD)
85
86$(subst %,%_MD5,$(objects)) :
87 @$(MD5)
88
89###############################################################################
90# Installation Details
91###############################################################################
92
93$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
94 @$(PREBUILD)
95 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
46bbc13b
MT
96
97ifeq "$(ROOT)" ""
2b6cce9b 98 rm -rf $(DIR_APP)/Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx}
46bbc13b
MT
99else
100 cd $(DIR_APP) && sed -i '/def add_multiarch_paths/a \ return' setup.py
101endif
8f6e4eaf 102
46bbc13b 103 cd $(DIR_APP) && OPT="$(CFLAGS)" ./configure $(CONFIGURE_ARGS)
2b6cce9b
JS
104 cd $(DIR_APP) && make $(MAKETUNING)
105 cd $(DIR_APP) && make install
6ede1975
AF
106
107 # Remove precompiled pycache at toolchain and tests
108ifneq "$(ROOT)" ""
109 cd $(TOOLS_DIR)/lib/python3.8 && find . | grep -E "(/__pycache__|/test/)" | xargs rm -rf
110else
111 cd /usr/lib/python3.8 && find . | grep -E "(/test/)" | xargs rm -rf
112endif
113
2b6cce9b
JS
114 @rm -rf $(DIR_APP)
115 @$(POSTBUILD)