tunasync/Makefile
呼啸随风 669b768f67
make go build use static-link mode
depends changed! 
e.g.
before:  `header-file.h` and `shared-library.so`
after: `header-file.h` and `archive-libraries.a`
2021-11-17 16:26:08 +08:00

20 lines
514 B
Makefile

LDFLAGS="-X main.buildstamp=`date -u '+%s'` -X main.githash=`git rev-parse HEAD` -linkmode 'external' -extldflags '-static'"
all: get tunasync tunasynctl
get:
go get ./cmd/tunasync
go get ./cmd/tunasynctl
build:
mkdir -p build
tunasync: build
go build -o build/tunasync -ldflags ${LDFLAGS} github.com/tuna/tunasync/cmd/tunasync
tunasynctl: build
go build -o build/tunasynctl -ldflags ${LDFLAGS} github.com/tuna/tunasync/cmd/tunasynctl
test:
go test -v -covermode=count -coverprofile=profile.cov ./...