-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
22 lines (18 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
NAME = $(shell basename `pwd`)
VERSION = $(shell git describe --tags --always)
OUTDIR = dist/$(NAME)-$(VERSION)
all:
dist:
@mkdir -p dist/$(NAME)-$(VERSION)
.PHONY: outdir
outdir:
@echo "dist/$(NAME)-$(VERSION)"
build: dist
@echo "Building with system defaults..."
@CGO_ENABLED=0 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)"
@echo "Building ..."
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)-darwin-arm64
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)-darwin-amd64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)-linux-amd64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)-linux-arm64
@echo "Done."