This commit is contained in:
2019-11-01 23:56:17 -07:00
parent 92335ead98
commit 3aec504aa1
6 changed files with 182 additions and 61 deletions

View File

@@ -9,16 +9,26 @@ BUILDARCH := $(shell uname -m)
FN := fediverse-archive
IMAGENAME := sneak/$(FN)
UNAME_S := $(shell uname -s)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
GOFLAGS = -ldflags "-linkmode external -extldflags -static $(GOLDFLAGS)"
# osx can't statically link apparently?!
ifeq ($(UNAME_S),Darwin)
GOFLAGS := -ldflags "$(GOLDFLAGS)"
endif
ifneq ($(UNAME_S),Darwin)
GOFLAGS = -ldflags "-linkmode external -extldflags -static $(GOLDFLAGS)"
endif
default: rundebug
rundebug: build
./$(FN) -debug
DEBUG=1 ./$(FN)
run: build
./$(FN)