make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / arch / cris / Makefile
1 # $Id: Makefile,v 1.1.1.1 2005/04/11 02:49:58 jack 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 LD_SCRIPT=$(TOPDIR)/arch/cris/cris.ld
14
15 # A bug in ld prevents us from having a (constant-value) symbol in a
16 # "ORIGIN =" or "LENGTH =" expression.  We fix that by generating a
17 # linker file with the symbolic part of those expressions evaluated.
18 #  Unfortunately, there is trouble making vmlinux depend on anything we
19 # generate here, so we *always* regenerate the final linker script and
20 # replace the LD macro to get what we want.  Thankfully(?) vmlinux is
21 # always rebuilt (due to calling make recursively and not knowing if
22 # anything was rebuilt).
23 #  The shell script to build in some kind of dependency is really not
24 # necessary for reasons of speed.  It's there because always
25 # regenerating stuff (even for incremental linking of subsystems!) is
26 # even more nauseating.
27 LD = if [ ! -e $(LD_SCRIPT).tmp -o $(LD_SCRIPT) -nt $(LD_SCRIPT).tmp ]; then \
28           sed -e s/@CONFIG_ETRAX_DRAM_VIRTUAL_BASE@/0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)/ \
29               -e s/@CONFIG_ETRAX_DRAM_SIZE_M@/$(CONFIG_ETRAX_DRAM_SIZE)/ \
30               < $(LD_SCRIPT) > $(LD_SCRIPT).tmp; \
31      else true; \
32      fi && $(CROSS_COMPILE)ld -mcrislinux
33
34 LINKFLAGS = -T $(LD_SCRIPT).tmp
35
36 # objcopy is used to make binary images from the resulting linked file
37
38 OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
39
40 # -mlinux enables -march=v10, -fno-underscores, -D__linux__ among others
41
42 CFLAGS := $(CFLAGS) -mlinux -pipe
43
44 ifdef CONFIG_ETRAX_KGDB
45 CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
46 CFLAGS += -fno-omit-frame-pointer
47 endif
48
49 AFLAGS += -mlinux
50
51 HEAD := arch/cris/kernel/head.o
52
53 SUBDIRS += arch/cris/kernel arch/cris/mm arch/cris/lib arch/cris/drivers
54 ifdef CONFIG_ETRAX_AXISFLASHMAP
55 # only build this if axis flash map is used, because they depend on
56 # each others config options
57 SUBDIRS += arch/cris/boot/rescue
58 endif
59 CORE_FILES += arch/cris/kernel/kernel.o arch/cris/mm/mm.o
60 DRIVERS += arch/cris/drivers/drivers.o
61 LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
62 LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LIBGCC)
63
64 arch/cris/kernel: dummy
65         $(MAKE) linuxsubdirs SUBDIRS=arch/cris/kernel
66
67 arch/cris/mm: dummy
68         $(MAKE) linuxsubdirs SUBDIRS=arch/cris/mm
69
70 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
71
72 vmlinux.bin: vmlinux
73         $(OBJCOPY) vmlinux vmlinux.bin
74
75 timage: vmlinux.bin
76         cat vmlinux.bin cramfs.img >timage
77
78 simimage: timage
79         cp vmlinux.bin simvmlinux.bin
80
81 # the following will remake timage without compiling the kernel
82 # it does of course require that all object files exist...
83
84 cramfs:
85 ## cramfs      - Creates a cramfs image
86         mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img
87         cat vmlinux.bin cramfs.img >timage
88
89 clinux: vmlinux.bin decompress.bin rescue.bin
90
91 decompress.bin: dummy
92         @make -C arch/cris/boot/compressed decompress.bin
93
94 rescue.bin: dummy
95         @make -C arch/cris/boot/rescue rescue.bin
96
97 zImage: vmlinux.bin
98 ## zImage     - Compressed kernel (gzip)
99         @$(MAKEBOOT) zImage
100
101 compressed: zImage
102
103 archclean:
104         @$(MAKEBOOT) clean
105         rm -f timage vmlinux.bin cramfs.img
106         rm -rf $(LD_SCRIPT).tmp
107
108 archmrproper:
109
110 archdep:
111         @$(MAKEBOOT) dep