-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 1.46 KB
/
Makefile
File metadata and controls
40 lines (31 loc) · 1.46 KB
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
MAKEFLAGS += --silent
export BUILD_DIR ?= build
default: debug
release:
mkdir -p ./$(BUILD_DIR) && cd ./$(BUILD_DIR) && cmake ../ -DCMAKE_BUILD_TYPE=Release && cmake --build .
debug:
mkdir -p ./$(BUILD_DIR) && cd ./$(BUILD_DIR) && cmake ../ -DCMAKE_BUILD_TYPE=Debug && cmake --build .
test:
@if [ -f ./$(BUILD_DIR)/test ]; then ./$(BUILD_DIR)/test ${ARGS}; else echo "Please run 'make' or 'make release' first" && exit 1; fi
bench:
@if [ -f ./$(BUILD_DIR)/bench ]; then ./$(BUILD_DIR)/bench; else echo "Please run 'make' or 'make release' first" && exit 1; fi
bench-mem:
@if [ ! -f ./$(BUILD_DIR)/bench-mem ]; then echo "Please run 'make' or 'make release' first" && exit 1; fi
@echo "Running memory benchmark with uniform distribution..."
@valgrind --tool=massif --massif-out-file=./$(BUILD_DIR)/massif.out.uniform ./$(BUILD_DIR)/bench-mem uniform
@ms_print ./$(BUILD_DIR)/massif.out.uniform | head -50
@echo ""
@echo "Running memory benchmark with Zipfian distribution..."
@valgrind --tool=massif --massif-out-file=./$(BUILD_DIR)/massif.out.zipf ./$(BUILD_DIR)/bench-mem zipf
@ms_print ./$(BUILD_DIR)/massif.out.zipf | head -50
@echo ""
@echo "Full reports saved to:"
@echo " - ./$(BUILD_DIR)/massif.out.uniform"
@echo " - ./$(BUILD_DIR)/massif.out.zipf"
@echo ""
@echo "To view full reports, run:"
@echo " ms_print ./$(BUILD_DIR)/massif.out.uniform"
@echo " ms_print ./$(BUILD_DIR)/massif.out.zipf"
clean:
rm -rf ./$(BUILD_DIR)
.PHONY: test bench bench-mem