Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #
  2. # This file is subject to the terms and conditions of the GNU General Public
  3. # License. See the file "COPYING" in the main directory of this archive
  4. # for more details.
  5. #
  6. # Copyright (C) 2001 - 2005 Tensilica Inc.
  7. # Copyright (C) 2014 Cadence Design Systems Inc.
  8. #
  9. # This file is included by the global makefile so that you can add your own
  10. # architecture-specific flags and dependencies.
  11. # Core configuration.
  12. # (Use VAR=<xtensa_config> to use another default compiler.)
  13. variant-y := $(CONFIG_XTENSA_VARIANT_NAME)
  14. VARIANT = $(variant-y)
  15. ifneq ($(VARIANT),)
  16. ifdef cross_compiling
  17. ifndef CROSS_COMPILE
  18. CROSS_COMPILE = xtensa_$(VARIANT)-
  19. endif
  20. endif
  21. endif
  22. # Platform configuration
  23. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  24. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  25. platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
  26. # temporarily until string.h is fixed
  27. KBUILD_CFLAGS += -ffreestanding -D__linux__
  28. KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
  29. KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
  30. KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
  31. ifneq ($(CONFIG_KERNEL_ABI_CALL0),)
  32. KBUILD_CFLAGS += -mabi=call0
  33. KBUILD_AFLAGS += -mabi=call0
  34. endif
  35. KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
  36. ifneq ($(CONFIG_LD_NO_RELAX),)
  37. KBUILD_LDFLAGS := --no-relax
  38. endif
  39. CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)
  40. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  41. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  42. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  43. KBUILD_DEFCONFIG := iss_defconfig
  44. libs-y += arch/xtensa/lib/
  45. boot := arch/xtensa/boot
  46. all Image zImage uImage xipImage: vmlinux
  47. $(Q)$(MAKE) $(build)=$(boot) $@
  48. archheaders:
  49. $(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all
  50. define archhelp
  51. @echo '* Image - Kernel ELF image with reset vector'
  52. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  53. @echo '* uImage - U-Boot wrapped image'
  54. @echo ' xipImage - XIP image'
  55. endef