-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 685 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 685 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
BINDIR=bin
VERSION=$(shell git describe --tags || echo "unknownversion")
ifdef NAME
FULLNAME=$(NAME)-$@
else
FULLNAME=oh-my-apple-store-$@-$(VERSION)
endif
LDFLAGS="-s -w -X github.com/Bpazy/oh-my-apple-store/cmd.buildVer=${VERSION}"
GOBUILD=go build -ldflags=${LDFLAGS}
CMDPATH=.
all: linux-amd64 darwin-amd64 windows-amd64 # Most used
darwin-amd64:
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(FULLNAME) $(CMDPATH)
linux-amd64:
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(FULLNAME) $(CMDPATH)
windows-amd64:
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(FULLNAME).exe $(CMDPATH)
install:
go install -ldflags=${LDFLAGS} $(CMDPATH)
clean:
rm $(BINDIR)/*