blob: 71e17d3eeddba6d8119378e414a4bc742a26a5d9 [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)
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020026inc := -Iarch/cris/include/$(SARCH)
27inc += -Iarch/cris/include/$(SARCH)/arch
Linus Torvalds1da177e2005-04-16 15:20:36 -070028else
29SARCH :=
Jesper Nilsson556dcee2008-10-21 17:45:58 +020030inc :=
Linus Torvalds1da177e2005-04-16 15:20:36 -070031endif
32
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010033ifneq ($(mach-y),)
34MACH := mach-$(mach-y)
Jesper Nilsson556dcee2008-10-21 17:45:58 +020035inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
36inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010037else
38MACH :=
39endif
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041LD = $(CROSS_COMPILE)ld -mcrislinux
42
43OBJCOPYFLAGS := -O binary -R .note -R .comment -S
44
45CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Jesper Nilsson556dcee2008-10-21 17:45:58 +020047KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
48KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
49KBUILD_CPPFLAGS += $(inc)
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51ifdef CONFIG_FRAME_POINTER
Sam Ravnborga0f97e02007-10-14 22:21:35 +020052KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
53KBUILD_CFLAGS += -fno-omit-frame-pointer
Linus Torvalds1da177e2005-04-16 15:20:36 -070054endif
55
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020056head-y := arch/cris/$(SARCH)/kernel/head.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Sam Ravnborga0f97e02007-10-14 22:21:35 +020058LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020060core-y += arch/cris/kernel/ arch/cris/mm/
61core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010062ifdef CONFIG_ETRAX_ARCH_V32
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020063core-y += arch/cris/$(SARCH)/$(MACH)/
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010064endif
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020065drivers-y += arch/cris/$(SARCH)/drivers/
66libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Mikael Starvik3e41d652005-07-27 11:44:30 -070068# cris source path
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020069SRC_ARCH = $(srctree)/arch/cris
Mikael Starvik3e41d652005-07-27 11:44:30 -070070# cris object files path
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020071OBJ_ARCH = $(objtree)/arch/cris
Mikael Starvik3e41d652005-07-27 11:44:30 -070072
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020073boot := arch/cris/boot
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020074MACHINE := arch/cris/$(SARCH)
Mikael Starvik3e41d652005-07-27 11:44:30 -070075
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010076all: zImage
Mikael Starvik3e41d652005-07-27 11:44:30 -070077
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010078zImage Image: vmlinux
79 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020081archprepare:
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010083archclean:
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020084 $(Q)if [ -e arch/cris/boot ]; then \
85 $(MAKE) $(clean)=arch/cris/boot; \
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010086 fi
87
88CLEAN_FILES += \
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020089 $(boot)/zImage \
90 $(boot)/compressed/decompress.bin \
91 $(boot)/compressed/piggy.gz \
92 $(boot)/rescue/rescue.bin
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010093
Jesper Nilsson0365f702008-10-21 22:10:27 +020094
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020095# MRPROPER_FILES +=
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010096
97define archhelp
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020098 echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
99 echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
Jesper Nilsson2c2314b2007-11-30 16:07:06 +0100100endef