Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. AFLAGS += -m5 -isa=sh64 -traditional
  26. CFLAGS += $(cpu-y)
  27. LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \
  28. --defsym phys_stext_shmedia=phys_stext+1 \
  29. -e phys_stext_shmedia
  30. OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
  31. #
  32. # arch/sh64/defconfig never had any hope of being
  33. # frequently updated, so use one that does
  34. #
  35. KBUILD_DEFCONFIG := cayman_defconfig
  36. ifdef LOADADDR
  37. LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
  38. endif
  39. machine-$(CONFIG_SH_CAYMAN) := cayman
  40. machine-$(CONFIG_SH_SIMULATOR) := sim
  41. machine-$(CONFIG_SH_HARP) := harp
  42. machine-$(CONFIG_SH_ROMRAM) := romram
  43. head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
  44. core-y += arch/sh64/kernel/ arch/sh64/mm/
  45. ifneq ($(machine-y),)
  46. core-y += arch/sh64/mach-$(machine-y)/
  47. endif
  48. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  49. libs-y += arch/$(ARCH)/lib/ $(LIBGCC)
  50. drivers-$(CONFIG_OPROFILE) += arch/sh64/oprofile/
  51. boot := arch/$(ARCH)/boot
  52. zImage: vmlinux
  53. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  54. compressed: zImage
  55. archclean:
  56. $(Q)$(MAKE) $(clean)=$(boot)
  57. prepare: include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h
  58. include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
  59. include/asm include/linux/version.h
  60. $(call filechk,gen-asm-offsets)
  61. define filechk_gen-syscalltab
  62. (set -e; \
  63. echo "/*"; \
  64. echo " * DO NOT MODIFY."; \
  65. echo " *"; \
  66. echo " * This file was generated by arch/$(ARCH)/Makefile"; \
  67. echo " * Any changes will be reverted at build time."; \
  68. echo " */"; \
  69. echo ""; \
  70. echo "#ifndef __SYSCALLTAB_H"; \
  71. echo "#define __SYSCALLTAB_H"; \
  72. echo ""; \
  73. echo "#include <linux/kernel.h>"; \
  74. echo ""; \
  75. echo "struct syscall_info {"; \
  76. echo " const char *name;"; \
  77. echo "} syscall_info_table[] = {"; \
  78. sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \
  79. s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \
  80. echo "};"; \
  81. echo ""; \
  82. echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)"; \
  83. echo ""; \
  84. echo "#endif /* __SYSCALLTAB_H */" )
  85. endef
  86. arch/$(ARCH)/lib/syscalltab.h: arch/sh64/kernel/syscalls.S
  87. $(call filechk,gen-syscalltab)
  88. CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h
  89. define archhelp
  90. @echo ' zImage - Compressed kernel image (arch/sh64/boot/zImage)'
  91. endef