Added Makefile

This commit is contained in:
Pijus Kamandulis 2024-02-17 14:49:11 +02:00
parent 03623e5a82
commit 1e461d3548
2 changed files with 32 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
dist/

31
Makefile Normal file
View File

@ -0,0 +1,31 @@
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