-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 828 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
35
36
37
38
39
# Compiler and flags
CXX = g++
CXXFLAGS = -std=c++20 -Wall -pedantic -g -fsanitize=address
# Directories
SRC_DIR = src
OBJ_DIR = src
# Source files
SRCS = $(SRC_DIR)/main.cpp $(SRC_DIR)/CPos.cpp $(SRC_DIR)/ExprElement.cpp $(SRC_DIR)/CustomExpressionBuilder.cpp $(SRC_DIR)/CSpreadsheet.cpp
# Object files
OBJS = $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS))
# Include directories
INCLUDES = -I./
# Libraries and paths
LIBS = -L./x86_64-linux-gnu -lexpression_parser
# Executable name
TARGET = excel
# Default target
all: $(TARGET)
# Build target
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LIBS)
# Compile .cpp files to .o files
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
# Clean up object files and executable
clean:
rm -f $(OBJ_DIR)/*.o $(TARGET)
.PHONY: all clean