-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 889 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
# Define the compiler and its flags
CXX = g++
CXXFLAGS = -std=c++23 -Wall --pedantic
# Define the directory where the source files are located
SRCDIR = src
# Define the directory where the object files will be created
OBJDIR = obj
# Define the name of the final output
OUTPUT = WaSp
# Find all source files in subdirectories and create a list of corresponding object files
SOURCES = $(shell find $(SRCDIR) -type f -name "*.cpp")
OBJECTS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SOURCES))
# Rule to compile all .cpp files to .o files
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -c $< -o $@
# Rule to link all object files to create the final output
$(OUTPUT): $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $@ -lcurl
run:
make clean
make
./$(OUTPUT)
# Rule to clean up all object files and the final output
clean:
rm -rf $(OBJDIR)/* $(OUTPUT)
rm assets/*