Makefile 4.8 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_IMAGE := vmlinuz

22 23
KBUILD_DEFCONFIG := default_defconfig

L
Linus Torvalds 已提交
24
NM		= sh $(srctree)/arch/parisc/nm
25
CHECKFLAGS	+= -D__hppa__=1 -mbig-endian
26
LIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
27
export LIBGCC
L
Linus Torvalds 已提交
28 29 30 31

ifdef CONFIG_64BIT
UTS_MACHINE	:= parisc64
CHECKFLAGS	+= -D__LP64__=1 -m64
32
CC_ARCHES	= hppa64
33
LD_BFD		:= elf64-hppa-linux
34
else # 32-bit
35
CC_ARCHES	= hppa hppa2.0 hppa1.1
36
LD_BFD		:= elf32-hppa-linux
L
Linus Torvalds 已提交
37 38
endif

39 40
export LD_BFD

41 42 43 44 45 46 47
ifneq ($(SUBARCH),$(UTS_MACHINE))
	ifeq ($(CROSS_COMPILE),)
		CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
		CROSS_COMPILE := $(call cc-cross-prefix, \
			$(foreach a,$(CC_ARCHES), \
			$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
	endif
48
endif
L
Linus Torvalds 已提交
49 50 51 52 53 54 55

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.
56 57 58 59 60 61
cflags-y	+= -mno-space-regs

# -mfast-indirect-calls is only relevant for 32-bit kernels.
ifndef CONFIG_64BIT
cflags-y	+= -mfast-indirect-calls
endif
L
Linus Torvalds 已提交
62 63 64 65

# 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.
66
cflags-y	+= -mdisable-fpregs
L
Linus Torvalds 已提交
67 68 69

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

72
# Use long jumps instead of long branches (needed if your linker fails to
73 74 75 76
# link a too big vmlinux executable). Not enabled for building modules.
ifdef CONFIG_MLONGCALLS
KBUILD_CFLAGS_KERNEL += -mlong-calls
endif
77

L
Linus Torvalds 已提交
78
# select which processor to optimise for
79
cflags-$(CONFIG_PA7000)		+= -march=1.1 -mschedule=7100
L
Linus Torvalds 已提交
80 81 82 83 84 85 86
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 

87
KBUILD_CFLAGS	+= $(cflags-y)
L
Linus Torvalds 已提交
88

T
Thomas Gleixner 已提交
89
kernel-y			:= mm/ kernel/ math-emu/
L
Linus Torvalds 已提交
90 91

core-y	+= $(addprefix arch/parisc/, $(kernel-y))
92
libs-y	+= arch/parisc/lib/ $(LIBGCC)
L
Linus Torvalds 已提交
93 94 95

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

96 97
boot	:= arch/parisc/boot

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

102 103 104 105
PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
	else echo $(obj)/palo.conf; \
	fi)

106
palo lifimage: vmlinuz
107
	@if test ! -x "$(PALO)"; then \
K
Kyle McMartin 已提交
108 109 110 111
		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
112 113 114
	@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 已提交
115 116 117 118
		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
119
	$(PALO) -f $(PALOCONF)
K
Kyle McMartin 已提交
120

121 122 123 124 125
BOOT_TARGETS    = zImage Image palo lifimage
INSTALL_TARGETS = zinstall install

PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)

126 127 128
# Default kernel to build
all: bzImage

129
zImage: vmlinuz
130 131
Image: vmlinux

132 133 134
bzImage: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

135
ifdef CONFIG_PARISC_SELF_EXTRACT
136 137
vmlinuz: bzImage
	$(OBJCOPY) $(boot)/bzImage $@
138 139 140 141
else
vmlinuz: vmlinux
	@gzip -cf -9 $< > $@
endif
L
Linus Torvalds 已提交
142

143 144 145 146 147 148
install:
	$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
			$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
zinstall:
	$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
			$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
L
Linus Torvalds 已提交
149

150
CLEAN_FILES	+= lifimage
L
Linus Torvalds 已提交
151 152 153 154
MRPROPER_FILES	+= palo.conf

define archhelp
	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
155
	@echo  '  vmlinuz	- Compressed kernel image (./vmlinuz)'
K
Kyle McMartin 已提交
156
	@echo  '  palo		- Bootable image (./lifimage)'
157
	@echo  '  install	- Install uncompressed vmlinux kernel using'
158 159
	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
L
Linus Torvalds 已提交
160
	@echo  '		  copy to $$(INSTALL_PATH)'
161
	@echo  '  zinstall	- Install compressed vmlinuz kernel'
L
Linus Torvalds 已提交
162
endef
163 164 165 166

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