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