Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_LINUX_CUSTOM) := custom
  17. VARIANT = $(variant-y)
  18. export VARIANT
  19. # Platform configuration
  20. platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
  21. platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
  22. PLATFORM = $(platform-y)
  23. export PLATFORM
  24. # temporarily until string.h is fixed
  25. KBUILD_CFLAGS += -ffreestanding
  26. KBUILD_CFLAGS += -pipe -mlongcalls
  27. vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  28. plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  29. ifeq ($(KBUILD_SRC),)
  30. KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  31. else
  32. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  33. endif
  34. KBUILD_DEFCONFIG := iss_defconfig
  35. # ramdisk/initrd support
  36. # You need a compressed ramdisk image, named ramdisk.gz in
  37. # arch/xtensa/boot/ramdisk
  38. core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
  39. # Test for cross compiling
  40. ifneq ($(VARIANT),)
  41. COMPILE_ARCH = $(shell uname -m)
  42. ifneq ($(COMPILE_ARCH), xtensa)
  43. ifndef CROSS_COMPILE
  44. CROSS_COMPILE = xtensa_$(VARIANT)-
  45. endif
  46. endif
  47. endif
  48. #
  49. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  50. head-y := arch/xtensa/kernel/head.o
  51. core-y += arch/xtensa/kernel/ arch/xtensa/mm/
  52. ifneq ($(PLATFORM),)
  53. core-y += arch/xtensa/platforms/$(PLATFORM)/
  54. endif
  55. libs-y += arch/xtensa/lib/ $(LIBGCC)
  56. boot := arch/xtensa/boot
  57. all: zImage
  58. bzImage : zImage
  59. zImage zImage.initrd: vmlinux
  60. $(Q)$(MAKE) $(build)=$(boot) $@
  61. define archhelp
  62. @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  63. endef