xref: /OK3568_Linux_fs/kernel/arch/parisc/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# parisc/Makefile
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# This file is included by the global makefile so that you can add your own
5*4882a593Smuzhiyun# architecture-specific flags and dependencies. Remember to do have actions
6*4882a593Smuzhiyun# for "archclean" and "archdep" for cleaning up and making dependencies for
7*4882a593Smuzhiyun# this architecture
8*4882a593Smuzhiyun#
9*4882a593Smuzhiyun# This file is subject to the terms and conditions of the GNU General Public
10*4882a593Smuzhiyun# License.  See the file "COPYING" in the main directory of this archive
11*4882a593Smuzhiyun# for more details.
12*4882a593Smuzhiyun#
13*4882a593Smuzhiyun# Copyright (C) 1994 by Linus Torvalds
14*4882a593Smuzhiyun# Portions Copyright (C) 1999 The Puffin Group
15*4882a593Smuzhiyun#
16*4882a593Smuzhiyun# Modified for PA-RISC Linux by Paul Lahaie, Alex deVries,
17*4882a593Smuzhiyun# Mike Shaver, Helge Deller and Martin K. Petersen
18*4882a593Smuzhiyun#
19*4882a593Smuzhiyun
20*4882a593Smuzhiyunifdef CONFIG_PARISC_SELF_EXTRACT
21*4882a593Smuzhiyunboot := arch/parisc/boot
22*4882a593SmuzhiyunKBUILD_IMAGE := $(boot)/bzImage
23*4882a593Smuzhiyunelse
24*4882a593SmuzhiyunKBUILD_IMAGE := vmlinuz
25*4882a593Smuzhiyunendif
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunNM		= sh $(srctree)/arch/parisc/nm
28*4882a593SmuzhiyunCHECKFLAGS	+= -D__hppa__=1
29*4882a593Smuzhiyun
30*4882a593Smuzhiyunifdef CONFIG_64BIT
31*4882a593SmuzhiyunUTS_MACHINE	:= parisc64
32*4882a593SmuzhiyunCHECKFLAGS	+= -D__LP64__=1
33*4882a593SmuzhiyunCC_ARCHES	= hppa64
34*4882a593SmuzhiyunLD_BFD		:= elf64-hppa-linux
35*4882a593Smuzhiyunelse # 32-bit
36*4882a593SmuzhiyunCC_ARCHES	= hppa hppa2.0 hppa1.1
37*4882a593SmuzhiyunLD_BFD		:= elf32-hppa-linux
38*4882a593Smuzhiyunendif
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun# select defconfig based on actual architecture
41*4882a593Smuzhiyunifeq ($(shell uname -m),parisc64)
42*4882a593Smuzhiyun	KBUILD_DEFCONFIG := generic-64bit_defconfig
43*4882a593Smuzhiyunelse
44*4882a593Smuzhiyun	KBUILD_DEFCONFIG := generic-32bit_defconfig
45*4882a593Smuzhiyunendif
46*4882a593Smuzhiyun
47*4882a593Smuzhiyunexport LD_BFD
48*4882a593Smuzhiyun
49*4882a593Smuzhiyunifneq ($(SUBARCH),$(UTS_MACHINE))
50*4882a593Smuzhiyun	ifeq ($(CROSS_COMPILE),)
51*4882a593Smuzhiyun		CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
52*4882a593Smuzhiyun		CROSS_COMPILE := $(call cc-cross-prefix, \
53*4882a593Smuzhiyun			$(foreach a,$(CC_ARCHES), \
54*4882a593Smuzhiyun			$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
55*4882a593Smuzhiyun	endif
56*4882a593Smuzhiyunendif
57*4882a593Smuzhiyun
58*4882a593Smuzhiyunifdef CONFIG_DYNAMIC_FTRACE
59*4882a593Smuzhiyunifdef CONFIG_64BIT
60*4882a593SmuzhiyunNOP_COUNT := 8
61*4882a593Smuzhiyunelse
62*4882a593SmuzhiyunNOP_COUNT := 5
63*4882a593Smuzhiyunendif
64*4882a593Smuzhiyun
65*4882a593Smuzhiyunexport CC_USING_RECORD_MCOUNT:=1
66*4882a593Smuzhiyunexport CC_USING_PATCHABLE_FUNCTION_ENTRY:=1
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunKBUILD_AFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1
69*4882a593SmuzhiyunKBUILD_CFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1 \
70*4882a593Smuzhiyun		 -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunCC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))
73*4882a593Smuzhiyunendif
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunOBJCOPY_FLAGS =-O binary -R .note -R .comment -S
76*4882a593Smuzhiyun
77*4882a593Smuzhiyuncflags-y	:= -pipe
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun# These flags should be implied by an hppa-linux configuration, but they
80*4882a593Smuzhiyun# are not in gcc 3.2.
81*4882a593Smuzhiyuncflags-y	+= -mno-space-regs
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun# -mfast-indirect-calls is only relevant for 32-bit kernels.
84*4882a593Smuzhiyunifndef CONFIG_64BIT
85*4882a593Smuzhiyuncflags-y	+= -mfast-indirect-calls
86*4882a593Smuzhiyunendif
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun# Currently we save and restore fpregs on all kernel entry/interruption paths.
89*4882a593Smuzhiyun# If that gets optimized, we might need to disable the use of fpregs in the
90*4882a593Smuzhiyun# kernel.
91*4882a593Smuzhiyuncflags-y	+= -mdisable-fpregs
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun# Use long jumps instead of long branches (needed if your linker fails to
94*4882a593Smuzhiyun# link a too big vmlinux executable). Not enabled for building modules.
95*4882a593Smuzhiyunifdef CONFIG_MLONGCALLS
96*4882a593SmuzhiyunKBUILD_CFLAGS_KERNEL += -mlong-calls
97*4882a593Smuzhiyunendif
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun# Without this, "ld -r" results in .text sections that are too big (> 0x40000)
100*4882a593Smuzhiyun# for branches to reach stubs. And multiple .text sections trigger a warning
101*4882a593Smuzhiyun# when creating the sysfs module information section.
102*4882a593Smuzhiyunifndef CONFIG_64BIT
103*4882a593SmuzhiyunKBUILD_CFLAGS_MODULE += -ffunction-sections
104*4882a593Smuzhiyunendif
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun# select which processor to optimise for
107*4882a593Smuzhiyuncflags-$(CONFIG_PA7000)		+= -march=1.1 -mschedule=7100
108*4882a593Smuzhiyuncflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
109*4882a593Smuzhiyuncflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
110*4882a593Smuzhiyuncflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
111*4882a593Smuzhiyuncflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
112*4882a593Smuzhiyun
113*4882a593Smuzhiyunhead-y			:= arch/parisc/kernel/head.o
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunKBUILD_CFLAGS	+= $(cflags-y)
116*4882a593SmuzhiyunLIBGCC		:= $(shell $(CC) -print-libgcc-file-name)
117*4882a593Smuzhiyunexport LIBGCC
118*4882a593Smuzhiyun
119*4882a593Smuzhiyunkernel-y			:= mm/ kernel/ math-emu/
120*4882a593Smuzhiyun
121*4882a593Smuzhiyuncore-y	+= $(addprefix arch/parisc/, $(kernel-y))
122*4882a593Smuzhiyunlibs-y	+= arch/parisc/lib/ $(LIBGCC)
123*4882a593Smuzhiyun
124*4882a593Smuzhiyundrivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
125*4882a593Smuzhiyun
126*4882a593Smuzhiyunboot	:= arch/parisc/boot
127*4882a593Smuzhiyun
128*4882a593SmuzhiyunPALO := $(shell if (which palo 2>&1); then : ; \
129*4882a593Smuzhiyun	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
130*4882a593Smuzhiyun	fi)
131*4882a593Smuzhiyun
132*4882a593SmuzhiyunPALOCONF := $(shell if [ -f $(srctree)/palo.conf ]; then echo $(srctree)/palo.conf; \
133*4882a593Smuzhiyun	else echo $(objtree)/palo.conf; \
134*4882a593Smuzhiyun	fi)
135*4882a593Smuzhiyun
136*4882a593Smuzhiyunpalo lifimage: vmlinuz
137*4882a593Smuzhiyun	@if test ! -x "$(PALO)"; then \
138*4882a593Smuzhiyun		echo 'ERROR: Please install palo first (apt-get install palo)';\
139*4882a593Smuzhiyun		echo 'or build it from source and install it somewhere in your $$PATH';\
140*4882a593Smuzhiyun		false; \
141*4882a593Smuzhiyun	fi
142*4882a593Smuzhiyun	@if test ! -f "$(PALOCONF)"; then \
143*4882a593Smuzhiyun		cp $(srctree)/arch/parisc/defpalo.conf $(objtree)/palo.conf; \
144*4882a593Smuzhiyun		echo 'A generic palo config file ($(objree)/palo.conf) has been created for you.'; \
145*4882a593Smuzhiyun		echo 'You should check it and re-run "make palo".'; \
146*4882a593Smuzhiyun		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
147*4882a593Smuzhiyun		false; \
148*4882a593Smuzhiyun	fi
149*4882a593Smuzhiyun	$(PALO) -f $(PALOCONF)
150*4882a593Smuzhiyun
151*4882a593SmuzhiyunBOOT_TARGETS    = zImage Image palo lifimage
152*4882a593SmuzhiyunINSTALL_TARGETS = zinstall install
153*4882a593Smuzhiyun
154*4882a593SmuzhiyunPHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun# Default kernel to build
157*4882a593Smuzhiyunall: bzImage
158*4882a593Smuzhiyun
159*4882a593SmuzhiyunzImage: vmlinuz
160*4882a593SmuzhiyunImage: vmlinux
161*4882a593Smuzhiyun
162*4882a593SmuzhiyunbzImage: vmlinux
163*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
164*4882a593Smuzhiyun
165*4882a593Smuzhiyunifdef CONFIG_PARISC_SELF_EXTRACT
166*4882a593Smuzhiyunvmlinuz: bzImage
167*4882a593Smuzhiyun	$(OBJCOPY) $(boot)/bzImage $@
168*4882a593Smuzhiyunelse
169*4882a593Smuzhiyunvmlinuz: vmlinux
170*4882a593Smuzhiyun	@$(KGZIP) -cf -9 $< > $@
171*4882a593Smuzhiyunendif
172*4882a593Smuzhiyun
173*4882a593Smuzhiyuninstall:
174*4882a593Smuzhiyun	$(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
175*4882a593Smuzhiyun			$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
176*4882a593Smuzhiyunzinstall:
177*4882a593Smuzhiyun	$(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
178*4882a593Smuzhiyun			$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
179*4882a593Smuzhiyun
180*4882a593SmuzhiyunCLEAN_FILES	+= lifimage
181*4882a593SmuzhiyunMRPROPER_FILES	+= palo.conf
182*4882a593Smuzhiyun
183*4882a593Smuzhiyundefine archhelp
184*4882a593Smuzhiyun	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
185*4882a593Smuzhiyun	@echo  '  vmlinuz	- Compressed kernel image (./vmlinuz)'
186*4882a593Smuzhiyun	@echo  '  palo		- Bootable image (./lifimage)'
187*4882a593Smuzhiyun	@echo  '  install	- Install uncompressed vmlinux kernel using'
188*4882a593Smuzhiyun	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
189*4882a593Smuzhiyun	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
190*4882a593Smuzhiyun	@echo  '		  copy to $$(INSTALL_PATH)'
191*4882a593Smuzhiyun	@echo  '  zinstall	- Install compressed vmlinuz kernel'
192*4882a593Smuzhiyunendef
193*4882a593Smuzhiyun
194*4882a593Smuzhiyunarchclean:
195*4882a593Smuzhiyun	$(Q)$(MAKE) $(clean)=$(boot)
196*4882a593Smuzhiyun
197*4882a593Smuzhiyunarchheaders:
198*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=arch/parisc/kernel/syscalls all
199