diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2003-09-08 23:43:19 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2003-09-08 23:43:19 +0000 |
commit | b3964a3a4ca3ea25a4acea1c384ee717b8e157df (patch) | |
tree | f82b5f08c0c624cd4b25f99560b90cdc7ad9ef6f /rules/python.make | |
parent | 6d0a92e9246ebfc93d3a0c363d976e8468dc2f11 (diff) | |
download | ptxdist-b3964a3a4ca3ea25a4acea1c384ee717b8e157df.tar.gz ptxdist-b3964a3a4ca3ea25a4acea1c384ee717b8e157df.tar.xz |
* initial add
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunk@278 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'rules/python.make')
-rw-r--r-- | rules/python.make | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/rules/python.make b/rules/python.make new file mode 100644 index 000000000..0837d1435 --- /dev/null +++ b/rules/python.make @@ -0,0 +1,151 @@ +# -*-makefile-*- +# $Id: python.make,v 1.1 2003/09/08 23:43:19 mkl Exp $ +# +# (c) 2003 by David R Bacon +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXDIST project and license conditions +# see the README file. +# + +# +# We provide this package +# +ifdef PTXCONF_VHLL_PYTHON23 +PACKAGES += python +endif + +# +# Paths and names +# + +PYTHON_VERSION = 2.3 +PYTHON = Python-$(PYTHON_VERSION) +PYTHON_SUFFIX = tgz +PYTHON_URL = http://www.python.org/ftp/python/$(PYTHON_VERSION)/$(PYTHON).$(PYTHON_SUFFIX) +PYTHON_SOURCE = $(SRCDIR)/$(PYTHON).$(PYTHON_SUFFIX) +PYTHON_DIR = $(BUILDDIR)/$(PYTHON) +PYTHON_BUILDDIR = $(PYTHON_DIR)-build + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +python_get: $(STATEDIR)/python.get + +python_get_deps = \ + $(PYTHON_SOURCE) + +$(STATEDIR)/python.get: $(python_get_deps) + @$(call targetinfo, python.get) + touch $@ + +$(PYTHON_SOURCE): + @$(call targetinfo, $(PYTHON_SOURCE)) + @$(call get,$(PYTHON_URL)) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +python_extract: $(STATEDIR)/python.extract + +python_extract_deps = \ + $(STATEDIR)/python.get + +$(STATEDIR)/python.extract: $(python_extract_deps) + @$(call targetinfo, python.extract) + @$(call call, $(PYTHON_DIR)) + @$(call extract, $(PYTHON_SOURCE)) + @$(call patchin, $(PYTHON_DIR), $(PYTHON)) + touch $@ + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +python_prepare: $(STATEDIR)/python.prepare + +# +# dependencies +# +python_prepare_deps = \ + $(STATEDIR)/virtual-xchain.install \ + $(STATEDIR)/python.extract + +PYTHON_PATH = PATH=$(CROSS_PATH) +PYTHON_ENV = $(CROSS_ENV) + +PYTHON_AUTOCONF = --prefix=/usr +PYTHON_AUTOCONF += --build=$(GNU_HOST) +PYTHON_AUTOCONF += --host=$(PTXCONF_GNU_TARGET) +PYTHON_AUTOCONF += --target=$(PTXCONF_GNU_TARGET) + +PYTHON_MAKEVARS = HOSTPYTHON=$(XCHAIN_PYTHON_BUILDDIR)/python +PYTHON_MAKEVARS += HOSTPGEN=$(XCHAIN_PYTHON_BUILDDIR)/Parser/pgen +PYTHON_MAKEVARS += CROSS_COMPILE=yes + +$(STATEDIR)/python.prepare: $(python_prepare_deps) + @$(call targetinfo, python.prepare) + @$(call clean, $(PYTHON_BUILDDIR)) + mkdir -p $(PYTHON_BUILDDIR) + cd $(PYTHON_BUILDDIR) && \ + $(PYTHON_PATH) $(PYTHON_ENV) \ + $(PYTHON_DIR)/configure $(PYTHON_AUTOCONF) + touch $@ + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +python_compile: $(STATEDIR)/python.compile + +python_compile_deps = \ + $(STATEDIR)/xchain-python.compile \ + $(STATEDIR)/python.prepare + +$(STATEDIR)/python.compile: $(python_compile_deps) + @$(call targetinfo, python.compile) + $(PYTHON_PATH) make -C $(PYTHON_BUILDDIR) $(PYTHON_MAKEVARS) + touch $@ + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +python_install: $(STATEDIR)/python.install + +$(STATEDIR)/python.install: + @$(call targetinfo, python.install) + touch $@ + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +python_targetinstall: $(STATEDIR)/python.targetinstall + +$(STATEDIR)/python.targetinstall: $(STATEDIR)/python.compile + @$(call targetinfo, python.targetinstall) + + umask 022 && \ + $(PYTHON_PATH) make -C $(PYTHON_BUILDDIR) $(PYTHON_MAKEVARS) \ + libinstall DESTDIR=$(ROOTDIR) + + $(PYTHON_PATH) make -C $(PYTHON_BUILDDIR) $(PYTHON_MAKEVARS) \ + bininstall DESTDIR=$(ROOTDIR) + + $(CROSSSTRIP) -R .notes -R .comment $(ROOTDIR)/usr/bin/python2.3 + + touch $@ + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +python_clean: + rm -rf $(STATEDIR)/python.* + rm -fr $(PYTHON_DIR) + rm -fr $(PYTHON_BUILDDIR) + +# vim: syntax=make
\ No newline at end of file |