18c2ecf20Sopenharmony_ci#
28c2ecf20Sopenharmony_ci# parisc/Makefile
38c2ecf20Sopenharmony_ci#
48c2ecf20Sopenharmony_ci# This file is included by the global makefile so that you can add your own
58c2ecf20Sopenharmony_ci# architecture-specific flags and dependencies. Remember to do have actions
68c2ecf20Sopenharmony_ci# for "archclean" and "archdep" for cleaning up and making dependencies for
78c2ecf20Sopenharmony_ci# this architecture
88c2ecf20Sopenharmony_ci#
98c2ecf20Sopenharmony_ci# This file is subject to the terms and conditions of the GNU General Public
108c2ecf20Sopenharmony_ci# License.  See the file "COPYING" in the main directory of this archive
118c2ecf20Sopenharmony_ci# for more details.
128c2ecf20Sopenharmony_ci#
138c2ecf20Sopenharmony_ci# Copyright (C) 1994 by Linus Torvalds
148c2ecf20Sopenharmony_ci# Portions Copyright (C) 1999 The Puffin Group
158c2ecf20Sopenharmony_ci#
168c2ecf20Sopenharmony_ci# Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
178c2ecf20Sopenharmony_ci# Mike Shaver, Helge Deller and Martin K. Petersen
188c2ecf20Sopenharmony_ci#
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciifdef CONFIG_PARISC_SELF_EXTRACT
218c2ecf20Sopenharmony_ciboot := arch/parisc/boot
228c2ecf20Sopenharmony_ciKBUILD_IMAGE := $(boot)/bzImage
238c2ecf20Sopenharmony_cielse
248c2ecf20Sopenharmony_ciKBUILD_IMAGE := vmlinuz
258c2ecf20Sopenharmony_ciendif
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciNM		= sh $(srctree)/arch/parisc/nm
288c2ecf20Sopenharmony_ciCHECKFLAGS	+= -D__hppa__=1
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciifdef CONFIG_64BIT
318c2ecf20Sopenharmony_ciUTS_MACHINE	:= parisc64
328c2ecf20Sopenharmony_ciCHECKFLAGS	+= -D__LP64__=1
338c2ecf20Sopenharmony_ciCC_ARCHES	= hppa64
348c2ecf20Sopenharmony_ciLD_BFD		:= elf64-hppa-linux
358c2ecf20Sopenharmony_cielse # 32-bit
368c2ecf20Sopenharmony_ciCC_ARCHES	= hppa hppa2.0 hppa1.1
378c2ecf20Sopenharmony_ciLD_BFD		:= elf32-hppa-linux
388c2ecf20Sopenharmony_ciendif
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci# select defconfig based on actual architecture
418c2ecf20Sopenharmony_ciifeq ($(shell uname -m),parisc64)
428c2ecf20Sopenharmony_ci	KBUILD_DEFCONFIG := generic-64bit_defconfig
438c2ecf20Sopenharmony_cielse
448c2ecf20Sopenharmony_ci	KBUILD_DEFCONFIG := generic-32bit_defconfig
458c2ecf20Sopenharmony_ciendif
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciexport LD_BFD
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciifneq ($(SUBARCH),$(UTS_MACHINE))
508c2ecf20Sopenharmony_ci	ifeq ($(CROSS_COMPILE),)
518c2ecf20Sopenharmony_ci		CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
528c2ecf20Sopenharmony_ci		CROSS_COMPILE := $(call cc-cross-prefix, \
538c2ecf20Sopenharmony_ci			$(foreach a,$(CC_ARCHES), \
548c2ecf20Sopenharmony_ci			$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
558c2ecf20Sopenharmony_ci	endif
568c2ecf20Sopenharmony_ciendif
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciifdef CONFIG_DYNAMIC_FTRACE
598c2ecf20Sopenharmony_ciifdef CONFIG_64BIT
608c2ecf20Sopenharmony_ciNOP_COUNT := 8
618c2ecf20Sopenharmony_cielse
628c2ecf20Sopenharmony_ciNOP_COUNT := 5
638c2ecf20Sopenharmony_ciendif
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ciexport CC_USING_RECORD_MCOUNT:=1
668c2ecf20Sopenharmony_ciexport CC_USING_PATCHABLE_FUNCTION_ENTRY:=1
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciKBUILD_AFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1
698c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1 \
708c2ecf20Sopenharmony_ci		 -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ciCC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))
738c2ecf20Sopenharmony_ciendif
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciOBJCOPY_FLAGS =-O binary -R .note -R .comment -S
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_cicflags-y	:= -pipe
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci# These flags should be implied by an hppa-linux configuration, but they
808c2ecf20Sopenharmony_ci# are not in gcc 3.2.
818c2ecf20Sopenharmony_cicflags-y	+= -mno-space-regs
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci# -mfast-indirect-calls is only relevant for 32-bit kernels.
848c2ecf20Sopenharmony_ciifndef CONFIG_64BIT
858c2ecf20Sopenharmony_cicflags-y	+= -mfast-indirect-calls
868c2ecf20Sopenharmony_ciendif
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci# Currently we save and restore fpregs on all kernel entry/interruption paths.
898c2ecf20Sopenharmony_ci# If that gets optimized, we might need to disable the use of fpregs in the
908c2ecf20Sopenharmony_ci# kernel.
918c2ecf20Sopenharmony_cicflags-y	+= -mdisable-fpregs
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci# Use long jumps instead of long branches (needed if your linker fails to
948c2ecf20Sopenharmony_ci# link a too big vmlinux executable). Not enabled for building modules.
958c2ecf20Sopenharmony_ciifdef CONFIG_MLONGCALLS
968c2ecf20Sopenharmony_ciKBUILD_CFLAGS_KERNEL += -mlong-calls
978c2ecf20Sopenharmony_ciendif
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci# Without this, "ld -r" results in .text sections that are too big (> 0x40000)
1008c2ecf20Sopenharmony_ci# for branches to reach stubs. And multiple .text sections trigger a warning
1018c2ecf20Sopenharmony_ci# when creating the sysfs module information section.
1028c2ecf20Sopenharmony_ciifndef CONFIG_64BIT
1038c2ecf20Sopenharmony_ciKBUILD_CFLAGS_MODULE += -ffunction-sections
1048c2ecf20Sopenharmony_ciendif
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci# select which processor to optimise for
1078c2ecf20Sopenharmony_cicflags-$(CONFIG_PA7000)		+= -march=1.1 -mschedule=7100
1088c2ecf20Sopenharmony_cicflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
1098c2ecf20Sopenharmony_cicflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
1108c2ecf20Sopenharmony_cicflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
1118c2ecf20Sopenharmony_cicflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_cihead-y			:= arch/parisc/kernel/head.o 
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ciKBUILD_CFLAGS	+= $(cflags-y)
1168c2ecf20Sopenharmony_ciLIBGCC		:= $(shell $(CC) -print-libgcc-file-name)
1178c2ecf20Sopenharmony_ciexport LIBGCC
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_cikernel-y			:= mm/ kernel/ math-emu/
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_cicore-y	+= $(addprefix arch/parisc/, $(kernel-y))
1228c2ecf20Sopenharmony_cilibs-y	+= arch/parisc/lib/ $(LIBGCC)
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_cidrivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ciboot	:= arch/parisc/boot
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ciPALO := $(shell if (which palo 2>&1); then : ; \
1298c2ecf20Sopenharmony_ci	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
1308c2ecf20Sopenharmony_ci	fi)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ciPALOCONF := $(shell if [ -f $(srctree)/palo.conf ]; then echo $(srctree)/palo.conf; \
1338c2ecf20Sopenharmony_ci	else echo $(objtree)/palo.conf; \
1348c2ecf20Sopenharmony_ci	fi)
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_cipalo lifimage: vmlinuz
1378c2ecf20Sopenharmony_ci	@if test ! -x "$(PALO)"; then \
1388c2ecf20Sopenharmony_ci		echo 'ERROR: Please install palo first (apt-get install palo)';\
1398c2ecf20Sopenharmony_ci		echo 'or build it from source and install it somewhere in your $$PATH';\
1408c2ecf20Sopenharmony_ci		false; \
1418c2ecf20Sopenharmony_ci	fi
1428c2ecf20Sopenharmony_ci	@if test ! -f "$(PALOCONF)"; then \
1438c2ecf20Sopenharmony_ci		cp $(srctree)/arch/parisc/defpalo.conf $(objtree)/palo.conf; \
1448c2ecf20Sopenharmony_ci		echo 'A generic palo config file ($(objree)/palo.conf) has been created for you.'; \
1458c2ecf20Sopenharmony_ci		echo 'You should check it and re-run "make palo".'; \
1468c2ecf20Sopenharmony_ci		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
1478c2ecf20Sopenharmony_ci		false; \
1488c2ecf20Sopenharmony_ci	fi
1498c2ecf20Sopenharmony_ci	$(PALO) -f $(PALOCONF)
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ciBOOT_TARGETS    = zImage Image palo lifimage
1528c2ecf20Sopenharmony_ciINSTALL_TARGETS = zinstall install
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ciPHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci# Default kernel to build
1578c2ecf20Sopenharmony_ciall: bzImage
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_cizImage: vmlinuz
1608c2ecf20Sopenharmony_ciImage: vmlinux
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_cibzImage: vmlinux
1638c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ciifdef CONFIG_PARISC_SELF_EXTRACT
1668c2ecf20Sopenharmony_civmlinuz: bzImage
1678c2ecf20Sopenharmony_ci	$(OBJCOPY) $(boot)/bzImage $@
1688c2ecf20Sopenharmony_cielse
1698c2ecf20Sopenharmony_civmlinuz: vmlinux
1708c2ecf20Sopenharmony_ci	@$(KGZIP) -cf -9 $< > $@
1718c2ecf20Sopenharmony_ciendif
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ciinstall:
1748c2ecf20Sopenharmony_ci	$(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
1758c2ecf20Sopenharmony_ci			$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
1768c2ecf20Sopenharmony_cizinstall:
1778c2ecf20Sopenharmony_ci	$(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
1788c2ecf20Sopenharmony_ci			$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ciCLEAN_FILES	+= lifimage
1818c2ecf20Sopenharmony_ciMRPROPER_FILES	+= palo.conf
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_cidefine archhelp
1848c2ecf20Sopenharmony_ci	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
1858c2ecf20Sopenharmony_ci	@echo  '  vmlinuz	- Compressed kernel image (./vmlinuz)'
1868c2ecf20Sopenharmony_ci	@echo  '  palo		- Bootable image (./lifimage)'
1878c2ecf20Sopenharmony_ci	@echo  '  install	- Install uncompressed vmlinux kernel using'
1888c2ecf20Sopenharmony_ci	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
1898c2ecf20Sopenharmony_ci	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
1908c2ecf20Sopenharmony_ci	@echo  '		  copy to $$(INSTALL_PATH)'
1918c2ecf20Sopenharmony_ci	@echo  '  zinstall	- Install compressed vmlinuz kernel'
1928c2ecf20Sopenharmony_ciendef
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ciarchclean:
1958c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(clean)=$(boot)
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ciarchheaders:
1988c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=arch/parisc/kernel/syscalls all
199