2024-12-13 00:33:08 +01:00
|
|
|
CXX ?= g++
|
|
|
|
OPTFLAGS ?= -O3 -march=native
|
|
|
|
VECTOR_SIZE ?= 268435456
|
2024-12-16 14:51:38 +01:00
|
|
|
ENABLE_EVENTIFY ?= YES
|
2024-12-13 00:33:08 +01:00
|
|
|
|
2024-12-16 14:51:38 +01:00
|
|
|
CPPFLAGS = -DVECTOR_SIZE=$(VECTOR_SIZE)
|
|
|
|
INCLUDES = -I./include
|
2024-12-13 00:33:08 +01:00
|
|
|
CXXFLAGS = $(CPPFLAGS) -std=c++20 -fopenmp $(INCLUDES) $(OPTFLAGS)
|
2024-12-16 14:51:38 +01:00
|
|
|
LDFLAGS = -fopenmp
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_EVENTIFY), "YES")
|
|
|
|
CPPFLAGS += -DENABLE_EVENTIFY
|
|
|
|
INCLUDES += -I$(EVENTIFY_ROOT)/include
|
|
|
|
LDFLAGS += -L$(EVENTIFY_ROOT)/lib -leventify
|
|
|
|
endif
|
2024-12-13 00:33:08 +01:00
|
|
|
|
|
|
|
SRC_DIR = src
|
|
|
|
INCLUDE_DIR = include
|
|
|
|
OBJ_DIR = obj
|
|
|
|
BIN_DIR = bin
|
|
|
|
|
|
|
|
SRCS = $(wildcard $(SRC_DIR)/*.cpp)
|
|
|
|
|
|
|
|
OBJS = $(SRCS:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
|
|
|
|
|
|
|
|
TARGET = $(BIN_DIR)/benchmark
|
|
|
|
|
|
|
|
# Default rule to build the program
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
@mkdir -p $(BIN_DIR)
|
|
|
|
$(CXX) $(LDFLAGS) $(OBJS) -o $@
|
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
|
|
|
@mkdir -p $(OBJ_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BIN_DIR) $(OBJ_DIR)
|
|
|
|
|
|
|
|
.PHONY: all clean
|