-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
59 lines (47 loc) · 1.51 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
REF_FILE=usage_test/archive.ref
RULES_ARCHIVE=bazel-bin/archive.tar.gz
FETCH_VERSIONS=@bazel_ipfs//fetch_versions:main
TESTED_IPFS_VERSION ?=v0.4.20
.PHONY: test
test: $(REF_FILE)
[ "`$(MAKE) -s --no-print-directory run`" = "Hello world!" ]
.PHONY: ci-test
ci-test: $(REF_FILE)
sed -i.bak 's/ipfs_tools_repository(name = "bazel_ipfs_tools")/ipfs_tools_repository(name = "bazel_ipfs_tools", version = "$(TESTED_IPFS_VERSION)")/' hello_bazel/WORKSPACE
sed -i.bak 's/ipfs_tools_repository(name = "bazel_ipfs_tools")/ipfs_tools_repository(name = "bazel_ipfs_tools", version = "$(TESTED_IPFS_VERSION)")/' usage_test/WORKSPACE
[ "`$(MAKE) -s --no-print-directory run`" = "Hello world!" ]
.PHONY: test
test.str: $(REF_FILE)
[ "`$(MAKE) -s --no-print-directory run.str`" = "Hello world!" ]
.PHONY: release
release: $(RULES_ARCHIVE)
.PHONY: $(RULES_ARCHIVE)
$(RULES_ARCHIVE):
bazel build bazel_ipfs
.PHONY: run
run:
cd usage_test && bazel run @hello_ipfs//:hello_world
.PHONY: run
run.str:
cd usage_test && bazel run @hello_ipfs_str_ref//:hello_world
.PHONY: ipfs_init
ipfs_init:
cd usage_test && bazel run @bazel_ipfs_tools//:ipfs -- init
.PHONY: $(REF_FILE)
$(REF_FILE):
cd hello_bazel && bazel run pin > ../$@
.PHONY: re
clean:
rm -f $(REF_FILE)
cd hello_bazel && bazel clean --expunge
cd usage_test && bazel clean --expunge
bazel clean --expunge
.PHONY: versions.bzl
versions.bzl:
echo '# File generated by $(FETCH_VERSIONS)' > $@
echo >> $@
bazel run $(FETCH_VERSIONS) >> $@
buildifier $@
.PHONY: re
re: clean
$(MAKE)