-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (19 loc) · 869 Bytes
/
Makefile
File metadata and controls
24 lines (19 loc) · 869 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
PROJECT_NAME = enemeter-data-processing
.PHONY: build build-all clean test
build:
mkdir -p dist
go build -o dist/$(PROJECT_NAME) ./cmd/$(PROJECT_NAME)
build-all:
mkdir -p dist
@echo "Building for Linux..."
GOOS=linux GOARCH=amd64 go build -o dist/$(PROJECT_NAME)-linux -ldflags="-X '$(PROJECT_NAME)/internal/commands.CurrentVersion=$(VERSION)'" ./cmd/$(PROJECT_NAME)
@echo "Building for Windows..."
GOOS=windows GOARCH=amd64 go build -o dist/$(PROJECT_NAME).exe -ldflags="-X '$(PROJECT_NAME)/internal/commands.CurrentVersion=$(VERSION)'" ./cmd/$(PROJECT_NAME)
@echo "Building for macOS..."
GOOS=darwin GOARCH=amd64 go build -o dist/$(PROJECT_NAME)-mac -ldflags="-X '$(PROJECT_NAME)/internal/commands.CurrentVersion=$(VERSION)'" ./cmd/$(PROJECT_NAME)
@echo "Build completed. Contents of dist/:"
@ls -lh dist/
clean:
rm -rf dist/
test:
go test -v ./...