Linux-2.6.12-rc2
[pandora-kernel.git] / arch / cris / Makefile
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
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
28 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
29
30 CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
31 AFLAGS += -mlinux
32
33 CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
34
35 ifdef CONFIG_FRAME_POINTER
36 CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
37 CFLAGS += -fno-omit-frame-pointer
38 endif
39
40 head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
41
42 LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
43
44 core-y          += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
45 core-y          += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
46 drivers-y       += arch/$(ARCH)/$(SARCH)/drivers/
47 libs-y          += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
48
49 vmlinux.bin: vmlinux
50         $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
51
52 timage: vmlinux.bin
53         cat vmlinux.bin cramfs.img >timage
54
55 simimage: 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
61 cramfs:
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
66 clinux: vmlinux.bin decompress.bin rescue.bin
67
68 decompress.bin: FORCE
69         @make -C arch/$(ARCH)/boot/compressed decompress.bin
70
71 rescue.bin: FORCE
72         @make -C arch/$(ARCH)/boot/rescue rescue.bin
73
74 zImage: vmlinux.bin rescue.bin
75 ## zImage     - Compressed kernel (gzip)
76         @make -C arch/$(ARCH)/boot/ zImage
77
78 compressed: zImage
79
80 archmrproper:
81 archclean:
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
86 prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
87          include/asm-$(ARCH)/$(SARCH)/offset.h
88
89 # Create some links to make all tools happy
90 arch/$(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
102 include/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
108 arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
109                                         include/config/MARKER
110
111 include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s
112         $(call filechk,gen-asm-offsets)