Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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) 2000, 2001 Paolo Alberelli
  7. # Copyright (C) 2003, 2004 Paul Mundt
  8. #
  9. # This file is included by the global makefile so that you can add your own
  10. # architecture-specific flags and dependencies. Remember to do have actions
  11. # for "archclean" and "archdep" for cleaning up and making dependencies for
  12. # this architecture
  13. #
  14. cpu-y := -mb
  15. cpu-$(CONFIG_LITTLE_ENDIAN) := -ml
  16. cpu-$(CONFIG_CPU_SH5) += -m5-32media-nofpu
  17. ifdef CONFIG_LITTLE_ENDIAN
  18. LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64'
  19. LDFLAGS += -EL -mshlelf32_linux
  20. else
  21. LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4'
  22. LDFLAGS += -EB -mshelf32_linux
  23. endif
  24. # No requirements for endianess support from AFLAGS, 'as' always run through gcc
  25. CFLAGS += $(cpu-y)
  26. LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \
  27. --defsym phys_stext_shmedia=phys_stext+1 \
  28. -e phys_stext_shmedia
  29. OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
  30. #
  31. # arch/sh64/defconfig never had any hope of being
  32. # frequently updated, so use one that does
  33. #
  34. KBUILD_DEFCONFIG := cayman_defconfig
  35. ifdef LOADADDR
  36. LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
  37. endif
  38. machine-$(CONFIG_SH_CAYMAN) := cayman
  39. machine-$(CONFIG_SH_SIMULATOR) := sim
  40. machine-$(CONFIG_SH_HARP) := harp
  41. machine-$(CONFIG_SH_ROMRAM) := romram
  42. head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
  43. core-y += arch/sh64/kernel/ arch/sh64/mm/
  44. ifneq ($(machine-y),)
  45. core-y += arch/sh64/mach-$(machine-y)/
  46. endif
  47. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  48. libs-y += arch/$(ARCH)/lib/ $(LIBGCC)
  49. drivers-$(CONFIG_OPROFILE) += arch/sh64/oprofile/
  50. boot := arch/$(ARCH)/boot
  51. zImage: vmlinux
  52. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  53. compressed: zImage
  54. archclean:
  55. $(Q)$(MAKE) $(clean)=$(boot)
  56. archprepare: arch/$(ARCH)/lib/syscalltab.h
  57. define filechk_gen-syscalltab
  58. (set -e; \
  59. echo "/*"; \
  60. echo " * DO NOT MODIFY."; \
  61. echo " *"; \
  62. echo " * This file was generated by arch/$(ARCH)/Makefile"; \
  63. echo " * Any changes will be reverted at build time."; \
  64. echo " */"; \
  65. echo ""; \
  66. echo "#ifndef __SYSCALLTAB_H"; \
  67. echo "#define __SYSCALLTAB_H"; \
  68. echo ""; \
  69. echo "#include <linux/kernel.h>"; \
  70. echo ""; \
  71. echo "struct syscall_info {"; \
  72. echo " const char *name;"; \
  73. echo "} syscall_info_table[] = {"; \
  74. sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \
  75. s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \
  76. echo "};"; \
  77. echo ""; \
  78. echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)"; \
  79. echo ""; \
  80. echo "#endif /* __SYSCALLTAB_H */" )
  81. endef
  82. arch/$(ARCH)/lib/syscalltab.h: arch/sh64/kernel/syscalls.S
  83. $(call filechk,gen-syscalltab)
  84. CLEAN_FILES += arch/$(ARCH)/lib/syscalltab.h
  85. define archhelp
  86. @echo ' zImage - Compressed kernel image (arch/sh64/boot/zImage)'
  87. endef