Skip to content

Commit

Permalink
chore(Makefile): build dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
cad committed Jul 26, 2020
1 parent 38c6e59 commit abb1453
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ build: bundle
@echo Building
rm -rf bin/
mkdir -p bin/
CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -X 'github.com/cad/ovpm.Version=$(VERSION)' -extldflags '-static'" -o ./bin/ovpm ./cmd/ovpm
CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -X 'github.com/cad/ovpm.Version=$(VERSION)' -extldflags '-static'" -o ./bin/ovpmd ./cmd/ovpmd
#CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -X 'github.com/cad/ovpm.Version=$(VERSION)' -extldflags '-static'" -o ./bin/ovpm ./cmd/ovpm
#CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -X 'github.com/cad/ovpm.Version=$(VERSION)' -extldflags '-static'" -o ./bin/ovpmd ./cmd/ovpmd

# Link dynamically for now
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" go build -ldflags="-X 'github.com/cad/ovpm.Version=$(VERSION)'" -o ./bin/ovpm ./cmd/ovpm
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" go build -ldflags="-X 'github.com/cad/ovpm.Version=$(VERSION)'" -o ./bin/ovpmd ./cmd/ovpmd

clean-dist:
rm -rf dist/
Expand All @@ -60,4 +64,4 @@ clean-dist:
dist: clean-dist build
@echo Generating VERSION=$(VERSION) rpm and deb packages under dist/
nfpm pkg -t ./dist/ovpm.rpm
nfpm pkg -t ./dist/ovpm.deb
nfpm pkg -t ./dist/ovpm.deb

0 comments on commit abb1453

Please sign in to comment.