This repository has been archived by the owner on Aug 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from dgonyeo/master
Added build script
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# Gets the directory that this script is stored in. | ||
# https://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
ORG_PATH="github.com/appc" | ||
REPO_PATH="${ORG_PATH}/acserver" | ||
|
||
if [ ! -h gopath/src/${REPO_PATH} ]; then | ||
mkdir -p gopath/src/${ORG_PATH} | ||
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255 | ||
fi | ||
|
||
export GOBIN=${DIR}/bin | ||
export GOPATH=${DIR}/Godeps/_workspace:${DIR}/gopath | ||
|
||
eval $(go env) | ||
export GOOS GOARCH | ||
|
||
if [ "${GOOS}" = "freebsd" ]; then | ||
# /usr/bin/cc is clang on freebsd, but we need to tell it to go to | ||
# make it generate proper flavour of code that doesn't emit | ||
# warnings. | ||
export CC=clang | ||
fi | ||
|
||
echo "Building acserver..." | ||
go build -o $GOBIN/acserver ${REPO_PATH} |