-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 607 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 607 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
28
29
30
31
32
GO= go
GO_PACKAGE= github.com/fumiyas/qrc/cmd/qrc
CROSS_TARGETS= linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64
default: build
.PHONY: default build test vet fmt cross clean
build:
$(GO) build ./cmd/qrc
test:
$(GO) test ./...
vet:
$(GO) vet ./...
fmt:
$(GO) fmt ./...
cross:
@for target in $(CROSS_TARGETS); do \
os=$${target%%/*}; arch=$${target##*/}; \
ext=; [ "$$os" = "windows" ] && ext=.exe; \
out=qrc-$$os-$$arch$$ext; \
echo "==> $$out"; \
GOOS=$$os GOARCH=$$arch $(GO) build -o $$out $(GO_PACKAGE) || exit $$?; \
done
clean:
rm -f qrc qrc-*-* qrc-*-*.exe