Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 1 | # |
| 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 Salter | 37d11ab | 2012-10-03 17:39:12 -0400 | [diff] [blame] | 9 | KBUILD_DEFCONFIG := dsk6455_defconfig |
| 10 | |
Chen Gang | 1d2a64b | 2015-03-03 06:33:42 +0800 | [diff] [blame] | 11 | cflags-y += -mno-dsbt -msdata=none -D__linux__ |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 12 | |
| 13 | cflags-$(CONFIG_C6X_BIG_KERNEL) += -mlong-calls |
| 14 | |
Cao jin | 265444a | 2017-10-09 15:11:46 +0800 | [diff] [blame] | 15 | KBUILD_CFLAGS_MODULE += -mlong-calls -mno-dsbt -msdata=none |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 16 | |
| 17 | CHECKFLAGS += |
| 18 | |
| 19 | KBUILD_CFLAGS += $(cflags-y) |
| 20 | KBUILD_AFLAGS += $(cflags-y) |
| 21 | |
| 22 | ifdef CONFIG_CPU_BIG_ENDIAN |
| 23 | KBUILD_CFLAGS += -mbig-endian |
| 24 | KBUILD_AFLAGS += -mbig-endian |
| 25 | LINKFLAGS += -mbig-endian |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 26 | KBUILD_LDFLAGS += -mbig-endian -EB |
Luc Van Oostenryck | 85fa2cc | 2017-10-31 18:22:02 +0100 | [diff] [blame] | 27 | CHECKFLAGS += -D_BIG_ENDIAN |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 28 | endif |
| 29 | |
| 30 | head-y := arch/c6x/kernel/head.o |
| 31 | core-y += arch/c6x/kernel/ arch/c6x/mm/ arch/c6x/platforms/ |
| 32 | libs-y += arch/c6x/lib/ |
| 33 | |
| 34 | # Default to vmlinux.bin, override when needed |
| 35 | all: vmlinux.bin |
| 36 | |
| 37 | boot := arch/$(ARCH)/boot |
| 38 | |
| 39 | # Are we making a dtbImage.<boardname> target? If so, crack out the boardname |
| 40 | DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS))) |
| 41 | export DTB |
| 42 | |
Stephen Warren | 1020e29 | 2012-11-27 16:29:14 -0700 | [diff] [blame] | 43 | core-y += $(boot)/dts/ |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 44 | |
| 45 | # With make 3.82 we cannot mix normal and wildcard targets |
| 46 | |
| 47 | vmlinux.bin: vmlinux |
| 48 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
| 49 | |
| 50 | dtbImage.%: vmlinux |
| 51 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
| 52 | |
| 53 | archclean: |
| 54 | $(Q)$(MAKE) $(clean)=$(boot) |
| 55 | |
| 56 | define archhelp |
| 57 | @echo ' vmlinux.bin - Binary kernel image (arch/$(ARCH)/boot/vmlinux.bin)' |
| 58 | @echo ' dtbImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in' |
| 59 | @echo ' - stripped elf with fdt blob' |
| 60 | endef |