1 #############################################################
3 # create openwrt images
5 #############################################################
8 WRT_DIR:=$(BUILD_DIR)/wrt-tools
9 WRT_SOURCE=wrt-tools.tar.gz
10 WRT_SITE=http://openwrt.openbsd-geek.de
12 $(DL_DIR)/$(WRT_SOURCE):
13 $(WGET) -P $(DL_DIR) $(WRT_SITE)/$(WRT_SOURCE)
15 $(WRT_DIR)/.unpacked: $(DL_DIR)/$(WRT_SOURCE)
16 zcat $(DL_DIR)/$(WRT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
17 touch $(WRT_DIR)/.unpacked
19 wrt-tools: $(WRT_DIR)/.unpacked
20 $(CC) -o $(BUILD_DIR)/trx $(WRT_DIR)/trx.c
21 $(CC) -o $(BUILD_DIR)/addpattern $(WRT_DIR)/addpattern.c
23 openwrt-linux.trx.squashfs: wrt-tools
24 $(BUILD_DIR)/trx -o openwrt-linux.trx.squashfs $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE).squashfs
26 openwrt-gs-code.bin.squashfs: openwrt-linux.trx.squashfs
27 $(BUILD_DIR)/addpattern -2 -i openwrt-linux.trx.squashfs -o openwrt-gs-code.bin.squashfs -g
29 openwrt-g-code.bin.squashfs: openwrt-gs-code.bin.squashfs
30 sed -e "1s,^W54S,W54G," < openwrt-gs-code.bin.squashfs > openwrt-g-code.bin.squashfs
32 openwrt-linux.trx.jffs2: wrt-tools
33 $(BUILD_DIR)/trx -o openwrt-linux.trx.jffs2 $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE).jffs2
35 openwrt-gs-code.bin.jffs2: openwrt-linux.trx.jffs2
36 $(BUILD_DIR)/addpattern -2 -i openwrt-linux.trx.jffs2 -o openwrt-gs-code.bin.jffs2 -g
38 openwrt-g-code.bin.jffs2: openwrt-gs-code.bin.jffs2
39 sed -e "1s,^W54S,W54G," < openwrt-gs-code.bin.jffs2 > openwrt-g-code.bin.jffs2
41 openwrt-code.bin.squashfs: openwrt-gs-code.bin.squashfs openwrt-g-code.bin.squashfs
43 openwrt-code.bin.jffs2: openwrt-gs-code.bin.jffs2 openwrt-g-code.bin.jffs2