Changing makefile to generate portable dist (#18)

* changed build to create dist which does not require env variable to run

* configured makefile to grab libraries from harmony-path for dist
pull/19/head
Manish Gangal 5 years ago committed by Edgar Aroutiounian
parent fd2df1ed6b
commit b522afdb6e
  1. 10
      Makefile

@ -6,11 +6,18 @@ built_by := ${USER}@harmony.one
flags := -gcflags="all=-N -l -c 2"
ldflags := -X main.version=v${version} -X main.commit=${commit}
ldflags += -X main.builtAt=${built_at} -X main.builtBy=${built_by}
cli := hmy_cli
cli := ./dist/hmy_cli
env := GO111MODULE=on
DIR := ${CURDIR}
export CGO_LDFLAGS=-L$(DIR)/dist/lib -Wl,-rpath -Wl,\$ORIGIN/lib
all:
mkdir -p dist
rsync -a $(shell go env GOPATH)/src/github.com/harmony-one/bls/lib/* ./dist/lib/
rsync -a $(shell go env GOPATH)/src/github.com/harmony-one/mcl/lib/* ./dist/lib/
rsync -a /usr/local/opt/openssl/lib/* ./dist/lib/
$(env) go build -o $(cli) -ldflags="$(ldflags)" client/main.go
debug:
@ -28,3 +35,4 @@ test-rpc:
clean:
@rm -f $(cli)
@rm -rf ./dist
Loading…
Cancel
Save