Makefile 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. ifdef CONFIG_PARISC_SELF_EXTRACT
  20. boot := arch/parisc/boot
  21. KBUILD_IMAGE := $(boot)/bzImage
  22. else
  23. KBUILD_IMAGE := vmlinuz
  24. endif
  25. NM = sh $(srctree)/arch/parisc/nm
  26. CHECKFLAGS += -D__hppa__=1
  27. ifdef CONFIG_64BIT
  28. UTS_MACHINE := parisc64
  29. CHECKFLAGS += -D__LP64__=1
  30. CC_ARCHES = hppa64
  31. LD_BFD := elf64-hppa-linux
  32. else # 32-bit
  33. CC_ARCHES = hppa hppa2.0 hppa1.1
  34. LD_BFD := elf32-hppa-linux
  35. endif
  36. # select defconfig based on actual architecture
  37. ifeq ($(shell uname -m),parisc64)
  38. KBUILD_DEFCONFIG := generic-64bit_defconfig
  39. else
  40. KBUILD_DEFCONFIG := generic-32bit_defconfig
  41. endif
  42. export LD_BFD
  43. ifneq ($(SUBARCH),$(UTS_MACHINE))
  44. ifeq ($(CROSS_COMPILE),)
  45. CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
  46. CROSS_COMPILE := $(call cc-cross-prefix, \
  47. $(foreach a,$(CC_ARCHES), \
  48. $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
  49. endif
  50. endif
  51. ifdef CONFIG_DYNAMIC_FTRACE
  52. ifdef CONFIG_64BIT
  53. NOP_COUNT := 8
  54. else
  55. NOP_COUNT := 5
  56. endif
  57. export CC_USING_RECORD_MCOUNT:=1
  58. export CC_USING_PATCHABLE_FUNCTION_ENTRY:=1
  59. KBUILD_AFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1
  60. KBUILD_CFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1 \
  61. -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)
  62. CC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))
  63. endif
  64. OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
  65. cflags-y := -pipe
  66. # These flags should be implied by an hppa-linux configuration, but they
  67. # are not in gcc 3.2.
  68. cflags-y += -mno-space-regs
  69. # -mfast-indirect-calls is only relevant for 32-bit kernels.
  70. ifndef CONFIG_64BIT
  71. cflags-y += -mfast-indirect-calls
  72. endif
  73. # Currently we save and restore fpregs on all kernel entry/interruption paths.
  74. # If that gets optimized, we might need to disable the use of fpregs in the
  75. # kernel.
  76. cflags-y += -mdisable-fpregs
  77. # Use long jumps instead of long branches (needed if your linker fails to
  78. # link a too big vmlinux executable). Not enabled for building modules.
  79. ifdef CONFIG_MLONGCALLS
  80. KBUILD_CFLAGS_KERNEL += -mlong-calls
  81. endif
  82. # Without this, "ld -r" results in .text sections that are too big (> 0x40000)
  83. # for branches to reach stubs. And multiple .text sections trigger a warning
  84. # when creating the sysfs module information section.
  85. ifndef CONFIG_64BIT
  86. KBUILD_CFLAGS_MODULE += -ffunction-sections
  87. endif
  88. # select which processor to optimise for
  89. cflags-$(CONFIG_PA7000) += -march=1.1 -mschedule=7100
  90. cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200
  91. cflags-$(CONFIG_PA7100LC) += -march=1.1 -mschedule=7100LC
  92. cflags-$(CONFIG_PA7300LC) += -march=1.1 -mschedule=7300
  93. cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000
  94. head-y := arch/parisc/kernel/head.o
  95. KBUILD_CFLAGS += $(cflags-y)
  96. LIBGCC := $(shell $(CC) -print-libgcc-file-name)
  97. export LIBGCC
  98. kernel-y := mm/ kernel/ math-emu/
  99. core-y += $(addprefix arch/parisc/, $(kernel-y))
  100. libs-y += arch/parisc/lib/ $(LIBGCC)
  101. drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
  102. boot := arch/parisc/boot
  103. PALO := $(shell if (which palo 2>&1); then : ; \
  104. elif [ -x /sbin/palo ]; then echo /sbin/palo; \
  105. fi)
  106. PALOCONF := $(shell if [ -f $(srctree)/palo.conf ]; then echo $(srctree)/palo.conf; \
  107. else echo $(objtree)/palo.conf; \
  108. fi)
  109. palo lifimage: vmlinuz
  110. @if test ! -x "$(PALO)"; then \
  111. echo 'ERROR: Please install palo first (apt-get install palo)';\
  112. echo 'or build it from source and install it somewhere in your $$PATH';\
  113. false; \
  114. fi
  115. @if test ! -f "$(PALOCONF)"; then \
  116. cp $(srctree)/arch/parisc/defpalo.conf $(objtree)/palo.conf; \
  117. echo 'A generic palo config file ($(objree)/palo.conf) has been created for you.'; \
  118. echo 'You should check it and re-run "make palo".'; \
  119. echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
  120. false; \
  121. fi
  122. $(PALO) -f $(PALOCONF)
  123. BOOT_TARGETS = zImage Image palo lifimage
  124. INSTALL_TARGETS = zinstall install
  125. PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
  126. # Default kernel to build
  127. all: bzImage
  128. zImage: vmlinuz
  129. Image: vmlinux
  130. bzImage: vmlinux
  131. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  132. ifdef CONFIG_PARISC_SELF_EXTRACT
  133. vmlinuz: bzImage
  134. $(OBJCOPY) $(boot)/bzImage $@
  135. else
  136. vmlinuz: vmlinux
  137. @$(KGZIP) -cf -9 $< > $@
  138. endif
  139. install:
  140. $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
  141. $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
  142. zinstall:
  143. $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
  144. $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
  145. CLEAN_FILES += lifimage
  146. MRPROPER_FILES += palo.conf
  147. define archhelp
  148. @echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
  149. @echo ' vmlinuz - Compressed kernel image (./vmlinuz)'
  150. @echo ' palo - Bootable image (./lifimage)'
  151. @echo ' install - Install uncompressed vmlinux kernel using'
  152. @echo ' (your) ~/bin/$(INSTALLKERNEL) or'
  153. @echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
  154. @echo ' copy to $$(INSTALL_PATH)'
  155. @echo ' zinstall - Install compressed vmlinuz kernel'
  156. endef
  157. archclean:
  158. $(Q)$(MAKE) $(clean)=$(boot)
  159. archheaders:
  160. $(Q)$(MAKE) $(build)=arch/parisc/kernel/syscalls all