mirror of
https://github.com/alice-lg/birdwatcher.git
synced 2025-03-09 00:00:05 +01:00
make static linux build
This commit is contained in:
parent
cbeb79cbd4
commit
735ed87ded
1 changed files with 8 additions and 0 deletions
8
Makefile
8
Makefile
|
@ -34,6 +34,8 @@ ifneq ($(UNAME),$(filter $(UNAME),Darwin FreeBSD Linux))
|
|||
$(error error: Unkown OS )
|
||||
endif
|
||||
|
||||
LDFLAGS_STATIC=-ldflags="-extldflags '-static'"
|
||||
|
||||
all: $(TARGET)
|
||||
@echo "Built $(VERSION) @ $(TARGET)"
|
||||
|
||||
|
@ -46,6 +48,12 @@ linux:
|
|||
freebsd:
|
||||
GO111MODULE=on GOARCH=$(ARCH) GOOS=freebsd go build -o $(PROG)-freebsd-$(ARCH)
|
||||
|
||||
linux_static:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) \
|
||||
go build $(CFLAGS) \
|
||||
-a $(LDFLAGS_STATIC) \
|
||||
-o $(PROG)-linux-$(ARCH)
|
||||
|
||||
|
||||
build_server:
|
||||
ifeq ($(BUILD_SERVER), '')
|
||||
|
|
Loading…
Add table
Reference in a new issue