Skip to content

Commit

Permalink
Configurable CGO
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed May 7, 2024
1 parent dab5c0f commit 65d93a9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ LDFLAGS = "-s -w -X $(API_PKG).VersionHeader=$(VERSION_HEADER)"

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

.PHONY: release
release:
mkdir -p ./release
CGO_ENABLED=0 GOOS=linux GOARCH=386 $(GO) build -o ./release/armory-server_linux-386 -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=$(CGO_ENABLED) GOOS=linux GOARCH=386 $(GO) build -o ./release/armory-server_linux-386 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 $(GO) build -o ./release/armory-server_linux-amd64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) 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=$(CGO_ENABLED) GOOS=darwin GOARCH=amd64 $(GO) build -o ./release/armory-server_macos-amd64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=arm64 $(GO) build -o ./release/armory-server_macos-arm64 -trimpath -ldflags $(LDFLAGS) .

CGO_ENABLED=0 GOOS=windows GOARCH=386 $(GO) build -o ./release/armory-server_windows-386.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GO) build -o ./release/armory-server_windows-amd64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 $(GO) build -o ./release/armory-server_windows-arm64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=386 $(GO) build -o ./release/armory-server_windows-386.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 $(GO) build -o ./release/armory-server_windows-amd64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=arm64 $(GO) build -o ./release/armory-server_windows-arm64.exe -trimpath -ldflags $(LDFLAGS) .

CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 $(GO) build -o ./release/armory-server_freebsd-amd64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 $(GO) build -o ./release/armory-server_freebsd-arm64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 $(GO) build -o ./release/armory-server_openbsd-amd64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=openbsd GOARCH=arm64 $(GO) build -o ./release/armory-server_openbsd-arm64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=netbsd GOARCH=amd64 $(GO) build -o ./release/armory-server_netbsd-amd64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=0 GOOS=netbsd GOARCH=arm64 $(GO) build -o ./release/armory-server_netbsd-arm64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=freebsd GOARCH=amd64 $(GO) build -o ./release/armory-server_freebsd-amd64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=freebsd GOARCH=arm64 $(GO) build -o ./release/armory-server_freebsd-arm64 -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=openbsd GOARCH=amd64 $(GO) build -o ./release/armory-server_openbsd-amd64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=openbsd GOARCH=arm64 $(GO) build -o ./release/armory-server_openbsd-arm64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=netbsd GOARCH=amd64 $(GO) build -o ./release/armory-server_netbsd-amd64.exe -trimpath -ldflags $(LDFLAGS) .
CGO_ENABLED=$(CGO_ENABLED) GOOS=netbsd GOARCH=arm64 $(GO) build -o ./release/armory-server_netbsd-arm64.exe -trimpath -ldflags $(LDFLAGS) .

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

0 comments on commit 65d93a9

Please sign in to comment.