Makefile 4.7 KB

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