-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
65 lines (55 loc) · 2.11 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
#
# Copyright (C) 2011-2014 Entware
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include config.mk
export TOP:=$(shell (cd .. && pwd -P))
all: \
toolchain/.toolchain_prepared \
buildroot/.buildroot_prepared \
packages/.package_prepared
$(MAKE) -C "$(TOP)/openwrt_trunk" tools/compile
$(MAKE) -C "$(TOP)/openwrt_trunk" tools/install
$(MAKE) -C "$(TOP)/openwrt_trunk" package/toolchain/compile
@echo "Buildroot is ready! To recompile the whole repo type:"
@echo "cd ../openwrt_trunk"
@echo "make package/compile"
@echo "See Buildroot Wiki at http://wiki.openwrt.org/about/toolchain for details."
toolchain/.toolchain_prepared:
$(MAKE) -C "toolchain"
buildroot/.buildroot_prepared:
$(MAKE) -C "buildroot"
packages/.package_prepared:
$(MAKE) -C "packages"
define update_git_mirror
[ -d "$(TOP)/tmp" ] || mkdir "$(TOP)/tmp"
(cd "$(TOP)/tmp"; \
[ -d "$(2)" ] && rm -rf $(2); \
git clone $(1); \
cd $(2); \
git remote add upstream $(3); \
git fetch upstream; \
git merge upstream/master; \
git push origin master; \
cd ..; \
rm -rf $(2))
endef
update_git_mirrors: .git_mirrors_updated
.git_mirrors_updated:
$(call update_git_mirror,https://github.com/zyxmon/openwrt-packages,openwrt-packages,https://github.com/Entware/openwrt-packages)
$(call update_git_mirror,https://github.com/zyxmon/openwrt-routing,openwrt-routing,https://github.com/Entware/openwrt-routing)
$(call update_git_mirror,https://github.com/zyxmon/openwrt-telephony,openwrt-telephony,https://github.com/Entware/openwrt-telephony)
$(call update_git_mirror,https://github.com/zyxmon/openwrt-management,openwrt-management,https://github.com/Entware/openwrt-management)
$(call update_git_mirror,https://github.com/zyxmon/openwrt-oldpackages,openwrt-oldpackages,https://github.com/Entware/openwrt-oldpackages)
@touch $@
clean:
$(MAKE) -C toolchain clean
$(MAKE) -C buildroot clean
$(MAKE) -C packages clean
@rm -f .git_mirrors_updated
cleanall: clean
$(MAKE) -C toolchain cleanall
$(MAKE) -C buildroot cleanall
.PHONY: clean cleanall all