2 # http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
3 # http://github.com/cobbal/python-for-iphone
5 include ../Makefile.include
10 SOURCE=$(LIBNAME)-$(VERSION)
11 ARCHIVE=$(SOURCE).tar.bz2
13 # configuration settings
14 CONFIGURE=./configure --prefix=$(PREFIX) --enable-shared \
15 --disable-toolbox-glue
17 CONFIGURE_NATIVE= CFLAGS="" CXXFLAGS="" LDFLAGS="" CPPFLAGS="" \
24 LIBDYLIB=$(SOURCE)/libpython2.6.dylib
26 all: $(LIBDYLIB) .installed
28 $(TARBALLS_LOCATION)/$(ARCHIVE):
29 $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
31 $(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
33 $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
34 echo $(SOURCE) > .gitignore
35 # http://bugs.python.org/issue6869
36 cd $(SOURCE); patch -p1 < ../Python-2.6-ctypes.patch
37 cd $(SOURCE); $(CONFIGURE_NATIVE)
38 cd $(SOURCE); make python.exe Parser/pgen
39 cd $(SOURCE); mv python.exe hostpython
40 cd $(SOURCE); mv Parser/pgen Parser/hostpgen
41 cd $(SOURCE); mv libpython2.6.a hostlibpython2.6.a
42 cd $(SOURCE); make distclean
43 cd $(SOURCE); patch -p1 <../Python-2.6.5-xcompile.patch
44 cd $(SOURCE); $(CONFIGURE)
45 cd $(SOURCE); make -j $(MAKE_JOBS) HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE_TARGET=yes
48 cd $(SOURCE); make install HOSTPYTHON=./hostpython CROSS_COMPILE_TARGET=yes
49 find $(PREFIX)/lib/python2.6 -type f -name *.pyc -exec rm -f {} \;
50 find $(PREFIX)/lib/python2.6 -type f -name *.pyo -exec rm -f {} \;
54 rm -rf $(SOURCE) .installed
57 rm -rf $(SOURCE) .installed