-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (21 loc) · 1.05 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
.PHONY: \
build \
windowsbuild \
macbuild \
DEPLOY_PATH := build/
BIN_NAME := bioschemas-gocrawlit
VERSION=$(shell git describe --tags)
BUILD=$(shell date +%FT%T%z)
LDFLAGS=-ldflags "-X main.version=${VERSION} -X main.buildDate=${BUILD}"
build:
go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)$(BIN_NAME) main.go
windowsbuild:
env GOOS=windows GOARCH=amd64 go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)windows/64/$(BIN_NAME)_windows_64.exe main.go
env GOOS=windows GOARCH=386 go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)windows/x86/$(BIN_NAME)_windows_x86.exe main.go
linuxbuild:
env GOOS=linux GOARCH=amd64 go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)linux/64/$(BIN_NAME)_linux_64 main.go
env GOOS=linux GOARCH=386 go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)linux/x86/$(BIN_NAME)_linux_x86 main.go
macbuild:
env GOOS=darwin GOARCH=amd64 go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)darwin/64/$(BIN_NAME)_mac_64 main.go
env GOOS=darwin GOARCH=386 go build -i -v $(LDFLAGS) -o $(DEPLOY_PATH)darwin/x86/$(BIN_NAME)_mac_x86 main.go
build-all: windowsbuild linuxbuild macbuild