corregit el macos_release

This commit is contained in:
2025-10-31 23:11:17 +01:00
parent 8c6bea897c
commit 635efdba5e
2 changed files with 53 additions and 177 deletions

View File

@@ -2,13 +2,19 @@ executable = jaildoctors_dilemma
source = $(shell find source -name "*.cpp")
appName = JailDoctor's Dilemma
releaseFolder = jdd_release
version = v1.10
# Automatic version based on current date (OS-specific)
ifeq ($(OS),Windows_NT)
VERSION := $(shell powershell -Command "Get-Date -Format 'yyyy-MM-dd'")
else
VERSION := $(shell date +%Y-%m-%d)
endif
# Release names
windowsRelease = $(executable)-$(version)-win32-x64.zip
macosIntelRelease = $(executable)-$(version)-macos-intel.dmg
macosAppleSiliconRelease = $(executable)-$(version)-macos-apple-silicon.dmg
linuxRelease = $(executable)-$(version)-linux.tar.gz
windowsRelease = $(executable)-$(VERSION)-win32-x64.zip
macosIntelRelease = $(executable)-$(VERSION)-macos-intel.dmg
macosAppleSiliconRelease = $(executable)-$(VERSION)-macos-apple-silicon.dmg
linuxRelease = $(executable)-$(VERSION)-linux.tar.gz
# Specify the C++ standard
cpp_standard = c++20
@@ -78,6 +84,10 @@ macos_release:
# Build packing tool and create resources.pack
@$(MAKE) pack_tool
@$(MAKE) resources.pack
@echo "Creating macOS release - Version: $(VERSION)"
# Verify and install create-dmg if necessary
@which create-dmg > /dev/null || (echo "Installing create-dmg..." && brew install create-dmg)
# Remove data and possible data from previous builds
rm -rdf "$(releaseFolder)"
@@ -104,24 +114,51 @@ macos_release:
cp LICENSE "$(releaseFolder)"
cp README.md "$(releaseFolder)"
# Create links
ln -s /Applications "$(releaseFolder)"/Applications
# 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 convert tmp.dmg -format UDZO -o "$(macosIntelRelease)"
rm -f tmp.dmg
# Code sign the Intel application
codesign --deep --force --sign - --timestamp=none "$(releaseFolder)/$(appName).app"
# Build INTEL DMG with create-dmg
@echo "Creating Intel DMG with 96x96 icons..."
create-dmg \
--volname "$(appName)" \
--window-pos 200 120 \
--window-size 720 300 \
--icon-size 96 \
--text-size 12 \
--icon "$(appName).app" 278 102 \
--icon "LICENSE" 441 102 \
--icon "README.md" 604 102 \
--app-drop-link 115 102 \
--hide-extension "$(appName).app" \
"$(macosIntelRelease)" \
"$(releaseFolder)" || true
@echo "Intel release created: $(macosIntelRelease)"
# 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 convert tmp.dmg -format UDZO -o "$(macosAppleSiliconRelease)"
rm -f tmp.dmg
# Code sign the Apple Silicon application
codesign --deep --force --sign - --timestamp=none "$(releaseFolder)/$(appName).app"
# Build APPLE SILICON DMG with create-dmg
@echo "Creating Apple Silicon DMG with 96x96 icons..."
create-dmg \
--volname "$(appName)" \
--window-pos 200 120 \
--window-size 720 300 \
--icon-size 96 \
--text-size 12 \
--icon "$(appName).app" 278 102 \
--icon "LICENSE" 441 102 \
--icon "README.md" 604 102 \
--app-drop-link 115 102 \
--hide-extension "$(appName).app" \
"$(macosAppleSiliconRelease)" \
"$(releaseFolder)" || true
@echo "Apple Silicon release created: $(macosAppleSiliconRelease)"
# Remove data
rm -rdf Frameworks