1#
2# metag/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" cleaning up for this architecture.
7#
8# This file is subject to the terms and conditions of the GNU General Public
9# License.  See the file "COPYING" in the main directory of this archive
10# for more details.
11#
12# Copyright (C) 1994 by Linus Torvalds
13#               2007,2008,2012 by Imagination Technologies Ltd.
14#
15
16LDFLAGS					:=
17OBJCOPYFLAGS				:= -O binary -R .note -R .comment -S
18
19checkflags-$(CONFIG_METAG_META12)	+= -DMETAC_1_2
20checkflags-$(CONFIG_METAG_META21)	+= -DMETAC_2_1
21CHECKFLAGS				+= -D__metag__ $(checkflags-y)
22
23KBUILD_DEFCONFIG			:= tz1090_defconfig
24
25sflags-$(CONFIG_METAG_META12)		+= -mmetac=1.2
26ifeq ($(CONFIG_METAG_META12),y)
27# Only use TBI API 1.4 if DSP is enabled for META12 cores
28sflags-$(CONFIG_METAG_DSP)		+= -DTBI_1_4
29endif
30sflags-$(CONFIG_METAG_META21)		+= -mmetac=2.1 -DTBI_1_4
31
32cflags-$(CONFIG_METAG_FUNCTION_TRACE)	+= -mhwtrace-leaf -mhwtrace-retpc
33cflags-$(CONFIG_METAG_META21)		+= -mextensions=bex
34
35KBUILD_CFLAGS				+= -pipe
36KBUILD_CFLAGS				+= -ffunction-sections
37
38KBUILD_CFLAGS				+= $(sflags-y) $(cflags-y)
39KBUILD_AFLAGS				+= $(sflags-y)
40
41LDFLAGS_vmlinux				:= $(ldflags-y)
42
43head-y					:= arch/metag/kernel/head.o
44
45core-y					+= arch/metag/boot/dts/
46core-y					+= arch/metag/kernel/
47core-y					+= arch/metag/mm/
48
49libs-y					+= arch/metag/lib/
50libs-y					+= arch/metag/tbx/
51
52drivers-$(CONFIG_OPROFILE)		+= arch/metag/oprofile/
53
54boot					:= arch/metag/boot
55
56boot_targets				+= uImage
57boot_targets				+= uImage.gz
58boot_targets				+= uImage.bz2
59boot_targets				+= uImage.xz
60boot_targets				+= uImage.lzo
61boot_targets				+= uImage.bin
62boot_targets				+= vmlinux.bin
63
64PHONY					+= $(boot_targets)
65
66all: vmlinux.bin
67
68$(boot_targets): vmlinux
69	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
70
71%.dtb %.dtb.S %.dtb.o: scripts
72	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
73
74dtbs: scripts
75	$(Q)$(MAKE) $(build)=$(boot)/dts dtbs
76
77archclean:
78	$(Q)$(MAKE) $(clean)=$(boot)
79
80define archhelp
81  echo  '* vmlinux.bin	- Binary kernel image (arch/$(ARCH)/boot/vmlinux.bin)'
82  @echo '  uImage  	- Alias to bootable U-Boot image'
83  @echo '  uImage.bin	- Kernel-only image for U-Boot (bin)'
84  @echo '  uImage.gz	- Kernel-only image for U-Boot (gzip)'
85  @echo '  uImage.bz2	- Kernel-only image for U-Boot (bzip2)'
86  @echo '  uImage.xz	- Kernel-only image for U-Boot (xz)'
87  @echo '  uImage.lzo	- Kernel-only image for U-Boot (lzo)'
88  @echo '  dtbs		- Build device tree blobs for enabled boards'
89endef
90