mirror of https://github.com/pikami/cosmium.git
32 lines
637 B
Makefile
32 lines
637 B
Makefile
|
GOCMD=go
|
||
|
GOBUILD=$(GOCMD) build
|
||
|
GOTEST=$(GOCMD) test
|
||
|
GOCLEAN=$(GOCMD) clean
|
||
|
|
||
|
BINARY_NAME=codium
|
||
|
|
||
|
DIST_DIR=dist
|
||
|
|
||
|
all: test build-all
|
||
|
|
||
|
build-all: build-darwin-arm64 build-linux-amd64
|
||
|
|
||
|
build-darwin-arm64:
|
||
|
@echo "Building macOS binary..."
|
||
|
@GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-arm64 .
|
||
|
|
||
|
build-linux-amd64:
|
||
|
@echo "Building Linux binary..."
|
||
|
@GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-linux-amd64 .
|
||
|
|
||
|
test:
|
||
|
@echo "Running unit tests..."
|
||
|
@$(GOTEST) -v ./...
|
||
|
|
||
|
clean:
|
||
|
@echo "Cleaning up..."
|
||
|
@$(GOCLEAN)
|
||
|
@rm -rf $(DIST_DIR)
|
||
|
|
||
|
.PHONY: all test build-all build-macos build-linux clean
|