Skip to content

Commit

Permalink
build: Factor out static compilation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dlespiau committed Oct 27, 2019
1 parent 0f13e32 commit 7b84539
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ ifneq ($(RW),yes)
RO = -mod=readonly
endif

jk: pkg/__std/lib/assets_vfsdata.go FORCE
ifeq ($(STATIC),yes)
GO111MODULE=on go build $(RO) -a -tags netgo -o $@ -ldflags '-X main.Version=$(VERSION) -s -w -extldflags "-static"'
else
GO111MODULE=on go build $(RO) -o $@ -ldflags "-X main.Version=$(VERSION) -s -w"
A = -a
TAGS += -tags netgo
LDFLAGS += -extldflags "-static"
endif

jk: pkg/__std/lib/assets_vfsdata.go FORCE
GO111MODULE=on go build $(RO) $(A) $(TAGS) -o $@ -ldflags '-X main.Version=$(VERSION) -s -w $(LDFLAGS)'

pkg/__std/lib/assets_vfsdata.go: std/internal/__std_generated.ts std/dist/index.js
GO111MODULE=on go generate $(RO) ./pkg/__std/lib

Expand Down

0 comments on commit 7b84539

Please sign in to comment.