forked from google/codesearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildall
More file actions
executable file
·31 lines (26 loc) · 884 Bytes
/
Copy pathbuildall
File metadata and controls
executable file
·31 lines (26 loc) · 884 Bytes
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
#!/bin/bash
# This script builds the code search binaries for a variety of OS/architecture combinations.
. ./setup
for i in {5,6,8}{c,g,a,l}
do
go tool dist install cmd/$i
done
build() {
echo "# $1"
goos=$(echo $1 | sed 's;/.*;;')
goarch=$(echo $1 | sed 's;.*/;;')
GOOS=$goos GOARCH=$goarch CGO_ENABLED=0 \
go install -a code.google.com/p/codesearch/cmd/{cgrep,cindex,csearch}
rm -rf codesearch-$version
mkdir codesearch-$version
mv ~/g/bin/{cgrep,cindex,csearch}* codesearch-$version
chmod +x codesearch-$version/*
cat README.template | sed "s/ARCH/$(arch $goarch)/; s/OPERSYS/$(os $goos)/" >codesearch-$version/README.txt
rm -f codesearch-$version-$goos-$goarch.zip
zip -z -r codesearch-$version-$goos-$goarch.zip codesearch-$version < codesearch-$version/README.txt
rm -rf codesearch-0.01
}
for i in {linux,darwin,freebsd,windows}/{amd64,386}
do
build $i
done