-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (26 loc) · 1.14 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
NAME=anicat
BUILDIR=build
SRV_FILE=service-exec/service.go
VERSION := $(patsubst v%,%,$(shell git describe --tags || echo "x.x.x"))
GOBUILD=CGO_ENABLED=0 go build -ldflags '-X "github.com/NullpointerW/anicat/conf.Ver=$(VERSION)"'
all:
$(MAKE) windows
$(MAKE) linux
$(MAKE) windows-service
$(MAKE) docker-build
$(MAKE) docker-push
windows:
GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -ldflags '-X "github.com/NullpointerW/anicat/conf.Ver=$(VERSION)" -H=windowsgui' -o $(BUILDIR)/$(NAME)[email protected]
zip -j $(BUILDIR)/$(NAME)[email protected] $(BUILDIR)/$(NAME)[email protected]
windows-service:
GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -ldflags '-X "github.com/NullpointerW/anicat/conf.Ver=$(VERSION)" ' -o $(BUILDIR)/$(NAME)[email protected] $(SRV_FILE)
zip -j $(BUILDIR)/$(NAME)[email protected] $(BUILDIR)/$(NAME)[email protected]
linux:
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BUILDIR)/$(NAME)-$@-amd64
tar czvf $(BUILDIR)/$(NAME)[email protected] -C $(BUILDIR) $(NAME)-$@-amd64
docker-build:
docker build --build-arg VER=$(VERSION) -t wmooon/anicat -f docker/Dockerfile .
docker-push:
docker push wmooon/anicat
clean:
rm -rf $(BUILDIR)/*