[Python-modules-commits] r3328 - in /packages/pynxt/trunk/debian: control rules
bzed-guest at users.alioth.debian.org
bzed-guest at users.alioth.debian.org
Sun Sep 30 00:52:11 UTC 2007
Author: bzed-guest
Date: Sun Sep 30 00:52:11 2007
New Revision: 3328
URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=3328
Log:
building the toolchain
_ NOT TESTED _
Modified:
packages/pynxt/trunk/debian/control
packages/pynxt/trunk/debian/rules
Modified: packages/pynxt/trunk/debian/control
URL: http://svn.debian.org/wsvn/python-modules/packages/pynxt/trunk/debian/control?rev=3328&op=diff
==============================================================================
--- packages/pynxt/trunk/debian/control (original)
+++ packages/pynxt/trunk/debian/control Sun Sep 30 00:52:11 2007
@@ -3,7 +3,8 @@
Priority: optional
Maintainer: David Anderson <dave at natulte.net>
Uploaders: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>, Bernd Zeimetz <bernd at bzed.de>
-Build-Depends: debhelper (>= 5), python-all, python-support (>= 0.3)
+Build-Depends: debhelper (>= 5), python-all, python-support (>= 0.3),
+ python-pynxt | binutils-source, python-pynxt | gcc-4.2-source
Standards-Version: 3.7.2
XS-Vcs-Svn: svn://svn.debian.org/python-modules/packages/pynxt/trunk/
XS-Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/pynxt/trunk/
Modified: packages/pynxt/trunk/debian/rules
URL: http://svn.debian.org/wsvn/python-modules/packages/pynxt/trunk/debian/rules?rev=3328&op=diff
==============================================================================
--- packages/pynxt/trunk/debian/rules (original)
+++ packages/pynxt/trunk/debian/rules Sun Sep 30 00:52:11 2007
@@ -1,10 +1,68 @@
#!/usr/bin/make -f
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PKGNAME := python-pynxt
PYVERS := $(shell pyversions -r)
+# location of the firmware in the old package, if available
+OLD_FIRMWARE := /usr/share/python-support/python-pynxt/nxt/flash_driver.bin
+
+#we need to build the firmware if we don't have it...
+ifeq "$(wildcard $(OLD_FIRMWARE))" ""
+
+#first find our build dependencies:
+GCC_SOURCE = $(shell dpkg -L gcc-4.2-source | grep "gcc-[0-9.]*-dfsg.tar.bz2")
+GCC_DIR = $(shell tar tfj $(GCC_SOURCE) | head -1)
+
+BINUTILS_SOURCE = $(shell dpkg -L binutils-source | grep "/usr/src/binutils/binutils-.*.tar.bz2")
+BINUTILS_DIR = $(shell tar tfj $(BINUTILS_SOURCE) | head -1)
+
+TOOLCHAIN_DIR=$(CURDIR)/toolchain
+
+flash_driver.bin: build-toolchain
+ export PATH=$(TOOLCHAIN_DIR):$$PATH ;\
+ cd flash_write; $(MAKE)
+
+build-toolchain: build-binutils-stamp build-gcc-stamp
+
+build-binutils-stamp:
+ dh_testdir
+ mkdir -p $(TOOLCHAIN_DIR)
+ tar xfj $(BINUTILS_SOURCE)
+ cd $(BINUTILS_DIR) ;\
+ ./configure --target=arm-elf --prefix=$(TOOLCHAIN_DIR) \
+ --enable-interwork --enable-multilib \
+ --with-float=soft ;\
+ $(MAKE) all install
+ touch $@
+
+build-gcc-stamp:
+ dh_testdir
+ tar xfj $(GCC_SOURCE)
+ cd $(GCC_DIR) ;\
+ export PATH=$(TOOLCHAIN_DIR):$$PATH ;\
+ ./configure --target=arm-elf --prefix=$(TOOLCHAIN_DIR) \
+ --enable-interwork --enable-multilib --with-float=soft \
+ --enable-languages="c" ;\
+ $(MAKE) all-gcc install-gcc
+ touch $@
+
+clean_toolchain:
+ rm -rf $(TOOLCHAIN_DIR) $(GCC_DIR) $(BINUTILS_DIR)
+clean:: clean_toolchain
+
+else
+
+flash_driver.bin: build-toolchain
+ cp $(OLD_FIRMWARE) .
+
+endif
+
build: build-stamp
-build-stamp:
+build-stamp: clean_flash_driver.bin flash_driver.bin
dh_testdir
set -e; \
@@ -14,7 +72,11 @@
touch $@
-clean:
+clean_flash_driver.bin:
+ rm -f flash_driver.bin
+
+
+clean: clean_flash_driver.bin
dh_testdir
dh_testroot
-for py in $(PYVERS); do \
@@ -55,4 +117,4 @@
dh_builddeb
binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+.PHONY: build clean binary-indep binary-arch binary install clean_flash_driver.bin clean_toolchain
More information about the Python-modules-commits
mailing list