kbuild: enable 'make CFLAGS=...' to add additional options to CC
[linux-block.git] / arch / parisc / Makefile
CommitLineData
1da177e4
LT
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#
19NM = sh $(srctree)/arch/parisc/nm
20CHECKFLAGS += -D__hppa__=1
21
22ifdef CONFIG_64BIT
5beb5f32
RC
23CROSS_COMPILE := $(shell if [ -x /usr/bin/hppa64-linux-gnu-gcc ]; then \
24 echo hppa64-linux-gnu-; else echo hppa64-linux-; fi)
1da177e4
LT
25UTS_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
f5280cbe
GG
38ifneq ($(call cc-ifversion, -lt, 0303, "bad"),)
39$(error Sorry, GCC v3.3 or above is required.)
5beb5f32
RC
40endif
41
1da177e4
LT
42cflags-y := -pipe
43
44# These flags should be implied by an hppa-linux configuration, but they
45# are not in gcc 3.2.
46cflags-y += -mno-space-regs -mfast-indirect-calls
47
48# Currently we save and restore fpregs on all kernel entry/interruption paths.
49# If that gets optimized, we might need to disable the use of fpregs in the
50# kernel.
fa681a18 51cflags-y += -mdisable-fpregs
1da177e4
LT
52
53# Without this, "ld -r" results in .text sections that are too big
54# (> 0x40000) for branches to reach stubs.
55cflags-y += -ffunction-sections
56
57# select which processor to optimise for
58cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
59cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200
60cflags-$(CONFIG_PA7100LC) += -march=1.1 -mschedule=7100LC
61cflags-$(CONFIG_PA7300LC) += -march=1.1 -mschedule=7300
62cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000
63
64head-y := arch/parisc/kernel/head.o
65
a0f97e06 66KBUILD_CFLAGS += $(cflags-y)
1da177e4
LT
67
68kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o
69kernel-$(CONFIG_HPUX) += hpux/
70
71core-y += $(addprefix arch/parisc/, $(kernel-y))
72libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
73
74drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
75
76PALO := $(shell if which palo; then : ; \
77 elif [ -x /sbin/palo ]; then echo /sbin/palo; \
78 fi)
79
80palo: vmlinux
81 @if [ -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 [ ! -f ./palo.conf ]; then \
87 cp arch/parisc/defpalo.conf palo.conf; \
88 echo 'A generic palo config file (./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 ./palo.conf
94
95oldpalo: vmlinux
96 export TOPDIR=`pwd`; \
97 unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
98
99# Shorthands for known targets not supported by parisc, use palo as default
100Image zImage bzImage: palo
101
102kernel_install: vmlinux
103 sh $(src)/arch/parisc/install.sh \
104 $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
105
106install: kernel_install modules_install
107
0013a854 108CLEAN_FILES += lifimage
1da177e4
LT
109MRPROPER_FILES += palo.conf
110
111define archhelp
112 @echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
113 @echo ' palo - Bootable image (./lifimage)'
114 @echo ' install - Install kernel using'
115 @echo ' (your) ~/bin/installkernel or'
116 @echo ' (distribution) /sbin/installkernel or'
117 @echo ' copy to $$(INSTALL_PATH)'
118endef