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 | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 26 | inc := -Iarch/cris/include/arch-$(arch-y) -Iarch/cris/include/arch-$(arch-y)/arch |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | else |
| 28 | SARCH := |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 29 | inc := |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | endif |
| 31 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 32 | ifneq ($(mach-y),) |
| 33 | MACH := mach-$(mach-y) |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 34 | inc += -Iarch/cris/include/$(SARCH)/$(MACH)/ |
| 35 | inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 36 | else |
| 37 | MACH := |
| 38 | endif |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | LD = $(CROSS_COMPILE)ld -mcrislinux |
| 41 | |
| 42 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S |
| 43 | |
| 44 | CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 46 | KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc) |
| 47 | KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc) |
| 48 | KBUILD_CPPFLAGS += $(inc) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
| 50 | ifdef CONFIG_FRAME_POINTER |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 51 | KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g |
| 52 | KBUILD_CFLAGS += -fno-omit-frame-pointer |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | endif |
| 54 | |
| 55 | head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o |
| 56 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 57 | LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
| 59 | core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ |
| 60 | core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 61 | ifdef CONFIG_ETRAX_ARCH_V32 |
| 62 | core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/ |
| 63 | endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ |
| 65 | libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) |
| 66 | |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 67 | # cris source path |
| 68 | SRC_ARCH = $(srctree)/arch/$(ARCH) |
| 69 | # cris object files path |
| 70 | OBJ_ARCH = $(objtree)/arch/$(ARCH) |
| 71 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 72 | boot := arch/$(ARCH)/boot |
| 73 | MACHINE := arch/$(ARCH)/$(SARCH) |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 74 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 75 | all: zImage |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 76 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 77 | zImage Image: vmlinux |
| 78 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 80 | archprepare: $(SRC_ARCH)/.links FORCE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
| 82 | # Create some links to make all tools happy |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 83 | $(SRC_ARCH)/.links: |
| 84 | @rm -rf $(SRC_ARCH)/drivers |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 85 | @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 86 | @rm -rf $(SRC_ARCH)/boot |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 87 | @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot |
Mikael Starvik | 3e41d65 | 2005-07-27 11:44:30 -0700 | [diff] [blame] | 88 | @rm -rf $(SRC_ARCH)/lib |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 89 | @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib |
| 90 | @rm -f $(SRC_ARCH)/arch/mach |
| 91 | @rm -rf $(SRC_ARCH)/arch |
| 92 | @ln -sfn $(SARCH) $(SRC_ARCH)/arch |
| 93 | ifdef CONFIG_ETRAX_ARCH_V32 |
| 94 | @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach |
| 95 | endif |
| 96 | @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S |
| 97 | @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | @touch $@ |
| 99 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 100 | archclean: |
| 101 | $(Q)if [ -e arch/$(ARCH)/boot ]; then \ |
| 102 | $(MAKE) $(clean)=arch/$(ARCH)/boot; \ |
| 103 | fi |
| 104 | |
| 105 | CLEAN_FILES += \ |
| 106 | $(MACHINE)/boot/zImage \ |
| 107 | $(MACHINE)/boot/compressed/decompress.bin \ |
| 108 | $(MACHINE)/boot/compressed/piggy.gz \ |
| 109 | $(MACHINE)/boot/rescue/rescue.bin \ |
Jesper Nilsson | 556dcee | 2008-10-21 17:45:58 +0200 | [diff] [blame] | 110 | $(SRC_ARCH)/.links |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 111 | |
| 112 | MRPROPER_FILES += \ |
| 113 | $(SRC_ARCH)/drivers \ |
| 114 | $(SRC_ARCH)/boot \ |
| 115 | $(SRC_ARCH)/lib \ |
| 116 | $(SRC_ARCH)/arch \ |
Jesper Nilsson | 0365f70 | 2008-10-21 22:10:27 +0200 | [diff] [blame^] | 117 | $(SRC_ARCH)/kernel/vmlinux.lds.S |
| 118 | |
Jesper Nilsson | 2c2314b | 2007-11-30 16:07:06 +0100 | [diff] [blame] | 119 | |
| 120 | define archhelp |
| 121 | echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' |
| 122 | echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' |
| 123 | endef |