Skip to content

Commit 58e9035

Browse files
committed
build a static binary when releasing
1 parent 67d3c4c commit 58e9035

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ uninstall:
4747

4848
RELEASE_TAG ?= $(shell git rev-parse --abbrev-ref HEAD)
4949
RELEASE_SHA ?= $(shell git rev-parse --short HEAD)
50+
BUILD_OPTS =
5051

5152
.PHONY: $(NAMESPACE) compile-%
5253

@@ -62,7 +63,7 @@ compile-%: clean-%
6263
--in-place=.bak \
6364
src/Options/Utils.hs ; \
6465
PATH="$(CURDIR)/dist:$$PATH" ; \
65-
stack install --system-ghc --local-bin-path dist dockmaster:exe:$* ; \
66+
stack install --system-ghc --local-bin-path dist $(BUILD_OPTS) dockmaster:exe:$* ; \
6667
mv src/Options/Utils.hs.bak src/Options/Utils.hs \
6768
)
6869

@@ -108,9 +109,11 @@ REMOTE_GH:=origin
108109
REMOTE_LOCAL:=local
109110

110111
prerelease: PRERELEASE = true
112+
prerelease: BUILD_OPTS = --ghc-options '-fPIC -optl-static -optl-pthread'
111113
prerelease: _mkrelease
112114

113115
release: PRERELEASE = false
116+
release: BUILD_OPTS = --ghc-options '-fPIC -optl-static -optl-pthread'
114117
release: _mkrelease
115118

116119
_mkrelease: RELEASE_TAG = v$(RELEASE_VERSION)$(shell $(PRERELEASE) && echo '-pr')

0 commit comments

Comments
 (0)