blob: 9b7e42490dd1f147fc6a1002f13767a49a81467f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
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#
19NM = sh $(srctree)/arch/parisc/nm
20CHECKFLAGS += -D__hppa__=1
21
22ifdef CONFIG_64BIT
Randolph Chung5beb5f32005-10-21 22:52:00 -040023CROSS_COMPILE := $(shell if [ -x /usr/bin/hppa64-linux-gnu-gcc ]; then \
24 echo hppa64-linux-gnu-; else echo hppa64-linux-; fi)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025UTS_MACHINE := parisc64
26CHECKFLAGS += -D__LP64__=1 -m64
27else
28MACHINE := $(subst 64,,$(shell uname -m))
29ifneq ($(MACHINE),parisc)
30CROSS_COMPILE := hppa-linux-
31endif
32endif
33
34FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align
35
36OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
37
Randolph Chung5beb5f32005-10-21 22:52:00 -040038GCC_VERSION := $(call cc-version)
39ifneq ($(shell if [ -z $(GCC_VERSION) ] ; then echo "bad"; fi ;),)
40$(error Sorry, couldn't find ($(cc-version)).)
41endif
42ifneq ($(shell if [ $(GCC_VERSION) -lt 0303 ] ; then echo "bad"; fi ;),)
43$(error Sorry, your compiler is too old ($(GCC_VERSION)). GCC v3.3 or above is required.)
44endif
45
Linus Torvalds1da177e2005-04-16 15:20:36 -070046cflags-y := -pipe
47
48# These flags should be implied by an hppa-linux configuration, but they
49# are not in gcc 3.2.
50cflags-y += -mno-space-regs -mfast-indirect-calls
51
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.
Randolph Chungfa681a12005-10-21 22:48:34 -040055cflags-y += -mdisable-fpregs
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57# Without this, "ld -r" results in .text sections that are too big
58# (> 0x40000) for branches to reach stubs.
59cflags-y += -ffunction-sections
60
61# select which processor to optimise for
62cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
63cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200
64cflags-$(CONFIG_PA7100LC) += -march=1.1 -mschedule=7100LC
65cflags-$(CONFIG_PA7300LC) += -march=1.1 -mschedule=7300
66cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000
67
68head-y := arch/parisc/kernel/head.o
69
70CFLAGS += $(cflags-y)
71
72kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o
73kernel-$(CONFIG_HPUX) += hpux/
74
75core-y += $(addprefix arch/parisc/, $(kernel-y))
76libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
77
78drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
79
80PALO := $(shell if which palo; then : ; \
81 elif [ -x /sbin/palo ]; then echo /sbin/palo; \
82 fi)
83
84palo: vmlinux
85 @if [ -x $PALO ]; then \
86 echo 'ERROR: Please install palo first (apt-get install palo)';\
87 echo 'or build it from source and install it somewhere in your $$PATH';\
88 false; \
89 fi
90 @if [ ! -f ./palo.conf ]; then \
91 cp arch/parisc/defpalo.conf palo.conf; \
92 echo 'A generic palo config file (./palo.conf) has been created for you.'; \
93 echo 'You should check it and re-run "make palo".'; \
94 echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
95 false; \
96 fi
97 $(PALO) -f ./palo.conf
98
99oldpalo: vmlinux
100 export TOPDIR=`pwd`; \
101 unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
102
103# Shorthands for known targets not supported by parisc, use palo as default
104Image zImage bzImage: palo
105
106kernel_install: vmlinux
107 sh $(src)/arch/parisc/install.sh \
108 $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
109
110install: kernel_install modules_install
111
Sam Ravnborg0013a852005-09-09 20:57:26 +0200112CLEAN_FILES += lifimage
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113MRPROPER_FILES += palo.conf
114
115define archhelp
116 @echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
117 @echo ' palo - Bootable image (./lifimage)'
118 @echo ' install - Install kernel using'
119 @echo ' (your) ~/bin/installkernel or'
120 @echo ' (distribution) /sbin/installkernel or'
121 @echo ' copy to $$(INSTALL_PATH)'
122endef