Skip to content

Commit c8b441f

Browse files
authored
Merge pull request #17 from threefoldtech/static_build
update makefile to procude static build
2 parents f3e95bc + fc5ee6a commit c8b441f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
all: client server
22

3+
BUILD_FLAGS = -ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build'
4+
35
server:
46
mkdir -p bin
5-
cd cmds/server && go build && mv server ../../bin/trs
7+
cd cmds/server && go build $(BUILD_FLAGS) -o ../../bin/trs
68

79
client:
810
mkdir -p bin
9-
cd cmds/client && go build && mv client ../../bin/trc
11+
cd cmds/client && go build $(BUILD_FLAGS) -o ../../bin/trc
1012

1113
runserver: server
1214
sudo bin/trs -config router.toml

0 commit comments

Comments
 (0)