]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - arch/mn10300/Makefile
Move arch headers from include/asm-mn10300/ to arch/mn10300/include/asm/.
[mirror_ubuntu-focal-kernel.git] / arch / mn10300 / Makefile
CommitLineData
b920de1b
DH
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
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 :=
22OBJCOPYFLAGS := -O binary -R .note -R .comment -S
23#LDFLAGS_vmlinux := -Map linkmap.txt
24CHECKFLAGS +=
25
26PROCESSOR := unset
27UNIT := unset
28
29KBUILD_CFLAGS += -mam33 -mmem-funcs -DCPU=AM33
30KBUILD_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
39
40ifeq ($(CONFIG_MN10300_UNIT_ASB2303),y)
41UNIT := asb2303
42endif
43ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y)
44UNIT := asb2305
45endif
46
47
48head-y := arch/mn10300/kernel/head.o arch/mn10300/kernel/init_task.o
49
50core-y += arch/mn10300/kernel/ arch/mn10300/mm/
51
52ifneq ($(PROCESSOR),unset)
53core-y += arch/mn10300/proc-$(PROCESSOR)/
54endif
55ifneq ($(UNIT),unset)
56core-y += arch/mn10300/unit-$(UNIT)/
57endif
58libs-y += arch/mn10300/lib/
59
60drivers-$(CONFIG_OPROFILE) += arch/mn10300/oprofile/
61
62boot := arch/mn10300/boot
63
64.PHONY: zImage
65
66KBUILD_IMAGE := $(boot)/zImage
67CLEAN_FILES += $(boot)/zImage
68CLEAN_FILES += $(boot)/compressed/vmlinux
69CLEAN_FILES += $(boot)/compressed/vmlinux.bin
70CLEAN_FILES += $(boot)/compressed/vmlinux.bin.gz
71
72zImage: vmlinux
73 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
74
75all: zImage
76
77bootstrap:
78 $(Q)$(MAKEBOOT) bootstrap
79
80archclean:
81 $(Q)$(MAKE) $(clean)=arch/mn10300/proc-mn103e010
82 $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2303
83 $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2305
84
85define archhelp
86 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
87endef
88
89# If you make sure the .S files get compiled with debug info,
90# uncomment the following to disable optimisations
91# that are unhelpful whilst debugging.
92ifdef CONFIG_DEBUG_INFO
93#KBUILD_CFLAGS += -O1
94KBUILD_AFLAGS += -Wa,--gdwarf2
95endif
96
97###################################################################################################
98#
99# juggle some symlinks in the MN10300 asm include dir
100#
101# Update machine proc and unit symlinks if something which affects
102# them changed. We use .proc / .unit to indicate when they were
103# updated last, otherwise make uses the target directory mtime.
104#
105###################################################################################################
106
107# processor specific definitions
da761661
DH
108arch/mn10300/include/asm/.proc: $(wildcard include/config/proc/*.h) include/config/auto.conf
109 @echo ' SYMLINK arch/mn10300/include/asm/proc -> arch/mn10300/include/asm/proc-$(PROCESSOR)'
b920de1b 110ifneq ($(KBUILD_SRC),)
da761661
DH
111 $(Q)mkdir -p arch/mn10300/include/asm
112 $(Q)ln -fsn $(srctree)/arch/mn10300/include/asm/proc-$(PROCESSOR) arch/mn10300/include/asm/proc
b920de1b 113else
da761661 114 $(Q)ln -fsn proc-$(PROCESSOR) arch/mn10300/include/asm/proc
b920de1b
DH
115endif
116 @touch $@
117
da761661 118CLEAN_FILES += arch/mn10300/include/asm/proc arch/mn10300/include/asm/.proc
b920de1b 119
da761661 120prepare: arch/mn10300/include/asm/.proc
b920de1b
DH
121
122# unit specific definitions
da761661
DH
123arch/mn10300/include/asm/.unit: $(wildcard include/config/unit/*.h) include/config/auto.conf
124 @echo ' SYMLINK arch/mn10300/include/asm/unit -> arch/mn10300/include/asm/unit-$(UNIT)'
b920de1b 125ifneq ($(KBUILD_SRC),)
da761661
DH
126 $(Q)mkdir -p arch/mn10300/include/asm
127 $(Q)ln -fsn $(srctree)/arch/mn10300/include/asm/unit-$(UNIT) arch/mn10300/include/asm/unit
b920de1b 128else
da761661 129 $(Q)ln -fsn unit-$(UNIT) arch/mn10300/include/asm/unit
b920de1b
DH
130endif
131 @touch $@
132
da761661 133CLEAN_FILES += arch/mn10300/include/asm/unit arch/mn10300/include/asm/.unit
b920de1b 134
da761661 135prepare: arch/mn10300/include/asm/.unit