# Compiler CC = g++ # Compiler flags CFLAGS = -Wall -g # Paths to include directories (Adjust these paths to your installation) IMG_INCLUDE_DIR = include IMGUI_INCLUDE_DIR = imgui SDL2_LIB_DIR = C:/msys64/mingw64/bin LIB_DIR = lib # Include directories INCLUDE_DIRS = -I$(IMG_INCLUDE_DIR) -I$(IMGUI_INCLUDE_DIR) # Library directories LIB_DIRS = -L$(SDL2_LIB_DIR) -L$(LIB_DIR) # Libraries to link LIBS = -lmingw32 -lglfw3 -lopengl32 -lglew32 -lyaml-cpp -lcomdlg32 # Source directories SRC_DIR = src IMGUI_DIR = imgui # Object directory OBJ_DIR = build # Source files SOURCES = $(wildcard $(SRC_DIR)/*.cpp) $(wildcard $(IMGUI_DIR)/*.cpp) # Object files OBJECTS = $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SOURCES)) OBJECTS := $(patsubst $(IMGUI_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(OBJECTS)) # Executable name EXECUTABLE = $(OBJ_DIR)/game_engine.exe # Build target all: $(OBJ_DIR) $(EXECUTABLE) $(OBJ_DIR): mkdir $(OBJ_DIR) $(EXECUTABLE): $(OBJECTS) $(CC) $(OBJECTS) -o $@ $(LIB_DIRS) $(LIBS) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $< -o $@ $(OBJ_DIR)/%.o: $(IMGUI_DIR)/%.cpp $(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $< -o $@ clean: del /Q $(OBJ_DIR)\*.o