1 #############################################################
5 #############################################################
7 PYTHON_SOURCE
:=Python-
$(PYTHON_VERSION
).
tar.bz2
8 PYTHON_SITE
:=http
://python.org
/ftp
/python
/$(PYTHON_VERSION
)
9 PYTHON_DIR
:=$(BUILD_DIR
)/Python-
$(PYTHON_VERSION
)
12 PYTHON_TARGET_BINARY
:=usr
/bin
/python
14 $(DL_DIR
)/$(PYTHON_SOURCE
):
15 $(WGET
) -P
$(DL_DIR
) $(PYTHON_SITE
)/$(PYTHON_SOURCE
)
17 python-source
: $(DL_DIR
)/$(PYTHON_SOURCE
)
19 $(PYTHON_DIR
)/.unpacked
: $(DL_DIR
)/$(PYTHON_SOURCE
)
20 $(PYTHON_CAT
) $(DL_DIR
)/$(PYTHON_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
21 touch
$(PYTHON_DIR
)/.unpacked
23 $(PYTHON_DIR
)/.patched
: $(PYTHON_DIR
)/.unpacked
24 toolchain
/patch-kernel.sh
$(PYTHON_DIR
) package
/python
/ python\
*.patch
25 touch
$(PYTHON_DIR
)/.patched
27 $(PYTHON_DIR
)/.hostpython
: $(PYTHON_DIR
)/.patched
28 (cd
$(PYTHON_DIR
); rm -rf config.cache
; \
33 make python Parser
/pygen
; \
34 mv python hostpython
; \
35 mv Parser
/pgen Parser
/hostpgen
; \
38 touch
$(PYTHON_DIR
)/.hostpython
40 $(PYTHON_DIR
)/.configured
: $(PYTHON_DIR
)/.hostpython
41 (cd
$(PYTHON_DIR
); rm -rf config.cache
; \
42 $(TARGET_CONFIGURE_OPTS
) \
43 OPT
="$(TARGET_OPTIMIZATION)" \
45 --target
=$(GNU_TARGET_NAME
) \
46 --host
=$(GNU_TARGET_NAME
) \
47 --build
=$(GNU_HOST_NAME
) \
53 touch
$(PYTHON_DIR
)/.configured
55 $(PYTHON_DIR
)/$(PYTHON_BINARY
): $(PYTHON_DIR
)/.configured
56 export PYTHON_DISABLE_SSL
=1
57 $(MAKE
) CC
=$(TARGET_CC
) -C
$(PYTHON_DIR
) DESTDIR
=$(TARGET_DIR
) \
58 PYTHON_DISABLE_MODULES
="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
59 HOSTPYTHON
=.
/hostpython HOSTPGEN
=.
/Parser
/hostpgen
61 $(TARGET_DIR
)/$(PYTHON_TARGET_BINARY
): $(PYTHON_DIR
)/$(PYTHON_BINARY
)
62 export PYTHON_DISABLE_SSL
=1
63 LD_LIBRARY_PATH
=$(STAGING_DIR
)/lib
64 $(MAKE
) CC
=$(TARGET_CC
) -C
$(PYTHON_DIR
) install \
65 DESTDIR
=$(TARGET_DIR
) CROSS_COMPILE
=yes \
66 PYTHON_DISABLE_MODULES
="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" \
67 HOSTPYTHON
=.
/hostpython HOSTPGEN
=.
/Parser
/hostpgen
68 rm $(TARGET_DIR
)/usr
/bin
/python?.?
69 rm $(TARGET_DIR
)/usr
/bin
/idle
70 rm $(TARGET_DIR
)/usr
/bin
/pydoc
71 find
$(TARGET_DIR
)/usr
/lib
/ -name
'*.pyc' -o
-name
'*.pyo' -exec
rm {} \
;
72 rm -rf
$(TARGET_DIR
)/share
/locale
$(TARGET_DIR
)/usr
/info \
73 $(TARGET_DIR
)/usr
/man
$(TARGET_DIR
)/usr
/share
/doc \
74 $(TARGET_DIR
)/usr
/lib
/python
*/test
76 python
: uclibc
$(TARGET_DIR
)/$(PYTHON_TARGET_BINARY
)
79 -$(MAKE
) -C
$(PYTHON_DIR
) distclean
80 rm $(PYTHON_DIR
)/.configured
84 #############################################################
86 # Toplevel Makefile options
88 #############################################################
89 ifeq ($(strip $(BR2_PACKAGE_PYTHON
)),y
)