Skip to content

Commit

Permalink
DiceDB#855: Make DiceDB build work on different architectures (DiceDB…
Browse files Browse the repository at this point in the history
…#856)

Co-authored-by: pshubham <[email protected]>
  • Loading branch information
swaingotnochill and lucifercr07 authored Sep 30, 2024
1 parent fb59ab3 commit 87f5d83
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,35 @@ KEY_PATTERN ?= R:R #Set:Get pattern
RATIO ?= 1:10 #Set:Get ratio
PORT ?= 7379 #Port for dicedb

# Default OS and architecture
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)

.PHONY: build test build-docker run test-one

.DEFAULT_GOAL := build

# Help command
help:
@echo "Available commands:"
@echo " build - Build the project"
@echo " format - Format the code"
@echo " run - Run the project"
@echo " test - Run the integration tests"
@echo " test-one - Run a specific integration tests"
@echo " unittest - Run unit tests"
@echo " unittest-one - Run a specific unit test"
@echo " build-docker - Build docker image"
@echo " push-docker - Push docker image"
@echo " lint - Run linter"
@echo " run_benchmark - Run benchmark"
@echo " run_benchmark-small - Run small benchmark"
@echo " run_benchmark-large - Run large benchmark"
@echo " clean - Remove build artifacts"

build:
CGO_ENABLED=0 GOOS=linux go build -o ./dicedb
@echo "Building for $(GOOS)/$(GOARCH)"
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o ./dicedb

format:
go fmt ./...
Expand Down Expand Up @@ -66,3 +91,8 @@ run-benchmark-small:

run-benchmark-large:
$(MAKE) run_benchmark THREADS=8 DATA_SIZE=4096 CLIENTS=100 REQUESTS=50000

clean:
@echo "Cleaning build artifacts..."
rm -f dicedb
@echo "Clean complete."

0 comments on commit 87f5d83

Please sign in to comment.