-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 1.17 KB
/
Makefile
File metadata and controls
44 lines (34 loc) · 1.17 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
41
42
43
44
# Compiler
CXX = g++
# Directories
SRC_DIR = sources
BUILD_DIR = build
BIN_DIR = bin
INCLUDE_DIR = include
# Source files
SRCS = $(SRC_DIR)/main.cpp $(SRC_DIR)/Database.cpp $(SRC_DIR)/Group.cpp \
$(SRC_DIR)/NormalUser.cpp $(SRC_DIR)/sqlite3.c $(SRC_DIR)/Task.cpp \
$(SRC_DIR)/Timer.cpp $(SRC_DIR)/User.cpp $(SRC_DIR)/Color.cpp \
$(SRC_DIR)/bcrypt.cpp $(SRC_DIR)/blowfish.cpp $(SRC_DIR)/TaskManager.cpp \
$(SRC_DIR)/Admin.cpp
# Object files
OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(BUILD_DIR)/%.o, $(filter %.cpp, $(SRCS))) \
$(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(filter %.c, $(SRCS)))
# Output executable
TARGET = $(BIN_DIR)/my_program
# Compiler flags
CXXFLAGS = -I$(INCLUDE_DIR) -std=c++11
# Rule to build the final executable
$(TARGET): $(OBJS)
$(CXX) $(OBJS) -o $(TARGET)
# Rule to compile .cpp files into .o files
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CXX) -c $< -o $@ $(CXXFLAGS)
# Rule to compile .c files into .o files
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
$(CXX) -c $< -o $@ $(CXXFLAGS)
# Create build and bin directories if they don't exist
$(shell mkdir -p $(BUILD_DIR) $(BIN_DIR))
# Clean up build artifacts
clean:
rm -rf $(BUILD_DIR) $(BIN_DIR)