-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
27 lines (22 loc) · 1015 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
NAME=$(lastword $(subst /, ,$(abspath .)))
VERSION=$(shell git.exe describe --tags 2>nul || echo v0.0.0)
GOOPT=-ldflags "-s -w -X main.version=$(VERSION)"
GOEXE=$(shell go env GOEXE)
ifeq ($(OS),Windows_NT)
SHELL=CMD.EXE
SET=SET
else
SET=export
endif
all:
$(foreach X,$(wildcard internal/*),cd $(X) && go fmt && cd ../.. && ) :
$(foreach X,$(wildcard cmd/*),cd $(X) && $(SET) "CGO_ENABLED=0" && go build -o ../../$(notdir $(X)$(GOEXE)) $(GOOPT) && cd ../.. && ) :
_package:
$(MAKE) all
$(foreach X,$(wildcard cmd/*),zip $(notdir $(X))-$(VERSION)-$(GOOS)-$(GOARCH).zip $(notdir $(X))$(GOEXE) && ) :
package:
$(SET) "GOOS=windows" && $(SET) "GOARCH=386" && $(MAKE) _package
$(SET) "GOOS=windows" && $(SET) "GOARCH=amd64" && $(MAKE) _package
manifest:
make-scoop-manifest vo*-windows-*.zip > vo.json
make-scoop-manifest --inline "{ \"description\": \"Show the version number , timestamp and MD5SUM of Windows Executables\" }" showver*-windows-*.zip > showver.json