Makefile 3.6 KB

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