xref: /openbmc/linux/arch/parisc/Makefile (revision 6ca63662)
11da177e4SLinus Torvalds#
21da177e4SLinus Torvalds# parisc/Makefile
31da177e4SLinus Torvalds#
41da177e4SLinus Torvalds# This file is included by the global makefile so that you can add your own
51da177e4SLinus Torvalds# architecture-specific flags and dependencies. Remember to do have actions
61da177e4SLinus Torvalds# for "archclean" and "archdep" for cleaning up and making dependencies for
71da177e4SLinus Torvalds# this architecture
81da177e4SLinus Torvalds#
91da177e4SLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public
101da177e4SLinus Torvalds# License.  See the file "COPYING" in the main directory of this archive
111da177e4SLinus Torvalds# for more details.
121da177e4SLinus Torvalds#
131da177e4SLinus Torvalds# Copyright (C) 1994 by Linus Torvalds
141da177e4SLinus Torvalds# Portions Copyright (C) 1999 The Puffin Group
151da177e4SLinus Torvalds#
161da177e4SLinus Torvalds# Modified for PA-RISC Linux by Paul Lahaie, Alex deVries,
171da177e4SLinus Torvalds# Mike Shaver, Helge Deller and Martin K. Petersen
181da177e4SLinus Torvalds#
19c04f7ae2SAdrian Bunk
20594174d8SHelge DellerKBUILD_IMAGE := vmlinuz
21594174d8SHelge Deller
22c04f7ae2SAdrian BunkKBUILD_DEFCONFIG := default_defconfig
23c04f7ae2SAdrian Bunk
241da177e4SLinus TorvaldsNM		= sh $(srctree)/arch/parisc/nm
2514516765SLuc Van OostenryckCHECKFLAGS	+= -D__hppa__=1
264c01acc0SJames BottomleyLIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
27b6adc16eSHelge Dellerexport LIBGCC
281da177e4SLinus Torvalds
291da177e4SLinus Torvaldsifdef CONFIG_64BIT
301da177e4SLinus TorvaldsUTS_MACHINE	:= parisc64
311f2f01b1SLuc Van OostenryckCHECKFLAGS	+= -D__LP64__=1
326880b015SHelge DellerCC_ARCHES	= hppa64
33b6adc16eSHelge DellerLD_BFD		:= elf64-hppa-linux
34991b7d6eSKyle McMartinelse # 32-bit
356880b015SHelge DellerCC_ARCHES	= hppa hppa2.0 hppa1.1
36b6adc16eSHelge DellerLD_BFD		:= elf32-hppa-linux
371da177e4SLinus Torvaldsendif
381da177e4SLinus Torvalds
39b6adc16eSHelge Dellerexport LD_BFD
40b6adc16eSHelge Deller
416880b015SHelge Dellerifneq ($(SUBARCH),$(UTS_MACHINE))
420e39718bSHelge Deller	ifeq ($(CROSS_COMPILE),)
436880b015SHelge Deller		CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
446880b015SHelge Deller		CROSS_COMPILE := $(call cc-cross-prefix, \
456880b015SHelge Deller			$(foreach a,$(CC_ARCHES), \
466880b015SHelge Deller			$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
470e39718bSHelge Deller	endif
48991b7d6eSKyle McMartinendif
491da177e4SLinus Torvalds
506ca63662SSven Schnelleifdef CONFIG_DYNAMIC_FTRACE
516ca63662SSven Schnelleifdef CONFIG_64BIT
526ca63662SSven SchnelleNOP_COUNT := 8
536ca63662SSven Schnelleelse
546ca63662SSven SchnelleNOP_COUNT := 5
556ca63662SSven Schnelleendif
566ca63662SSven Schnelle
576ca63662SSven Schnelleexport CC_USING_RECORD_MCOUNT:=1
586ca63662SSven Schnelleexport CC_USING_PATCHABLE_FUNCTION_ENTRY:=1
596ca63662SSven Schnelle
606ca63662SSven SchnelleKBUILD_AFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1
616ca63662SSven SchnelleKBUILD_CFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1 \
626ca63662SSven Schnelle		 -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)
636ca63662SSven Schnelle
646ca63662SSven SchnelleCC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))
656ca63662SSven SchnelleKBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/parisc/kernel/module.lds
666ca63662SSven Schnelleendif
676ca63662SSven Schnelle
681da177e4SLinus TorvaldsOBJCOPY_FLAGS =-O binary -R .note -R .comment -S
691da177e4SLinus Torvalds
701da177e4SLinus Torvaldscflags-y	:= -pipe
711da177e4SLinus Torvalds
721da177e4SLinus Torvalds# These flags should be implied by an hppa-linux configuration, but they
731da177e4SLinus Torvalds# are not in gcc 3.2.
74d26a7730SJohn David Anglincflags-y	+= -mno-space-regs
75d26a7730SJohn David Anglin
76d26a7730SJohn David Anglin# -mfast-indirect-calls is only relevant for 32-bit kernels.
77d26a7730SJohn David Anglinifndef CONFIG_64BIT
78d26a7730SJohn David Anglincflags-y	+= -mfast-indirect-calls
79d26a7730SJohn David Anglinendif
801da177e4SLinus Torvalds
811da177e4SLinus Torvalds# Currently we save and restore fpregs on all kernel entry/interruption paths.
821da177e4SLinus Torvalds# If that gets optimized, we might need to disable the use of fpregs in the
831da177e4SLinus Torvalds# kernel.
84fa681a18SRandolph Chungcflags-y	+= -mdisable-fpregs
851da177e4SLinus Torvalds
86ec758f98SHelge Deller# Use long jumps instead of long branches (needed if your linker fails to
87cf71130dSHelge Deller# link a too big vmlinux executable). Not enabled for building modules.
88cf71130dSHelge Dellerifdef CONFIG_MLONGCALLS
89cf71130dSHelge DellerKBUILD_CFLAGS_KERNEL += -mlong-calls
90cf71130dSHelge Dellerendif
91ec758f98SHelge Deller
921e8249b8SHelge Deller# Without this, "ld -r" results in .text sections that are too big (> 0x40000)
931e8249b8SHelge Deller# for branches to reach stubs. And multiple .text sections trigger a warning
941e8249b8SHelge Deller# when creating the sysfs module information section.
951e8249b8SHelge Dellerifndef CONFIG_64BIT
961e8249b8SHelge DellerKBUILD_CFLAGS_MODULE += -ffunction-sections
971e8249b8SHelge Dellerendif
981e8249b8SHelge Deller
991da177e4SLinus Torvalds# select which processor to optimise for
10076603902SPaul Bollecflags-$(CONFIG_PA7000)		+= -march=1.1 -mschedule=7100
1011da177e4SLinus Torvaldscflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
1021da177e4SLinus Torvaldscflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
1031da177e4SLinus Torvaldscflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
1041da177e4SLinus Torvaldscflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
1051da177e4SLinus Torvalds
1061da177e4SLinus Torvaldshead-y			:= arch/parisc/kernel/head.o
1071da177e4SLinus Torvalds
108a0f97e06SSam RavnborgKBUILD_CFLAGS	+= $(cflags-y)
1091da177e4SLinus Torvalds
110481f93b6SThomas Gleixnerkernel-y			:= mm/ kernel/ math-emu/
1111da177e4SLinus Torvalds
1121da177e4SLinus Torvaldscore-y	+= $(addprefix arch/parisc/, $(kernel-y))
1134c01acc0SJames Bottomleylibs-y	+= arch/parisc/lib/ $(LIBGCC)
1141da177e4SLinus Torvalds
1151da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
1161da177e4SLinus Torvalds
117b6adc16eSHelge Dellerboot	:= arch/parisc/boot
118b6adc16eSHelge Deller
1196525ee55SKyle McMartinPALO := $(shell if (which palo 2>&1); then : ; \
1205feb4f39SKyle McMartin	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
1215feb4f39SKyle McMartin	fi)
1225feb4f39SKyle McMartin
123f67d4033SKyle McMartinPALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
124f67d4033SKyle McMartin	else echo $(obj)/palo.conf; \
125f67d4033SKyle McMartin	fi)
126f67d4033SKyle McMartin
127b0756b5aSHelge Dellerpalo lifimage: vmlinuz
128f67d4033SKyle McMartin	@if test ! -x "$(PALO)"; then \
1295feb4f39SKyle McMartin		echo 'ERROR: Please install palo first (apt-get install palo)';\
1305feb4f39SKyle McMartin		echo 'or build it from source and install it somewhere in your $$PATH';\
1315feb4f39SKyle McMartin		false; \
1325feb4f39SKyle McMartin	fi
133f67d4033SKyle McMartin	@if test ! -f "$(PALOCONF)"; then \
134f67d4033SKyle McMartin		cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
135f67d4033SKyle McMartin		echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
1365feb4f39SKyle McMartin		echo 'You should check it and re-run "make palo".'; \
1375feb4f39SKyle McMartin		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
1385feb4f39SKyle McMartin		false; \
1395feb4f39SKyle McMartin	fi
140f67d4033SKyle McMartin	$(PALO) -f $(PALOCONF)
1415feb4f39SKyle McMartin
142b0756b5aSHelge DellerBOOT_TARGETS    = zImage Image palo lifimage
143b0756b5aSHelge DellerINSTALL_TARGETS = zinstall install
144b0756b5aSHelge Deller
145b0756b5aSHelge DellerPHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
146b0756b5aSHelge Deller
14789e050c8SHelge Deller# Default kernel to build
14889e050c8SHelge Dellerall: bzImage
14989e050c8SHelge Deller
150b6adc16eSHelge DellerzImage: vmlinuz
151594174d8SHelge DellerImage: vmlinux
1521da177e4SLinus Torvalds
153b6adc16eSHelge DellerbzImage: vmlinux
154b6adc16eSHelge Deller	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
155b6adc16eSHelge Deller
156af21b01dSHelge Dellerifdef CONFIG_PARISC_SELF_EXTRACT
157b6adc16eSHelge Dellervmlinuz: bzImage
158b6adc16eSHelge Deller	$(OBJCOPY) $(boot)/bzImage $@
159af21b01dSHelge Dellerelse
160af21b01dSHelge Dellervmlinuz: vmlinux
161af21b01dSHelge Deller	@gzip -cf -9 $< > $@
162af21b01dSHelge Dellerendif
163594174d8SHelge Deller
164b0756b5aSHelge Dellerinstall:
165b0756b5aSHelge Deller	$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
166b0756b5aSHelge Deller			$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
167b0756b5aSHelge Dellerzinstall:
168b0756b5aSHelge Deller	$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
169b0756b5aSHelge Deller			$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
1701da177e4SLinus Torvalds
1710013a854SSam RavnborgCLEAN_FILES	+= lifimage
1721da177e4SLinus TorvaldsMRPROPER_FILES	+= palo.conf
1731da177e4SLinus Torvalds
1741da177e4SLinus Torvaldsdefine archhelp
1751da177e4SLinus Torvalds	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
176594174d8SHelge Deller	@echo  '  vmlinuz	- Compressed kernel image (./vmlinuz)'
1775feb4f39SKyle McMartin	@echo  '  palo		- Bootable image (./lifimage)'
178b0756b5aSHelge Deller	@echo  '  install	- Install uncompressed vmlinux kernel using'
179caa27b66SSam Ravnborg	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
180caa27b66SSam Ravnborg	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
1811da177e4SLinus Torvalds	@echo  '		  copy to $$(INSTALL_PATH)'
182b0756b5aSHelge Deller	@echo  '  zinstall	- Install compressed vmlinuz kernel'
1831da177e4SLinus Torvaldsendef
184575afc4dSFiroz Khan
185575afc4dSFiroz Khanarchheaders:
186575afc4dSFiroz Khan	$(Q)$(MAKE) $(build)=arch/parisc/kernel/syscalls all
187