actualitzada la carpeta release a SDL3
migrat a resources.pack
This commit is contained in:
91
Makefile
91
Makefile
@@ -1,5 +1,5 @@
|
||||
executable = jaildoctors_dilemma
|
||||
source = source/*.cpp
|
||||
source = $(shell find source -name "*.cpp")
|
||||
appName = JailDoctor's Dilemma
|
||||
releaseFolder = jdd_release
|
||||
version = v1.10
|
||||
@@ -13,35 +13,52 @@ linuxRelease = $(executable)-$(version)-linux.tar.gz
|
||||
# Specify the C++ standard
|
||||
cpp_standard = c++20
|
||||
|
||||
# Resource packing tool
|
||||
packTool = tools/pack_resources/pack_resources
|
||||
packToolSource = tools/pack_resources/pack_resources.cpp source/core/resources/resource_pack.cpp
|
||||
|
||||
# Build the resource packing tool
|
||||
pack_tool:
|
||||
@echo "Building pack_resources tool..."
|
||||
@cd tools/pack_resources && $(MAKE)
|
||||
|
||||
# Create resources.pack from data directory
|
||||
resources.pack: pack_tool
|
||||
@echo "Creating resources.pack..."
|
||||
@$(packTool) data resources.pack
|
||||
|
||||
windows:
|
||||
@echo off
|
||||
g++ $(source) -std=$(cpp_standard) -Wall -Os -lmingw32 -lws2_32 -lSDL2main -lSDL2 -lopengl32 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(executable).exe"
|
||||
g++ $(source) -Isource -std=$(cpp_standard) -Wall -Os -lmingw32 -lws2_32 -lSDL3main -lSDL3 -lopengl32 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(executable).exe"
|
||||
strip -s -R .comment -R .gnu.version "$(executable).exe" --strip-unneeded
|
||||
|
||||
windows_debug:
|
||||
@echo off
|
||||
g++ $(source) -D DEBUG -std=$(cpp_standard) -Wall -Os -lmingw32 -lws2_32 -lSDL2main -lSDL2 -lopengl32 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(executable)_debug.exe"
|
||||
g++ $(source) -Isource -D DEBUG -std=$(cpp_standard) -Wall -Os -lmingw32 -lws2_32 -lSDL3main -lSDL3 -lopengl32 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(executable)_debug.exe"
|
||||
strip -s -R .comment -R .gnu.version "$(executable)_debug.exe" --strip-unneeded
|
||||
|
||||
windows_release:
|
||||
@echo off
|
||||
|
||||
# Build packing tool and create resources.pack
|
||||
@$(MAKE) pack_tool
|
||||
@$(MAKE) resources.pack
|
||||
|
||||
# Create release folder
|
||||
powershell if (Test-Path "$(releaseFolder)") {Remove-Item "$(releaseFolder)" -Recurse -Force}
|
||||
powershell if (-not (Test-Path "$(releaseFolder)")) {New-Item "$(releaseFolder)" -ItemType Directory}
|
||||
|
||||
# Prepare data folder
|
||||
powershell Copy-Item -Path "data" -Destination "$(releaseFolder)" -recurse -Force
|
||||
powershell if (Test-Path "$(releaseFolder)\data\room\map.world") {Remove-Item "$(releaseFolder)\data\room\map.world" -Recurse -Force}
|
||||
powershell if (Test-Path "$(releaseFolder)\data\room\standard.tsx") {Remove-Item "$(releaseFolder)\data\room\standard.tsx" -Recurse -Force}
|
||||
|
||||
# Copy resources.pack instead of data folder
|
||||
powershell Copy-Item "resources.pack" -Destination "$(releaseFolder)"
|
||||
|
||||
# Copy root files
|
||||
powershell Copy-Item "LICENSE" -Destination "$(releaseFolder)"
|
||||
powershell Copy-Item "README.md" -Destination "$(releaseFolder)"
|
||||
powershell Copy-Item "gamecontrollerdb.txt" -Destination "$(releaseFolder)"
|
||||
powershell Copy-Item "release\*.dll" -Destination "$(releaseFolder)"
|
||||
|
||||
# Build
|
||||
g++ $(source) -std=$(cpp_standard) -Wall -Os -lmingw32 -lws2_32 -lSDL2main -lSDL2 -lopengl32 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(releaseFolder)/$(executable).exe"
|
||||
# Build with RELEASE_BUILD flag (include jdd.res for icon)
|
||||
g++ $(source) release/jdd.res -Isource -D RELEASE_BUILD -std=$(cpp_standard) -Wall -Os -lmingw32 -lws2_32 -lSDL3main -lSDL3 -lopengl32 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(releaseFolder)/$(executable).exe"
|
||||
strip -s -R .comment -R .gnu.version "$(releaseFolder)/$(executable).exe" --strip-unneeded
|
||||
|
||||
# Create ZIP
|
||||
@@ -52,12 +69,16 @@ windows_release:
|
||||
powershell if (Test-Path "$(releaseFolder)") {Remove-Item "$(releaseFolder)" -Recurse -Force}
|
||||
|
||||
macos:
|
||||
clang++ $(source) -std=$(cpp_standard) -Wall -Os -lSDL2 -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(executable)"
|
||||
clang++ $(source) -Isource -std=$(cpp_standard) -Wall -Os -lSDL3 -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(executable)"
|
||||
|
||||
macos_debug:
|
||||
clang++ $(source) -D DEBUG -std=$(cpp_standard) -Wall -Os -lSDL2 -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(executable)_debug"
|
||||
clang++ $(source) -Isource -D DEBUG -std=$(cpp_standard) -Wall -Os -lSDL3 -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(executable)_debug"
|
||||
|
||||
macos_release:
|
||||
# Build packing tool and create resources.pack
|
||||
@$(MAKE) pack_tool
|
||||
@$(MAKE) resources.pack
|
||||
|
||||
# Remove data and possible data from previous builds
|
||||
rm -rdf "$(releaseFolder)"
|
||||
rm -rdf Frameworks
|
||||
@@ -71,14 +92,11 @@ macos_release:
|
||||
mkdir -p "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
mkdir -p Frameworks
|
||||
|
||||
# Copy folders
|
||||
cp -R data "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
cp -R release/SDL2.framework "$(releaseFolder)/$(appName).app/Contents/Frameworks"
|
||||
cp -R release/SDL2.framework Frameworks
|
||||
|
||||
# Delete data
|
||||
rm -f "$(releaseFolder)/$(appName).app/Contents/Resources/data/room/map.world"
|
||||
rm -f "$(releaseFolder)/$(appName).app/Contents/Resources/data/room/standard.tsx"
|
||||
# Copy resources.pack instead of data folder
|
||||
cp resources.pack "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
cp gamecontrollerdb.txt "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
cp -R release/frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework "$(releaseFolder)/$(appName).app/Contents/Frameworks"
|
||||
cp -R release/frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework Frameworks
|
||||
|
||||
# Copy files
|
||||
cp release/*.icns "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
@@ -89,19 +107,19 @@ macos_release:
|
||||
# Create links
|
||||
ln -s /Applications "$(releaseFolder)"/Applications
|
||||
|
||||
# Build INTEL
|
||||
clang++ $(source) -D MACOS_BUNDLE -std=$(cpp_standard) -Wall -Os -framework SDL2 -F ./Frameworks -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
|
||||
# Build INTEL with RELEASE_BUILD flag
|
||||
clang++ $(source) -Isource -D MACOS_BUNDLE -D RELEASE_BUILD -std=$(cpp_standard) -Wall -Os -framework SDL3 -F ./Frameworks -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
|
||||
|
||||
# Build INTEL DMG
|
||||
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
|
||||
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
|
||||
hdiutil convert tmp.dmg -format UDZO -o "$(macosIntelRelease)"
|
||||
rm -f tmp.dmg
|
||||
|
||||
# Build APPLE SILICON
|
||||
clang++ $(source) -D MACOS_BUNDLE -std=$(cpp_standard) -Wall -Os -framework SDL2 -F ./Frameworks -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
||||
# Build APPLE SILICON with RELEASE_BUILD flag
|
||||
clang++ $(source) -Isource -D MACOS_BUNDLE -D RELEASE_BUILD -std=$(cpp_standard) -Wall -Os -framework SDL3 -F ./Frameworks -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
||||
|
||||
# Build APPLE SILICON DMG
|
||||
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
|
||||
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
|
||||
hdiutil convert tmp.dmg -format UDZO -o "$(macosAppleSiliconRelease)"
|
||||
rm -f tmp.dmg
|
||||
|
||||
@@ -110,31 +128,32 @@ macos_release:
|
||||
rm -rdf "$(releaseFolder)"
|
||||
|
||||
linux:
|
||||
g++ $(source) -std=$(cpp_standard) -Wall -Os -lSDL2 -lGL -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(executable)"
|
||||
g++ $(source) -Isource -std=$(cpp_standard) -Wall -Os -lSDL3 -lGL -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(executable)"
|
||||
strip -s -R .comment -R .gnu.version "$(executable)" --strip-unneeded
|
||||
|
||||
linux_debug:
|
||||
g++ $(source) -D DEBUG -std=$(cpp_standard) -Wall -Os -lSDL2 -lGL -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(executable)_debug"
|
||||
g++ $(source) -Isource -D DEBUG -std=$(cpp_standard) -Wall -Os -lSDL3 -lGL -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(executable)_debug"
|
||||
strip -s -R .comment -R .gnu.version "$(executable)_debug" --strip-unneeded
|
||||
|
||||
linux_release:
|
||||
# Build packing tool and create resources.pack
|
||||
@$(MAKE) pack_tool
|
||||
@$(MAKE) resources.pack
|
||||
|
||||
# Remove data
|
||||
rm -rdf "$(releaseFolder)"
|
||||
|
||||
# Create folders
|
||||
mkdir -p "$(releaseFolder)"
|
||||
|
||||
# Copy data
|
||||
cp -R data "$(releaseFolder)"
|
||||
# Copy resources.pack instead of data folder
|
||||
cp resources.pack "$(releaseFolder)"
|
||||
cp LICENSE "$(releaseFolder)"
|
||||
cp README.md "$(releaseFolder)"
|
||||
cp gamecontrollerdb.txt "$(releaseFolder)"
|
||||
|
||||
# Delete data
|
||||
rm -f "$(releaseFolder)/data/room/map.world"
|
||||
rm -f "$(releaseFolder)/data/room/standard.tsx"
|
||||
|
||||
# Build
|
||||
g++ $(source) -std=$(cpp_standard) -Wall -Os -lSDL2 -lGL -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(releaseFolder)/$(executable)"
|
||||
# Build with RELEASE_BUILD flag
|
||||
g++ $(source) -Isource -D RELEASE_BUILD -std=$(cpp_standard) -Wall -Os -lSDL3 -lGL -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(releaseFolder)/$(executable)"
|
||||
strip -s -R .comment -R .gnu.version "$(releaseFolder)/$(executable)" --strip-unneeded
|
||||
|
||||
# Pack files
|
||||
|
||||
Reference in New Issue
Block a user