xref: /openbmc/linux/arch/parisc/Makefile (revision cf71130d)
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
20c04f7ae2SAdrian BunkKBUILD_DEFCONFIG := default_defconfig
21c04f7ae2SAdrian Bunk
221da177e4SLinus TorvaldsNM		= sh $(srctree)/arch/parisc/nm
231da177e4SLinus TorvaldsCHECKFLAGS	+= -D__hppa__=1
244c01acc0SJames BottomleyLIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
251da177e4SLinus Torvalds
26991b7d6eSKyle McMartinMACHINE		:= $(shell uname -m)
27991b7d6eSKyle McMartinifeq ($(MACHINE),parisc*)
28991b7d6eSKyle McMartinNATIVE		:= 1
29991b7d6eSKyle McMartinendif
30991b7d6eSKyle McMartin
311da177e4SLinus Torvaldsifdef CONFIG_64BIT
321da177e4SLinus TorvaldsUTS_MACHINE	:= parisc64
331da177e4SLinus TorvaldsCHECKFLAGS	+= -D__LP64__=1 -m64
34991b7d6eSKyle McMartinWIDTH		:= 64
35991b7d6eSKyle McMartinelse # 32-bit
36991b7d6eSKyle McMartinWIDTH		:=
371da177e4SLinus Torvaldsendif
381da177e4SLinus Torvalds
39991b7d6eSKyle McMartin# attempt to help out folks who are cross-compiling
40991b7d6eSKyle McMartinifeq ($(NATIVE),1)
41991b7d6eSKyle McMartinCROSS_COMPILE	:= hppa$(WIDTH)-linux-
420e39718bSHelge Dellerelse
430e39718bSHelge Deller ifeq ($(CROSS_COMPILE),)
440e39718bSHelge Deller CROSS_COMPILE	:= hppa$(WIDTH)-linux-gnu-
450e39718bSHelge Deller endif
46991b7d6eSKyle McMartinendif
471da177e4SLinus Torvalds
481da177e4SLinus TorvaldsOBJCOPY_FLAGS =-O binary -R .note -R .comment -S
491da177e4SLinus Torvalds
501da177e4SLinus Torvaldscflags-y	:= -pipe
511da177e4SLinus Torvalds
521da177e4SLinus Torvalds# These flags should be implied by an hppa-linux configuration, but they
531da177e4SLinus Torvalds# are not in gcc 3.2.
541da177e4SLinus Torvaldscflags-y	+= -mno-space-regs -mfast-indirect-calls
551da177e4SLinus Torvalds
561da177e4SLinus Torvalds# Currently we save and restore fpregs on all kernel entry/interruption paths.
571da177e4SLinus Torvalds# If that gets optimized, we might need to disable the use of fpregs in the
581da177e4SLinus Torvalds# kernel.
59fa681a18SRandolph Chungcflags-y	+= -mdisable-fpregs
601da177e4SLinus Torvalds
611da177e4SLinus Torvalds# Without this, "ld -r" results in .text sections that are too big
621da177e4SLinus Torvalds# (> 0x40000) for branches to reach stubs.
63d75f054aSHelge Dellerifndef CONFIG_FUNCTION_TRACER
641da177e4SLinus Torvalds  cflags-y	+= -ffunction-sections
65d75f054aSHelge Dellerendif
661da177e4SLinus Torvalds
67ec758f98SHelge Deller# Use long jumps instead of long branches (needed if your linker fails to
68cf71130dSHelge Deller# link a too big vmlinux executable). Not enabled for building modules.
69cf71130dSHelge Dellerifdef CONFIG_MLONGCALLS
70cf71130dSHelge DellerKBUILD_CFLAGS_KERNEL += -mlong-calls
71cf71130dSHelge Dellerendif
72ec758f98SHelge Deller
731da177e4SLinus Torvalds# select which processor to optimise for
741da177e4SLinus Torvaldscflags-$(CONFIG_PA7100)		+= -march=1.1 -mschedule=7100
751da177e4SLinus Torvaldscflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
761da177e4SLinus Torvaldscflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
771da177e4SLinus Torvaldscflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
781da177e4SLinus Torvaldscflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
791da177e4SLinus Torvalds
801da177e4SLinus Torvaldshead-y			:= arch/parisc/kernel/head.o
811da177e4SLinus Torvalds
82a0f97e06SSam RavnborgKBUILD_CFLAGS	+= $(cflags-y)
831da177e4SLinus Torvalds
84481f93b6SThomas Gleixnerkernel-y			:= mm/ kernel/ math-emu/
851da177e4SLinus Torvaldskernel-$(CONFIG_HPUX)		+= hpux/
861da177e4SLinus Torvalds
871da177e4SLinus Torvaldscore-y	+= $(addprefix arch/parisc/, $(kernel-y))
884c01acc0SJames Bottomleylibs-y	+= arch/parisc/lib/ $(LIBGCC)
891da177e4SLinus Torvalds
901da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
911da177e4SLinus Torvalds
926525ee55SKyle McMartinPALO := $(shell if (which palo 2>&1); then : ; \
935feb4f39SKyle McMartin	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
945feb4f39SKyle McMartin	fi)
955feb4f39SKyle McMartin
96f67d4033SKyle McMartinPALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
97f67d4033SKyle McMartin	else echo $(obj)/palo.conf; \
98f67d4033SKyle McMartin	fi)
99f67d4033SKyle McMartin
1005feb4f39SKyle McMartinpalo: vmlinux
101f67d4033SKyle McMartin	@if test ! -x "$(PALO)"; then \
1025feb4f39SKyle McMartin		echo 'ERROR: Please install palo first (apt-get install palo)';\
1035feb4f39SKyle McMartin		echo 'or build it from source and install it somewhere in your $$PATH';\
1045feb4f39SKyle McMartin		false; \
1055feb4f39SKyle McMartin	fi
106f67d4033SKyle McMartin	@if test ! -f "$(PALOCONF)"; then \
107f67d4033SKyle McMartin		cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
108f67d4033SKyle McMartin		echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
1095feb4f39SKyle McMartin		echo 'You should check it and re-run "make palo".'; \
1105feb4f39SKyle McMartin		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
1115feb4f39SKyle McMartin		false; \
1125feb4f39SKyle McMartin	fi
113f67d4033SKyle McMartin	$(PALO) -f $(PALOCONF)
1145feb4f39SKyle McMartin
115991b7d6eSKyle McMartin# Shorthands for known targets not supported by parisc, use vmlinux as default
116991b7d6eSKyle McMartinImage zImage bzImage: vmlinux
1171da177e4SLinus Torvalds
1181905b771SRolf Eike Beerinstall: vmlinux
1191da177e4SLinus Torvalds	sh $(src)/arch/parisc/install.sh \
1201da177e4SLinus Torvalds			$(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
1211da177e4SLinus Torvalds
1220013a854SSam RavnborgCLEAN_FILES	+= lifimage
1231da177e4SLinus TorvaldsMRPROPER_FILES	+= palo.conf
1241da177e4SLinus Torvalds
1251da177e4SLinus Torvaldsdefine archhelp
1261da177e4SLinus Torvalds	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
1275feb4f39SKyle McMartin	@echo  '  palo		- Bootable image (./lifimage)'
1281da177e4SLinus Torvalds	@echo  '  install	- Install kernel using'
129caa27b66SSam Ravnborg	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
130caa27b66SSam Ravnborg	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
1311da177e4SLinus Torvalds	@echo  '		  copy to $$(INSTALL_PATH)'
1321da177e4SLinus Torvaldsendef
133991b7d6eSKyle McMartin
134991b7d6eSKyle McMartin# we require gcc 3.3 or above to compile the kernel
135991b7d6eSKyle McMartinarchprepare: checkbin
136991b7d6eSKyle McMartincheckbin:
137991b7d6eSKyle McMartin	@if test "$(call cc-version)" -lt "0303"; then \
138991b7d6eSKyle McMartin		echo -n "Sorry, GCC v3.3 or above is required to build " ; \
139991b7d6eSKyle McMartin		echo "the kernel." ; \
140991b7d6eSKyle McMartin		false ; \
141991b7d6eSKyle McMartin	fi
142