-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (45 loc) · 793 Bytes
/
Copy pathMakefile
File metadata and controls
57 lines (45 loc) · 793 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
MAKEFLAGS += --silent
TARGET = notify-mail
PLATFORM := $(shell uname -m)
ARCH :=
ifeq ($(PLATFORM),x86_64)
ARCH = amd64
endif
ifeq ($(PLATFORM),aarch64)
ARCH = arm64
endif
ifeq ($(PLATFORM),armv7l)
ARCH = armhf
endif
GOARCH :=
ifeq ($(ARCH),amd64)
GOARCH = amd64
endif
ifeq ($(ARCH),i386)
GOARCH = 386
endif
ifeq ($(ARCH),arm64)
GOARCH = arm64
endif
ifeq ($(ARCH),armhf)
GOARCH = arm
endif
ifeq ($(GOARCH),)
$(error Invalid ARCH: $(ARCH))
endif
all: $(TARGET)
distclean: clean
clean:
rm -f $(TARGET)
install: $(TARGET)
install -Dm755 $(TARGET) $(DESTDIR)/usr/bin/$(TARGET)
uninstall:
rm -f $(DESTDIR)/usr/bin/$(TARGET)
$(TARGET):
GOOS=linux GOARCH=$(GOARCH) go build
test:
go test ./... -race -cover
tidy:
go mod tidy
vendor: tidy
go mod vendor