blob: 4a5404b3d0e45712c246b93c05ce21da5e732489 [file] [log] [blame]
Jesper Nilsson2c2314b2007-11-30 16:07:06 +01001#
Linus Torvalds1da177e2005-04-16 15:20:36 -07002# cris/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" and "archdep" for cleaning up and making dependencies for
7# this architecture
8#
9# This file is subject to the terms and conditions of the GNU General Public
10# License. See the file "COPYING" in the main directory of this archive
11# for more details.
12
Adrian Bunk8f808412008-02-26 19:47:03 +020013KBUILD_DEFCONFIG := etrax-100lx_v2_defconfig
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015arch-y := v10
16arch-$(CONFIG_ETRAX_ARCH_V10) := v10
Mikael Starvik3e41d652005-07-27 11:44:30 -070017arch-$(CONFIG_ETRAX_ARCH_V32) := v32
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010019# No config available for make clean etc
20mach-y := fs
21mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
22mach-$(CONFIG_ETRAXFS) := fs
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024ifneq ($(arch-y),)
25SARCH := arch-$(arch-y)
David Howellsabbf1592012-10-02 18:01:26 +010026inc := -Iarch/cris/include/uapi/$(SARCH)
27inc += -Iarch/cris/include/$(SARCH)
28inc += -Iarch/cris/include/uapi/$(SARCH)/arch
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020029inc += -Iarch/cris/include/$(SARCH)/arch
Linus Torvalds1da177e2005-04-16 15:20:36 -070030else
31SARCH :=
Jesper Nilsson556dcee2008-10-21 17:45:58 +020032inc :=
Linus Torvalds1da177e2005-04-16 15:20:36 -070033endif
34
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010035ifneq ($(mach-y),)
36MACH := mach-$(mach-y)
Jesper Nilsson556dcee2008-10-21 17:45:58 +020037inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
38inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010039else
40MACH :=
41endif
42
Rabin Vincenta9f75ac2015-02-08 16:14:06 +010043ifneq ($(CONFIG_BUILTIN_DTB),"")
44core-$(CONFIG_OF) += arch/cris/boot/dts/
45endif
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047LD = $(CROSS_COMPILE)ld -mcrislinux
48
49OBJCOPYFLAGS := -O binary -R .note -R .comment -S
50
Jesper Nilsson556dcee2008-10-21 17:45:58 +020051KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
52KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
53KBUILD_CPPFLAGS += $(inc)
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55ifdef CONFIG_FRAME_POINTER
Sam Ravnborga0f97e02007-10-14 22:21:35 +020056KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
57KBUILD_CFLAGS += -fno-omit-frame-pointer
Linus Torvalds1da177e2005-04-16 15:20:36 -070058endif
59
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020060head-y := arch/cris/$(SARCH)/kernel/head.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Sam Ravnborga0f97e02007-10-14 22:21:35 +020062LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020064core-y += arch/cris/kernel/ arch/cris/mm/
65core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010066ifdef CONFIG_ETRAX_ARCH_V32
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020067core-y += arch/cris/$(SARCH)/$(MACH)/
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010068endif
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020069drivers-y += arch/cris/$(SARCH)/drivers/
70libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Mikael Starvik3e41d652005-07-27 11:44:30 -070072# cris source path
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020073SRC_ARCH = $(srctree)/arch/cris
Mikael Starvik3e41d652005-07-27 11:44:30 -070074# cris object files path
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020075OBJ_ARCH = $(objtree)/arch/cris
Mikael Starvik3e41d652005-07-27 11:44:30 -070076
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020077boot := arch/cris/boot
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020078MACHINE := arch/cris/$(SARCH)
Mikael Starvik3e41d652005-07-27 11:44:30 -070079
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010080all: zImage
Mikael Starvik3e41d652005-07-27 11:44:30 -070081
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010082zImage Image: vmlinux
83 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020085archprepare:
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010087archclean:
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020088 $(Q)if [ -e arch/cris/boot ]; then \
89 $(MAKE) $(clean)=arch/cris/boot; \
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010090 fi
91
92CLEAN_FILES += \
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020093 $(boot)/zImage \
94 $(boot)/compressed/decompress.bin \
95 $(boot)/compressed/piggy.gz \
96 $(boot)/rescue/rescue.bin
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010097
Jesper Nilsson0365f702008-10-21 22:10:27 +020098
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020099# MRPROPER_FILES +=
Jesper Nilsson2c2314b2007-11-30 16:07:06 +0100100
101define archhelp
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200102 echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
103 echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
Jesper Nilsson2c2314b2007-11-30 16:07:06 +0100104endef