1 # $Id: Makefile,v 1.23 2004/10/19 13:07:34 starvik Exp $
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
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
13 # A bug in ld prevents us from having a (constant-value) symbol in a
14 # "ORIGIN =" or "LENGTH =" expression.
17 arch-
$(CONFIG_ETRAX_ARCH_V10
) := v10
19 # No config avaiable for make clean etc
21 SARCH
:= arch-
$(arch-y
)
26 LD
= $(CROSS_COMPILE
)ld -mcrislinux
28 OBJCOPYFLAGS
:= -O binary
-R .note
-R .comment
-S
30 CPPFLAGS_vmlinux.lds
= -DDRAM_VIRTUAL_BASE
=0x
$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE
)
33 CFLAGS
:= $(CFLAGS
) -mlinux
-march
=$(arch-y
) -pipe
35 ifdef CONFIG_FRAME_POINTER
36 CFLAGS
:= $(subst -fomit-frame-pointer
,,$(CFLAGS
)) -g
37 CFLAGS
+= -fno-omit-frame-pointer
40 head-y
:= arch
/$(ARCH
)/$(SARCH
)/kernel
/head.o
42 LIBGCC
= $(shell $(CC
) $(CFLAGS
) -print-file-name
=libgcc.a
)
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
)
50 $(OBJCOPY
) $(OBJCOPYFLAGS
) vmlinux vmlinux.bin
53 cat vmlinux.bin cramfs.img
>timage
56 cp vmlinux.bin simvmlinux.bin
58 # the following will remake timage without compiling the kernel
59 # it does of course require that all object files exist...
62 ## cramfs - Creates a cramfs image
63 mkcramfs
-b
8192 -m romfs_meta.txt root cramfs.img
64 cat vmlinux.bin cramfs.img
>timage
66 clinux
: vmlinux.bin decompress.bin rescue.bin
69 @make
-C arch
/$(ARCH
)/boot
/compressed decompress.bin
72 @make
-C arch
/$(ARCH
)/boot
/rescue rescue.bin
74 zImage
: vmlinux.bin rescue.bin
75 ## zImage - Compressed kernel (gzip)
76 @make
-C arch
/$(ARCH
)/boot
/ zImage
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
86 prepare
: arch
/$(ARCH
)/.links
include/asm-
$(ARCH
)/.arch \
87 include/asm-
$(ARCH
)/$(SARCH
)/offset.h
89 # Create some links to make all tools happy
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
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
108 arch
/$(ARCH
)/$(SARCH
)/kernel
/asm-offsets.s
: include/asm
include/linux
/version.h \
109 include/config
/MARKER
111 include/asm-
$(ARCH
)/$(SARCH
)/offset.h
: arch
/$(ARCH
)/$(SARCH
)/kernel
/asm-offsets.s
112 $(call filechk
,gen-asm-offsets
)