Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 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 | |
| 22 | ifdef CONFIG_64BIT |
| 23 | CROSS_COMPILE := hppa64-linux- |
| 24 | UTS_MACHINE := parisc64 |
| 25 | CHECKFLAGS += -D__LP64__=1 -m64 |
| 26 | else |
| 27 | MACHINE := $(subst 64,,$(shell uname -m)) |
| 28 | ifneq ($(MACHINE),parisc) |
| 29 | CROSS_COMPILE := hppa-linux- |
| 30 | endif |
| 31 | endif |
| 32 | |
| 33 | FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align |
| 34 | |
| 35 | OBJCOPY_FLAGS =-O binary -R .note -R .comment -S |
| 36 | |
| 37 | cflags-y := -pipe |
| 38 | |
| 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 | |
| 43 | # Currently we save and restore fpregs on all kernel entry/interruption paths. |
| 44 | # If that gets optimized, we might need to disable the use of fpregs in the |
| 45 | # kernel. |
| 46 | #cflags-y += -mdisable-fpregs |
| 47 | |
| 48 | # Without this, "ld -r" results in .text sections that are too big |
| 49 | # (> 0x40000) for branches to reach stubs. |
| 50 | cflags-y += -ffunction-sections |
| 51 | |
| 52 | # select which processor to optimise for |
| 53 | cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100 |
| 54 | cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200 |
| 55 | cflags-$(CONFIG_PA7100LC) += -march=1.1 -mschedule=7100LC |
| 56 | cflags-$(CONFIG_PA7300LC) += -march=1.1 -mschedule=7300 |
| 57 | cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000 |
| 58 | |
| 59 | head-y := arch/parisc/kernel/head.o |
| 60 | |
| 61 | CFLAGS += $(cflags-y) |
| 62 | |
| 63 | kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o |
| 64 | kernel-$(CONFIG_HPUX) += hpux/ |
| 65 | |
| 66 | core-y += $(addprefix arch/parisc/, $(kernel-y)) |
| 67 | libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name` |
| 68 | |
| 69 | drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/ |
| 70 | |
| 71 | PALO := $(shell if which palo; then : ; \ |
| 72 | elif [ -x /sbin/palo ]; then echo /sbin/palo; \ |
| 73 | fi) |
| 74 | |
| 75 | palo: vmlinux |
| 76 | @if [ -x $PALO ]; then \ |
| 77 | echo 'ERROR: Please install palo first (apt-get install palo)';\ |
| 78 | echo 'or build it from source and install it somewhere in your $$PATH';\ |
| 79 | false; \ |
| 80 | fi |
| 81 | @if [ ! -f ./palo.conf ]; then \ |
| 82 | cp arch/parisc/defpalo.conf palo.conf; \ |
| 83 | echo 'A generic palo config file (./palo.conf) has been created for you.'; \ |
| 84 | echo 'You should check it and re-run "make palo".'; \ |
| 85 | echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \ |
| 86 | false; \ |
| 87 | fi |
| 88 | $(PALO) -f ./palo.conf |
| 89 | |
| 90 | oldpalo: vmlinux |
| 91 | export TOPDIR=`pwd`; \ |
| 92 | unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage |
| 93 | |
| 94 | # Shorthands for known targets not supported by parisc, use palo as default |
| 95 | Image zImage bzImage: palo |
| 96 | |
| 97 | kernel_install: vmlinux |
| 98 | sh $(src)/arch/parisc/install.sh \ |
| 99 | $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" |
| 100 | |
| 101 | install: kernel_install modules_install |
| 102 | |
| 103 | prepare: include/asm-parisc/offsets.h |
| 104 | |
| 105 | arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ |
| 106 | include/config/MARKER |
| 107 | |
| 108 | include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s |
| 109 | $(call filechk,gen-asm-offsets) |
| 110 | |
| 111 | CLEAN_FILES += lifimage include/asm-parisc/offsets.h |
| 112 | MRPROPER_FILES += palo.conf |
| 113 | |
| 114 | define archhelp |
| 115 | @echo '* vmlinux - Uncompressed kernel image (./vmlinux)' |
| 116 | @echo ' palo - Bootable image (./lifimage)' |
| 117 | @echo ' install - Install kernel using' |
| 118 | @echo ' (your) ~/bin/installkernel or' |
| 119 | @echo ' (distribution) /sbin/installkernel or' |
| 120 | @echo ' copy to $$(INSTALL_PATH)' |
| 121 | endef |