-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·55 lines (40 loc) · 1014 Bytes
/
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
-include user.mk
define gc
git clone $(1) $(2)
endef
define gp
cd $(1)
git pull
endef
project=uISP
remotes=leaf libs modules
url_leaf=https://github.com/leaflabs/hardware-lib.git
url_libs=https://github.com/nekromant/nc-libs
url_modules=https://github.com/nekromant/nc-mods
url_xue=git://projects.qi-hardware.com/xue.git
all: .bootstrapped
push=modules libs
p-%:
cd $* && git push
pushall: $(addprefix p-,$(push))
git push
echo "Push done"
.bootstrapped: $(addprefix c-,$(remotes))
@echo "Bootstrap complete"
touch .bootstrapped
u-%:
if [ -d $* ]; then cd $* && git pull; else git clone $($(addprefix url_,$(*))) $*; fi
update-remotes: $(addprefix u-,$(remotes))
echo "Remotes update done"
update:
git pull
$(MAKE) update-remotes
@echo "Update complete"
purge:
rm -Rfv libs/
rm -Rfv leaf/
rm -Rfv user.mk
check-%:
@[ -d $* ] && [ -d $*/.git ] || echo "Library '$*' is missing or doesn't contain a git repo! This is BAD."
kicad: $(addprefix check-,$(remotes))
kicad $(project).pro