-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (28 loc) · 889 Bytes
/
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
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
BINARY_NAME=mongo-bench
.PHONY: all
all: build
build: test
$(GOBUILD) -o $(BINARY_NAME) *.go
@echo "Build complete: $(BINARY_NAME)"
run:
@echo "Running $(BINARY_NAME) with THREADS=$(THREADS), DOCS=$(DOCS), URI=$(URI)"
./$(BINARY_NAME) -threads $(THREADS) -docs $(DOCS) -uri $(URI)
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
@echo "Clean complete"
test:
$(GOTEST) -v ./...
help:
@echo "Usage:"
@echo " make - Builds the binary"
@echo " make build - Builds the binary"
@echo " make run - Runs the application with THREADS, DOCS, and URI variables"
@echo " Example: make run THREADS=10 DOCS=10000 URI=mongodb://localhost:27017"
@echo " make clean - Removes the binary"
@echo " make test - Runs tests"
@echo " make help - Displays this help message"