Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #
  2. # parisc/Makefile
  3. #
  4. # This file is included by the global makefile so that you can add your own
  5. # architecture-specific flags and dependencies. Remember to do have actions
  6. # for "archclean" and "archdep" for cleaning up and making dependencies for
  7. # this architecture
  8. #
  9. # This file is subject to the terms and conditions of the GNU General Public
  10. # License. See the file "COPYING" in the main directory of this archive
  11. # for more details.
  12. #
  13. # Copyright (C) 1994 by Linus Torvalds
  14. # Portions Copyright (C) 1999 The Puffin Group
  15. #
  16. # Modified for PA-RISC Linux by Paul Lahaie, Alex deVries,
  17. # Mike Shaver, Helge Deller and Martin K. Petersen
  18. #
  19. KBUILD_DEFCONFIG := default_defconfig
  20. NM = sh $(srctree)/arch/parisc/nm
  21. CHECKFLAGS += -D__hppa__=1
  22. LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  23. ifdef CONFIG_64BIT
  24. UTS_MACHINE := parisc64
  25. CHECKFLAGS += -D__LP64__=1 -m64
  26. CC_ARCHES = hppa64
  27. else # 32-bit
  28. CC_ARCHES = hppa hppa2.0 hppa1.1
  29. endif
  30. ifneq ($(SUBARCH),$(UTS_MACHINE))
  31. ifeq ($(CROSS_COMPILE),)
  32. CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
  33. CROSS_COMPILE := $(call cc-cross-prefix, \
  34. $(foreach a,$(CC_ARCHES), \
  35. $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
  36. endif
  37. endif
  38. OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
  39. cflags-y := -pipe
  40. # These flags should be implied by an hppa-linux configuration, but they
  41. # are not in gcc 3.2.
  42. cflags-y += -mno-space-regs -mfast-indirect-calls
  43. # Currently we save and restore fpregs on all kernel entry/interruption paths.
  44. # If that gets optimized, we might need to disable the use of fpregs in the
  45. # kernel.
  46. cflags-y += -mdisable-fpregs
  47. # Without this, "ld -r" results in .text sections that are too big
  48. # (> 0x40000) for branches to reach stubs.
  49. ifndef CONFIG_FUNCTION_TRACER
  50. cflags-y += -ffunction-sections
  51. endif
  52. # Use long jumps instead of long branches (needed if your linker fails to
  53. # link a too big vmlinux executable). Not enabled for building modules.
  54. ifdef CONFIG_MLONGCALLS
  55. KBUILD_CFLAGS_KERNEL += -mlong-calls
  56. endif
  57. # select which processor to optimise for
  58. cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
  59. cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200
  60. cflags-$(CONFIG_PA7100LC) += -march=1.1 -mschedule=7100LC
  61. cflags-$(CONFIG_PA7300LC) += -march=1.1 -mschedule=7300
  62. cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000
  63. head-y := arch/parisc/kernel/head.o
  64. KBUILD_CFLAGS += $(cflags-y)
  65. kernel-y := mm/ kernel/ math-emu/
  66. kernel-$(CONFIG_HPUX) += hpux/
  67. core-y += $(addprefix arch/parisc/, $(kernel-y))
  68. libs-y += arch/parisc/lib/ $(LIBGCC)
  69. drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
  70. PALO := $(shell if (which palo 2>&1); then : ; \
  71. elif [ -x /sbin/palo ]; then echo /sbin/palo; \
  72. fi)
  73. PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
  74. else echo $(obj)/palo.conf; \
  75. fi)
  76. palo: vmlinux
  77. @if test ! -x "$(PALO)"; then \
  78. echo 'ERROR: Please install palo first (apt-get install palo)';\
  79. echo 'or build it from source and install it somewhere in your $$PATH';\
  80. false; \
  81. fi
  82. @if test ! -f "$(PALOCONF)"; then \
  83. cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
  84. echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
  85. echo 'You should check it and re-run "make palo".'; \
  86. echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
  87. false; \
  88. fi
  89. $(PALO) -f $(PALOCONF)
  90. # Shorthands for known targets not supported by parisc, use vmlinux as default
  91. Image zImage bzImage: vmlinux
  92. install: vmlinux
  93. sh $(src)/arch/parisc/install.sh \
  94. $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
  95. CLEAN_FILES += lifimage
  96. MRPROPER_FILES += palo.conf
  97. define archhelp
  98. @echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
  99. @echo ' palo - Bootable image (./lifimage)'
  100. @echo ' install - Install kernel using'
  101. @echo ' (your) ~/bin/$(INSTALLKERNEL) or'
  102. @echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
  103. @echo ' copy to $$(INSTALL_PATH)'
  104. endef
  105. # we require gcc 3.3 or above to compile the kernel
  106. archprepare: checkbin
  107. checkbin:
  108. @if test "$(call cc-version)" -lt "0303"; then \
  109. echo -n "Sorry, GCC v3.3 or above is required to build " ; \
  110. echo "the kernel." ; \
  111. false ; \
  112. fi