Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
k8scat committed Dec 29, 2022
1 parent 04785f4 commit 93c25db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Makefile
Expand Up @@ -11,24 +11,25 @@ BUILD_FLAGS = -ldflags "-X main.version=$(VERSION) \
-X main.date=$(BUILD_DATE) -w -s" \
-trimpath
MAIN_SRC_FILE = cmd/articli/main.go
GOARCH = $(shell uname -m)

.PHONY: build
build: pre-build
GO111MODULE=on CGO_ENABLED=$(CGO_ENABLED) GOOS=$(BUILD_GOOS) GOARCH=amd64 $(GO) $(BUILD_TARGET) $(BUILD_FLAGS) -o bin/$(BUILD_GOOS)/$(NAME) $(MAIN_SRC_FILE)
GO111MODULE=on CGO_ENABLED=$(CGO_ENABLED) GOOS=$(BUILD_GOOS) GOARCH=$(GOARCH) $(GO) $(BUILD_TARGET) $(BUILD_FLAGS) -o bin/$(BUILD_GOOS)/$(NAME) $(MAIN_SRC_FILE)
chmod +x bin/$(BUILD_GOOS)/$(NAME)
rm -rf $(NAME)
ln -s bin/$(BUILD_GOOS)/$(NAME) $(NAME)

.PHONY: darwin
darwin: pre-build
GO111MODULE=on CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=amd64 $(GO) $(BUILD_TARGET) $(BUILD_FLAGS) -o bin/darwin/$(NAME) $(MAIN_SRC_FILE)
GO111MODULE=on CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=$(GOARCH) $(GO) $(BUILD_TARGET) $(BUILD_FLAGS) -o bin/darwin/$(NAME) $(MAIN_SRC_FILE)
chmod +x bin/darwin/$(NAME)
rm -rf $(NAME)
ln -s bin/darwin/$(NAME) $(NAME)

.PHONY: linux
linux: pre-build
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 $(GO) $(BUILD_TARGET) $(BUILD_FLAGS) -o bin/linux/$(NAME) $(MAIN_SRC_FILE)
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=$(GOARCH) $(GO) $(BUILD_TARGET) $(BUILD_FLAGS) -o bin/linux/$(NAME) $(MAIN_SRC_FILE)
chmod +x bin/linux/$(NAME)
rm -rf $(NAME)
ln -s bin/linux/$(NAME) $(NAME)
Expand Down
1 change: 0 additions & 1 deletion pkg/segmentfault/client.go
@@ -1,6 +1,5 @@
package segmentfault

import "C"
import (
"errors"
"io"
Expand Down

0 comments on commit 93c25db

Please sign in to comment.