patch.in 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. ifneq ($(filter xtensa%,$(ARCH)),)
  2. #############################################################
  3. #
  4. # Xtensa processor architecture (including Diamond Standard cores)
  5. #
  6. #############################################################
  7. # The following defines a function to be used like this:
  8. # $(call XTENSA_PATCH, <module>, <patchdir>, <relative dir list...>)
  9. # which returns the first overlay patch file for <module> found
  10. # in the list of directories <relative dir list...> which are
  11. # relative to <patchdir> (itself either absolute or relative to the
  12. # current directory). The returned filename is relative to <patchdir>.
  13. # For example:
  14. # $(call XTENSA_PATCH, binutils, some/dir/path, . ..)
  15. # (no commas between directory paths in the list).
  16. #
  17. # A selected overlay patch must exist ("fsf" means no specific
  18. # overlay is selected). So the function emits a Makefile error
  19. # if a selected patch file is not found.
  20. XTENSA_CORENAME:=$(call qstrip,$(BR2_xtensa_core_name))
  21. ifeq ($(XTENSA_CORENAME),fsf)
  22. XTENSA_PATCH =
  23. else
  24. XTENSA_PATCH_SUFFIX = $(1)-xtensa_$(XTENSA_CORENAME).tgz
  25. XTENSA_PATCH_FILE = $(firstword $(wildcard $(patsubst %,$(2)/%/*$(XTENSA_PATCH_SUFFIX),$(3))))
  26. # FULLPATH = $(if $(filter /%,$(1)),$(1),$(PWD)/$(1))
  27. XTENSA_PATCH = $(if $(XTENSA_PATCH_FILE),$(patsubst $(2)/%,%,$(XTENSA_PATCH_FILE)),\
  28. $(error Missing $(1) patch for Xtensa $(XTENSA_CORENAME) processor (*$(XTENSA_PATCH_SUFFIX) in $(addprefix $(2)/,$(3)))))
  29. endif
  30. endif