aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 28 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 71dbd3d..a6c81bb 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,15 @@ CXX = g++
CC = gcc
-NT_SDL_DLL_LOCATION = SDL2-2.24.0/x86_64-w64-mingw32/bin/SDL2.dll
+NT_SDL_DLL_LOCATION = WindowsShit/SDL2-2.24.0/x86_64-w64-mingw32/bin/SDL2.dll
+NT_SDL_TTF_DLL_LOCATION = WindowsShit/SDL2_ttf-2.24.0/x86_64-w64-mingw32/bin/SDL2_ttf.dll
+NT_SDL_IMAGE_DLL_LOCATION = WindowsShit/SDL2_image-2.6.0/x86_64-w64-mingw32/bin/SDL2_image.dll
+NT_SDL_MIXER_DLL_LOCATION = WindowsShit/SDL2_mixer-2.6.1/x86_64-w64-mingw32/bin/SDL2_mixer.dll
NT_LIBWINPTHREAD_LOCATION = WindowsShit/libwinpthread-1.dll
-MACOS_SDL_DYLIB_LOCATION = /opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib
+MACOS_SDL_DYLIB_LOCATION = /opt/homebrew/opt/sdl2/lib/libSDL2.dylib
+MACOS_SDL_TTF_DYLIB_LOCATION = /opt/homebrew/opt/sdl2_ttf/lib/libSDL2_ttf.dylib
+MACOS_SDL_IMAGE_DYLIB_LOCATION = /opt/homebrew/opt/sdl2_image/lib/libSDL2_image.dylib
+MACOS_SDL_MIXER_DYLIB_LOCATION = /opt/homebrew/opt/sdl2_mixer/lib/libSDL2_mixer.dylib
APP_NAME = ShowdownOfTheSticks
UNAME_S := $(shell uname -s)
@@ -33,6 +39,7 @@ ifeq ($(UNAME_S),Darwin)
TARGET_DIR = $(BUILD_DIR)/dist/$(APP_NAME).app/Contents/MacOS
TARGET = $(TARGET_DIR)/$(APP_NAME)
INFO_PLIST = $(BUILD_DIR)/dist/$(APP_NAME).app/Contents/Info.plist
+ APP_ICNS = $(BUILD_DIR)/dist/$(APP_NAME).app/Contents/Resources/AppIcon.icns
MAKE_APP = true
else
TARGET_DIR = $(BUILD_DIR)/dist
@@ -44,7 +51,7 @@ endif
CXXFLAGS = -I/opt/homebrew/include -D_THREAD_SAFE -std=c++17
CFLAGS = -I/opt/homebrew/include -D_THREAD_SAFE
-LDFLAGS = -L/opt/homebrew/lib -lSDL2
+LDFLAGS = -L/opt/homebrew/lib -lSDL2 -lSDL2_ttf -lSDL2_image -lSDL2_mixer
ifeq ($(OS),Windows_NT)
CC = x86_64-w64-mingw32-gcc
@@ -52,9 +59,12 @@ ifeq ($(OS),Windows_NT)
TARGET_DIR = $(BUILD_DIR)/dist
TARGET = $(TARGET_DIR)/$(APP_NAME).exe
MAKE_APP = false
- CXXFLAGS = -ISDL2-2.24.0/x86_64-w64-mingw32/include -D_THREAD_SAFE -std=c++17 -static-libgcc -static-libstdc++
- CFLAGS = -ISDL2-2.24.0/x86_64-w64-mingw32/include -D_THREAD_SAFE
- LDFLAGS = -LSDL2-2.24.0/x86_64-w64-mingw32/lib -lSDL2 -static-libgcc -static-libstdc++
+ CXXFLAGS = -IWindowsShit/SDL2-2.24.0/x86_64-w64-mingw32/include -IWindowsShit/SDL2_ttf-2.24.0/x86_64-w64-mingw32/include -IWindowsShit/SDL2_image-2.6.0/x86_64-w64-mingw32/include -IWindowsShit/SDL2_mixer-2.6.1/x86_64-w64-mingw32/include
+ CXXFLAGS += -D_THREAD_SAFE -std=c++17 -static-libgcc -static-libstdc++
+ CFLAGS = -IWindowsShit/SDL2-2.24.0/x86_64-w64-mingw32/include -IWindowsShit/SDL2_ttf-2.24.0/x86_64-w64-mingw32/include -IWindowsShit/SDL2_image-2.6.0/x86_64-w64-mingw32/include -IWindowsShit/SDL2_mixer-2.6.1/x86_64-w64-mingw32/include
+ CFLAGS += -D_THREAD_SAFE
+ LDFLAGS = -LWindowsShit/SDL2-2.24.0/x86_64-w64-mingw32/lib -LWindowsShit/SDL2_ttf-2.24.0/x86_64-w64-mingw32/lib -LWindowsShit/SDL2_image-2.6.0/x86_64-w64-mingw32/lib -LWindowsShit/SDL2_mixer-2.6.1/x86_64-w64-mingw32/lib
+ LDFLAGS += -lSDL2 -lSDL2_ttf -lSDL2_image -lSDL2_mixer -static-libgcc -static-libstdc++
endif
all: $(TARGET)
@@ -64,14 +74,25 @@ $(TARGET): $(OBJ_CPP) $(LUA_OBJ)
$(CXX) $(OBJ_CPP) $(LUA_OBJ) -o $(TARGET) $(LDFLAGS)
ifeq ($(MAKE_APP),true)
mkdir -p $(dir $(INFO_PLIST))
- cp Info.plist $(INFO_PLIST)
+ mkdir -p $(dir $(APP_ICNS))
+ cp MacShit/Info.plist $(INFO_PLIST)
+ cp MacShit/AppIcon.icns $(APP_ICNS)
mkdir -p $(TARGET_DIR)
cp $(MACOS_SDL_DYLIB_LOCATION) $(TARGET_DIR)/libSDL2.dylib
+ cp $(MACOS_SDL_TTF_DYLIB_LOCATION) $(TARGET_DIR)/libSDL2_ttf.dylib
+ cp $(MACOS_SDL_IMAGE_DYLIB_LOCATION) $(TARGET_DIR)/libSDL2_image.dylib
+ cp $(MACOS_SDL_MIXER_DYLIB_LOCATION) $(TARGET_DIR)/libSDL2_mixer.dylib
install_name_tool -change $(MACOS_SDL_DYLIB_LOCATION) @executable_path/libSDL2.dylib $(TARGET)
+ install_name_tool -change $(MACOS_SDL_TTF_DYLIB_LOCATION) @executable_path/libSDL2_ttf.dylib $(TARGET)
+ install_name_tool -change $(MACOS_SDL_IMAGE_DYLIB_LOCATION) @executable_path/libSDL2_image.dylib $(TARGET)
+ install_name_tool -change $(MACOS_SDL_MIXER_DYLIB_LOCATION) @executable_path/libSDL2_mixer.dylib $(TARGET)
otool -l $(TARGET)
endif
ifeq ($(OS),Windows_NT)
cp $(NT_SDL_DLL_LOCATION) $(TARGET_DIR)/SDL2.dll
+ cp $(NT_SDL_TTF_DLL_LOCATION) $(TARGET_DIR)/SDL2_ttf.dll
+ cp $(NT_SDL_IMAGE_DLL_LOCATION) $(TARGET_DIR)/SDL2_image.dll
+ cp $(NT_SDL_MIXER_DLL_LOCATION) $(TARGET_DIR)/SDL2_mixer.dll
cp $(NT_LIBWINPTHREAD_LOCATION) $(TARGET_DIR)/libwinpthread-1.dll
endif