This repository has been archived by the owner on Nov 26, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
122 lines (99 loc) · 4.81 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
VERSION=3.19.5
LINUX=linux-$(VERSION)
all::
@echo
@echo "Options:"
@echo
@echo "make usb\t\tBuilds a linux kernel that when flashed will boot a filesystem on a USB stick"
@echo
@echo "make openwrt\t\tBuilds pri and alt OpenWRT firmware images for EA4500 / E4200v2 and EA3500"
@echo "make openwrt4500\tBuilds pri and alt OpenWRT firmware images for EA4500 / E4200v2"
@echo "make openwrt3500\tBuilds pri and alt OpenWRT firmware images for EA3500"
@echo
@echo "make openwrt-kirkwood-ea3500-pri.ssa \tBuilds pri OpenWRT firmware image for EA3500"
@echo "make openwrt-kirkwood-ea3500-alt.ssa \tBuilds alt OpenWRT firmware image for EA3500"
@echo "make openwrt-kirkwood-ea4500-pri.ssa \tBuilds pri OpenWRT firmware image for EA4500 / E4200v2"
@echo "make openwrt-kirkwood-ea4500-alt.ssa \tBuilds alt OpenWRT firmware image for EA4500 / E4200v2"
@echo
usb:: .usb_built
.usb_fetched:
wget https://www.kernel.org/pub/linux/kernel/v3.x/$(LINUX).tar.xz
touch $@
.usb_extracted: .usb_fetched
tar xvf $(LINUX).tar.xz
touch $@
.usb_patched: .usb_extracted
cd $(LINUX) && patch -p1 < ../patches/usb.patch > ../.usb_patchlog
touch $@
.usb_configured: .usb_patched
cd $(LINUX) && make oldconfig ARCH=arm
touch $@
.usb_built: .usb_configured
cd $(LINUX) && make -j4 ARCH=arm LOADADDR=0x00008000 uImage
cd $(LINUX) && make ARCH=arm dtbs
cat $(LINUX)/arch/arm/boot/zImage $(LINUX)/arch/arm/boot/dts/kirkwood-candyhouse.dtb > /tmp/zImage+kirkwood-candyhouse.dtb
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n $(LINUX) -d /tmp/zImage+kirkwood-candyhouse.dtb uImage-$(VERSION)-ea4500
touch $@
openwrt:: openwrt4500 openwrt3500
openwrt3500:: openwrt-kirkwood-ea3500-pri.ssa openwrt-kirkwood-ea3500-alt.ssa
openwrt4500:: openwrt-kirkwood-ea4500-pri.ssa openwrt-kirkwood-ea4500-alt.ssa
.openwrt_fetched:
git clone git://git.openwrt.org/15.05/openwrt.git
touch $@
.openwrt_luci: .openwrt_fetched
cd openwrt && ./scripts/feeds update packages luci && ./scripts/feeds install -a -p luci
touch $@
openwrt-kirkwood-ea3500-pri.ssa: .openwrt_luci
cd openwrt && patch -p1 < ../patches/openwrt.patch
cd openwrt && patch -p1 < ../patches/openwrt-3500.patch
cd openwrt && patch -p1 < ../patches/openwrt-pri.patch
cd openwrt && chmod 755 target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
cd openwrt && make target/linux/clean
cd openwrt && make oldconfig && make -j4
cd openwrt && patch -p1 -R < ../patches/openwrt-pri.patch
cd openwrt && patch -p1 -R < ../patches/openwrt-3500.patch
cd openwrt && patch -p1 -R < ../patches/openwrt.patch
cp openwrt/bin/kirkwood/openwrt-kirkwood-ea3500.ssa openwrt-kirkwood-ea3500-pri.ssa
openwrt-kirkwood-ea3500-alt.ssa: .openwrt_luci
cd openwrt && patch -p1 < ../patches/openwrt.patch
cd openwrt && patch -p1 < ../patches/openwrt-3500.patch
cd openwrt && patch -p1 < ../patches/openwrt-alt.patch
cd openwrt && chmod 755 target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
cd openwrt && make target/linux/clean
cd openwrt && make oldconfig && make -j4
cd openwrt && patch -p1 -R < ../patches/openwrt-alt.patch
cd openwrt && patch -p1 -R < ../patches/openwrt-3500.patch
cd openwrt && patch -p1 -R < ../patches/openwrt.patch
cp openwrt/bin/kirkwood/openwrt-kirkwood-ea3500.ssa openwrt-kirkwood-ea3500-alt.ssa
openwrt-kirkwood-ea4500-pri.ssa: .openwrt_luci
cd openwrt && patch -p1 < ../patches/openwrt.patch
cd openwrt && patch -p1 < ../patches/openwrt-4500.patch
cd openwrt && patch -p1 < ../patches/openwrt-pri.patch
cd openwrt && chmod 755 target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
cd openwrt && make target/linux/clean
cd openwrt && make oldconfig && make -j4
cd openwrt && patch -p1 -R < ../patches/openwrt-pri.patch
cd openwrt && patch -p1 -R < ../patches/openwrt-4500.patch
cd openwrt && patch -p1 -R < ../patches/openwrt.patch
cp openwrt/bin/kirkwood/openwrt-kirkwood-ea4500.ssa openwrt-kirkwood-ea4500-pri.ssa
openwrt-kirkwood-ea4500-alt.ssa: .openwrt_luci
cd openwrt && patch -p1 < ../patches/openwrt.patch
cd openwrt && patch -p1 < ../patches/openwrt-4500.patch
cd openwrt && patch -p1 < ../patches/openwrt-alt.patch
cd openwrt && chmod 755 target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
cd openwrt && make target/linux/clean
cd openwrt && make oldconfig && make -j4
cd openwrt && patch -p1 -R < ../patches/openwrt-alt.patch
cd openwrt && patch -p1 -R < ../patches/openwrt-4500.patch
cd openwrt && patch -p1 -R < ../patches/openwrt.patch
cp openwrt/bin/kirkwood/openwrt-kirkwood-ea4500.ssa openwrt-kirkwood-ea4500-alt.ssa
usb-clean::
rm -rf .usb_extracted .usb_patched .usb_configured .usb_built $(LINUX) uImage-$(VERSION)-ea4500
usb-distclean: usb-clean
rm -rf $(LINUX).tar.xz .usb*
openwrt-clean::
rm -rf *.ssa
openwrt-distclean: openwrt-clean
rm -rf openwrt/ .openwrt*
clean: usb-clean openwrt-clean
distclean: usb-distclean openwrt-distclean