-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (31 loc) · 940 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
33
34
35
36
37
38
39
GO_CMD = GOARCH=amd64 go
GO_CMD_ARM = GOARCH=arm64 go
GO_CMD_LINUX = GOOS=linux $(GO_CMD)
GO_CMD_DARWIN = GOOS=darwin $(GO_CMD)
GO_CMD_DARWIN_ARM = GOOS=darwin $(GO_CMD_ARM)
GO_CMD_WINDOWS = GOOS=windows $(GO_CMD)
GO_FILES = $(shell find ./ -type f -name '*.go')
.PHONY:all
all: ldap-utils-linux ldap-utils-macos ldap-utils-macos-arm ldap-utils-windows.exe
.PHONY:clean
clean:
rm -f ldap-utils-linux
rm -f ldap-utils-macos
rm -f ldap-utils-macos-arm
rm -f ldap-utils-windows.exe
ldap-utils-linux:$(GO_FILES)
$(GO_CMD_LINUX) build -o $@ $^
ldap-utils-macos:$(GO_FILES)
$(GO_CMD_DARWIN) build -o $@ $^
ldap-utils-macos-arm:$(GO_FILES)
$(GO_CMD_DARWIN_ARM) build -o $@ $^
ldap-utils-windows.exe:$(GO_FILES)
$(GO_CMD_WINDOWS) build -o $@ $^
.PHONY:lint
lint:$(GO_FILES)
go vet --all $^
ifeq (, $(shell which golangci-lint))
echo "golangci-lint not in path, skipping check"
else
golangci-lint run -v -c .golangci.yml $^
endif