Makefile 4.3 KB

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