@@ -244,7 +244,7 @@ CORE_FILTER += Core/debugger.c Core/sm83_disassembler.c Core/symbol_hash.c
244244LDFLAGS += -arch arm64
245245OCFLAGS += -x objective-c -fobjc-arc -Wno-deprecated-declarations -isysroot $(SYSROOT )
246246LDFLAGS += -miphoneos-version-min=11.0 -isysroot $(SYSROOT )
247- REREGISTER_LDFLAGS := $(LDFLAGS ) -lobjc -framework CoreServices -framework Foundation
247+ IOS_INSTALLER_LDFLAGS := $(LDFLAGS ) -lobjc -framework CoreServices -framework Foundation
248248LDFLAGS += -lobjc -framework UIKit -framework Foundation -framework CoreGraphics -framework Metal -framework MetalKit -framework AudioToolbox -framework AVFoundation -framework QuartzCore -framework CoreMotion -framework CoreVideo -framework CoreMedia -framework CoreImage -framework UserNotifications -weak_framework CoreHaptics
249249CODESIGN := codesign -fs -
250250else
@@ -325,7 +325,7 @@ quicklook: $(BIN)/SameBoy.qlgenerator
325325sdl : $(SDL_TARGET ) $(BIN ) /SDL/dmg_boot.bin $(BIN ) /SDL/mgb_boot.bin $(BIN ) /SDL/cgb0_boot.bin $(BIN ) /SDL/cgb_boot.bin $(BIN ) /SDL/agb_boot.bin $(BIN ) /SDL/sgb_boot.bin $(BIN ) /SDL/sgb2_boot.bin $(BIN ) /SDL/LICENSE $(BIN ) /SDL/registers.sym $(BIN ) /SDL/background.bmp $(BIN ) /SDL/Shaders $(BIN ) /SDL/Palettes
326326bootroms : $(BIN ) /BootROMs/agb_boot.bin $(BIN ) /BootROMs/cgb_boot.bin $(BIN ) /BootROMs/cgb0_boot.bin $(BIN ) /BootROMs/dmg_boot.bin $(BIN ) /BootROMs/mgb_boot.bin $(BIN ) /BootROMs/sgb_boot.bin $(BIN ) /BootROMs/sgb2_boot.bin
327327tester : $(TESTER_TARGET ) $(BIN ) /tester/dmg_boot.bin $(BIN ) /tester/cgb_boot.bin $(BIN ) /tester/agb_boot.bin $(BIN ) /tester/sgb_boot.bin $(BIN ) /tester/sgb2_boot.bin
328- _ios : $(BIN ) /SameBoy-iOS.app $(OBJ ) /reregister
328+ _ios : $(BIN ) /SameBoy-iOS.app $(OBJ ) /installer
329329ios-ipa : $(BIN ) /SameBoy-iOS.ipa
330330ios-deb : $(BIN ) /SameBoy-iOS.deb
331331ifeq ($(PLATFORM ) ,windows32)
@@ -344,7 +344,7 @@ CORE_SOURCES := $(filter-out $(CORE_FILTER),$(shell ls Core/*.c))
344344CORE_HEADERS := $(shell ls Core/* .h)
345345SDL_SOURCES := $(shell ls SDL/* .c) $(OPEN_DIALOG ) $(patsubst % ,SDL/audio/% .c,$(SDL_AUDIO_DRIVERS ) )
346346TESTER_SOURCES := $(shell ls Tester/* .c)
347- IOS_SOURCES := $(filter-out iOS/reregister .m, $(shell ls iOS/* .m) ) $(shell ls AppleCommon/* .m)
347+ IOS_SOURCES := $(filter-out iOS/installer .m, $(shell ls iOS/* .m) ) $(shell ls AppleCommon/* .m)
348348COCOA_SOURCES := $(shell ls Cocoa/* .m) $(shell ls HexFiend/* .m) $(shell ls JoyKit/* .m) $(shell ls AppleCommon/* .m)
349349QUICKLOOK_SOURCES := $(shell ls QuickLook/* .m) $(shell ls QuickLook/* .c)
350350
@@ -449,9 +449,8 @@ ifeq ($(CONF), release)
449449 $(STRIP) $@
450450endif
451451
452- $(OBJ ) /reregister : iOS/reregister.m iOS/reregister.entitlements
453- $(CC ) $< -o $@ $(REREGISTER_LDFLAGS ) $(CFLAGS )
454- codesign -fs - --entitlements iOS/reregister.entitlements $@
452+ $(OBJ ) /installer : iOS/installer.m
453+ $(CC ) $< -o $@ $(IOS_INSTALLER_LDFLAGS ) $(CFLAGS )
455454
456455# Cocoa Port
457456
@@ -697,20 +696,22 @@ $(BIN)/SameBoy-iOS.deb: $(OBJ)/debian-binary $(OBJ)/control.tar.gz $(OBJ)/data.t
697696 -@$(MKDIR ) -p $(dir $@ )
698697 (cd $( OBJ) && ar cr $( abspath $@ ) $( notdir $^) )
699698
700- $(OBJ ) /data.tar.gz : ios iOS/jailbreak.entitlements
701- $(MKDIR ) -p $(OBJ ) /Applications
702- cp -rf $(BIN ) /SameBoy-iOS.app $(OBJ ) /Applications/SameBoy-iOS.app
703- cp build/obj-ios/reregister $(OBJ ) /Applications/SameBoy-iOS.app
704- codesign -fs - --entitlements iOS/jailbreak.entitlements $(OBJ ) /Applications/SameBoy-iOS.app
705- (cd $( OBJ) && tar -czf $( abspath $@ ) --format ustar --uid 501 --gid 501 --numeric-owner ./Applications)
706- rm -rf $(OBJ ) /Applications
699+ $(OBJ ) /data.tar.gz : ios iOS/jailbreak.entitlements iOS/installer.entitlements
700+ $(MKDIR ) -p $(OBJ ) /private/var/containers/
701+ cp -rf $(BIN ) /SameBoy-iOS.app $(OBJ ) /private/var/containers/SameBoy-iOS.app
702+ cp build/obj-ios/installer $(OBJ ) /private/var/containers/SameBoy-iOS.app
703+ codesign -fs - --entitlements iOS/installer.entitlements $(OBJ ) /private/var/containers/SameBoy-iOS.app/installer
704+ codesign -fs - --entitlements iOS/jailbreak.entitlements $(OBJ ) /private/var/containers/SameBoy-iOS.app
705+ (cd $( OBJ) && tar -czf $( abspath $@ ) --format ustar --uid 501 --gid 501 --numeric-owner ./private)
706+ rm -rf $(OBJ ) /private/
707707
708- $(OBJ ) /control.tar.gz : iOS/deb-postinst iOS/deb-control
708+ $(OBJ ) /control.tar.gz : iOS/deb-postinst iOS/deb-prerm iOS/deb- control
709709 -@$(MKDIR ) -p $(dir $@ )
710710 sed " s/@VERSION/$( VERSION) /" < iOS/deb-control > $(OBJ ) /control
711711 ln iOS/deb-postinst $(OBJ ) /postinst
712- (cd $( OBJ) && tar -czf $( abspath $@ ) --format ustar --uid 501 --gid 501 --numeric-owner ./control ./postinst)
713- rm $(OBJ ) /control $(OBJ ) /postinst
712+ ln iOS/deb-prerm $(OBJ ) /prerm
713+ (cd $( OBJ) && tar -czf $( abspath $@ ) --format ustar --uid 501 --gid 501 --numeric-owner ./control ./postinst ./prerm)
714+ rm $(OBJ ) /control $(OBJ ) /postinst $(OBJ ) /prerm
714715
715716$(OBJ ) /debian-binary :
716717 -@$(MKDIR ) -p $(dir $@ )
0 commit comments