-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
50 lines (41 loc) · 1.29 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
.PHONY: all
all: bundles/bashLib
.PHONY: test
test: bundles/bashTest
@prove -v tests/test-dotploy.sh
.PHONY: dev-test
dev-test:
@prove -v tests/test-dotploy.sh
.PHONY: clean
clean:
@rm -f dotploy && rm -rf bundles
.PHONY: standalone
standalone: dotploy
dotploy: bundles/bashLib
@sed -e '1,/# @@BASHLIB BEGIN@@/d' -e '/# @@BASHLIB END@@/,$$d' bundles/bashLib/src/bashLib > bashLib; \
awk ' \
/# @@BASHLIB BEGIN@@/ {system("cat bashLib"); bashlib=1; next} \
/# @@BASHLIB END@@/ {bashlib=0; next} \
bashlib {next} \
{print} \
' dotploy.sh > dotploy && rm bashLib; \
sed -i 's/# \(export STANDALONE=1\)/\1/g' dotploy; \
sed -i 's/dotploy\.sh/dotploy/g' dotploy; \
chmod a+x dotploy
bundles:
@mkdir -p bundles
bundles/bashLib: bundles FORCE
@if [ -d bundles/bashLib ]; \
then \
( cd bundles/bashLib; git checkout master; git fetch --all --prune; git reset --hard origin/master ); \
else \
git clone https://github.com/techlivezheng/bashLib.git bundles/bashLib; \
fi
bundles/bashTest: bundles/bashLib FORCE
@if [ -d bundles/bashTest ]; \
then \
( cd bundles/bashTest; git checkout master; git fetch --all --prune; git reset --hard origin/master ); \
else \
git clone https://github.com/techlivezheng/bashTest.git bundles/bashTest; \
fi
FORCE: