Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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-$(CONFIG_XTENSA_PLATFORM_S6105) := s6105
  24. PLATFORM = $(platform-y)
  25. export PLATFORM
  26. # temporarily until string.h is fixed
  27. KBUILD_CFLAGS += -ffreestanding
  28. KBUILD_CFLAGS += -pipe -mlongcalls
  29. KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
  30. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  31. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  32. ifeq ($(KBUILD_SRC),)
  33. KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  34. else
  35. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  36. endif
  37. KBUILD_DEFCONFIG := iss_defconfig
  38. # ramdisk/initrd support
  39. # You need a compressed ramdisk image, named ramdisk.gz in
  40. # arch/xtensa/boot/ramdisk
  41. core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
  42. # Test for cross compiling
  43. ifneq ($(VARIANT),)
  44. COMPILE_ARCH = $(shell uname -m)
  45. ifneq ($(COMPILE_ARCH), xtensa)
  46. ifndef CROSS_COMPILE
  47. CROSS_COMPILE = xtensa_$(VARIANT)-
  48. endif
  49. endif
  50. endif
  51. # Only build variant and/or platform if it includes a Makefile
  52. buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
  53. buildplf := $(shell test -a $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
  54. # Find libgcc.a
  55. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  56. head-y := arch/xtensa/kernel/head.o
  57. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  58. core-y += $(buildvar) $(buildplf)
  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