summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
Diffstat (limited to 'rules')
-rw-r--r--rules/image-toolchain-deb.in3
-rw-r--r--rules/image-toolchain-deb.make42
-rw-r--r--rules/image-toolchain-tgz.in3
-rw-r--r--rules/image-toolchain-tgz.make36
-rw-r--r--rules/post/cleanup.make16
5 files changed, 100 insertions, 0 deletions
diff --git a/rules/image-toolchain-deb.in b/rules/image-toolchain-deb.in
new file mode 100644
index 0000000..27bf883
--- /dev/null
+++ b/rules/image-toolchain-deb.in
@@ -0,0 +1,3 @@
+config IMAGE_TOOLCHAIN_DEB
+ bool
+ default y
diff --git a/rules/image-toolchain-deb.make b/rules/image-toolchain-deb.make
new file mode 100644
index 0000000..aae6146
--- /dev/null
+++ b/rules/image-toolchain-deb.make
@@ -0,0 +1,42 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# 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
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_TOOLCHAIN_DEB) += image-toolchain-deb
+
+#
+# Paths and names
+#
+IMAGE_TOOLCHAIN_DEB_VERSION := $(shell ./scripts/setlocalversion ./.tarball-version)
+IMAGE_TOOLCHAIN_DEB_ARCH := $(shell uname -m)
+ifeq ($(IMAGE_TOOLCHAIN_DEB_ARCH),x86_64)
+IMAGE_TOOLCHAIN_DEB_ARCH := amd64
+endif
+ifeq ($(patsubst i%86,,$(IMAGE_TOOLCHAIN_DEB_ARCH)),)
+IMAGE_TOOLCHAIN_DEB_ARCH := i386
+endif
+ifeq ($(IMAGE_TOOLCHAIN_DEB_ARCH),ppc)
+IMAGE_TOOLCHAIN_DEB_ARCH := powerpc
+endif
+IMAGE_TOOLCHAIN_DEB_IMAGE := $(PTXDIST_WORKSPACE)/dist/oselas.toolchain-$(IMAGE_TOOLCHAIN_DEB_VERSION)-$(subst _,-,$(PTXCONF_PLATFORM))_$(IMAGE_TOOLCHAIN_DEB_VERSION)_$(IMAGE_TOOLCHAIN_DEB_ARCH).deb
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+$(IMAGE_TOOLCHAIN_DEB_IMAGE): $(STATEDIR)/world.cleanup
+ @$(call targetinfo)
+ @mkdir -p $(dir $@)
+ @scripts/make_deb.sh -d "$(@)" -s "$(PTXCONF_SYSROOT_CROSS)"
+ @$(call finish)
+
+# vim: syntax=make
diff --git a/rules/image-toolchain-tgz.in b/rules/image-toolchain-tgz.in
new file mode 100644
index 0000000..3790f86
--- /dev/null
+++ b/rules/image-toolchain-tgz.in
@@ -0,0 +1,3 @@
+config IMAGE_TOOLCHAIN_TGZ
+ bool
+ default y
diff --git a/rules/image-toolchain-tgz.make b/rules/image-toolchain-tgz.make
new file mode 100644
index 0000000..a80c808
--- /dev/null
+++ b/rules/image-toolchain-tgz.make
@@ -0,0 +1,36 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2014 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# 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
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_TOOLCHAIN_TGZ) += image-toolchain-tgz
+
+#
+# Paths and names
+#
+IMAGE_TOOLCHAIN_TGZ_VERSION := $(shell ./scripts/setlocalversion ./.tarball-version)
+IMAGE_TOOLCHAIN_TGZ_IMAGE := $(PTXDIST_WORKSPACE)/dist/oselas.toolchain-$(IMAGE_TOOLCHAIN_TGZ_VERSION)-$(subst _,-,$(PTXCONF_PLATFORM)).tar.xz
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+$(IMAGE_TOOLCHAIN_TGZ_IMAGE): $(STATEDIR)/world.cleanup
+ @$(call targetinfo)
+ @mkdir -p $(dir $@)
+ @echo 'tar -C "$(PTX_AUTOBUILD_DESTDIR)$(PTXCONF_PREFIX)" \
+ --exclude=gcc-first \
+ -cJf "$(@)" \
+ "${PTXCONF_PROJECT}/$(PTXCONF_GNU_TARGET)/$(PTXCONF_PREFIX_TCID)"' \
+ | fakeroot
+ @$(call finish)
+
+# vim: syntax=make
diff --git a/rules/post/cleanup.make b/rules/post/cleanup.make
new file mode 100644
index 0000000..55abf33
--- /dev/null
+++ b/rules/post/cleanup.make
@@ -0,0 +1,16 @@
+
+$(STATEDIR)/world.cleanup: $(STATEDIR)/world.targetinstall
+ @$(call targetinfo)
+ @find "$(PTXCONF_SYSROOT_CROSS)" -depth -type d -print0 | \
+ xargs -r -0 -- rmdir -v --ignore-fail-on-non-empty --
+ find \
+ "$(PTXCONF_SYSROOT_CROSS)/libexec/" \
+ "$(PTXCONF_SYSROOT_CROSS)/bin/" \
+ "$(PTXCONF_SYSROOT_CROSS)/"*/bin/ \
+ -type f \( -executable -o -name "*.so*" \) \
+ | xargs -n1 --verbose strip || true
+ @$(call touch)
+
+world: $(STATEDIR)/world.cleanup
+
+# vim: syntax=make