cosmium/Makefile

43 lines
1.1 KiB
Makefile
Raw Normal View History

2024-02-17 12:49:11 +00:00
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
2024-02-18 22:28:16 +00:00
BINARY_NAME=cosmium
2024-02-17 12:49:11 +00:00
DIST_DIR=dist
all: test build-all
2024-02-25 21:27:21 +00:00
build-all: build-darwin-arm64 build-darwin-amd64 build-linux-amd64 build-windows-amd64
2024-02-17 12:49:11 +00:00
build-darwin-arm64:
2024-02-25 21:27:21 +00:00
@echo "Building macOS ARM binary..."
2024-02-17 12:49:11 +00:00
@GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-arm64 .
2024-02-25 21:27:21 +00:00
build-darwin-amd64:
@echo "Building macOS x64 binary..."
@GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-amd64 .
2024-02-17 12:49:11 +00:00
build-linux-amd64:
2024-02-25 21:27:21 +00:00
@echo "Building Linux x64 binary..."
2024-02-17 12:49:11 +00:00
@GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-linux-amd64 .
2024-02-25 21:27:21 +00:00
build-windows-amd64:
@echo "Building Windows x64 binary..."
@GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-windows-amd64.exe .
2024-02-25 21:27:21 +00:00
2024-02-17 15:25:57 +00:00
generate-parser-nosql:
pigeon -o ./parsers/nosql/nosql.go ./parsers/nosql/nosql.peg
2024-02-17 12:49:11 +00:00
test:
@echo "Running unit tests..."
@$(GOTEST) -v ./...
clean:
@echo "Cleaning up..."
@$(GOCLEAN)
@rm -rf $(DIST_DIR)
2024-02-17 15:25:57 +00:00
.PHONY: all test build-all build-macos build-linux clean generate-parser-nosql