xref: /openbmc/linux/arch/parisc/Makefile (revision 6525ee55)
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
241da177e4SLinus Torvalds
25991b7d6eSKyle McMartinMACHINE		:= $(shell uname -m)
26991b7d6eSKyle McMartinifeq ($(MACHINE),parisc*)
27991b7d6eSKyle McMartinNATIVE		:= 1
28991b7d6eSKyle McMartinendif
29991b7d6eSKyle McMartin
301da177e4SLinus Torvaldsifdef CONFIG_64BIT
311da177e4SLinus TorvaldsUTS_MACHINE	:= parisc64
321da177e4SLinus TorvaldsCHECKFLAGS	+= -D__LP64__=1 -m64
33991b7d6eSKyle McMartinWIDTH		:= 64
34991b7d6eSKyle McMartinCROSS_COMPILE	:= hppa64-linux-gnu-
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-
42991b7d6eSKyle McMartinendif
431da177e4SLinus Torvalds
441da177e4SLinus TorvaldsOBJCOPY_FLAGS =-O binary -R .note -R .comment -S
451da177e4SLinus Torvalds
461da177e4SLinus Torvaldscflags-y	:= -pipe
471da177e4SLinus Torvalds
481da177e4SLinus Torvalds# These flags should be implied by an hppa-linux configuration, but they
491da177e4SLinus Torvalds# are not in gcc 3.2.
501da177e4SLinus Torvaldscflags-y	+= -mno-space-regs -mfast-indirect-calls
511da177e4SLinus Torvalds
521da177e4SLinus Torvalds# Currently we save and restore fpregs on all kernel entry/interruption paths.
531da177e4SLinus Torvalds# If that gets optimized, we might need to disable the use of fpregs in the
541da177e4SLinus Torvalds# kernel.
55fa681a18SRandolph Chungcflags-y	+= -mdisable-fpregs
561da177e4SLinus Torvalds
571da177e4SLinus Torvalds# Without this, "ld -r" results in .text sections that are too big
581da177e4SLinus Torvalds# (> 0x40000) for branches to reach stubs.
591da177e4SLinus Torvaldscflags-y	+= -ffunction-sections
601da177e4SLinus Torvalds
611da177e4SLinus Torvalds# select which processor to optimise for
621da177e4SLinus Torvaldscflags-$(CONFIG_PA7100)		+= -march=1.1 -mschedule=7100
631da177e4SLinus Torvaldscflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
641da177e4SLinus Torvaldscflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
651da177e4SLinus Torvaldscflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
661da177e4SLinus Torvaldscflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
671da177e4SLinus Torvalds
681da177e4SLinus Torvaldshead-y			:= arch/parisc/kernel/head.o
691da177e4SLinus Torvalds
70a0f97e06SSam RavnborgKBUILD_CFLAGS	+= $(cflags-y)
711da177e4SLinus Torvalds
721da177e4SLinus Torvaldskernel-y			:= mm/ kernel/ math-emu/ kernel/init_task.o
731da177e4SLinus Torvaldskernel-$(CONFIG_HPUX)		+= hpux/
741da177e4SLinus Torvalds
751da177e4SLinus Torvaldscore-y	+= $(addprefix arch/parisc/, $(kernel-y))
769d29213fSKyle McMartinlibs-y	+= arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
771da177e4SLinus Torvalds
781da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
791da177e4SLinus Torvalds
806525ee55SKyle McMartinPALO := $(shell if (which palo 2>&1); then : ; \
815feb4f39SKyle McMartin	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
825feb4f39SKyle McMartin	fi)
835feb4f39SKyle McMartin
84f67d4033SKyle McMartinPALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
85f67d4033SKyle McMartin	else echo $(obj)/palo.conf; \
86f67d4033SKyle McMartin	fi)
87f67d4033SKyle McMartin
885feb4f39SKyle McMartinpalo: vmlinux
89f67d4033SKyle McMartin	@if test ! -x "$(PALO)"; then \
905feb4f39SKyle McMartin		echo 'ERROR: Please install palo first (apt-get install palo)';\
915feb4f39SKyle McMartin		echo 'or build it from source and install it somewhere in your $$PATH';\
925feb4f39SKyle McMartin		false; \
935feb4f39SKyle McMartin	fi
94f67d4033SKyle McMartin	@if test ! -f "$(PALOCONF)"; then \
95f67d4033SKyle McMartin		cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
96f67d4033SKyle McMartin		echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
975feb4f39SKyle McMartin		echo 'You should check it and re-run "make palo".'; \
985feb4f39SKyle McMartin		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
995feb4f39SKyle McMartin		false; \
1005feb4f39SKyle McMartin	fi
101f67d4033SKyle McMartin	$(PALO) -f $(PALOCONF)
1025feb4f39SKyle McMartin
103991b7d6eSKyle McMartin# Shorthands for known targets not supported by parisc, use vmlinux as default
104991b7d6eSKyle McMartinImage zImage bzImage: vmlinux
1051da177e4SLinus Torvalds
1061da177e4SLinus Torvaldskernel_install: vmlinux
1071da177e4SLinus Torvalds	sh $(src)/arch/parisc/install.sh \
1081da177e4SLinus Torvalds			$(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
1091da177e4SLinus Torvalds
1101da177e4SLinus Torvaldsinstall: kernel_install modules_install
1111da177e4SLinus Torvalds
1120013a854SSam RavnborgCLEAN_FILES	+= lifimage
1131da177e4SLinus TorvaldsMRPROPER_FILES	+= palo.conf
1141da177e4SLinus Torvalds
1151da177e4SLinus Torvaldsdefine archhelp
1161da177e4SLinus Torvalds	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
1175feb4f39SKyle McMartin	@echo  '  palo		- Bootable image (./lifimage)'
1181da177e4SLinus Torvalds	@echo  '  install	- Install kernel using'
1191da177e4SLinus Torvalds	@echo  '		  (your) ~/bin/installkernel or'
1201da177e4SLinus Torvalds	@echo  '		  (distribution) /sbin/installkernel or'
1211da177e4SLinus Torvalds	@echo  '		  copy to $$(INSTALL_PATH)'
1221da177e4SLinus Torvaldsendef
123991b7d6eSKyle McMartin
124991b7d6eSKyle McMartin# we require gcc 3.3 or above to compile the kernel
125991b7d6eSKyle McMartinarchprepare: checkbin
126991b7d6eSKyle McMartincheckbin:
127991b7d6eSKyle McMartin	@if test "$(call cc-version)" -lt "0303"; then \
128991b7d6eSKyle McMartin		echo -n "Sorry, GCC v3.3 or above is required to build " ; \
129991b7d6eSKyle McMartin		echo "the kernel." ; \
130991b7d6eSKyle McMartin		false ; \
131991b7d6eSKyle McMartin	fi
132