xref: /openbmc/linux/arch/parisc/Makefile (revision 9d29213f)
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#
191da177e4SLinus TorvaldsNM		= sh $(srctree)/arch/parisc/nm
201da177e4SLinus TorvaldsCHECKFLAGS	+= -D__hppa__=1
211da177e4SLinus Torvalds
22991b7d6eSKyle McMartinMACHINE		:= $(shell uname -m)
23991b7d6eSKyle McMartinifeq ($(MACHINE),parisc*)
24991b7d6eSKyle McMartinNATIVE		:= 1
25991b7d6eSKyle McMartinendif
26991b7d6eSKyle McMartin
271da177e4SLinus Torvaldsifdef CONFIG_64BIT
281da177e4SLinus TorvaldsUTS_MACHINE	:= parisc64
291da177e4SLinus TorvaldsCHECKFLAGS	+= -D__LP64__=1 -m64
30991b7d6eSKyle McMartinWIDTH		:= 64
31991b7d6eSKyle McMartinCROSS_COMPILE	:= hppa64-linux-gnu-
32991b7d6eSKyle McMartinelse # 32-bit
33991b7d6eSKyle McMartinWIDTH		:=
341da177e4SLinus Torvaldsendif
351da177e4SLinus Torvalds
36991b7d6eSKyle McMartin# attempt to help out folks who are cross-compiling
37991b7d6eSKyle McMartinifeq ($(NATIVE),1)
38991b7d6eSKyle McMartinCROSS_COMPILE	:= hppa$(WIDTH)-linux-
39991b7d6eSKyle McMartinendif
401da177e4SLinus Torvalds
411da177e4SLinus TorvaldsOBJCOPY_FLAGS =-O binary -R .note -R .comment -S
421da177e4SLinus Torvalds
431da177e4SLinus Torvaldscflags-y	:= -pipe
441da177e4SLinus Torvalds
451da177e4SLinus Torvalds# These flags should be implied by an hppa-linux configuration, but they
461da177e4SLinus Torvalds# are not in gcc 3.2.
471da177e4SLinus Torvaldscflags-y	+= -mno-space-regs -mfast-indirect-calls
481da177e4SLinus Torvalds
491da177e4SLinus Torvalds# Currently we save and restore fpregs on all kernel entry/interruption paths.
501da177e4SLinus Torvalds# If that gets optimized, we might need to disable the use of fpregs in the
511da177e4SLinus Torvalds# kernel.
52fa681a18SRandolph Chungcflags-y	+= -mdisable-fpregs
531da177e4SLinus Torvalds
541da177e4SLinus Torvalds# Without this, "ld -r" results in .text sections that are too big
551da177e4SLinus Torvalds# (> 0x40000) for branches to reach stubs.
561da177e4SLinus Torvaldscflags-y	+= -ffunction-sections
571da177e4SLinus Torvalds
581da177e4SLinus Torvalds# select which processor to optimise for
591da177e4SLinus Torvaldscflags-$(CONFIG_PA7100)		+= -march=1.1 -mschedule=7100
601da177e4SLinus Torvaldscflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
611da177e4SLinus Torvaldscflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
621da177e4SLinus Torvaldscflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
631da177e4SLinus Torvaldscflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
641da177e4SLinus Torvalds
651da177e4SLinus Torvaldshead-y			:= arch/parisc/kernel/head.o
661da177e4SLinus Torvalds
67a0f97e06SSam RavnborgKBUILD_CFLAGS	+= $(cflags-y)
681da177e4SLinus Torvalds
691da177e4SLinus Torvaldskernel-y			:= mm/ kernel/ math-emu/ kernel/init_task.o
701da177e4SLinus Torvaldskernel-$(CONFIG_HPUX)		+= hpux/
711da177e4SLinus Torvalds
721da177e4SLinus Torvaldscore-y	+= $(addprefix arch/parisc/, $(kernel-y))
739d29213fSKyle McMartinlibs-y	+= arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
741da177e4SLinus Torvalds
751da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
761da177e4SLinus Torvalds
775feb4f39SKyle McMartinPALO := $(shell if which palo; then : ; \
785feb4f39SKyle McMartin	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
795feb4f39SKyle McMartin	fi)
805feb4f39SKyle McMartin
81f67d4033SKyle McMartinPALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
82f67d4033SKyle McMartin	else echo $(obj)/palo.conf; \
83f67d4033SKyle McMartin	fi)
84f67d4033SKyle McMartin
855feb4f39SKyle McMartinpalo: vmlinux
86f67d4033SKyle McMartin	@if test ! -x "$(PALO)"; then \
875feb4f39SKyle McMartin		echo 'ERROR: Please install palo first (apt-get install palo)';\
885feb4f39SKyle McMartin		echo 'or build it from source and install it somewhere in your $$PATH';\
895feb4f39SKyle McMartin		false; \
905feb4f39SKyle McMartin	fi
91f67d4033SKyle McMartin	@if test ! -f "$(PALOCONF)"; then \
92f67d4033SKyle McMartin		cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
93f67d4033SKyle McMartin		echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
945feb4f39SKyle McMartin		echo 'You should check it and re-run "make palo".'; \
955feb4f39SKyle McMartin		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
965feb4f39SKyle McMartin		false; \
975feb4f39SKyle McMartin	fi
98f67d4033SKyle McMartin	$(PALO) -f $(PALOCONF)
995feb4f39SKyle McMartin
100991b7d6eSKyle McMartin# Shorthands for known targets not supported by parisc, use vmlinux as default
101991b7d6eSKyle McMartinImage zImage bzImage: vmlinux
1021da177e4SLinus Torvalds
1031da177e4SLinus Torvaldskernel_install: vmlinux
1041da177e4SLinus Torvalds	sh $(src)/arch/parisc/install.sh \
1051da177e4SLinus Torvalds			$(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
1061da177e4SLinus Torvalds
1071da177e4SLinus Torvaldsinstall: kernel_install modules_install
1081da177e4SLinus Torvalds
1090013a854SSam RavnborgCLEAN_FILES	+= lifimage
1101da177e4SLinus TorvaldsMRPROPER_FILES	+= palo.conf
1111da177e4SLinus Torvalds
1121da177e4SLinus Torvaldsdefine archhelp
1131da177e4SLinus Torvalds	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
1145feb4f39SKyle McMartin	@echo  '  palo		- Bootable image (./lifimage)'
1151da177e4SLinus Torvalds	@echo  '  install	- Install kernel using'
1161da177e4SLinus Torvalds	@echo  '		  (your) ~/bin/installkernel or'
1171da177e4SLinus Torvalds	@echo  '		  (distribution) /sbin/installkernel or'
1181da177e4SLinus Torvalds	@echo  '		  copy to $$(INSTALL_PATH)'
1191da177e4SLinus Torvaldsendef
120991b7d6eSKyle McMartin
121991b7d6eSKyle McMartin# we require gcc 3.3 or above to compile the kernel
122991b7d6eSKyle McMartinarchprepare: checkbin
123991b7d6eSKyle McMartincheckbin:
124991b7d6eSKyle McMartin	@if test "$(call cc-version)" -lt "0303"; then \
125991b7d6eSKyle McMartin		echo -n "Sorry, GCC v3.3 or above is required to build " ; \
126991b7d6eSKyle McMartin		echo "the kernel." ; \
127991b7d6eSKyle McMartin		false ; \
128991b7d6eSKyle McMartin	fi
129