-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (24 loc) · 982 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# light-beaconchain-explorer
EXECUTABLE=explorer
LINUX=$(EXECUTABLE)_linux_amd64
DARWIN=$(EXECUTABLE)_darwin_amd64
VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
VERSION := $(shell git rev-parse --short HEAD)
GOLDFLAGS += -X 'github.com/pk910/light-beaconchain-explorer/utils.BuildVersion="$(VERSION)"'
GOLDFLAGS += -X 'github.com/pk910/light-beaconchain-explorer/utils.Buildtime="$(BUILDTIME)"'
GOLDFLAGS += -X 'github.com/pk910/light-beaconchain-explorer/utils.BuildRelease="$(RELEASE)"'
.PHONY: all test clean
all: test build
test:
go test ./...
build: linux darwin
@echo version: $(VERSION)
linux: $(LINUX)
darwin: $(DARWIN)
$(LINUX):
env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -o bin/$(LINUX) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer
$(DARWIN):
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o bin/$(DARWIN) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer
clean:
rm -f $(LINUX) $(DARWIN)