Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. archprepare: $(archinc)/.platform
  51. # Update machine cpu and platform symlinks if something which affects
  52. # them changed.
  53. $(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf
  54. @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
  55. $(Q)mkdir -p $(archinc)
  56. $(Q)mkdir -p $(archinc)/xtensa
  57. $(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config
  58. @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
  59. $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
  60. @touch $@
  61. all: zImage
  62. bzImage : zImage
  63. zImage zImage.initrd: vmlinux
  64. $(Q)$(MAKE) $(build)=$(boot) $@
  65. CLEAN_FILES += arch/xtensa/vmlinux.lds \
  66. $(archinc)/platform $(archinc)/xtensa/config \
  67. $(archinc)/.platform
  68. define archhelp
  69. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  70. endef