Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. # Test for cross compiling
  21. ifneq ($(VARIANT),)
  22. COMPILE_ARCH = $(shell uname -m)
  23. ifneq ($(COMPILE_ARCH), xtensa)
  24. ifndef CROSS_COMPILE
  25. CROSS_COMPILE = xtensa_$(VARIANT)-
  26. endif
  27. endif
  28. endif
  29. # Platform configuration
  30. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  31. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  32. platform-$(CONFIG_XTENSA_PLATFORM_S6105) := s6105
  33. PLATFORM = $(platform-y)
  34. export PLATFORM
  35. # temporarily until string.h is fixed
  36. KBUILD_CFLAGS += -ffreestanding -D__linux__
  37. KBUILD_CFLAGS += -pipe -mlongcalls
  38. KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
  39. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  40. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  41. ifeq ($(KBUILD_SRC),)
  42. KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  43. else
  44. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  45. endif
  46. KBUILD_DEFCONFIG := iss_defconfig
  47. # Only build variant and/or platform if it includes a Makefile
  48. buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
  49. buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
  50. # Find libgcc.a
  51. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  52. head-y := arch/xtensa/kernel/head.o
  53. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  54. core-y += $(buildvar) $(buildplf)
  55. libs-y += arch/xtensa/lib/ $(LIBGCC)
  56. boot := arch/xtensa/boot
  57. all: zImage
  58. bzImage : zImage
  59. zImage: vmlinux
  60. $(Q)$(MAKE) $(build)=$(boot) $@
  61. define archhelp
  62. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  63. endef