Makefile 2.5 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 VAR=<xtensa_config> to use another default compiler.)
  14. variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf
  15. variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
  16. VARIANT = $(variant-y)
  17. export VARIANT
  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. # temporarily until string.h is fixed
  24. KBUILD_CFLAGS += -ffreestanding
  25. KBUILD_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 ($(VARIANT),)
  33. COMPILE_ARCH = $(shell uname -m)
  34. ifneq ($(COMPILE_ARCH), xtensa)
  35. ifndef CROSS_COMPILE
  36. CROSS_COMPILE = xtensa_$(VARIANT)-
  37. endif
  38. endif
  39. endif
  40. #
  41. LIBGCC := $(shell $(CC) $(KBUILD_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/platforms/$(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 processor variant 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)/variant -> $(archinc)/variant-$(VARIANT)'
  55. $(Q)mkdir -p $(archinc)
  56. $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant
  57. @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
  58. $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
  59. @touch $@
  60. all: zImage
  61. bzImage : zImage
  62. zImage zImage.initrd: vmlinux
  63. $(Q)$(MAKE) $(build)=$(boot) $@
  64. CLEAN_FILES += arch/xtensa/vmlinux.lds \
  65. $(archinc)/platform $(archinc)/variant \
  66. $(archinc)/.platform
  67. define archhelp
  68. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  69. endef