forked from RileyRaschke/sc-data-util
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
32 lines (23 loc) · 698 Bytes
/
makefile
File metadata and controls
32 lines (23 loc) · 698 Bytes
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
.DEFAULT_GOAL := all
# Cross-platform compatible way to get git version
DISTVER := $(shell git describe --always --dirty --long --tags 2>nul || git describe --always --dirty --long --tags 2>/dev/null || echo "unknown")
# Correct package path for version injection
PKG := github.com/egargale/sc-data-util
all: test dist
test:
go test -v ./scid/... ./csv/... ./util/...
dist:
go build -ldflags "-X $(PKG)/util.Version=$(DISTVER)"
install: test dist
go install -ldflags "-X $(PKG)/util.Version=$(DISTVER)" .
upgrade:
go get -u && go mod tidy
goformat:
gofmt -s -w .
# Add a clean target for both platforms
clean:
ifeq ($(OS),Windows_NT)
del *.exe 2>nul || exit 0
else
rm -f *.exe
endif