1 export BUILD_TOPDIR=$(PWD)
2 export STAGING_DIR=$(BUILD_TOPDIR)/tmp
4 export MAKECMD=make --silent ARCH=mips CROSS_COMPILE=mips-linux-gnu-
6 # boot delay (time to autostart boot command)
7 export CONFIG_BOOTDELAY=1
9 tplink_mr3020: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-mr3020
10 tplink_mr3020: export MAX_UBOOT_SIZE=64
11 tplink_mr3020: export COMPRESSED_UBOOT=1
13 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) mr3020_config
14 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
15 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
18 tplink_wr703n: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wr703n
19 tplink_wr703n: export MAX_UBOOT_SIZE=64
20 tplink_wr703n: export COMPRESSED_UBOOT=1
22 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) wr703n_config
23 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
24 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
27 tplink_wr720n_v3_CH: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wr720n_v3_CH
28 tplink_wr720n_v3_CH: export MAX_UBOOT_SIZE=64
29 tplink_wr720n_v3_CH: export COMPRESSED_UBOOT=1
31 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) wr720n_v3_CH_config
32 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
33 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
36 tplink_wr710n: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wr710n
37 tplink_wr710n: export MAX_UBOOT_SIZE=64
38 tplink_wr710n: export COMPRESSED_UBOOT=1
40 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) wr710n_config
41 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
42 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
45 tplink_mr3040: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-mr3040
46 tplink_mr3040: export MAX_UBOOT_SIZE=64
47 tplink_mr3040: export COMPRESSED_UBOOT=1
49 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) mr3040_config
50 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
51 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
54 tplink_mr10u: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-mr10u
55 tplink_mr10u: export MAX_UBOOT_SIZE=64
56 tplink_mr10u: export COMPRESSED_UBOOT=1
58 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) mr10u_config
59 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
60 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
63 tplink_wr740n_v4: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wr740n_v4
64 tplink_wr740n_v4: export MAX_UBOOT_SIZE=64
65 tplink_wr740n_v4: export COMPRESSED_UBOOT=1
67 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) wr740n_v4_config
68 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
69 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
72 tplink_mr3220_v2: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-mr3220_v2
73 tplink_mr3220_v2: export MAX_UBOOT_SIZE=64
74 tplink_mr3220_v2: export COMPRESSED_UBOOT=1
76 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) mr3220_v2_config
77 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
78 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
81 tplink_wdr3600_43x0: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wdr3600-43x0
82 tplink_wdr3600_43x0: export MAX_UBOOT_SIZE=64
83 tplink_wdr3600_43x0: export COMPRESSED_UBOOT=1
85 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) db12x_config
86 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
87 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
90 dlink_dir505: export UBOOT_FILE_NAME=uboot_for_d-link_dir-505
91 dlink_dir505: export MAX_UBOOT_SIZE=64
92 dlink_dir505: export COMPRESSED_UBOOT=1
94 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) dir505_config
95 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
96 @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
99 8devices_carambola2: export UBOOT_FILE_NAME=uboot_for_8devices_carambola2
100 8devices_carambola2: export MAX_UBOOT_SIZE=256
102 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) carambola2_config
103 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
104 @cp $(BUILD_TOPDIR)/u-boot/u-boot.bin $(BUILD_TOPDIR)/bin/temp.bin
108 @echo -e "\n======= Preparing $(MAX_UBOOT_SIZE)KB file filled with 0xFF... ======="
109 @`tr "\000" "\377" < /dev/zero | dd ibs=1k count=$(MAX_UBOOT_SIZE) of=$(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).bin`
110 @echo -e "\n======= Copying U-Boot image... ======="
111 @`dd if=$(BUILD_TOPDIR)/bin/temp.bin of=$(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).bin conv=notrunc`
112 @`rm $(BUILD_TOPDIR)/bin/temp.bin`
113 @echo -e "\n======= U-Boot image ready, size:" `wc -c < $(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).bin`" bytes =======\n"
114 @`md5sum $(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).bin | awk '{print $$1}' | tr -d '\n' > $(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).md5`
115 @`echo ' *'$(UBOOT_FILE_NAME).bin >> $(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).md5`
116 @if [ "`wc -c < $(BUILD_TOPDIR)/bin/$(UBOOT_FILE_NAME).bin`" -gt "`echo '$(MAX_UBOOT_SIZE)*1024' | bc`" ]; then \
117 echo -e "\n **********************************"; \
118 echo " * U-BOOT IMAGE SIZE TOO BIG! *"; \
119 echo -e " **********************************\n"; \
123 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) clean
124 @rm -f $(BUILD_TOPDIR)/bin/*.bin
125 @rm -f $(BUILD_TOPDIR)/bin/*.md5
128 @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) distclean
129 @rm -f $(BUILD_TOPDIR)/bin/*.bin
130 @rm -f $(BUILD_TOPDIR)/bin/*.md5