-
-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 863 Bytes
/
Makefile
File metadata and controls
47 lines (38 loc) · 863 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
BIN_DIR := ./bin
BIN_DST := /usr/bin
ifdef GOOS
ifeq (${GOOS}, windows)
WIN_TARGET := True
endif
else
ifeq (${OS}, Windows_NT)
WIN_TARGET := True
endif
endif
ifdef WIN_TARGET
TSSH := tssh.exe
else
TSSH := tssh
endif
ifeq (${OS}, Windows_NT)
RM := PowerShell -Command Remove-Item -Force
GO_TEST := go test
else
RM := rm -f
GO_TEST := ${shell basename `which gotest 2>/dev/null` 2>/dev/null || echo go test}
endif
.PHONY: all clean test install
all: ${BIN_DIR}/${TSSH}
${BIN_DIR}/${TSSH}: $(wildcard ./cmd/tssh/*.go ./tssh/*.go) go.mod go.sum
go build -o ${BIN_DIR}/ ./cmd/tssh
clean:
$(foreach f, $(wildcard ${BIN_DIR}/*), $(RM) $(f);)
test:
${GO_TEST} -v -count=1 ./tssh
install: all
ifdef WIN_TARGET
@echo install target is not supported for Windows
else
@mkdir -p ${DESTDIR}${BIN_DST}
cp ${BIN_DIR}/tssh ${DESTDIR}${BIN_DST}/
endif