blob: 760b734fb82277b2845dc8c121c6293e90df9377 [file] [log] [blame]
Jonas Bonnf8c4a272011-06-04 21:52:05 +03001# BK Id: %F% %I% %G% %U% %#%
2#
3# This file is included by the global makefile so that you can add your own
Masahiro Yamada8212f892021-10-13 15:36:22 +09004# architecture-specific flags and dependencies.
Jonas Bonnf8c4a272011-06-04 21:52:05 +03005#
6# This file is subject to the terms and conditions of the GNU General Public
7# License. See the file "COPYING" in the main directory of this archive
8# for more details.
9#
10# Copyright (C) 1994 by Linus Torvalds
11# Modifications for the OpenRISC architecture:
12# Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
13# Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
14#
15# Based on:
16# arch/i386/Makefile
17
18KBUILD_DEFCONFIG := or1ksim_defconfig
19
Jonas Bonnf8c4a272011-06-04 21:52:05 +030020OBJCOPYFLAGS := -O binary -R .note -R .comment -S
Jonas Bonnf8c4a272011-06-04 21:52:05 +030021LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
22
Chen Gangee4f96d2013-07-31 11:34:27 +080023KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__
Jonas Bonnf8c4a272011-06-04 21:52:05 +030024
Joel Stanley472ab9e2020-12-22 17:37:31 +103025all: vmlinux.bin
26
27boot := arch/$(ARCH)/boot
28
Jonas Bonnf8c4a272011-06-04 21:52:05 +030029ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y)
30 KBUILD_CFLAGS += $(call cc-option,-mhard-mul)
31else
32 KBUILD_CFLAGS += $(call cc-option,-msoft-mul)
33endif
34
35ifeq ($(CONFIG_OPENRISC_HAVE_INST_DIV),y)
36 KBUILD_CFLAGS += $(call cc-option,-mhard-div)
37else
38 KBUILD_CFLAGS += $(call cc-option,-msoft-div)
39endif
40
Thomas Gleixnercf5e6de2012-05-03 09:02:56 +000041head-y := arch/openrisc/kernel/head.o
Jonas Bonnf8c4a272011-06-04 21:52:05 +030042
Jonas Bonnf8c4a272011-06-04 21:52:05 +030043libs-y += $(LIBGCC)
44
Joel Stanley472ab9e2020-12-22 17:37:31 +103045PHONY += vmlinux.bin
46
47vmlinux.bin: vmlinux
48 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@