Makefile 4.1 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#
# parisc/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Portions Copyright (C) 1999 The Puffin Group
#
# Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
# Mike Shaver, Helge Deller and Martin K. Petersen
#
19 20 21

KBUILD_DEFCONFIG := default_defconfig

L
Linus Torvalds 已提交
22 23
NM		= sh $(srctree)/arch/parisc/nm
CHECKFLAGS	+= -D__hppa__=1
24
LIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
L
Linus Torvalds 已提交
25

26 27 28 29 30
MACHINE		:= $(shell uname -m)
ifeq ($(MACHINE),parisc*)
NATIVE		:= 1
endif

L
Linus Torvalds 已提交
31 32 33
ifdef CONFIG_64BIT
UTS_MACHINE	:= parisc64
CHECKFLAGS	+= -D__LP64__=1 -m64
34 35 36
WIDTH		:= 64
else # 32-bit
WIDTH		:=
L
Linus Torvalds 已提交
37 38
endif

39 40 41
# attempt to help out folks who are cross-compiling
ifeq ($(NATIVE),1)
CROSS_COMPILE	:= hppa$(WIDTH)-linux-
42 43 44 45
else
 ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE	:= hppa$(WIDTH)-linux-gnu-
 endif
46
endif
L
Linus Torvalds 已提交
47 48 49 50 51 52 53 54 55 56 57 58

OBJCOPY_FLAGS =-O binary -R .note -R .comment -S

cflags-y	:= -pipe

# These flags should be implied by an hppa-linux configuration, but they
# are not in gcc 3.2.
cflags-y	+= -mno-space-regs -mfast-indirect-calls

# Currently we save and restore fpregs on all kernel entry/interruption paths.
# If that gets optimized, we might need to disable the use of fpregs in the
# kernel.
59
cflags-y	+= -mdisable-fpregs
L
Linus Torvalds 已提交
60 61 62

# Without this, "ld -r" results in .text sections that are too big
# (> 0x40000) for branches to reach stubs.
63 64 65
ifndef CONFIG_FUNCTION_TRACER
  cflags-y	+= -ffunction-sections
endif
L
Linus Torvalds 已提交
66

67
# Use long jumps instead of long branches (needed if your linker fails to
68 69 70 71
# link a too big vmlinux executable). Not enabled for building modules.
ifdef CONFIG_MLONGCALLS
KBUILD_CFLAGS_KERNEL += -mlong-calls
endif
72

L
Linus Torvalds 已提交
73 74 75 76 77 78 79 80 81
# select which processor to optimise for
cflags-$(CONFIG_PA7100)		+= -march=1.1 -mschedule=7100
cflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
cflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
cflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
cflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000

head-y			:= arch/parisc/kernel/head.o 

82
KBUILD_CFLAGS	+= $(cflags-y)
L
Linus Torvalds 已提交
83

T
Thomas Gleixner 已提交
84
kernel-y			:= mm/ kernel/ math-emu/
L
Linus Torvalds 已提交
85 86 87
kernel-$(CONFIG_HPUX)		+= hpux/

core-y	+= $(addprefix arch/parisc/, $(kernel-y))
88
libs-y	+= arch/parisc/lib/ $(LIBGCC)
L
Linus Torvalds 已提交
89 90 91

drivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/

92
PALO := $(shell if (which palo 2>&1); then : ; \
K
Kyle McMartin 已提交
93 94 95
	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
	fi)

96 97 98 99
PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
	else echo $(obj)/palo.conf; \
	fi)

K
Kyle McMartin 已提交
100
palo: vmlinux
101
	@if test ! -x "$(PALO)"; then \
K
Kyle McMartin 已提交
102 103 104 105
		echo 'ERROR: Please install palo first (apt-get install palo)';\
		echo 'or build it from source and install it somewhere in your $$PATH';\
		false; \
	fi
106 107 108
	@if test ! -f "$(PALOCONF)"; then \
		cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
		echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
K
Kyle McMartin 已提交
109 110 111 112
		echo 'You should check it and re-run "make palo".'; \
		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
		false; \
	fi
113
	$(PALO) -f $(PALOCONF)
K
Kyle McMartin 已提交
114

115 116
# Shorthands for known targets not supported by parisc, use vmlinux as default
Image zImage bzImage: vmlinux
L
Linus Torvalds 已提交
117

118
install: vmlinux
L
Linus Torvalds 已提交
119 120 121
	sh $(src)/arch/parisc/install.sh \
			$(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"

122
CLEAN_FILES	+= lifimage
L
Linus Torvalds 已提交
123 124 125 126
MRPROPER_FILES	+= palo.conf

define archhelp
	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
K
Kyle McMartin 已提交
127
	@echo  '  palo		- Bootable image (./lifimage)'
L
Linus Torvalds 已提交
128
	@echo  '  install	- Install kernel using'
129 130
	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
L
Linus Torvalds 已提交
131 132
	@echo  '		  copy to $$(INSTALL_PATH)'
endef
133 134 135 136 137 138 139 140 141

# we require gcc 3.3 or above to compile the kernel
archprepare: checkbin
checkbin:
	@if test "$(call cc-version)" -lt "0303"; then \
		echo -n "Sorry, GCC v3.3 or above is required to build " ; \
		echo "the kernel." ; \
		false ; \
	fi