1 |
1275 |
phoenix |
#
|
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 |
|
|
|
60 |
|
|
# Note that the order of .o files below is important is some cases
|
61 |
|
|
# (because initcalls are executed in the order they are linked)
|
62 |
|
|
# Never add any driver before mm.o!
|
63 |
|
|
CORE_FILES += arch/cris/kernel/kernel.o arch/cris/mm/mm.o
|
64 |
|
|
DRIVERS += arch/cris/drivers/drivers.o
|
65 |
|
|
LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
|
66 |
|
|
LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LIBGCC)
|
67 |
|
|
|
68 |
|
|
arch/cris/kernel: dummy
|
69 |
|
|
$(MAKE) linuxsubdirs SUBDIRS=arch/cris/kernel
|
70 |
|
|
|
71 |
|
|
arch/cris/mm: dummy
|
72 |
|
|
$(MAKE) linuxsubdirs SUBDIRS=arch/cris/mm
|
73 |
|
|
|
74 |
|
|
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
|
75 |
|
|
|
76 |
|
|
vmlinux.bin: vmlinux
|
77 |
|
|
$(OBJCOPY) vmlinux vmlinux.bin
|
78 |
|
|
|
79 |
|
|
timage: vmlinux.bin
|
80 |
|
|
cat vmlinux.bin cramfs.img >timage
|
81 |
|
|
|
82 |
|
|
simimage: timage
|
83 |
|
|
cp vmlinux.bin simvmlinux.bin
|
84 |
|
|
|
85 |
|
|
# the following will remake timage without compiling the kernel
|
86 |
|
|
# it does of course require that all object files exist...
|
87 |
|
|
|
88 |
|
|
cramfs:
|
89 |
|
|
## cramfs - Creates a cramfs image
|
90 |
|
|
mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img
|
91 |
|
|
cat vmlinux.bin cramfs.img >timage
|
92 |
|
|
|
93 |
|
|
clinux: vmlinux.bin decompress.bin rescue.bin
|
94 |
|
|
|
95 |
|
|
decompress.bin: dummy
|
96 |
|
|
@make -C arch/cris/boot/compressed decompress.bin
|
97 |
|
|
|
98 |
|
|
rescue.bin: dummy
|
99 |
|
|
@make -C arch/cris/boot/rescue rescue.bin
|
100 |
|
|
|
101 |
|
|
zImage: vmlinux.bin
|
102 |
|
|
## zImage - Compressed kernel (gzip)
|
103 |
|
|
@$(MAKEBOOT) zImage
|
104 |
|
|
|
105 |
|
|
compressed: zImage
|
106 |
|
|
|
107 |
|
|
archclean:
|
108 |
|
|
@$(MAKEBOOT) clean
|
109 |
|
|
rm -f timage vmlinux.bin cramfs.img
|
110 |
|
|
rm -rf $(LD_SCRIPT).tmp
|
111 |
|
|
|
112 |
|
|
archmrproper:
|
113 |
|
|
|
114 |
|
|
archdep:
|
115 |
|
|
@$(MAKEBOOT) dep
|