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