The following steps describe how to set up an Xcode External Build Project to Edit and Assemble z88dk .c and .asm source files (Xcode version 5.1.1 is used below but should still work with earlier versions)

1. Launch Xcode
2. File->New Project
3. Select Other->External Build System

Click Next

Click Next

4. Click Next

5. Enter Project Name e.g. z88dk-spectrum-test
6. Enter Build tool /bin/bash

Click Next

Click Next

7. Click Next

8. Choose a directory to create files in and click Create

9. Copy .c and .asm files and z88dk-zxspectrum-my-project-name-build.sh file to project directory created by Xcode

Example z88dk-zxspectrum-my-project-name-build.sh file can be found here

Add files copied above to Xcode Project via Cmd-Opt-A

Add files copied above to Xcode Project via Cmd-Opt-A

10. Add files copied above to Xcode Project via Cmd-Opt-A

Change .asm files Type in Xcode sidebar to Assembly (to enable syntax highlighting)

Change .asm files Type in Xcode sidebar to Assembly (to enable syntax highlighting)

11. Change .asm files Type in Xcode sidebar to Assembly (to enable syntax highlighting)

12. Edit z88dk-zxspectrum-my-project-name-build.sh file and edit Exec Name

Z80EXECNAME=my-project-name

Note: PATH declaration is included as Xcode doesn’t pick up PATH from .bash_profile, .profile etc.

PATH declaration /usr/local/bin/ is added for tapmaker

13. Save z88dk-zxspectrum-my-project-name-build.sh

14. Click on Project in Xcode and Click Target->Info
15. Enter z88dk-zxspectrum-$(PROJECT_NAME)-build.sh as Arguments

Enter $(SRCROOT) as Directory

Enter $(SRCROOT) as Directory

16. Enter $(SRCROOT) as Directory

17. Click Product->Build to run z88dk-zxspectrum-my-project-name-build.sh

Click Product->Build to run z88dk-zxspectrum-my-project-name-build.sh

Click Product->Build to run z88dk-zxspectrum-my-project-name-build.sh

Note: To add additional Build targets (e.g. ZX81) duplicate the ZX Spectrum target and change the name of the .sh file in the argument to the name of the zx81 build .sh file

To add additional Build targets (e.g. ZX81) duplicate the ZX Spectrum target and change the name of the .sh file in the argument to the name of the zx81 build .sh file

To add additional Build targets (e.g. ZX81) duplicate the ZX Spectrum target and change the name of the .sh file in the argument to the name of the zx81 build .sh file

Example z88dk-zx81-my-project-name-build.sh file can be found here

also edit the Scheme names in Projects->Schemes->Manage Schemes to match the target names

Advertisements