-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
37 lines (27 loc) · 850 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
# Specify the compiler and flags
CXX = g++
# Specify the path to the SFMLUI(VUI) library
VUI_PATH = "D:\VS Code Vuk\C++\SFMLUI"
LIBS = -lV-UI -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system -lcomdlg32
CPPFLAGS = -I -lm -Wall -O2 -Iinclude -MMD -L$(VUI_PATH)
TARGET = VDM.exe
SOURCES = $(wildcard src/*.cpp)
OBJECTS = $(patsubst src/%.cpp,obj/%.o,$(SOURCES))
DEPS = $(patsubst src/%.cpp,obj/%.d,$(SOURCES))
# Default target
all: $(TARGET)
# Rule to build the target
$(TARGET): $(OBJECTS)
$(CXX) -o $@ $^ $(CPPFLAGS) $(LIBS)
# Rule to build the object files
obj/%.o: src/%.cpp
$(CC) $(CFLAGS) $(LIBS) -c -o $@ $<
# Rule to include dependencies
-include $(DEPS)
# Rule to clean up the project
clean:
del *.exe obj\*.o obj\*.d
# Rule to rebuild the project from scratch
rebuild: clean all
# Phony targets
.PHONY: all clean rebuild