Altered makefile to add new ldflags to remove debug info
This commit is contained in:
@@ -30,14 +30,14 @@ clean:
|
||||
|
||||
# Build for current platform
|
||||
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-all: clean
|
||||
@for platform in $(PLATFORMS); do \
|
||||
for arch in $(ARCHS); do \
|
||||
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 \
|
||||
mv $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch $(BUILD_DIR)/$(BINARY_NAME)-$$platform-$$arch.exe; \
|
||||
fi; \
|
||||
|
||||
Reference in New Issue
Block a user