Skip to content

Commit

Permalink
Merge pull request #8 from ckosmic/testing
Browse files Browse the repository at this point in the history
Merge testing branch
  • Loading branch information
ckosmic authored Oct 18, 2021
2 parents 8a96054 + d99103d commit 85831ef
Show file tree
Hide file tree
Showing 26 changed files with 2,253 additions and 46 deletions.
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ TARGET_RPI ?= 0
# Build for Emscripten/WebGL
TARGET_WEB ?= 0

# Build for iOS devices
TARGET_IOS ?= 1

# Makeflag to enable OSX fixes
Expand Down Expand Up @@ -698,6 +699,7 @@ LOADER_FLAGS = -vwf
SHA1SUM = sha1sum
ZEROTERM = $(PYTHON) $(TOOLS_DIR)/zeroterm.py
IBTOOL = ibtool
CODESIGN = codesign

###################### Dependency Check #####################

Expand Down Expand Up @@ -746,6 +748,24 @@ $(BASEPACK_PATH): $(BASEPACK_LST)

endif

ios: default
$(RM) -rf $(BUILD_DIR_BASE)/$(TARGET).app
cp -a ios/. $(BUILD_DIR)
cp -R $(BUILD_DIR) build/$(TARGET).app
$(RM) -rf $(BUILD_DIR_BASE)/Payload
$(RM) -rf $(BUILD_DIR_BASE)/$(TARGET).ipa
mkdir $(BUILD_DIR_BASE)/Payload
cp -r $(BUILD_DIR_BASE)/$(TARGET).app $(BUILD_DIR_BASE)/Payload
$(CODESIGN) -f -s "$(CODE_SIGN_IDENTITY)" --entitlements "$(CODE_SIGN_ENTITLEMENTS)" $(BUILD_DIR_BASE)/Payload/$(TARGET).app
cd $(BUILD_DIR_BASE) && zip -r -q $(TARGET).ipa Payload && cd ..
$(RM) -rf $(BUILD_DIR_BASE)/Payload
$(RM) -rf $(BUILD_DIR_BASE)/$(TARGET).app

sim: default
$(RM) -rf $(BUILD_DIR_BASE)/$(TARGET).app
cp -a ios/. $(BUILD_DIR)
cp -R $(BUILD_DIR) build/$(TARGET).app

clean:
$(RM) -r $(BUILD_DIR_BASE)

Expand Down Expand Up @@ -1024,7 +1044,7 @@ $(BUILD_DIR)/%.o: %.s
$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(BUILD_DIR)/$(RPC_LIBS)
$(LD) -L $(BUILD_DIR) -o $@ $(O_FILES) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LDFLAGS)

.PHONY: all clean distclean default diff test load libultra res
.PHONY: all clean distclean default diff test load libultra res ios sim
.PRECIOUS: $(BUILD_DIR)/bin/%.elf $(SOUND_BIN_DIR)/%.ctl $(SOUND_BIN_DIR)/%.tbl $(SOUND_SAMPLE_TABLES) $(SOUND_BIN_DIR)/%.s $(BUILD_DIR)/%
.DELETE_ON_ERROR:

Expand Down
18 changes: 18 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
case ${PLATFORM_NAME} in
iphoneos)
export CC="clang -arch arm64 --target=arm64-apple-ios -mios-version-min=13.2 -fobjc-weak -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -DUSE_GLES -DAAPI_SDL2 -DWAPI_SDL2"
export CXX="clang++ -arch arm64 -mios-version-min=13.2 -fobjc-weak -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -DUSE_GLES -DAAPI_SDL2 -DWAPI_SDL2"
;;
iphonesimulator)
export CC="clang -arch x86_64 -mios-version-min=13.2 -fobjc-weak -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -DUSE_GLES -DAAPI_SDL2 -DWAPI_SDL2"
export CXX="clang++ -arch x86_64 -mios-version-min=13.2 -fobjc-weak -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -DUSE_GLES -DAAPI_SDL2 -DWAPI_SDL2"
;;
esac

export IOSINCLUDE="${SDL2_INCLUDE_DIR}/"
export IOSLIBS="${BUILT_PRODUCTS_DIR}/"

gmake -j4 TARGET_IOS=1

cp -R "build/us_pc/." "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}/"
rsync -aP --exclude="Info.plist" "ios/" "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
20 changes: 3 additions & 17 deletions build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@ export CC="clang -arch arm64 -mios-version-min=13.2 -fobjc-weak -isysroot /Appli
export CXX="clang++ -arch arm64 -mios-version-min=13.2 -fobjc-weak -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -DUSE_GLES -DAAPI_SDL2 -DWAPI_SDL2"
export IOSINCLUDE="../ioslib/include"
export IOSLIBS="../ioslib/lib"
export CODE_SIGN_IDENTITY="Apple Development"
export CODE_SIGN_ENTITLEMENTS="sm64ios.entitlements"

gmake -j4 TARGET_IOS=1

if [ $? -eq 0 ]; then
rm -rf build/sm64ios.app
cp -a ios/. build/us_pc/
cp -R build/us_pc build/sm64ios.app
codesign -f -s "Apple Development" --entitlements sm64ios.entitlements build/sm64ios.app
rm -rf build/Payload
rm -rf build/sm64ios.ipa
mkdir build/Payload
cp -r build/sm64ios.app build/Payload
cd build
zip -r -q sm64ios.ipa Payload
rm -rf Payload
rm -rf sm64ios.app
cd ..
fi
gmake ios -j4 TARGET_IOS=1
8 changes: 1 addition & 7 deletions build_sim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@ export CXX="clang++ -arch x86_64 -mios-version-min=13.2 -fobjc-weak -std=c++11 -
export IOSINCLUDE="../simlib/include"
export IOSLIBS="../simlib/lib"

gmake -j4 TARGET_IOS=1

if [ $? -eq 0 ]; then
rm -rf build/sm64ios.app
cp -a ios/. build/us_pc/
cp -R build/us_pc build/sm64ios.app
fi
gmake sim -j4 TARGET_IOS=1
10 changes: 10 additions & 0 deletions sm64ios.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions sm64ios.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Binary file added sm64ios/sm64ios.xcodeproj/TemplateIcon.icns
Binary file not shown.
10 changes: 10 additions & 0 deletions sm64ios/sm64ios.xcodeproj/TemplateInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>This project builds an SDL based project for iPhone OS using C or Objective-C. It includes everything you need to get up and running with SDL on iPhone.</string>
<key>CFBundleIconFile</key>
<string>Icon.png</string>
</dict>
</plist>
Loading

0 comments on commit 85831ef

Please sign in to comment.