Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. #
  8. # This file is included by the global makefile so that you can add your own
  9. # architecture-specific flags and dependencies. Remember to do have actions
  10. # for "archclean" and "archdep" for cleaning up and making dependencies for
  11. # this architecture
  12. # Core configuration.
  13. # (Use VAR=<xtensa_config> to use another default compiler.)
  14. variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf
  15. variant-$(CONFIG_XTENSA_VARIANT_DC232B) := dc232b
  16. variant-$(CONFIG_XTENSA_VARIANT_S6000) := s6000
  17. variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
  18. VARIANT = $(variant-y)
  19. export VARIANT
  20. # Test for cross compiling
  21. ifneq ($(VARIANT),)
  22. COMPILE_ARCH = $(shell uname -m)
  23. ifneq ($(COMPILE_ARCH), xtensa)
  24. ifndef CROSS_COMPILE
  25. CROSS_COMPILE = xtensa_$(VARIANT)-
  26. endif
  27. endif
  28. endif
  29. # Platform configuration
  30. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  31. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  32. platform-$(CONFIG_XTENSA_PLATFORM_S6105) := s6105
  33. platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
  34. PLATFORM = $(platform-y)
  35. export PLATFORM
  36. # temporarily until string.h is fixed
  37. KBUILD_CFLAGS += -ffreestanding -D__linux__
  38. KBUILD_CFLAGS += -pipe -mlongcalls
  39. KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
  40. ifneq ($(CONFIG_LD_NO_RELAX),)
  41. LDFLAGS := --no-relax
  42. endif
  43. ifeq ($(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1)
  44. CHECKFLAGS += -D__XTENSA_EB__
  45. endif
  46. ifeq ($(shell echo -e __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1)
  47. CHECKFLAGS += -D__XTENSA_EL__
  48. endif
  49. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  50. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  51. ifeq ($(KBUILD_SRC),)
  52. KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  53. else
  54. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  55. endif
  56. KBUILD_DEFCONFIG := iss_defconfig
  57. # Only build variant and/or platform if it includes a Makefile
  58. buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
  59. buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
  60. # Find libgcc.a
  61. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  62. head-y := arch/xtensa/kernel/head.o
  63. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  64. core-y += $(buildvar) $(buildplf)
  65. libs-y += arch/xtensa/lib/ $(LIBGCC)
  66. ifneq ($(CONFIG_BUILTIN_DTB),"")
  67. core-$(CONFIG_OF) += arch/xtensa/boot/
  68. endif
  69. boot := arch/xtensa/boot
  70. all: zImage
  71. bzImage : zImage
  72. zImage: vmlinux
  73. $(Q)$(MAKE) $(build)=$(boot) $@
  74. %.dtb:
  75. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  76. define archhelp
  77. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  78. endef