162306a36Sopenharmony_ci# BK Id: %F% %I% %G% %U% %#%
262306a36Sopenharmony_ci#
362306a36Sopenharmony_ci# This file is included by the global makefile so that you can add your own
462306a36Sopenharmony_ci# architecture-specific flags and dependencies.
562306a36Sopenharmony_ci#
662306a36Sopenharmony_ci# This file is subject to the terms and conditions of the GNU General Public
762306a36Sopenharmony_ci# License.  See the file "COPYING" in the main directory of this archive
862306a36Sopenharmony_ci# for more details.
962306a36Sopenharmony_ci#
1062306a36Sopenharmony_ci# Copyright (C) 1994 by Linus Torvalds
1162306a36Sopenharmony_ci# Modifications for the OpenRISC architecture:
1262306a36Sopenharmony_ci# Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
1362306a36Sopenharmony_ci# Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
1462306a36Sopenharmony_ci#
1562306a36Sopenharmony_ci# Based on:
1662306a36Sopenharmony_ci# arch/i386/Makefile
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciKBUILD_DEFCONFIG := or1ksim_defconfig
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciOBJCOPYFLAGS    := -O binary -R .note -R .comment -S
2162306a36Sopenharmony_ciLIBGCC 		:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciKBUILD_CFLAGS	+= -pipe -ffixed-r10 -D__linux__
2462306a36Sopenharmony_ciKBUILD_CFLAGS	+= -msfimm -mshftimm
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciall: vmlinux.bin
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciboot := arch/$(ARCH)/boot
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y)
3162306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-mhard-mul)
3262306a36Sopenharmony_cielse
3362306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-msoft-mul)
3462306a36Sopenharmony_ciendif
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ciifeq ($(CONFIG_OPENRISC_HAVE_INST_DIV),y)
3762306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-mhard-div)
3862306a36Sopenharmony_cielse
3962306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-msoft-div)
4062306a36Sopenharmony_ciendif
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciifeq ($(CONFIG_OPENRISC_HAVE_INST_CMOV),y)
4362306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-mcmov)
4462306a36Sopenharmony_ciendif
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ciifeq ($(CONFIG_OPENRISC_HAVE_INST_ROR),y)
4762306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-mror)
4862306a36Sopenharmony_ciendif
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ciifeq ($(CONFIG_OPENRISC_HAVE_INST_RORI),y)
5162306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-mrori)
5262306a36Sopenharmony_ciendif
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ciifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y)
5562306a36Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-msext)
5662306a36Sopenharmony_ciendif
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cilibs-y		+= $(LIBGCC)
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciPHONY += vmlinux.bin
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_civmlinux.bin: vmlinux
6362306a36Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
64