-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
42 lines (30 loc) · 1.06 KB
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
BINARY_NAME=cosmium
DIST_DIR=dist
all: test build-all
build-all: build-darwin-arm64 build-darwin-amd64 build-linux-amd64 build-windows-amd64
build-darwin-arm64:
@echo "Building macOS ARM binary..."
@GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-arm64 .
build-darwin-amd64:
@echo "Building macOS x64 binary..."
@GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-amd64 .
build-linux-amd64:
@echo "Building Linux x64 binary..."
@GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-linux-amd64 .
build-windows-amd64:
@echo "Building Windows x64 binary..."
@GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(DIST_DIR)/$(BINARY_NAME)-windows-amd64.exe .
generate-parser-nosql:
pigeon -o ./parsers/nosql/nosql.go ./parsers/nosql/nosql.peg
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 generate-parser-nosql