2 # Makefile for Broadcom BCM947XX boards
4 # Copyright 2001-2003, Broadcom Corporation
7 # THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 # KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 # SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 # FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12 # Copyright 2004 Manuel Novoa III <mjn3@codepoet.org>
13 # Modified to support bzip'd kernels.
14 # Of course, it would be better to integrate bunzip capability into CFE.
16 # Copyright 2005 Oleg I. Vdovikin <oleg@cs.msu.su>
17 # Cleaned up, modified for lzma support, removed from kernel
19 # 2009-10-05 - Upgrade to lzma SDK 4.57 by Leonid Lisovskiy
22 TEXT_START
:= 0x80001000
23 BZ_TEXT_START
:= 0x80500000
25 OBJCOPY
:= $(CROSS_COMPILE
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
27 CFLAGS
= -D__KERNEL__
-Wall
-Wstrict-prototypes
-Wno-trigraphs
-O2 \
28 -fno-strict-aliasing
-fno-common
-fomit-frame-pointer
-G
0 -mno-abicalls
-fno-pic \
29 -ffunction-sections
-pipe
-Wa
,--trap \
30 -mabi
=32 -march
=mips32
-Wa
,-32 -Wa
,-march
=mips32
-Wa
,-mips32
31 CFLAGS
+= -DLOADADDR
=$(TEXT_START
) -D_LZMA_IN_CB
32 CFLAGS
+= -I
$(SRCBASE
)/include -I
$(SRCBASE
)/lzma
/C
/Compress
/Lzma
34 ASFLAGS
= $(CFLAGS
) -D__ASSEMBLY__
-DBZ_TEXT_START
=$(BZ_TEXT_START
)
36 SEDFLAGS
:= s
/BZ_TEXT_START
/$(BZ_TEXT_START
)/;s
/TEXT_START
/$(TEXT_START
)/
38 OBJECTS
:= head.o data.o
40 vpath
%.c
$(SRCBASE
)/lzma
/C
/Compress
/Lzma
44 # Don't build dependencies, this may die if $(CC) isn't gcc
55 loader.o
: loader.lds
$(OBJECTS
)
56 $(LD
) -static
--gc-sections
-no-warn-mismatch
-T loader.lds
-o
$@
$(OBJECTS
)
58 loader.lds
: loader.lds.in Makefile
59 @sed
"$(SEDFLAGS)" < $< > $@
61 data.o
: data.lds decompress.image
62 $(LD
) -no-warn-mismatch
-T data.lds
-r
-o
$@
-b binary decompress.image
-b elf32-tradlittlemips
65 @echo
"SECTIONS { .data : { code_start = .; *(.data) code_stop = .; }}" > $@
67 decompress.image
: decompress
70 decompress
: decompress.lds decompress.o LzmaDecode.o
71 $(LD
) -static
--gc-sections
-no-warn-mismatch
-T decompress.lds
-o
$@ decompress.o LzmaDecode.o
73 decompress.lds
: decompress.lds.in Makefile
74 @sed
"$(SEDFLAGS)" < $< > $@
79 rm -f loader.gz loader decompress
*.lds
*.o
*.image