1f8c4a270SJonas Bonn# BK Id: %F% %I% %G% %U% %#% 2f8c4a270SJonas Bonn# 3f8c4a270SJonas Bonn# This file is included by the global makefile so that you can add your own 48212f898SMasahiro Yamada# architecture-specific flags and dependencies. 5f8c4a270SJonas Bonn# 6f8c4a270SJonas Bonn# This file is subject to the terms and conditions of the GNU General Public 7f8c4a270SJonas Bonn# License. See the file "COPYING" in the main directory of this archive 8f8c4a270SJonas Bonn# for more details. 9f8c4a270SJonas Bonn# 10f8c4a270SJonas Bonn# Copyright (C) 1994 by Linus Torvalds 11f8c4a270SJonas Bonn# Modifications for the OpenRISC architecture: 12f8c4a270SJonas Bonn# Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> 13f8c4a270SJonas Bonn# Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> 14f8c4a270SJonas Bonn# 15f8c4a270SJonas Bonn# Based on: 16f8c4a270SJonas Bonn# arch/i386/Makefile 17f8c4a270SJonas Bonn 18f8c4a270SJonas BonnKBUILD_DEFCONFIG := or1ksim_defconfig 19f8c4a270SJonas Bonn 20f8c4a270SJonas BonnOBJCOPYFLAGS := -O binary -R .note -R .comment -S 21f8c4a270SJonas BonnLIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 22f8c4a270SJonas Bonn 23ee4f96d0SChen GangKBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__ 24*87e387acSStafford HorneKBUILD_CFLAGS += -msfimm -mshftimm 25f8c4a270SJonas Bonn 26472ab9eeSJoel Stanleyall: vmlinux.bin 27472ab9eeSJoel Stanley 28472ab9eeSJoel Stanleyboot := arch/$(ARCH)/boot 29472ab9eeSJoel Stanley 30f8c4a270SJonas Bonnifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y) 31f8c4a270SJonas Bonn KBUILD_CFLAGS += $(call cc-option,-mhard-mul) 32f8c4a270SJonas Bonnelse 33f8c4a270SJonas Bonn KBUILD_CFLAGS += $(call cc-option,-msoft-mul) 34f8c4a270SJonas Bonnendif 35f8c4a270SJonas Bonn 36f8c4a270SJonas Bonnifeq ($(CONFIG_OPENRISC_HAVE_INST_DIV),y) 37f8c4a270SJonas Bonn KBUILD_CFLAGS += $(call cc-option,-mhard-div) 38f8c4a270SJonas Bonnelse 39f8c4a270SJonas Bonn KBUILD_CFLAGS += $(call cc-option,-msoft-div) 40f8c4a270SJonas Bonnendif 41f8c4a270SJonas Bonn 42*87e387acSStafford Horneifeq ($(CONFIG_OPENRISC_HAVE_INST_CMOV),y) 43*87e387acSStafford Horne KBUILD_CFLAGS += $(call cc-option,-mcmov) 44*87e387acSStafford Horneendif 45*87e387acSStafford Horne 46*87e387acSStafford Horneifeq ($(CONFIG_OPENRISC_HAVE_INST_ROR),y) 47*87e387acSStafford Horne KBUILD_CFLAGS += $(call cc-option,-mror) 48*87e387acSStafford Horneendif 49*87e387acSStafford Horne 50*87e387acSStafford Horneifeq ($(CONFIG_OPENRISC_HAVE_INST_RORI),y) 51*87e387acSStafford Horne KBUILD_CFLAGS += $(call cc-option,-mrori) 52*87e387acSStafford Horneendif 53*87e387acSStafford Horne 54*87e387acSStafford Horneifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y) 55*87e387acSStafford Horne KBUILD_CFLAGS += $(call cc-option,-msext) 56*87e387acSStafford Horneendif 57*87e387acSStafford Horne 58f8c4a270SJonas Bonnlibs-y += $(LIBGCC) 59f8c4a270SJonas Bonn 60472ab9eeSJoel StanleyPHONY += vmlinux.bin 61472ab9eeSJoel Stanley 62472ab9eeSJoel Stanleyvmlinux.bin: vmlinux 63472ab9eeSJoel Stanley $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 64