blob: 6ab942e6c534a01be558b1a1e85511b4f6dacbe9 [file] [log] [blame]
Aurelien Jacquiotc2784002011-10-04 10:54:51 -04001#
2# linux/arch/c6x/Makefile
3#
4# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive
6# for more details.
7#
8
Mark Salter37d11ab2012-10-03 17:39:12 -04009KBUILD_DEFCONFIG := dsk6455_defconfig
10
Chen Gang1d2a64b2015-03-03 06:33:42 +080011cflags-y += -mno-dsbt -msdata=none -D__linux__
Aurelien Jacquiotc2784002011-10-04 10:54:51 -040012
13cflags-$(CONFIG_C6X_BIG_KERNEL) += -mlong-calls
14
Cao jin265444a2017-10-09 15:11:46 +080015KBUILD_CFLAGS_MODULE += -mlong-calls -mno-dsbt -msdata=none
Aurelien Jacquiotc2784002011-10-04 10:54:51 -040016
17CHECKFLAGS +=
18
19KBUILD_CFLAGS += $(cflags-y)
20KBUILD_AFLAGS += $(cflags-y)
21
22ifdef CONFIG_CPU_BIG_ENDIAN
23KBUILD_CFLAGS += -mbig-endian
24KBUILD_AFLAGS += -mbig-endian
25LINKFLAGS += -mbig-endian
26KBUILD_LDFLAGS += -mbig-endian
27LDFLAGS += -EB
Luc Van Oostenryck85fa2cc2017-10-31 18:22:02 +010028CHECKFLAGS += -D_BIG_ENDIAN
Aurelien Jacquiotc2784002011-10-04 10:54:51 -040029endif
30
31head-y := arch/c6x/kernel/head.o
32core-y += arch/c6x/kernel/ arch/c6x/mm/ arch/c6x/platforms/
33libs-y += arch/c6x/lib/
34
35# Default to vmlinux.bin, override when needed
36all: vmlinux.bin
37
38boot := arch/$(ARCH)/boot
39
40# Are we making a dtbImage.<boardname> target? If so, crack out the boardname
41DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS)))
42export DTB
43
44ifneq ($(DTB),)
Stephen Warren1020e292012-11-27 16:29:14 -070045core-y += $(boot)/dts/
Aurelien Jacquiotc2784002011-10-04 10:54:51 -040046endif
47
48# With make 3.82 we cannot mix normal and wildcard targets
49
50vmlinux.bin: vmlinux
51 $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
52
53dtbImage.%: vmlinux
54 $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
55
56archclean:
57 $(Q)$(MAKE) $(clean)=$(boot)
58
59define archhelp
60 @echo ' vmlinux.bin - Binary kernel image (arch/$(ARCH)/boot/vmlinux.bin)'
61 @echo ' dtbImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
62 @echo ' - stripped elf with fdt blob'
63endef