-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
39 lines (30 loc) · 1.36 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
28
29
30
31
32
33
34
35
36
37
38
39
VERSION := "2.3.10"
BUILD := $(shell git rev-parse --short HEAD)
FLAGS := "-s -w -X=main.build=$(BUILD) -X=main.time=`TZ=UTC date '+%FT%TZ'` -X=main.version=$(VERSION)"
REPO := awsu
USER := kreuzwerker
build/awsu-linux-amd64:
@mkdir -p build
nice docker container run --rm \
-v $(PWD):/build/awsu \
-w /build/awsu \
golang:1.19rc1-stretch bash -c \
"apt-get update -q && apt-get install -qqy libpcsclite-dev && go mod download && go build -o $@ -ldflags $(FLAGS) awsu.go"
build/awsu-linux-amd64-ubuntu:
@mkdir -p build
nice docker container run --rm -e DEBIAN_FRONTEND=noninteractive \
-v $(PWD):/build/awsu \
-w /build/awsu \
ubuntu:20.04 bash -c \
"apt-get update -q && apt-get install -qqy build-essential software-properties-common pkg-config wget libpcsclite-dev && wget -c https://dl.google.com/go/go1.19.5.linux-amd64.tar.gz -O - | tar -xz -C /usr/local && export PATH=$$PATH:/usr/local/go/bin && go mod download && go build -o $@ -ldflags $(FLAGS) awsu.go"
# Test within the container
# curl -sL https://git.io/goreleaser | bash -s -- --clean --skip-publish --snapshot --skip-sign --debug
build/awsu-darwin-amd64:
@mkdir -p build
nice go build -o $@ -ldflags $(FLAGS) awsu.go
build: build/awsu-darwin-amd64 build/awsu-linux-amd64;
clean:
rm -rf build
test:
go list ./... | grep -v exp | xargs go test -cover
.PHONY: build clean release retract test