-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (33 loc) · 1.02 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
# Compiler and flags
CXX := g++
CXXFLAGS := -std=c++11 -Wall
# Directories
SRC_DIR := src
BUILD_DIR := build
INCLUDE_DIR := include
DATA_DIR := data
RESULTS_DIR := $(DATA_DIR)/results
# Source files
SRCS := $(wildcard $(SRC_DIR)/**/*.cpp $(SRC_DIR)/*.cpp)
OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCS))
# Include directories
INC_DIRS := -I$(INCLUDE_DIR)
# Executable
TARGET := lesg_flower_exchange
.PHONY: all clean
all: $(BUILD_DIR)/$(TARGET)
$(BUILD_DIR)/$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(INC_DIRS) $^ -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(INC_DIRS) -c $< -o $@
clean:
rm -rf $(BUILD_DIR)
run: $(BUILD_DIR)/$(TARGET)
./$(BUILD_DIR)/$(TARGET)
# Add additional dependencies here if needed
# Example: Dependency for CSVReader.cpp
$(BUILD_DIR)/service/CSVReader.o: $(INCLUDE_DIR)/service/CSVReader.h
# Example: Dependency for NewMatchingEngine.cpp
$(BUILD_DIR)/service/NewMatchingEngine.o: $(INCLUDE_DIR)/service/NewMatchingEngine.h
# Add more dependencies as needed