48 lines
1.2 KiB
Makefile
Executable File
48 lines
1.2 KiB
Makefile
Executable File
BINARY_DIR=bin
|
|
BINARY_NAME=watch-spring
|
|
APP_NAME := watch-spring
|
|
COVERAGE_DIR=coverage
|
|
MAIN := ./main.go
|
|
WIN_MAIN := ./cmd/windows/main.go
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
goreportcard:
|
|
goreportcard-cli -v
|
|
test:
|
|
go test ./...
|
|
test-coverage:
|
|
rm -rf ${COVERAGE_DIR}
|
|
mkdir ${COVERAGE_DIR}
|
|
go test -v -coverprofile ${COVERAGE_DIR}/cover.out ./...
|
|
go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html
|
|
|
|
.PHONY: build_linux_amd64
|
|
build_linux_amd64:
|
|
@mkdir -p $(BINARY_DIR)
|
|
GOOS=linux GOARCH=amd64 go build -o $(BINARY_DIR)/$(APP_NAME)_linux_amd64 $(MAIN)
|
|
|
|
.PHONY: build_linux_arm64
|
|
build_linux_arm64:
|
|
@mkdir -p $(BINARY_DIR)
|
|
GOOS=linux GOARCH=arm64 go build -o $(BINARY_DIR)/$(APP_NAME)_linux_arm64 $(MAIN)
|
|
|
|
.PHONY: build_windows_amd64
|
|
build_windows_amd64:
|
|
@mkdir -p $(BINARY_DIR)
|
|
GOOS=windows GOARCH=amd64 go build -o $(BINARY_DIR)/$(APP_NAME)_windows_amd64.exe $(WIN_MAIN)
|
|
|
|
.PHONY: build_windows_386
|
|
build_windows_386:
|
|
@mkdir -p $(BINARY_DIR)
|
|
GOOS=windows GOARCH=386 go build -o $(BINARY_DIR)/$(APP_NAME)_windows_386.exe $(WIN_MAIN)
|
|
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf $(BINARY_DIR)
|
|
|
|
.PHONY: rebuild
|
|
rebuild: clean build_linux_amd64 build_linux_arm64 build_windows_amd64 build_windows_386
|
|
|