Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_DC233C) := dc233c
  17. variant-$(CONFIG_XTENSA_VARIANT_S6000) := s6000
  18. variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
  19. VARIANT = $(variant-y)
  20. export VARIANT
  21. # Test for cross compiling
  22. ifneq ($(VARIANT),)
  23. COMPILE_ARCH = $(shell uname -m)
  24. ifneq ($(COMPILE_ARCH), xtensa)
  25. ifndef CROSS_COMPILE
  26. CROSS_COMPILE = xtensa_$(VARIANT)-
  27. endif
  28. endif
  29. endif
  30. # Platform configuration
  31. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  32. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  33. platform-$(CONFIG_XTENSA_PLATFORM_S6105) := s6105
  34. platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
  35. PLATFORM = $(platform-y)
  36. export PLATFORM
  37. # temporarily until string.h is fixed
  38. KBUILD_CFLAGS += -ffreestanding -D__linux__
  39. KBUILD_CFLAGS += -pipe -mlongcalls
  40. KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
  41. ifneq ($(CONFIG_LD_NO_RELAX),)
  42. LDFLAGS := --no-relax
  43. endif
  44. ifeq ($(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1)
  45. CHECKFLAGS += -D__XTENSA_EB__
  46. endif
  47. ifeq ($(shell echo -e __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1)
  48. CHECKFLAGS += -D__XTENSA_EL__
  49. endif
  50. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  51. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  52. ifeq ($(KBUILD_SRC),)
  53. KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  54. else
  55. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  56. endif
  57. KBUILD_DEFCONFIG := iss_defconfig
  58. # Only build variant and/or platform if it includes a Makefile
  59. buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
  60. buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
  61. # Find libgcc.a
  62. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  63. head-y := arch/xtensa/kernel/head.o
  64. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  65. core-y += $(buildvar) $(buildplf)
  66. libs-y += arch/xtensa/lib/ $(LIBGCC)
  67. drivers-$(CONFIG_OPROFILE) += arch/xtensa/oprofile/
  68. ifneq ($(CONFIG_BUILTIN_DTB),"")
  69. core-$(CONFIG_OF) += arch/xtensa/boot/dts/
  70. endif
  71. boot := arch/xtensa/boot
  72. all: zImage
  73. bzImage : zImage
  74. zImage: vmlinux
  75. $(Q)$(MAKE) $(build)=$(boot) $@
  76. %.dtb:
  77. $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
  78. define archhelp
  79. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  80. endef