Change how the Android camput.arm asset is built to use make.go

Change-Id: I00a6e22ef088a173f78ffca83c984d915670180c
This commit is contained in:
Brad Fitzpatrick 2013-09-03 19:48:32 -07:00
parent 83ab8a62e8
commit dabe4355af
2 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,16 @@
# To use this Makefile, first:
#
# $ cd $GOROOT/src
# $ GOOS=linux GOARCH=arm ./make.bash
#
# TODO: have make.go bootstrap that above when necessary, running "go env" to find the GOROOT and
# mirror it all into a separate writable GOROOT under $CAMROOT/tmp and bootstrap
# it with "GOOS=linux GOARCH=arm make.bash".
all:
GOROOT=$(HOME)/armgo GOOS=linux GOARCH=arm CGO_ENABLED=0 $(HOME)/armgo/bin/go build -o camput.arm --ldflags="-X camlistore.org/pkg/buildinfo.GitInfo "`../../../misc/gitversion` camlistore.org/cmd/camput
(cd ../../.. && go run make.go --os=linux --arch=arm --targets=camlistore.org/cmd/camput)
cp -p ../../../bin/linux_arm/camput camput.arm
../../../misc/gitversion > camput-version.txt
mkdir -p ../gen/org/camlistore
/bin/echo -n "package org.camlistore; public final class ChildProcessConfig { // " > ../gen/org/camlistore/ChildProcessConfig.java
openssl sha1 camput.arm >> ../gen/org/camlistore/ChildProcessConfig.java
/bin/echo "}" >> ../gen/org/camlistore/ChildProcessConfig.java

11
make.go
View File

@ -248,10 +248,21 @@ func main() {
}
if !*quiet {
// TODO: change this next line to call
// actualBinDir(binDir) instead. But the linker
// crashes (!!?!) right now if we do that.
// Bug to be filed once I'm off this plane.
log.Printf("Success. Binaries are in %s", binDir)
}
}
func actualBinDir(dir string) string {
if *buildARCH == runtime.GOARCH && *buildOS == runtime.GOOS {
return dir
}
return filepath.Join(dir, *buildOS+"_"+*buildARCH)
}
// Create an environment variable of the form key=value.
func envPair(key, value string) string {
return fmt.Sprintf("%s=%s", key, value)