1 include $(TOPDIR
)/rules.mk
3 KDIR
:=$(BUILD_DIR
)/linux-
$(KERNEL
)-ar7
5 PKG_BUILD_DIR
:=$(BUILD_DIR
)/ar7loader
8 OUTPUT_FORMAT
:= elf32-tradlittlemips
10 CFLAGS
:= -D__KERNEL__
-Wall
-Wstrict-prototypes
-Wno-trigraphs
-Os \
11 -fno-strict-aliasing
-fno-common
-fomit-frame-pointer
-G
0 -mno-abicalls
-fno-pic \
12 -pipe
-mlong-calls
-fno-common \
13 -mabi
=32 -march
=mips32
-Wa
,-32 -Wa
,-march
=mips32
-Wa
,-mips32
-Wa
,--trap \
17 mkdir
-p
$(PKG_BUILD_DIR
)
19 $(PKG_BUILD_DIR
)/zimage.script
: src
/zimage.script.in
20 sed
-e
's/@@OUTPUT_FORMAT@@/$(OUTPUT_FORMAT)/' \
21 -e
's/@@LOADADDR@@/$(LOADADDR)/' <$< >$@
23 $(PKG_BUILD_DIR
)/ld.script
: src
/ld.script.in
24 sed
-e
's/@@OUTPUT_FORMAT@@/$(OUTPUT_FORMAT)/' \
25 -e
's/@@LOADADDR@@/$(LOADADDR)/' <$< >$@
27 $(PKG_BUILD_DIR
)/loader.o
: src
/loader.c
28 $(TARGET_CC
) $(CFLAGS
) -c
-o
$@
$<
30 $(PKG_BUILD_DIR
)/srec2bin
: src
/srec2bin.c
33 $(KDIR
)/vmlinux.gz
: $(KDIR
)/vmlinux
34 gzip
-c
-vf9
< $< > $@
36 $(BIN_DIR
)/openwrt-ar7-zimage.bin
: $(KDIR
)/vmlinux.gz compile
37 $(TARGET_CROSS
)ld -T
$(PKG_BUILD_DIR
)/zimage.script
-r
-b binary
$< -o
$(KDIR
)/zimage.o
38 $(TARGET_CROSS
)ld -static
-G
0 -no-warn-mismatch
-R
$(KDIR
)/linux-
$(KERNEL
)*/vmlinux
-T
$(PKG_BUILD_DIR
)/ld.script \
39 $(PKG_BUILD_DIR
)/loader.o \
42 $(TARGET_CROSS
)objcopy
-O srec
$(KDIR
)/loader
$(KDIR
)/ram_zimage.sre
43 $(PKG_BUILD_DIR
)/srec2bin
$(KDIR
)/ram_zimage.sre
$@
46 rm -rf
$(PKG_BUILD_DIR
)
47 prepare
: $(PKG_BUILD_DIR
) $(PKG_BUILD_DIR
)/zimage.script
$(PKG_BUILD_DIR
)/ld.script
48 compile
: prepare
$(PKG_BUILD_DIR
)/loader.o
$(PKG_BUILD_DIR
)/srec2bin
49 install: $(BIN_DIR
)/openwrt-ar7-zimage.bin
This page took 0.038207 seconds and 5 git commands to generate.