Skip to content

Commit

Permalink
Disable CGO
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed May 7, 2024
1 parent f657ce9 commit 5116787
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GO_VERSION = $(shell $(GO) version)
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MIN_SUPPORTED_GO_MAJOR_VERSION = 1
MIN_SUPPORTED_GO_MINOR_VERSION = 18
MIN_SUPPORTED_GO_MINOR_VERSION = 21
GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MIN_SUPPORTED_GO_MAJOR_VERSION).$(MIN_SUPPORTED_GO_MINOR_VERSION)

VERSION_HEADER ?= 1
Expand All @@ -31,16 +31,16 @@ LDFLAGS = "-s -w -X $(API_PKG).VersionHeader=$(VERSION_HEADER)"

.PHONY: armory-server
armory-server:
$(GO) build -o armory-server -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 $(GO) build -o armory-server -trimpath -ldflags $(LDFLAGS) .

.PHONY: release
release:
mkdir -p ./release
GOOS=linux GOARCH=amd64 $(GO) build -o ./release/armory-server_linux-amd64 -trimpath -ldflags $(LDFLAGS) .
GOOS=linux GOARCH=arm64 $(GO) build -o ./release/armory-server_linux-arm64 -trimpath -ldflags $(LDFLAGS) .
GOOS=darwin GOARCH=amd64 $(GO) build -o ./release/armory-server_macos-amd64 -trimpath -ldflags $(LDFLAGS) .
GOOS=darwin GOARCH=arm64 $(GO) build -o ./release/armory-server_macos-arm64 -trimpath -ldflags $(LDFLAGS) .
GOOS=windows GOARCH=amd64 $(GO) build -o ./release/armory-server_windows.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o ./release/armory-server_linux-amd64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO) build -o ./release/armory-server_linux-arm64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GO) build -o ./release/armory-server_macos-amd64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 $(GO) build -o ./release/armory-server_macos-arm64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GO) build -o ./release/armory-server_windows.exe -trimpath -ldflags $(LDFLAGS) .

clean:
rm -f ./armory-server
Expand Down

0 comments on commit 5116787

Please sign in to comment.