Update Makefile-windows
This commit is contained in:
@@ -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 $< $@
|
||||
|
||||
Reference in New Issue
Block a user