37 lines
731 B
Makefile
37 lines
731 B
Makefile
|
CXX ?= g++
|
||
|
OPTFLAGS ?= -O3 -march=native
|
||
|
|
||
|
VECTOR_SIZE ?= 268435456
|
||
|
CPPFLAGS = -DVECTOR_SIZE=$(VECTOR_SIZE)
|
||
|
INCLUDES = -I./include -I$(EVENTIFY_ROOT)/include
|
||
|
|
||
|
CXXFLAGS = $(CPPFLAGS) -std=c++20 -fopenmp $(INCLUDES) $(OPTFLAGS)
|
||
|
LDFLAGS = -fopenmp -L$(EVENTIFY_ROOT)/lib -leventify
|
||
|
|
||
|
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
|