-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (26 loc) · 926 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
PKG := github.com/nico-juni/go-genproto-googleads
GOOGLE_PROTO := google.golang.org/genproto/googleapis/ads/googleads
TARGETS := v7 v8 v9 v10
SRC := googleapis/bazel-bin/google/ads/googleads/$(VERSION)/gapi-ads-googleads-$(VERSION)-go.tar.gz
all: $(TARGETS)
$(TARGETS): googleapis
-rm -rf build
make gen VERSION=$@
gen: _build
-rm -rf $(VERSION) pb/$(VERSION)
cp -a build/$(PKG)/$(VERSION) $(VERSION)
cp -a build/$(GOOGLE_PROTO)/$(VERSION) pb/$(VERSION)
_build: $(SRC)
mkdir build
tar zxf $(SRC) -C build
grep -l -R '$(GOOGLE_PROTO)' build/ | \
xargs sed -i.bak -e 's,$(GOOGLE_PROTO),$(PKG)/pb,'
find build -name '*.bak' -exec rm {} \;
$(SRC): googleapis
cd googleapis; bazel build //google/ads/googleads/$(VERSION):gapi-ads-googleads-$(VERSION)-go
googleapis:
#git clone --depth=1 --branch googleads https://github.com/nico-juni/googleapis
cp -R ../googleapis .
clean:
-rm -rf build
-rm -rf googleapis