2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 DROP_SECTIONS
:=.reginfo .mdebug .comment .note .pdr .options .MIPS.options
11 OBJCOPY_SREC
:=$(TARGET_CROSS
)objcopy
-S
-O srec
$(addprefix --remove-section
=,$(DROP_SECTIONS
))
14 KERNEL_ENTRY
:=0x94100000
18 EVA_LOADADDR
:= 0x94100000
22 LOADADDR
=$(LOADADDR
) \
23 KERNEL_ENTRY
=$(KERNEL_ENTRY
) \
24 RAMSTART
=$(RAMSTART
) \
27 CFLAGS
:= -D__KERNEL__
-Wall
-Wstrict-prototypes
-Wno-trigraphs
-Os \
28 -fno-strict-aliasing
-fno-common
-fomit-frame-pointer
-G
0 -mno-abicalls
-fno-pic \
29 -pipe
-mlong-calls
-fno-common \
30 -mabi
=32 -march
=mips32
-Wa
,-32 -Wa
,-march
=mips32
-Wa
,-mips32
-Wa
,--trap \
31 -DLOADADDR
=$(LOADADDR
)
34 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader
$(LOADER_MAKEOPTS
) clean
38 cat
$(KDIR
)/vmlinux |
$(STAGING_DIR_HOST
)/bin
/lzma e
-si
-so
-eos
-lc1
-lp2
-pb2
> $(KDIR
)/vmlinux.lzma
40 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader \
43 $(OBJCOPY_SREC
) $(KDIR
)/loader.elf
$(KDIR
)/loader.srec
44 srec2bin
$(KDIR
)/loader.srec
$(KDIR
)/loader.bin
47 define align
/jffs2-64k
51 define align
/jffs2-128k
55 define Image
/Build
/CyberTAN
56 (dd if
=/dev
/zero bs
=16 count
=1; cat
$(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).bin
) | \
57 $(STAGING_DIR_HOST
)/bin
/addpattern
-p
$(3) -o
$(BIN_DIR
)/openwrt-
$(2)-$(4).bin
60 #define Image/Build/sErCoMm
61 # cat sercomm/adam2.bin "$(BIN_DIR)/openwrt-$(BOARD)-$(1).bin" > "$(KDIR)/dgfw.tmp"
62 # dd if=sercomm/$(2) of="$(KDIR)/dgfw.tmp" bs=$$$$((0x3e0000 - 80)) seek=1 conv=notrunc
63 # $(STAGING_DIR_HOST)/bin/dgfirmware -f -w "$(BIN_DIR)/openwrt-$(2)-$(3).img" "$(KDIR)/dgfw.tmp"
64 # rm -f "$(KDIR)/dgfw.tmp"
67 define Image
/Build
/EVA
68 $(STAGING_DIR_HOST
)/bin
/lzma2eva
$(KERNEL_ENTRY
) $(KERNEL_ENTRY
) $(KDIR
)/vmlinux.lzma
$(BIN_DIR
)/openwrt-
$(2)-$(1).bin
69 cat
$(KDIR
)/root.
$(1) >> $(BIN_DIR
)/openwrt-
$(2)-$(1).bin
70 $(call prepare_generic_squashfs
,$(BIN_DIR
)/openwrt-
$(2)-$(1).bin
)
74 dd if
=$(KDIR
)/loader.bin
$(call align
/$(1)) > $(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).bin
75 cat
$(KDIR
)/root.
$(1) >> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).bin
76 $(call prepare_generic_squashfs
,$(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).bin
)
77 $(call Image
/Build
/CyberTAN
,$(1),AG1B
,AG1B
,$(1))
78 $(call Image
/Build
/CyberTAN
,$(1),WA21
,WA21
,$(1))
79 $(call Image
/Build
/CyberTAN
,$(1),WA22
,WA22
,$(1))
80 $(call Image
/Build
/CyberTAN
,$(1),WAG2
,WAG2
,$(1))
81 $(call Image
/Build
/CyberTAN
,$(1),AG241v2
,AG3A
-b
-r
2.0,$(1))
82 $(call Image
/Build
/CyberTAN
,$(1),AG241v1
,AG3A
-b
,$(1))
83 $(call Image
/Build
/CyberTAN
,$(1),WA31
,WA31
-b
,$(1))
84 $(call Image
/Build
/CyberTAN
,$(1),WA32
,WA32
-b
,$(1))
85 $(call Image
/Build
/CyberTAN
,$(1),WA7A
,WA7A
-b
,$(1))
86 $(call Image
/Build
/CyberTAN
,$(1),WA7B
,WA7B
-b
,$(1))
87 # $(call Image/Build/sErCoMm,$(1),dg834,$(1))
88 # $(call Image/Build/sErCoMm,$(1),jdr454wb,$(1))
89 $(call Image
/Build
/EVA
,$(1),EVA
)
92 $(eval
$(call BuildImage
))