forked from Nesvilab/philosopher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (51 loc) · 1.99 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
SOURCEDIR=.
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
BINARY = philosopher
VERSION = $(shell date +%Y%m%d)
BUILD = $(shell date +%Y%m%d%H%M)
TAG = v4.4.0
LDFLAGS = -ldflags "-w -s -extldflags -static -X main.version=${TAG} -X main.build=${BUILD}"
.DEFAULT_GOAL: $(BINARY)
$(BINARY): $(SOURCES)
go build ${LDFLAGS} -o ${BINARY} main.go
.PHONY: deploy
deploy:
unzip -o lib/dat/bindata.go.zip -d lib/dat/
unzip -o lib/ext/cdhit/unix/bindata.go.zip -d lib/ext/cdhit/unix/
unzip -o lib/ext/cdhit/win/bindata.go.zip -d lib/ext/cdhit/win/
unzip -o lib/ext/comet/unix/bindata.go.zip -d lib/ext/comet/unix/
unzip -o lib/ext/comet/win/bindata.go.zip -d lib/ext/comet/win/rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz
unzip -o lib/ext/rawfilereader/reh64/bindata.go.zip -d lib/ext/rawfilereader/reh64/
unzip -o lib/ext/rawfilereader/win/bindata.go.zip -d lib/ext/rawfilereader/win/
unzip -o lib/pip/bindata.go.zip -d lib/pip/
unzip -o lib/dat/bindata.go.zip -d lib/dat/
unzip -o lib/obo/unimod/bindata.go.zip -d lib/obo/unimod/
.PHONY: test
test:
go test ./... -v
.PHONY: rc
rc:
env CGO_ENABLED=0 gox -os="linux" ${LDFLAGS} -arch=amd64 -output philosopher-${TAG}-RC
env CGO_ENABLED=0 gox -os="windows" ${LDFLAGS} -arch=amd64 -output philosopher-${TAG}-RC
mv philosopher-${TAG}-RC ~/bin/
mv philosopher-${TAG}-RC.exe ~/bin/
.PHONY: linux
linux:
env CGO_ENABLED=0 gox -os="linux" ${LDFLAGS} -arch=amd64 -output philosopher
.PHONY: windows
windows:
env CGO_ENABLED=0 gox -os="windows" ${LDFLAGS} -arch=amd64 -output philosopher
.PHONY: all
all:
env CGO_ENABLED=0 gox -os="linux" ${LDFLAGS} -arch=amd64 -output philosopher
env CGO_ENABLED=0 gox -os="windows" ${LDFLAGS} -arch=amd64 -output philosopher
.PHONY: push
push:
git tag -a ${TAG} -m "Philosopher ${TAG}"
git push origin master -f --tags
.PHONY: draft
draft:
goreleaser --skip-publish --snapshot --release-notes=Changelog --rm-dist
.PHONY: release
release:
goreleaser --release-notes=Changelog --rm-dist