Skip to content

Commit

Permalink
Merge pull request #1085 from ploxiln/nogoflags
Browse files Browse the repository at this point in the history
Makefile: replace GOFLAGS with BLDFLAGS
  • Loading branch information
mreiferson authored Sep 24, 2018
2 parents 8f6fa1f + d1ee283 commit 0210853
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN wget -O /bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-
&& chmod +x /bin/dep \
&& /bin/dep ensure \
&& ./test.sh \
&& CGO_ENABLED=0 make DESTDIR=/opt PREFIX=/nsq GOFLAGS='-ldflags="-s -w"' install
&& CGO_ENABLED=0 make DESTDIR=/opt PREFIX=/nsq BLDFLAGS='-ldflags="-s -w"' install

FROM alpine:3.7

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
PREFIX=/usr/local
DESTDIR=
GOFLAGS=
BINDIR=${PREFIX}/bin

DESTDIR=
BLDDIR = build
BLDFLAGS=
EXT=
ifeq (${GOOS},windows)
EXT=.exe
Expand All @@ -24,7 +23,7 @@ $(BLDDIR)/to_nsq: $(wildcard apps/to_nsq/*.go internal/*/*.go

$(BLDDIR)/%:
@mkdir -p $(dir $@)
go build ${GOFLAGS} -o $@ ./apps/$*
go build ${BLDFLAGS} -o $@ ./apps/$*

$(APPS): %: $(BLDDIR)/%

Expand Down
2 changes: 1 addition & 1 deletion dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for os in linux darwin freebsd windows; do
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/nsq-XXXXX)
TARGET="nsq-$version.$os-$arch.$goversion"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
make DESTDIR=$BUILD PREFIX=/$TARGET GOFLAGS="$GOFLAGS" install
make DESTDIR=$BUILD PREFIX=/$TARGET BLDFLAGS="$GOFLAGS" install
pushd $BUILD
sudo chown -R 0:0 $TARGET
tar czvf $TARGET.tar.gz $TARGET
Expand Down

0 comments on commit 0210853

Please sign in to comment.