Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 1 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | # 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 Bunk | 8f80841 | 2008-02-26 19:47:03 +0200 | [diff] [blame] | 13 | KBUILD_DEFCONFIG := etrax-100lx_v2_defconfig |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | arch-y := v10 |
| 16 | arch-$(CONFIG_ETRAX_ARCH_V10) := v10 |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 17 | arch-$(CONFIG_ETRAX_ARCH_V32) := v32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 19 | # No config available for make clean etc |
| 20 | mach-y := fs |
| 21 | mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3 |
| 22 | mach-$(CONFIG_ETRAXFS) := fs |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | ifneq ($(arch-y),) |
| 25 | SARCH := arch-$(arch-y) |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 26 | inc := -Iarch/cris/include/$(SARCH) |
| 27 | inc += -Iarch/cris/include/$(SARCH)/arch |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | else |
| 29 | SARCH := |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 30 | inc := |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | endif |
| 32 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 33 | ifneq ($(mach-y),) |
| 34 | MACH := mach-$(mach-y) |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 35 | inc += -Iarch/cris/include/$(SARCH)/$(MACH)/ |
| 36 | inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 37 | else |
| 38 | MACH := |
| 39 | endif |
| 40 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | LD = $(CROSS_COMPILE)ld -mcrislinux |
| 42 | |
| 43 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S |
| 44 | |
| 45 | CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 47 | KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc) |
| 48 | KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc) |
| 49 | KBUILD_CPPFLAGS += $(inc) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
| 51 | ifdef CONFIG_FRAME_POINTER |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 52 | KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g |
| 53 | KBUILD_CFLAGS += -fno-omit-frame-pointer |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | endif |
| 55 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 56 | head-y := arch/cris/$(SARCH)/kernel/head.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 58 | LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 60 | core-y += arch/cris/kernel/ arch/cris/mm/ |
| 61 | core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/ |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 62 | ifdef CONFIG_ETRAX_ARCH_V32 |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 63 | core-y += arch/cris/$(SARCH)/$(MACH)/ |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 64 | endif |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 65 | drivers-y += arch/cris/$(SARCH)/drivers/ |
| 66 | libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 68 | # cris source path |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 69 | SRC_ARCH = $(srctree)/arch/cris |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 70 | # cris object files path |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 71 | OBJ_ARCH = $(objtree)/arch/cris |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 72 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 73 | boot := arch/cris/$(SARCH)/boot |
| 74 | MACHINE := arch/cris/$(SARCH) |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 75 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 76 | all: zImage |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 77 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 78 | zImage Image: vmlinux |
| 79 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 81 | archprepare: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 83 | archclean: |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 84 | $(Q)if [ -e arch/cris/$(SARCH)/boot ]; then \ |
| 85 | $(MAKE) $(clean)=arch/cris/$(SARCH)/boot; \ |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 86 | fi |
| 87 | |
| 88 | CLEAN_FILES += \ |
| 89 | $(MACHINE)/boot/zImage \ |
| 90 | $(MACHINE)/boot/compressed/decompress.bin \ |
| 91 | $(MACHINE)/boot/compressed/piggy.gz \ |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 92 | $(MACHINE)/boot/rescue/rescue.bin |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 93 | |
Jesper Nilsson | 0365f70 | 2008-10-21 22:10:27 +0200 | [diff] [blame] | 94 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 95 | # MRPROPER_FILES += |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 96 | |
| 97 | define archhelp |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 98 | echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)' |
| 99 | echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)' |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 100 | endef |