at v2.6.12 112 lines 3.3 kB view raw
1# $Id: Makefile,v 1.23 2004/10/19 13:07:34 starvik Exp $ 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 13# A bug in ld prevents us from having a (constant-value) symbol in a 14# "ORIGIN =" or "LENGTH =" expression. 15 16arch-y := v10 17arch-$(CONFIG_ETRAX_ARCH_V10) := v10 18 19# No config avaiable for make clean etc 20ifneq ($(arch-y),) 21SARCH := arch-$(arch-y) 22else 23SARCH := 24endif 25 26LD = $(CROSS_COMPILE)ld -mcrislinux 27 28OBJCOPYFLAGS := -O binary -R .note -R .comment -S 29 30CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) 31AFLAGS += -mlinux 32 33CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe 34 35ifdef CONFIG_FRAME_POINTER 36CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g 37CFLAGS += -fno-omit-frame-pointer 38endif 39 40head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o 41 42LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a) 43 44core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ 45core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ 46drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ 47libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) 48 49vmlinux.bin: vmlinux 50 $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin 51 52timage: vmlinux.bin 53 cat vmlinux.bin cramfs.img >timage 54 55simimage: timage 56 cp vmlinux.bin simvmlinux.bin 57 58# the following will remake timage without compiling the kernel 59# it does of course require that all object files exist... 60 61cramfs: 62## cramfs - Creates a cramfs image 63 mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img 64 cat vmlinux.bin cramfs.img >timage 65 66clinux: vmlinux.bin decompress.bin rescue.bin 67 68decompress.bin: FORCE 69 @make -C arch/$(ARCH)/boot/compressed decompress.bin 70 71rescue.bin: FORCE 72 @make -C arch/$(ARCH)/boot/rescue rescue.bin 73 74zImage: vmlinux.bin rescue.bin 75## zImage - Compressed kernel (gzip) 76 @make -C arch/$(ARCH)/boot/ zImage 77 78compressed: zImage 79 80archmrproper: 81archclean: 82 $(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot 83 rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img 84 rm -rf $(LD_SCRIPT).tmp 85 86prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \ 87 include/asm-$(ARCH)/$(SARCH)/offset.h 88 89# Create some links to make all tools happy 90arch/$(ARCH)/.links: 91 @rm -rf arch/$(ARCH)/drivers 92 @ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers 93 @rm -rf arch/$(ARCH)/boot 94 @ln -sfn $(SARCH)/boot arch/$(ARCH)/boot 95 @rm -rf arch/$(ARCH)/lib 96 @ln -sfn $(SARCH)/lib arch/$(ARCH)/lib 97 @ln -sfn $(SARCH) arch/$(ARCH)/arch 98 @ln -sfn ../$(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S 99 @touch $@ 100 101# Create link to sub arch includes 102include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h) 103 @echo ' Making asm-$(ARCH)/arch -> asm-$(ARCH)/$(SARCH) symlink' 104 @rm -f include/asm-$(ARCH)/arch 105 @ln -sf $(SARCH) include/asm-$(ARCH)/arch 106 @touch $@ 107 108arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ 109 include/config/MARKER 110 111include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s 112 $(call filechk,gen-asm-offsets)