blob: d73b58c847a63f3786ac3e69da0795363ee74ca7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#
3# m32r/Makefile
4#
Paul Smith4f193362006-03-05 17:14:10 -05005# This file is included by the global makefile so that you can add your own
6# architecture-specific flags and dependencies.
7#
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Adrian Bunk7622b462008-04-22 00:33:02 +03009KBUILD_DEFCONFIG := m32700ut.smp_defconfig
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011LDFLAGS :=
12OBJCOPYFLAGS := -O binary -R .note -R .comment -S
Hirokazu Takata3d60f842007-02-10 01:43:39 -080013LDFLAGS_vmlinux :=
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Sam Ravnborga0f97e02007-10-14 22:21:35 +020015KBUILD_CFLAGS += -pipe -fno-schedule-insns
Sam Ravnborg80c00ba2010-07-28 19:11:27 +020016KBUILD_CFLAGS_KERNEL += -mmodel=medium
Sam Ravnborg65881692010-07-28 17:33:09 +020017KBUILD_CFLAGS_MODULE += -mmodel=large
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19ifdef CONFIG_CHIP_VDEC2
20cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -Wa,-bitinst
Hirokazu Takatacde05cf2006-02-24 13:03:50 -080021aflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -O2 -Wa,-bitinst -Wa,-no-parallel
Linus Torvalds1da177e2005-04-16 15:20:36 -070022else
23cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -m32r2
Hirokazu Takatacde05cf2006-02-24 13:03:50 -080024aflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -m32r2 -O2
Linus Torvalds1da177e2005-04-16 15:20:36 -070025endif
26
27cflags-$(CONFIG_ISA_M32R) += -DNO_FPU
Hirokazu Takatacde05cf2006-02-24 13:03:50 -080028aflags-$(CONFIG_ISA_M32R) += -DNO_FPU -O2 -Wa,-no-bitinst
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Sam Ravnborga0f97e02007-10-14 22:21:35 +020030KBUILD_CFLAGS += $(cflags-y)
Sam Ravnborg222d3942007-10-15 21:59:31 +020031KBUILD_AFLAGS += $(aflags-y)
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Al Viroc74dbac2005-09-26 06:19:28 +010033CHECKFLAGS += -D__m32r__ -D__BIG_ENDIAN__=1
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Thomas Gleixner7433c5c2012-05-03 09:02:54 +000035head-y := arch/m32r/kernel/head.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
Sam Ravnborga0f97e02007-10-14 22:21:35 +020037LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39libs-y += arch/m32r/lib/ $(LIBGCC)
40core-y += arch/m32r/kernel/ \
41 arch/m32r/mm/ \
Hirokazu Takata3264f972007-08-01 21:09:31 +090042 arch/m32r/boot/ \
43 arch/m32r/platforms/
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45drivers-$(CONFIG_OPROFILE) += arch/m32r/oprofile/
46
47boot := arch/m32r/boot
48
Paul Smith4f193362006-03-05 17:14:10 -050049PHONY += zImage
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51all: zImage
52
53zImage: vmlinux
54 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
55
56compressed: zImage
57
58archclean:
59 $(Q)$(MAKE) $(clean)=$(boot)
60
61define archhelp
62 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
63endef