This commit is contained in:
Jarrad Hope 2016-06-18 20:28:08 +02:00
parent 9858dc5d0d
commit 2da74dd34d
3 changed files with 73 additions and 5 deletions

35
.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
/tmp
*/**/*un~
*/**/*.test
*un~
.DS_Store
*/**/.DS_Store
.ethtest
*/**/*tx_database*
*/**/*dapps*
Godeps/_workspace/pkg
Godeps/_workspace/bin
#*
.#*
*#
*~
.project
.settings
# used by the Makefile
/build/_workspace/
/build/bin/
# travis
profile.tmp
profile.cov
# vagrant
.vagrant

View File

@ -1,13 +1,14 @@
GOBIN = build/bin
GO ?= latest
statusgo:
go install
@echo "Done installing status go."
@echo "Run \"statusgo\" to view available commands"
build/env.sh go build -i -o $(GOBIN)/statusgo ./
@echo "status go compilation done."
@echo "Run \"build/bin/statusgo\" to view available commands"
statusgo-android: xgo
xgo --go=$(GO) --targets=android-16/aar ./
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=android-16/aar ./
@echo "Android cross compilation done:"
xgo:
go get github.com/karalabe/xgo
build/env.sh go get github.com/karalabe/xgo

32
build/env.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e
if [ ! -f "build/env.sh" ]; then
echo "$0 must be run from the root of the repository."
exit 2
fi
# Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace"
root="$PWD"
ethdir="$workspace/src/github.com/ethereum"
if [ ! -L "$ethdir/go-ethereum" ]; then
mkdir -p "$ethdir"
cd "$ethdir"
ln -s ../../../../../. go-ethereum
cd "$root"
fi
# Set up the environment to use the workspace.
# Also add Godeps workspace so we build using canned dependencies.
GOPATH="$ethdir/go-ethereum/Godeps/_workspace:$workspace"
GOBIN="$PWD/build/bin"
export GOPATH GOBIN
# Run the command inside the workspace.
cd "$ethdir/go-ethereum"
PWD="$ethdir/go-ethereum"
# Launch the arguments with the configured environment.
exec "$@"