Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. # Platform configuration
  21. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  22. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  23. PLATFORM = $(platform-y)
  24. export PLATFORM
  25. # temporarily until string.h is fixed
  26. KBUILD_CFLAGS += -ffreestanding
  27. KBUILD_CFLAGS += -pipe -mlongcalls
  28. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  29. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  30. ifeq ($(KBUILD_SRC),)
  31. KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  32. else
  33. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  34. endif
  35. KBUILD_DEFCONFIG := iss_defconfig
  36. # ramdisk/initrd support
  37. # You need a compressed ramdisk image, named ramdisk.gz in
  38. # arch/xtensa/boot/ramdisk
  39. core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
  40. # Test for cross compiling
  41. ifneq ($(VARIANT),)
  42. COMPILE_ARCH = $(shell uname -m)
  43. ifneq ($(COMPILE_ARCH), xtensa)
  44. ifndef CROSS_COMPILE
  45. CROSS_COMPILE = xtensa_$(VARIANT)-
  46. endif
  47. endif
  48. endif
  49. #
  50. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  51. head-y := arch/xtensa/kernel/head.o
  52. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  53. ifneq ($(VARIANT),)
  54. core-y += arch/xtensa/variants/$(VARIANT)/
  55. endif
  56. ifneq ($(PLATFORM),)
  57. core-y += arch/xtensa/platforms/$(PLATFORM)/
  58. endif
  59. libs-y += arch/xtensa/lib/ $(LIBGCC)
  60. boot := arch/xtensa/boot
  61. all: zImage
  62. bzImage : zImage
  63. zImage zImage.initrd: vmlinux
  64. $(Q)$(MAKE) $(build)=$(boot) $@
  65. define archhelp
  66. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  67. endef