From 7f237ea2ba85ca8c11cf807194187b6b41ae8f31 Mon Sep 17 00:00:00 2001 From: junseopark-digipen Date: Mon, 14 Sep 2026 18:12:35 +0900 Subject: [PATCH] Update Makefile-windows --- Makefile-windows | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile-windows b/Makefile-windows index 18fa8fd..a2b02de 100644 --- a/Makefile-windows +++ b/Makefile-windows @@ -8,10 +8,10 @@ BUILD_DIR := build/windows BINARY := game.exe # Specify what flags to give to the compiler -CXX_FLAGS := -g -std=c++20 -Wall -Werror -Wextra -c -I ./lib/windows/include -D GLEW_STATIC -D SDL_MAIN_HANDLED +CXX_FLAGS := -g -std=c++20 -Wall -Werror -Wextra -c -I ./lib/windows/include -D SDL_MAIN_HANDLED -D GLEW_STATIC # Specify what flags to give to the linker -LINK_FLAGS := -lglew32s -lopengl32 -lSDL2 -L ./lib/windows/lib +LINK_FLAGS := -lglew32s -lopengl32 -lSDL2 -L ./lib/windows/lib -static-libgcc -static-libstdc++ # Find all the source files CXX_FILES := $(shell find $(SOURCE_DIR) -name *.cpp) @@ -19,10 +19,13 @@ CXX_FILES := $(shell find $(SOURCE_DIR) -name *.cpp) # Find all the source shaders SHADER_FILES := $(shell find $(SOURCE_DIR) -name *.vert) $(shell find $(SOURCE_DIR) -name *.frag) +LIBS_DIR := lib/windows/bin +DLL_FILES := $(shell find $(LIBS_DIR) -name *.dll) + # Determine a list of object and dependency files from all the source files OBJ_FILES := $(patsubst $(SOURCE_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(CXX_FILES)) DEP_FILES := $(patsubst %.o,%.d,$(OBJ_FILES)) -COPIED_FILES := $(patsubst $(SOURCE_DIR)/%,$(BUILD_DIR)/%,$(SHADER_FILES)) +COPIED_FILES := $(patsubst $(SOURCE_DIR)/%,$(BUILD_DIR)/%,$(SHADER_FILES)) $(patsubst $(LIBS_DIR)/%,$(BUILD_DIR)/%,$(DLL_FILES)) .PHONY: program program: $(BUILD_DIR)/$(BINARY) $(COPIED_FILES) @@ -48,3 +51,6 @@ $(BUILD_DIR)/%.vert: $(SOURCE_DIR)/%.vert $(BUILD_DIR)/%.frag: $(SOURCE_DIR)/%.frag cp $< $@ + +$(BUILD_DIR)/%: $(LIBS_DIR)/% + cp $< $@