-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (61 loc) · 2.47 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
#
#
hiwifi_root = $(shell pwd)
openwrt_dir = openwrt-ramips
packages_required = build-essential git flex gettext libncurses5-dev \
unzip gawk liblzma-dev u-boot-tools
openwrt_feeds = libevent2 luci luci-app-radvd luci-app-samba xl2tpd ntfs-3g
### mwan3 luci-app-mwan3
final: s_build_openwrt
make -C recovery.bin
s_build_openwrt: s_install_feeds
@cd $(openwrt_dir); \
if [ -e .config ]; then \
mv -vf .config .config.bak; \
echo "WARNING: .config is updated, backed up as '.config.bak'"; \
fi; \
cp -vf ../config-hiwifi-hc5761 .config
make -C $(openwrt_dir) V=s -j4
s_install_feeds: s_update_feeds
@cd $(openwrt_dir); ./scripts/feeds install $(openwrt_feeds);
@svn co svn://svn.openwrt.org/openwrt/packages/net/pptpd $(openwrt_dir)/package/pptpd
@svn co https://github.com/madeye/shadowsocks-libev.git/tags/v1.4.8/openwrt $(openwrt_dir)/package/shadowsocks
@svn co https://proto-bridge.googlecode.com/svn/trunk/proto-bridge $(openwrt_dir)/package/proto-bridge
@cd $(openwrt_dir)/package; \
[ -d ../../../hc5761/package/xt_salist -a ! -e xt_salist ] && ln -sf ../../../hc5761/package/xt_salist || :
@touch s_install_feeds
s_update_feeds: s_hiwifi_patch
@cd $(openwrt_dir); ./scripts/feeds update;
@touch s_update_feeds
s_hiwifi_patch: s_checkout_svn
@cd $(openwrt_dir); patch -p0 < ../hiwifi-hc5761.patch
@cp -vf config-hiwifi-hc5761 $(openwrt_dir)/.config
@touch s_hiwifi_patch
# 2. Checkout source code:
s_checkout_svn: s_check_hostdeps
svn co svn://svn.openwrt.org/openwrt/trunk $(openwrt_dir) -r43594
@[ -d /var/dl ] && ln -sf /var/dl $(openwrt_dir)/dl || :
@touch s_checkout_svn
s_check_hostdeps:
# 1. Install required host components:
@which dpkg >/dev/null 2>&1 || exit 0; \
for p in $(packages_required); do \
dpkg -s $$p >/dev/null 2>&1 || to_install="$$to_install$$p "; \
done; \
if [ -n "$$to_install" ]; then \
echo "Please install missing packages by running the following commands:"; \
echo " sudo apt-get update"; \
echo " sudo apt-get install -y $$to_install"; \
exit 1; \
fi;
@touch s_check_hostdeps
menuconfig: s_install_feeds
@cd $(openwrt_dir); [ -f .config ] && mv -vf .config .config.bak || :
@cp -vf config-hiwifi-hc5761 $(openwrt_dir)/.config
@touch config-hiwifi-hc5761 # change modification time
@make -C $(openwrt_dir) menuconfig
@[ $(openwrt_dir)/.config -nt config-hiwifi-hc5761 ] && cp -vf $(openwrt_dir)/.config config-hiwifi-hc5761 || :
clean:
rm -f s_build_openwrt
make clean -C recovery.bin
make clean -C $(openwrt_dir) V=s