Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. KBUILD_CFLAGS += $(call cc-option,-mno-fdpic,)
  32. ifneq ($(CONFIG_KERNEL_ABI_CALL0),)
  33. KBUILD_CFLAGS += -mabi=call0
  34. KBUILD_AFLAGS += -mabi=call0
  35. endif
  36. KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
  37. KBUILD_AFLAGS += $(call cc-option,-mno-fdpic,)
  38. KBUILD_LDFLAGS += -m elf32xtensa
  39. ifneq ($(CONFIG_LD_NO_RELAX),)
  40. KBUILD_LDFLAGS += --no-relax
  41. endif
  42. CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)
  43. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  44. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  45. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  46. KBUILD_DEFCONFIG := iss_defconfig
  47. libs-y += arch/xtensa/lib/
  48. boot := arch/xtensa/boot
  49. all Image zImage uImage xipImage: vmlinux
  50. $(Q)$(MAKE) $(build)=$(boot) $@
  51. archheaders:
  52. $(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all
  53. define archhelp
  54. @echo '* Image - Kernel ELF image with reset vector'
  55. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  56. @echo '* uImage - U-Boot wrapped image'
  57. @echo ' xipImage - XIP image'
  58. endef