Skip to content
Snippets Groups Projects
Commit 9a299934 authored by Florent Gluck's avatar Florent Gluck
Browse files

Minor changes to build flags

parent 1c78d887
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,9 @@ clean_certs:
#-------------------------------------------------------------------------
# To build a static executable:
# CGO_ENABLED=0 go build
build:
@echo "[Building nexus-server]"
@cd src/server && go build -a .
......
#build_flags=build -a
build_flags=build
#static_flags=-ldflags '-w -extldflags "-static"'
static_flags=
# To force a full recompile:
# build_flags=build -a
# To build a static executable:
# CGO_ENABLED=0 go build
OSES=linux windows darwin
ARCHES=amd64 arm64 386
CA_CERT_NAME=ca-cert.pem
......@@ -54,7 +55,7 @@ build_dev: build_dir prepare_dev build
build:
@echo "[Building for $(OS) $(ARCH)]" ;\
if [ $(OS) = "linux" ]; then \
GOARCH=$(ARCH) GOOS=$(OS) CGO_ENABLED=0 go $(build_flags) $(static_flags) -o build/$(ARCH)/$(OS)/ ;\
GOARCH=$(ARCH) GOOS=$(OS) CGO_ENABLED=0 go $(build_flags) -o build/$(ARCH)/$(OS)/ ;\
strip -s build/$(ARCH)/$(OS)/$(bin) ;\
#upx build/$(ARCH)/$(OS)/$(bin) ;\
else \
......@@ -74,7 +75,7 @@ build_all:
mkdir -p build/$$arch/$$os ;\
echo "[Building for $$os $$arch]" ;\
if [ $$os = "linux" ]; then \
GOARCH=$$arch GOOS=$$os CGO_ENABLED=0 go $(build_flags) $(static_flags) -o build/$$arch/$$os/ ;\
GOARCH=$$arch GOOS=$$os CGO_ENABLED=0 go $(build_flags) -o build/$$arch/$$os/ ;\
strip -s build/$$arch/$$os/$(bin) ;\
#upx build/$$arch/$$os/$(bin) ;\
else \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment