-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
32 lines (26 loc) · 744 Bytes
/
makefile
File metadata and controls
32 lines (26 loc) · 744 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
EXE_NAME=FileCleanup
OUTPUT_FOLDER_WINDOWS=windows-build
.PHONY: build
build: ## Run tests
go build ./...
.PHONY: test
test: ## Run tests
gotestsum --format testname ./...
.PHONY: fmt
fmt: ## Format go files
go fmt ./...
.PHONY: setup
setup: ## Setup the precommit hook
@which pre-commit > /dev/null 2>&1 || (echo "pre-commit not installed see README." && false)
@pre-commit install
install:
go build -o $(EXE_NAME) .
sudo mv $(EXE_NAME) /usr/local/bin
sudo chmod +x /usr/local/bin/$(EXE_NAME)
.PHONY: windows-amd64
build-windows:
#env GOOS=windows GOARCH=amd64 go build -o $(EXE_NAME).exe
if [ ! -d $(OUTPUT_FOLDER_WINDOWS) ]; then
mkdir -p $(OUTPUT_FOLDER_WINDOWS); \
echo "Created folder: $(OUTPUT_FOLDER)"; \
fi