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