]>
Commit | Line | Data |
---|---|---|
2b6cce9b JS |
1 | ############################################################################### |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
2ab91657 | 4 | # Copyright (C) 2007-2020 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 | ||
25 | include Config | |
26 | ||
e2cc8e4e | 27 | VER = 3.8.7 |
2b6cce9b JS |
28 | |
29 | THISAPP = Python-$(VER) | |
30 | DL_FILE = $(THISAPP).tar.xz | |
31 | DL_FROM = $(URL_IPFIRE) | |
32 | DIR_APP = $(DIR_SRC)/$(THISAPP) | |
33 | TARGET = $(DIR_INFO)/$(THISAPP) | |
408330e4 | 34 | PROG = python3 |
408330e4 | 35 | |
2dc2a278 | 36 | DEPS = |
2b6cce9b | 37 | |
46bbc13b MT |
38 | # Normal build or $(TOOLS_DIR) build. |
39 | # | |
40 | ifeq "$(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 | |
48 | else | |
49 | TARGET = $(DIR_INFO)/$(THISAPP)-tools | |
50 | CONFIGURE_ARGS = \ | |
51 | --prefix=$(TOOLS_DIR) \ | |
52 | --without-ensurepip | |
53 | endif | |
54 | ||
2b6cce9b JS |
55 | ############################################################################### |
56 | # Top-level Rules | |
57 | ############################################################################### | |
58 | ||
59 | objects = $(DL_FILE) | |
60 | ||
61 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
62 | ||
e2cc8e4e | 63 | $(DL_FILE)_MD5 = 60fe018fffc7f33818e6c340d29e2db9 |
2b6cce9b JS |
64 | |
65 | install : $(TARGET) | |
66 | ||
67 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
68 | ||
69 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
70 | ||
71 | md5 : $(subst %,%_MD5,$(objects)) | |
72 | ||
408330e4 MT |
73 | dist: |
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 | |
97 | ifeq "$(ROOT)" "" | |
2b6cce9b | 98 | rm -rf $(DIR_APP)/Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx} |
46bbc13b MT |
99 | else |
100 | cd $(DIR_APP) && sed -i '/def add_multiarch_paths/a \ return' setup.py | |
101 | endif | |
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 | |
108 | ifneq "$(ROOT)" "" | |
109 | cd $(TOOLS_DIR)/lib/python3.8 && find . | grep -E "(/__pycache__|/test/)" | xargs rm -rf | |
110 | else | |
111 | cd /usr/lib/python3.8 && find . | grep -E "(/test/)" | xargs rm -rf | |
112 | endif | |
113 | ||
2b6cce9b JS |
114 | @rm -rf $(DIR_APP) |
115 | @$(POSTBUILD) |