Following on from the z88dk Xcode Project post below, the following steps describe how to set up an Xcode External Build Project to Edit and Compile Boriel ZX Basic .bas 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
4. Click Next

Click Next

Click Next

5. Enter Project Name e.g. zxbasic-spectrum-test
6. Enter Build tool /bin/bash
7. Click Next

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

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

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

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

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

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

11. Change .bas files Type in Xcode sidebar to Pascal (or any of the other source code file types) to enable syntax highlighting

Change .bas files Type in Xcode sidebar to Pascal (or any of the other source code file types) to enable syntax highlighting

Change .bas files Type in Xcode sidebar to Pascal (or any of the other source code file types) to enable syntax highlighting

12. Edit zxbasic-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 (part of z88dk distribution)

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

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

Enter $(SRCROOT) as Directory

Enter $(SRCROOT) as Directory

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

"Click

Build to run zxbasic-zxspectrum-my-project-name-build.sh” class /> Click Product->Build to run zxbasic-zxspectrum-my-project-name-build.sh

Advertisements