summaryrefslogtreecommitdiff
path: root/target/xtensa/patch.in
diff options
context:
space:
mode:
authorMaxim Grigoriev <maxim2405@gmail.com>2009-07-24 02:17:22 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2009-07-24 02:17:22 +0200
commit5ddb904a8620bceddd4df1c05c7342e10592c0c3 (patch)
tree0e01403aa2e63e0f36922cd10bda0cb31f4f6952 /target/xtensa/patch.in
parentcd0b1ce3b7934c631477ad3262316199b73cce89 (diff)
target/; xtensa support
Part of #163. Signed-off-by: Maxim Grigoriev <maxim2405@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'target/xtensa/patch.in')
-rw-r--r--target/xtensa/patch.in33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/xtensa/patch.in b/target/xtensa/patch.in
new file mode 100644
index 000000000..5b723a8b4
--- /dev/null
+++ b/target/xtensa/patch.in
@@ -0,0 +1,33 @@
+ifneq ($(filter xtensa%,$(ARCH)),)
+#############################################################
+#
+# Xtensa processor architecture (including Diamond Standard cores)
+#
+#############################################################
+
+# The following defines a function to be used like this:
+# $(call XTENSA_PATCH, <module>, <patchdir>, <relative dir list...>)
+# which returns the first overlay patch file for <module> found
+# in the list of directories <relative dir list...> which are
+# relative to <patchdir> (itself either absolute or relative to the
+# current directory). The returned filename is relative to <patchdir>.
+# For example:
+# $(call XTENSA_PATCH, binutils, some/dir/path, . ..)
+# (no commas between directory paths in the list).
+#
+# A selected overlay patch must exist ("fsf" means no specific
+# overlay is selected). So the function emits a Makefile error
+# if a selected patch file is not found.
+
+XTENSA_CORENAME:=$(strip $(subst ",,$(BR2_xtensa_core_name)))
+ifeq ($(XTENSA_CORENAME),fsf)
+XTENSA_PATCH =
+else
+XTENSA_PATCH_SUFFIX = $(1)-xtensa_$(XTENSA_CORENAME).tgz
+XTENSA_PATCH_FILE = $(firstword $(wildcard $(patsubst %,$(2)/%/*$(XTENSA_PATCH_SUFFIX),$(3))))
+# FULLPATH = $(if $(filter /%,$(1)),$(1),$(PWD)/$(1))
+XTENSA_PATCH = $(if $(XTENSA_PATCH_FILE),$(patsubst $(2)/%,%,$(XTENSA_PATCH_FILE)),\
+ $(error Missing $(1) patch for Xtensa $(XTENSA_CORENAME) processor (*$(XTENSA_PATCH_SUFFIX) in $(addprefix $(2)/,$(3)))))
+endif
+
+endif