-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.local
28 lines (28 loc) · 1.21 KB
/
Makefile.local
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
generate-gh-tuples:
@make DISTFILES=$$(make -VDISTFILES:Mtensorflow-tensorflow\*) extract
@printf %s 'GH_TUPLE='
@IFS=: ;\
sed -nEe '/\/\/github.com/s/.*\/([^\/]*)\/([^\/]*)\/archive\/([^"]*)")?,.*/\1:\2:\3/p' \
$$(make -VWRKSRC)/WORKSPACE \
$$(make -VWRKSRC)/tensorflow/workspace.bzl \
| sort -u | \
while read name acct tarball; do \
tag=$$(printf %s "$$tarball" | sed -E 's,(.tar.gz|.tar.xz|.zip),,'); \
label=$$( \
printf %s "$$name" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$acct" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$tag" | sed 's,[^[:alpha:][:digit:]],_,g'); \
printf ' \\\n %s' "$$name:$$acct:$$tag:$$label"; \
done; \
sed -nEe '/\/\/github.com/s/.*\/([^\/]*)\/([^\/]*)\/releases\/download\/([^\/]+)\/([^"]*)")?,.*/\1:\2:\3/p' \
$$(make -VWRKSRC)/WORKSPACE \
$$(make -VWRKSRC)/tensorflow/workspace.bzl \
| sort -u | \
while read name acct tag; do \
label=$$( \
printf %s "$$name" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$acct" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$tag" | sed 's,[^[:alpha:][:digit:]],_,g'); \
printf ' \\\n %s' "$$name:$$acct:$$tag:$$label"; \
done; \
printf '\n'