blob: ec89886ed4554b692dbb3b1154045df90212caaa [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
26CCSPECS := $(shell $(CC) -v 2>&1 | grep "^Reading specs from " | head -1 | cut -c20-)
27CCDIR := $(strip $(patsubst %/specs,%,$(CCSPECS)))
28CPUCLASS := fr400
29
30# test for cross compiling
31COMPILE_ARCH = $(shell uname -m)
32
33ifdef CONFIG_MMU
34UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
35else
36UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
37endif
38
39ARCHMODFLAGS += -G0 -mlong-calls
40
41ifdef CONFIG_GPREL_DATA_8
Sam Ravnborga0f97e02007-10-14 22:21:35 +020042KBUILD_CFLAGS += -G8
Linus Torvalds1da177e2005-04-16 15:20:36 -070043else
44ifdef CONFIG_GPREL_DATA_4
Sam Ravnborga0f97e02007-10-14 22:21:35 +020045KBUILD_CFLAGS += -G4
Linus Torvalds1da177e2005-04-16 15:20:36 -070046else
47ifdef CONFIG_GPREL_DATA_NONE
Sam Ravnborga0f97e02007-10-14 22:21:35 +020048KBUILD_CFLAGS += -G0
Linus Torvalds1da177e2005-04-16 15:20:36 -070049endif
50endif
51endif
52
53#LDFLAGS_vmlinux := -Map linkmap.txt
54
55ifdef CONFIG_GC_SECTIONS
Sam Ravnborga0f97e02007-10-14 22:21:35 +020056KBUILD_CFLAGS += -ffunction-sections -fdata-sections
Linus Torvalds1da177e2005-04-16 15:20:36 -070057LINKFLAGS += --gc-sections
58endif
59
60ifndef CONFIG_FRAME_POINTER
Sam Ravnborga0f97e02007-10-14 22:21:35 +020061KBUILD_CFLAGS += -mno-linked-fp
Linus Torvalds1da177e2005-04-16 15:20:36 -070062endif
63
64ifdef CONFIG_CPU_FR451_COMPILE
Sam Ravnborga0f97e02007-10-14 22:21:35 +020065KBUILD_CFLAGS += -mcpu=fr450
Linus Torvalds1da177e2005-04-16 15:20:36 -070066AFLAGS += -mcpu=fr450
67ASFLAGS += -mcpu=fr450
68else
69ifdef CONFIG_CPU_FR551_COMPILE
Sam Ravnborga0f97e02007-10-14 22:21:35 +020070KBUILD_CFLAGS += -mcpu=fr550
Linus Torvalds1da177e2005-04-16 15:20:36 -070071AFLAGS += -mcpu=fr550
72ASFLAGS += -mcpu=fr550
73else
Sam Ravnborga0f97e02007-10-14 22:21:35 +020074KBUILD_CFLAGS += -mcpu=fr400
Linus Torvalds1da177e2005-04-16 15:20:36 -070075AFLAGS += -mcpu=fr400
76ASFLAGS += -mcpu=fr400
77endif
78endif
79
80# pretend the kernel is going to run on an FR400 with no media-fp unit
81# - reserve CC3 for use with atomic ops
82# - all the extra registers are dealt with only at context switch time
Sam Ravnborga0f97e02007-10-14 22:21:35 +020083KBUILD_CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
84KBUILD_CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
Linus Torvalds1da177e2005-04-16 15:20:36 -070085AFLAGS += -mno-fdpic
86ASFLAGS += -mno-fdpic
87
88# make sure the .S files get compiled with debug info
89# and disable optimisations that are unhelpful whilst debugging
90ifdef CONFIG_DEBUG_INFO
Sam Ravnborga0f97e02007-10-14 22:21:35 +020091#KBUILD_CFLAGS += -O1
Linus Torvalds1da177e2005-04-16 15:20:36 -070092AFLAGS += -Wa,--gdwarf2
93ASFLAGS += -Wa,--gdwarf2
94endif
95
96head-y := arch/frv/kernel/head.o arch/frv/kernel/init_task.o
97
98core-y += arch/frv/kernel/ arch/frv/mm/
99libs-y += arch/frv/lib/
100
101core-$(CONFIG_MB93090_MB00) += arch/frv/mb93090-mb00/
102
103all: Image
104
105Image: vmlinux
106 $(Q)$(MAKE) $(build)=arch/frv/boot $@
107
108bootstrap:
109 $(Q)$(MAKEBOOT) bootstrap
110
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111archclean:
Al Viro00ddaf22006-09-23 01:22:46 +0100112 $(Q)$(MAKE) $(clean)=arch/frv/boot
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
114archdep: scripts/mkdep symlinks
David Howells41be6ae2006-01-08 01:01:25 -0800115 $(Q)$(MAKE) $(build)=arch/frv/boot dep