blob: a3d0fef3b126ba859e5fe0459b1e12658cbebe69 [file] [log] [blame]
David Howellsb920de12008-02-08 04:19:31 -08001###############################################################################
2#
3# MN10300 Kernel makefile system specifications
4#
5# Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
6# Modified by David Howells (dhowells@redhat.com)
7#
8# This program is free software; you can redistribute it and/or
9# modify it under the terms of the GNU General Public Licence
10# as published by the Free Software Foundation; either version
11# 2 of the Licence, or (at your option) any later version.
12#
13###############################################################################
14
15KBUILD_DEFCONFIG := asb2303_defconfig
16
17CCSPECS := $(shell $(CC) -v 2>&1 | grep "^Reading specs from " | head -1 | cut -c20-)
18CCDIR := $(strip $(patsubst %/specs,%,$(CCSPECS)))
19KBUILD_CPPFLAGS += -nostdinc -I$(CCDIR)/include
20
21LDFLAGS :=
Mark Salterb0641e82010-01-08 14:43:15 -080022OBJCOPYFLAGS := -O binary -R .note -R .comment -R .GCC-command-line -R .note.gnu.build-id -S
David Howellsb920de12008-02-08 04:19:31 -080023#LDFLAGS_vmlinux := -Map linkmap.txt
24CHECKFLAGS +=
25
26PROCESSOR := unset
27UNIT := unset
28
Geert Uytterhoeven99574232012-10-04 17:11:13 -070029KBUILD_CFLAGS += -mam33 -DCPU=AM33 $(call cc-option,-mmem-funcs,)
David Howellsb920de12008-02-08 04:19:31 -080030KBUILD_AFLAGS += -mam33 -DCPU=AM33
31
32ifeq ($(CONFIG_MN10300_CURRENT_IN_E2),y)
33KBUILD_CFLAGS += -ffixed-e2 -fcall-saved-e5
34endif
35
36ifeq ($(CONFIG_MN10300_PROC_MN103E010),y)
37PROCESSOR := mn103e010
38endif
Akira Takeuchi368dd5a2010-10-27 17:28:55 +010039ifeq ($(CONFIG_MN10300_PROC_MN2WS0050),y)
40PROCESSOR := mn2ws0050
41endif
David Howellsb920de12008-02-08 04:19:31 -080042
43ifeq ($(CONFIG_MN10300_UNIT_ASB2303),y)
44UNIT := asb2303
45endif
46ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y)
47UNIT := asb2305
48endif
Akira Takeuchi368dd5a2010-10-27 17:28:55 +010049ifeq ($(CONFIG_MN10300_UNIT_ASB2364),y)
50UNIT := asb2364
51endif
David Howellsb920de12008-02-08 04:19:31 -080052
53
Thomas Gleixnerfe285f52012-05-03 09:02:56 +000054head-y := arch/mn10300/kernel/head.o
David Howellsb920de12008-02-08 04:19:31 -080055
56core-y += arch/mn10300/kernel/ arch/mn10300/mm/
57
58ifneq ($(PROCESSOR),unset)
59core-y += arch/mn10300/proc-$(PROCESSOR)/
60endif
61ifneq ($(UNIT),unset)
62core-y += arch/mn10300/unit-$(UNIT)/
63endif
64libs-y += arch/mn10300/lib/
65
66drivers-$(CONFIG_OPROFILE) += arch/mn10300/oprofile/
67
68boot := arch/mn10300/boot
69
70.PHONY: zImage
71
72KBUILD_IMAGE := $(boot)/zImage
73CLEAN_FILES += $(boot)/zImage
74CLEAN_FILES += $(boot)/compressed/vmlinux
75CLEAN_FILES += $(boot)/compressed/vmlinux.bin
76CLEAN_FILES += $(boot)/compressed/vmlinux.bin.gz
77
78zImage: vmlinux
79 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
80
81all: zImage
82
83bootstrap:
84 $(Q)$(MAKEBOOT) bootstrap
85
86archclean:
87 $(Q)$(MAKE) $(clean)=arch/mn10300/proc-mn103e010
88 $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2303
89 $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2305
90
91define archhelp
92 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
93endef
94
95# If you make sure the .S files get compiled with debug info,
96# uncomment the following to disable optimisations
97# that are unhelpful whilst debugging.
98ifdef CONFIG_DEBUG_INFO
99#KBUILD_CFLAGS += -O1
100KBUILD_AFLAGS += -Wa,--gdwarf2
101endif
102
David Howellsb920de12008-02-08 04:19:31 -0800103#
David Howells2f2a2132009-04-10 14:33:48 +0100104# include the appropriate processor- and unit-specific headers
David Howellsb920de12008-02-08 04:19:31 -0800105#
David Howells2f2a2132009-04-10 14:33:48 +0100106KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/proc-$(PROCESSOR)/include
107KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/unit-$(UNIT)/include