blob: 4d1b1e9baef102ed79013098b27918a4cea051a9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# frv/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions
6# for "archclean" and "archdep" for cleaning up and making dependencies for
7# this architecture
8#
9# This file is subject to the terms and conditions of the GNU General Public
10# License. See the file "COPYING" in the main directory of this archive
11# for more details.
12#
13# Copyright (c) 2003, 2004 Red Hat Inc.
14# - Written by David Howells <dhowells@redhat.com>
15# - Derived from arch/m68knommu/Makefile,
16# Copyright (c) 1999,2001 D. Jeff Dionne <jeff@lineo.ca>,
17# Rt-Control Inc. / Lineo, Inc.
18#
19# Copyright (C) 1998,1999 D. Jeff Dionne <jeff@uclinux.org>,
20# Kenneth Albanowski <kjahds@kjahds.com>,
21#
22# Based on arch/m68k/Makefile:
23# Copyright (C) 1994 by Hamish Macdonald
24#
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026ifdef CONFIG_MMU
27UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
28else
29UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
30endif
31
Sam Ravnborgc9575dc2010-07-28 19:33:00 +020032KBUILD_AFLAGS_MODULE += -G0 -mlong-calls
33KBUILD_CFLAGS_MODULE += -G0 -mlong-calls
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35ifdef CONFIG_GPREL_DATA_8
Sam Ravnborga0f97e02007-10-14 22:21:35 +020036KBUILD_CFLAGS += -G8
Linus Torvalds1da177e2005-04-16 15:20:36 -070037else
38ifdef CONFIG_GPREL_DATA_4
Sam Ravnborga0f97e02007-10-14 22:21:35 +020039KBUILD_CFLAGS += -G4
Linus Torvalds1da177e2005-04-16 15:20:36 -070040else
41ifdef CONFIG_GPREL_DATA_NONE
Sam Ravnborga0f97e02007-10-14 22:21:35 +020042KBUILD_CFLAGS += -G0
Linus Torvalds1da177e2005-04-16 15:20:36 -070043endif
44endif
45endif
46
47#LDFLAGS_vmlinux := -Map linkmap.txt
48
49ifdef CONFIG_GC_SECTIONS
Sam Ravnborga0f97e02007-10-14 22:21:35 +020050KBUILD_CFLAGS += -ffunction-sections -fdata-sections
Linus Torvalds1da177e2005-04-16 15:20:36 -070051endif
52
53ifndef CONFIG_FRAME_POINTER
Sam Ravnborga0f97e02007-10-14 22:21:35 +020054KBUILD_CFLAGS += -mno-linked-fp
Linus Torvalds1da177e2005-04-16 15:20:36 -070055endif
56
57ifdef CONFIG_CPU_FR451_COMPILE
Sam Ravnborga0f97e02007-10-14 22:21:35 +020058KBUILD_CFLAGS += -mcpu=fr450
Sam Ravnborg222d3942007-10-15 21:59:31 +020059KBUILD_AFLAGS += -mcpu=fr450
Linus Torvalds1da177e2005-04-16 15:20:36 -070060else
61ifdef CONFIG_CPU_FR551_COMPILE
Sam Ravnborga0f97e02007-10-14 22:21:35 +020062KBUILD_CFLAGS += -mcpu=fr550
Sam Ravnborg222d3942007-10-15 21:59:31 +020063KBUILD_AFLAGS += -mcpu=fr550
Linus Torvalds1da177e2005-04-16 15:20:36 -070064else
Sam Ravnborga0f97e02007-10-14 22:21:35 +020065KBUILD_CFLAGS += -mcpu=fr400
Sam Ravnborg222d3942007-10-15 21:59:31 +020066KBUILD_AFLAGS += -mcpu=fr400
Linus Torvalds1da177e2005-04-16 15:20:36 -070067endif
68endif
69
70# pretend the kernel is going to run on an FR400 with no media-fp unit
71# - reserve CC3 for use with atomic ops
72# - all the extra registers are dealt with only at context switch time
Sam Ravnborga0f97e02007-10-14 22:21:35 +020073KBUILD_CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
74KBUILD_CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
Sam Ravnborg222d3942007-10-15 21:59:31 +020075KBUILD_AFLAGS += -mno-fdpic
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
77# make sure the .S files get compiled with debug info
78# and disable optimisations that are unhelpful whilst debugging
79ifdef CONFIG_DEBUG_INFO
Sam Ravnborga0f97e02007-10-14 22:21:35 +020080#KBUILD_CFLAGS += -O1
Sam Ravnborg222d3942007-10-15 21:59:31 +020081KBUILD_AFLAGS += -Wa,--gdwarf2
Linus Torvalds1da177e2005-04-16 15:20:36 -070082endif
83
Thomas Gleixnercb0fcba2012-05-03 09:02:53 +000084head-y := arch/frv/kernel/head.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
86core-y += arch/frv/kernel/ arch/frv/mm/
87libs-y += arch/frv/lib/
88
89core-$(CONFIG_MB93090_MB00) += arch/frv/mb93090-mb00/
90
91all: Image
92
93Image: vmlinux
94 $(Q)$(MAKE) $(build)=arch/frv/boot $@
95
Linus Torvalds1da177e2005-04-16 15:20:36 -070096archclean:
Al Viro00ddaf22006-09-23 01:22:46 +010097 $(Q)$(MAKE) $(clean)=arch/frv/boot