blob: 29c2ceb38a76dd05fb98e9728e53b2d0753df0df [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
Jesper Nilsson556dcee2008-10-21 17:45:58 +020045KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
46KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
47KBUILD_CPPFLAGS += $(inc)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49ifdef CONFIG_FRAME_POINTER
Sam Ravnborga0f97e02007-10-14 22:21:35 +020050KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
51KBUILD_CFLAGS += -fno-omit-frame-pointer
Linus Torvalds1da177e2005-04-16 15:20:36 -070052endif
53
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020054head-y := arch/cris/$(SARCH)/kernel/head.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
Sam Ravnborga0f97e02007-10-14 22:21:35 +020056LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020058core-y += arch/cris/kernel/ arch/cris/mm/
59core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010060ifdef CONFIG_ETRAX_ARCH_V32
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020061core-y += arch/cris/$(SARCH)/$(MACH)/
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010062endif
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020063drivers-y += arch/cris/$(SARCH)/drivers/
64libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
Mikael Starvik3e41d652005-07-27 11:44:30 -070066# cris source path
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020067SRC_ARCH = $(srctree)/arch/cris
Mikael Starvik3e41d652005-07-27 11:44:30 -070068# cris object files path
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020069OBJ_ARCH = $(objtree)/arch/cris
Mikael Starvik3e41d652005-07-27 11:44:30 -070070
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020071boot := arch/cris/boot
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020072MACHINE := arch/cris/$(SARCH)
Mikael Starvik3e41d652005-07-27 11:44:30 -070073
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010074all: zImage
Mikael Starvik3e41d652005-07-27 11:44:30 -070075
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010076zImage Image: vmlinux
77 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020079archprepare:
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010081archclean:
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020082 $(Q)if [ -e arch/cris/boot ]; then \
83 $(MAKE) $(clean)=arch/cris/boot; \
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010084 fi
85
86CLEAN_FILES += \
Jesper Nilsson66ab3a72009-04-21 11:44:57 +020087 $(boot)/zImage \
88 $(boot)/compressed/decompress.bin \
89 $(boot)/compressed/piggy.gz \
90 $(boot)/rescue/rescue.bin
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010091
Jesper Nilsson0365f702008-10-21 22:10:27 +020092
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020093# MRPROPER_FILES +=
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010094
95define archhelp
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020096 echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
97 echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
Jesper Nilsson2c2314b2007-11-30 16:07:06 +010098endef