add hackish makfile, so that other developers could build images. anyone shuld clean...
[openwrt/svn-archive/archive.git] / openwrt / target / default / openwrt.mk
1 #############################################################
2 #
3 # create openwrt images
4 #
5 #############################################################
6
7 # wrt tools
8 WRT_DIR:=$(BUILD_DIR)/wrt-tools
9 WRT_SOURCE=wrt-tools.tar.gz
10 WRT_SITE=http://openwrt.openbsd-geek.de
11
12 $(DL_DIR)/$(WRT_SOURCE):
13 $(WGET) -P $(DL_DIR) $(WRT_SITE)/$(WRT_SOURCE)
14
15 $(WRT_DIR)/.unpacked: $(DL_DIR)/$(WRT_SOURCE)
16 zcat $(DL_DIR)/$(WRT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
17 touch $(WRT_DIR)/.unpacked
18
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
22
23 openwrt-linux.trx.squashfs: wrt-tools
24 $(BUILD_DIR)/trx -o openwrt-linux.trx.squashfs $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE).squashfs
25
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
28
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
31
32 openwrt-linux.trx.jffs2: wrt-tools
33 $(BUILD_DIR)/trx -o openwrt-linux.trx.jffs2 $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE).jffs2
34
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
37
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
40
41 openwrt-code.bin.squashfs: openwrt-gs-code.bin.squashfs openwrt-g-code.bin.squashfs
42
43 openwrt-code.bin.jffs2: openwrt-gs-code.bin.jffs2 openwrt-g-code.bin.jffs2
44