Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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-y := common
  20. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  21. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  22. PLATFORM = $(platform-y)
  23. export PLATFORM
  24. #LDFLAGS_vmlinux := -T$(word 1,$(LINKSCRIPT))
  25. AFLAGS_vmlinux.lds.o := -Uxtensa
  26. CPPFLAGS += -Iarch/xtensa -Iinclude/asm -mlongcalls -g
  27. AFLAGS += -Iarch/xtensa -Iinclude/asm
  28. CPP = $(CC) -E $(CFLAGS)
  29. cflags-y += -Iarch/xtensa -pipe -mlongcalls
  30. KBUILD_DEFCONFIG := common_defconfig
  31. # ramdisk/initrd support
  32. # You need a compressed ramdisk image, named ramdisk.gz in
  33. # arch/xtensa/boot/ramdisk
  34. core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
  35. # Test for cross compiling
  36. ifneq ($(CPU),)
  37. COMPILE_ARCH = $(shell uname -m)
  38. ifneq ($(COMPILE_ARCH), xtensa)
  39. ifndef CROSS_COMPILE
  40. CROSS_COMPILE = xtensa_$(CPU)-
  41. endif
  42. endif
  43. endif
  44. #
  45. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  46. head-y := arch/xtensa/kernel/head.o
  47. core-y += arch/xtensa/kernel/ \
  48. arch/xtensa/mm/ arch/xtensa/platform-$(PLATFORM)/
  49. libs-y += arch/xtensa/lib/ $(LIBGCC)
  50. boot := arch/xtensa/boot
  51. arch/xtensa/kernel/asm-offsets.s: \
  52. arch/xtensa/kernel/asm-offsets.c \
  53. include/asm-xtensa/.platform
  54. include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
  55. $(call filechk,gen-asm-offsets)
  56. prepare: include/asm-xtensa/.platform include/asm-xtensa/offsets.h
  57. # Update machine cpu and platform symlinks if something which affects
  58. # them changed.
  59. include/asm-xtensa/.platform: $(wildcard include/config/arch/*.h)
  60. @echo ' Setting up cpu ($(CPU)) and platform ($(PLATFORM)) symlinks'
  61. $(Q)rm -f include/asm-xtensa/platform
  62. $(Q)rm -f include/asm-xtensa/xtensa/config
  63. $(Q)(cd include/asm-xtensa/; ln -sf platform-$(PLATFORM) platform)
  64. $(Q)(cd include/asm-xtensa/xtensa; ln -sf config-$(CPU) config)
  65. all: zImage
  66. bzImage : zImage
  67. zImage zImage.initrd: vmlinux
  68. $(Q)$(MAKE) $(build)=$(boot) $@
  69. CLEAN_FILES += arch/xtensa/vmlinux.lds include/asm-xtensa/offset.h
  70. define archhelp
  71. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  72. endef