David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 1 | ############################################################################### |
| 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 | |
| 15 | KBUILD_DEFCONFIG := asb2303_defconfig |
| 16 | |
| 17 | CCSPECS := $(shell $(CC) -v 2>&1 | grep "^Reading specs from " | head -1 | cut -c20-) |
| 18 | CCDIR := $(strip $(patsubst %/specs,%,$(CCSPECS))) |
| 19 | KBUILD_CPPFLAGS += -nostdinc -I$(CCDIR)/include |
| 20 | |
| 21 | LDFLAGS := |
Mark Salter | b0641e8 | 2010-01-08 14:43:15 -0800 | [diff] [blame] | 22 | OBJCOPYFLAGS := -O binary -R .note -R .comment -R .GCC-command-line -R .note.gnu.build-id -S |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 23 | #LDFLAGS_vmlinux := -Map linkmap.txt |
| 24 | CHECKFLAGS += |
| 25 | |
| 26 | PROCESSOR := unset |
| 27 | UNIT := unset |
| 28 | |
Geert Uytterhoeven | 9957423 | 2012-10-04 17:11:13 -0700 | [diff] [blame] | 29 | KBUILD_CFLAGS += -mam33 -DCPU=AM33 $(call cc-option,-mmem-funcs,) |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 30 | KBUILD_AFLAGS += -mam33 -DCPU=AM33 |
| 31 | |
| 32 | ifeq ($(CONFIG_MN10300_CURRENT_IN_E2),y) |
| 33 | KBUILD_CFLAGS += -ffixed-e2 -fcall-saved-e5 |
| 34 | endif |
| 35 | |
| 36 | ifeq ($(CONFIG_MN10300_PROC_MN103E010),y) |
| 37 | PROCESSOR := mn103e010 |
| 38 | endif |
Akira Takeuchi | 368dd5a | 2010-10-27 17:28:55 +0100 | [diff] [blame] | 39 | ifeq ($(CONFIG_MN10300_PROC_MN2WS0050),y) |
| 40 | PROCESSOR := mn2ws0050 |
| 41 | endif |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 42 | |
| 43 | ifeq ($(CONFIG_MN10300_UNIT_ASB2303),y) |
| 44 | UNIT := asb2303 |
| 45 | endif |
| 46 | ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y) |
| 47 | UNIT := asb2305 |
| 48 | endif |
Akira Takeuchi | 368dd5a | 2010-10-27 17:28:55 +0100 | [diff] [blame] | 49 | ifeq ($(CONFIG_MN10300_UNIT_ASB2364),y) |
| 50 | UNIT := asb2364 |
| 51 | endif |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 52 | |
| 53 | |
Thomas Gleixner | fe285f5 | 2012-05-03 09:02:56 +0000 | [diff] [blame] | 54 | head-y := arch/mn10300/kernel/head.o |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 55 | |
| 56 | core-y += arch/mn10300/kernel/ arch/mn10300/mm/ |
| 57 | |
| 58 | ifneq ($(PROCESSOR),unset) |
| 59 | core-y += arch/mn10300/proc-$(PROCESSOR)/ |
| 60 | endif |
| 61 | ifneq ($(UNIT),unset) |
| 62 | core-y += arch/mn10300/unit-$(UNIT)/ |
| 63 | endif |
| 64 | libs-y += arch/mn10300/lib/ |
| 65 | |
| 66 | drivers-$(CONFIG_OPROFILE) += arch/mn10300/oprofile/ |
| 67 | |
| 68 | boot := arch/mn10300/boot |
| 69 | |
| 70 | .PHONY: zImage |
| 71 | |
| 72 | KBUILD_IMAGE := $(boot)/zImage |
| 73 | CLEAN_FILES += $(boot)/zImage |
| 74 | CLEAN_FILES += $(boot)/compressed/vmlinux |
| 75 | CLEAN_FILES += $(boot)/compressed/vmlinux.bin |
| 76 | CLEAN_FILES += $(boot)/compressed/vmlinux.bin.gz |
| 77 | |
| 78 | zImage: vmlinux |
| 79 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 80 | |
| 81 | all: zImage |
| 82 | |
| 83 | bootstrap: |
| 84 | $(Q)$(MAKEBOOT) bootstrap |
| 85 | |
| 86 | archclean: |
| 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 | |
| 91 | define archhelp |
| 92 | echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' |
| 93 | endef |
| 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. |
| 98 | ifdef CONFIG_DEBUG_INFO |
| 99 | #KBUILD_CFLAGS += -O1 |
| 100 | KBUILD_AFLAGS += -Wa,--gdwarf2 |
| 101 | endif |
| 102 | |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 103 | # |
David Howells | 2f2a213 | 2009-04-10 14:33:48 +0100 | [diff] [blame] | 104 | # include the appropriate processor- and unit-specific headers |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 105 | # |
David Howells | 2f2a213 | 2009-04-10 14:33:48 +0100 | [diff] [blame] | 106 | KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/proc-$(PROCESSOR)/include |
| 107 | KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/unit-$(UNIT)/include |