Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 CPU=<xtensa_config> to use another default compiler.)
  14. cpu-$(CONFIG_XTENSA_CPU_LINUX_BE) := linux_be
  15. cpu-$(CONFIG_XTENSA_CPU_LINUX_CUSTOM) := linux_custom
  16. CPU = $(cpu-y)
  17. export CPU
  18. # Platform configuration
  19. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  20. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  21. PLATFORM = $(platform-y)
  22. export PLATFORM
  23. CPPFLAGS += $(if $(KBUILD_SRC),-I$(srctree)/include/asm-xtensa/)
  24. CPPFLAGS += -Iinclude/asm
  25. CFLAGS += -pipe -mlongcalls
  26. KBUILD_DEFCONFIG := iss_defconfig
  27. # ramdisk/initrd support
  28. # You need a compressed ramdisk image, named ramdisk.gz in
  29. # arch/xtensa/boot/ramdisk
  30. core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
  31. # Test for cross compiling
  32. ifneq ($(CPU),)
  33. COMPILE_ARCH = $(shell uname -m)
  34. ifneq ($(COMPILE_ARCH), xtensa)
  35. ifndef CROSS_COMPILE
  36. CROSS_COMPILE = xtensa_$(CPU)-
  37. endif
  38. endif
  39. endif
  40. #
  41. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  42. head-y := arch/xtensa/kernel/head.o
  43. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  44. ifneq ($(PLATFORM),)
  45. core-y += arch/xtensa/platform-$(PLATFORM)/
  46. endif
  47. libs-y += arch/xtensa/lib/ $(LIBGCC)
  48. boot := arch/xtensa/boot
  49. archinc := include/asm-xtensa
  50. arch/xtensa/kernel/asm-offsets.s: \
  51. arch/xtensa/kernel/asm-offsets.c $(archinc)/.platform
  52. include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
  53. $(call filechk,gen-asm-offsets)
  54. prepare: $(archinc)/.platform $(archinc)/offsets.h
  55. # Update machine cpu and platform symlinks if something which affects
  56. # them changed.
  57. $(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER
  58. @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
  59. $(Q)mkdir -p $(archinc)
  60. $(Q)mkdir -p $(archinc)/xtensa
  61. $(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config
  62. @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
  63. $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
  64. @touch $@
  65. all: zImage
  66. bzImage : zImage
  67. zImage zImage.initrd: vmlinux
  68. $(Q)$(MAKE) $(build)=$(boot) $@
  69. CLEAN_FILES += arch/xtensa/vmlinux.lds $(archinc)/offset.h \
  70. $(archinc)/platform $(archinc)/xtensa/config \
  71. $(archinc)/.platform
  72. define archhelp
  73. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  74. endef