2014-10-14 02:35:17 +00:00
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
hiwifi_root = $(shell pwd)
|
2014-12-27 20:16:15 +08:00
|
|
|
openwrt_dir = openwrt-ar71xx
|
2015-01-28 12:51:38 +08:00
|
|
|
host_packages = build-essential git flex gettext libncurses5-dev unzip gawk liblzma-dev u-boot-tools
|
|
|
|
|
openwrt_feeds = libevent2 luci luci-app-samba xl2tpd pptpd pdnsd ethtool
|
2015-01-06 16:25:51 +08:00
|
|
|
### mwan3 luci-app-mwan3
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2015-05-20 23:56:41 +08:00
|
|
|
HC6361: .install_feeds
|
2014-10-14 02:35:17 +00:00
|
|
|
@cd $(openwrt_dir); \
|
|
|
|
|
if [ -e .config ]; then \
|
|
|
|
|
mv -vf .config .config.bak; \
|
|
|
|
|
echo "WARNING: .config is updated, backed up as '.config.bak'"; \
|
|
|
|
|
fi; \
|
2014-12-27 20:16:15 +08:00
|
|
|
cp -vf ../config-hiwifi-hc6361 .config
|
2016-04-28 14:04:06 +08:00
|
|
|
make -C $(openwrt_dir) V=s -j$(shell grep ^processor /proc/cpuinfo | wc -l)
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2015-05-20 23:56:41 +08:00
|
|
|
recovery.bin: HC6361
|
|
|
|
|
make -C recovery.bin
|
|
|
|
|
|
|
|
|
|
.install_feeds: .update_feeds
|
2014-10-14 02:35:17 +00:00
|
|
|
@cd $(openwrt_dir); ./scripts/feeds install $(openwrt_feeds);
|
2015-05-20 23:56:41 +08:00
|
|
|
@cd $(openwrt_dir)/package; \
|
|
|
|
|
[ -e rssnsj-feeds ] || git clone https://github.com/rssnsj/network-feeds.git rssnsj-feeds
|
|
|
|
|
@touch .install_feeds
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2015-05-20 23:56:41 +08:00
|
|
|
.update_feeds: .patched
|
2014-10-14 02:35:17 +00:00
|
|
|
@cd $(openwrt_dir); ./scripts/feeds update;
|
2015-05-20 23:56:41 +08:00
|
|
|
@touch .update_feeds
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2015-05-20 23:56:41 +08:00
|
|
|
.patched: .checkout_svn
|
2015-01-15 17:44:21 +08:00
|
|
|
@cd $(openwrt_dir); cat ../patches/*.patch | patch -p0
|
2015-01-06 16:25:51 +08:00
|
|
|
@cp -vf config-hiwifi-hc6361 $(openwrt_dir)/.config
|
2015-05-20 23:56:41 +08:00
|
|
|
@touch .patched
|
2015-01-06 16:25:51 +08:00
|
|
|
|
2014-10-14 02:35:17 +00:00
|
|
|
# 2. Checkout source code:
|
2015-05-20 23:56:41 +08:00
|
|
|
.checkout_svn: .check_hostdeps
|
2016-04-28 14:04:06 +08:00
|
|
|
# svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker $(openwrt_dir) -r43166 || :
|
|
|
|
|
git clone git://git.openwrt.org/14.07/openwrt.git $(openwrt_dir)
|
2014-10-14 02:35:17 +00:00
|
|
|
@[ -d /var/dl ] && ln -sf /var/dl $(openwrt_dir)/dl || :
|
2015-05-20 23:56:41 +08:00
|
|
|
@touch .checkout_svn
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2015-05-20 23:56:41 +08:00
|
|
|
.check_hostdeps:
|
2014-10-14 02:35:17 +00:00
|
|
|
# 1. Install required host components:
|
2014-10-20 14:44:58 +00:00
|
|
|
@which dpkg >/dev/null 2>&1 || exit 0; \
|
2015-01-28 12:51:38 +08:00
|
|
|
for p in $(host_packages); do \
|
2014-10-20 14:44:58 +00:00
|
|
|
dpkg -s $$p >/dev/null 2>&1 || to_install="$$to_install$$p "; \
|
2014-10-14 02:35:17 +00:00
|
|
|
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;
|
2015-05-20 23:56:41 +08:00
|
|
|
@touch .check_hostdeps
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2015-05-20 23:56:41 +08:00
|
|
|
menuconfig: .install_feeds
|
2014-10-14 02:35:17 +00:00
|
|
|
@cd $(openwrt_dir); [ -f .config ] && mv -vf .config .config.bak || :
|
2014-12-27 20:16:15 +08:00
|
|
|
@cp -vf config-hiwifi-hc6361 $(openwrt_dir)/.config
|
|
|
|
|
@touch config-hiwifi-hc6361 # change modification time
|
2014-10-14 02:35:17 +00:00
|
|
|
@make -C $(openwrt_dir) menuconfig
|
2014-12-27 20:16:15 +08:00
|
|
|
@[ $(openwrt_dir)/.config -nt config-hiwifi-hc6361 ] && cp -vf $(openwrt_dir)/.config config-hiwifi-hc6361 || :
|
2014-10-14 02:35:17 +00:00
|
|
|
|
2014-10-14 13:05:44 +00:00
|
|
|
clean:
|
|
|
|
|
rm -f s_build_openwrt
|
2015-05-20 23:56:41 +08:00
|
|
|
make clean -C recovery.bin
|
2014-10-14 13:05:44 +00:00
|
|
|
make clean -C $(openwrt_dir) V=s
|
|
|
|
|
|