Altered makefile to add new ldflags to remove debug info

This commit is contained in:
Evan Hosinski
2026-04-07 09:10:49 -04:00
parent 5c36b034b6
commit 5905b3478d
+2 -2
View File
@@ -30,14 +30,14 @@ clean:
# Build for current platform # Build for current platform
build: build:
CGO_ENABLED=0 $(GO) build -o $(BUILD_DIR)/$(BINARY_NAME) -ldflags "-X main.version=$(VERSION)" crowsnest.go CGO_ENABLED=0 $(GO) build -o $(BUILD_DIR)/$(BINARY_NAME) -ldflags "-X main.version=$(VERSION) -s -w" crowsnest.go
# Build for all platforms # Build for all platforms
build-all: clean build-all: clean
@for platform in $(PLATFORMS); do \ @for platform in $(PLATFORMS); do \
for arch in $(ARCHS); do \ for arch in $(ARCHS); do \
echo "Building for $$platform/$$arch..."; \ echo "Building for $$platform/$$arch..."; \
GOOS=$$platform GOARCH=$$arch CGO_ENABLED=0 $(GO) build -o $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch -ldflags "-X main.version=$(VERSION)" crowsnest.go; \ GOOS=$$platform GOARCH=$$arch CGO_ENABLED=0 $(GO) build -o $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch -ldflags "-X main.version=$(VERSION) -s -w" crowsnest.go; \
if [ "$$platform" = "windows" ]; then \ if [ "$$platform" = "windows" ]; then \
mv $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch.exe; \ mv $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch.exe; \
fi; \ fi; \