-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 836 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
28
29
30
31
32
SHELL := /bin/sh
BINS = bin/macos/pwscraper-macos bin/win64/pwscraper-win64.exe bin/linux64/pwscraper-linux64
GOSRC = $(shell find . -name '*.go')
CGO_ENABLED = 0
ENVVARS = CGO_ENABLED=$(CGO_ENABLED)
LDFLAGS = -ldflags='-s -w'
BUILDFLAGS = -tags "osusergo netgo"
BUILDWINFLAGS = -tags "osusergo netgo"
PACKAGE = github.com/popsu/mtgpwscraper/cmd
.PHONY: build
build: $(BINS)
.PHONY: dev
dev: bin/linux64/pwscraper
.PHONY: clean
clean:
- go clean .
- rm -vrf bin/*
bin/macos/pwscraper-macos: $(GOSRC)
$(ENVVARS) GOOS=darwin go build $(LDFLAGS) $(BUILDFLAGS) -o $@ $(PACKAGE)
bin/win64/pwscraper-win64.exe: $(GOSRC)
$(ENVVARS) GOOS=windows CC=x86_64-w64-mingw32-gcc \
go build $(LDFLAGS) $(BUILDWINFLAGS) -o $@ $(PACKAGE)
bin/linux64/pwscraper-linux64: $(GOSRC)
$(ENVVARS) go build $(LDFLAGS) $(BUILDFLAGS) -o $@ $(PACKAGE)