diff --git a/Makefile b/Makefile index fd44ae9..197fffd 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile # Apple2BuildPipelineSample # -# Part of a sample build pipeline for Apple ][ software development +# Part of a sample build pipeline for Apple II software development # # Created by Quinn Dunki on 8/15/14. # One Girl, One Laptop Productions @@ -34,7 +34,7 @@ PGM=___PACKAGENAME___ # MACHINE = apple2enh-loader # MACHINE = apple2enh-reboot -# Uncomment and set this to your starting address in Apple ][ memory +# Uncomment and set this to your starting address in Apple II memory # if necessary: # START_ADDR = 6000 diff --git a/README.md b/README.md index a8b55eb..9cc6653 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Apple2BuildPipeline =================== -A build pipeline for making Apple \]\[ software on OS X. +A build pipeline for making Apple II software on OS X. Features: ========= @@ -11,31 +11,31 @@ This project was built based on the one created by [Quinn Dunki](http://quinndun * Attempts to hide all of the infrastructure which you don't need to modify in a make directory. * Supports linking together multiple C and assembly files. To add a new file to the project, just create a new *.c or *.s file in the project directory. * If you change a header file, the right source files will rebuild automatically. Header file dependencies are generated during the build. - * Supports all cc65 Apple configurations. So, if you want to target enhanced Apple //e's running DOS 3.3, knock yourself out. Just set the configuration you want in the Makefile and the build will do the right thing to create a disk image for that configuration. - * On Mac OS X, Virtual \]\[ will start when you build and the emulator with execute your program. This works for all supported cc65 Apple configurations. Also, it uses a machine configuration which is stored in the make directory in your project. That way, you can modify the machine configuration to be exactly the config you want to test under. - * The Mac OS X deliverable is now an installer which will create an Xcode project template. So, to start a new Apple \]\[ project in Xcode, select File->New->Project. Among the iOS and OS X project templates, you will find the "Apple \]\[ Asm Project" and "Apple \]\[ C Project" options. Select either and you will have a new Apple \]\[ project ready to go. + * Supports all cc65 Apple configurations. So, if you want to target enhanced Apple IIe's running DOS 3.3, knock yourself out. Just set the configuration you want in the Makefile and the build will do the right thing to create a disk image for that configuration. + * On Mac OS X, Virtual II will start when you build and the emulator with execute your program. This works for all supported cc65 Apple configurations. Also, it uses a machine configuration which is stored in the make directory in your project. That way, you can modify the machine configuration to be exactly the config you want to test under. + * The Mac OS X deliverable is now an installer which will create an Xcode project template. So, to start a new Apple II project in Xcode, select File->New->Project. Among the iOS and OS X project templates, you will find the "Apple II Asm Project" and "Apple II C Project" options. Select either and you will have a new Apple II project ready to go. Mac OS X Installation: ---------------------- In order to use this infrastructure from Mac OS X, follow these instructions: - 1. Install [Xcode from Apple](https://itunes.apple.com/us/app/xcode/id497799835?mt=12&uo=4). Xcode is generally the most popular app in the Mac App Store in the "Developer Tools" category. Xcode is free and you do not need to be a registered Apple developer to download and use it, especially if you are building Apple \]\[ programs. I have only tested with Xcode 6 which is the latest version. It appears as though project templates are a feature introduced in Xcode 4 so the Apple // project template may work with Xcode 4 or 5 but I have not tested them. + 1. Install [Xcode from Apple](https://itunes.apple.com/us/app/xcode/id497799835?mt=12&uo=4). Xcode is generally the most popular app in the Mac App Store in the "Developer Tools" category. Xcode is free and you do not need to be a registered Apple developer to download and use it, especially if you are building Apple II programs. I have only tested with Xcode 6 which is the latest version. It appears as though project templates are a feature introduced in Xcode 4 so the Apple II project template may work with Xcode 4 or 5 but I have not tested them. 2. Install the [cc65 v2.13.3 package](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.0/cc65.2.13.3.pkg). - 3. Install the [Apple // project template](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.2/AppleXcodeTemplate.pkg). - 4. Install and setup [Virtual \]\[](http://www.virtualii.com). + 3. Install the [Apple II project template](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.3/AppleXcodeTemplate.pkg). + 4. Install and setup [Virtual II](http://www.virtualii.com). Your First Project: ------------------- -Everything you need is now installed. To create a new Apple \]\[ project in Xcode: +Everything you need is now installed. To create a new Apple II project in Xcode: 1. Start Xcode and create a new project by using File->New->Project... - 2. In the dialog, you will see an Apple \]\[ option below the OS X section. Select that and select "Apple \]\[ C Project" for a basic C-based project. Or select "Apple \]\[ Asm Project" for a basic assembly project. Click "Next". - 3. A dialog box with a few text fields will appear. In product name, put in the name of the Apple \]\[ executable you want to build. Organization Name and Organization Identifier can be anything you want it to be. Leave Build Tool set to "/usr/bin/make". Click "Next". + 2. In the dialog, you will see an "Apple II" option below the OS X section. Select that and select "Apple II C Project" for a basic C-based project. Or select "Apple II Asm Project" for a basic assembly project. Click "Next". + 3. A dialog box with a few text fields will appear. In product name, put in the name of the Apple II executable you want to build. Organization Name and Organization Identifier can be anything you want it to be. Leave Build Tool set to "/usr/bin/make". Click "Next". 4. Xcode now prompts you where you want to save your project. The name of the project will be the product name you already gave. Pick a good directory for your project. Your Documents foler is a reasonable option. Click "Create". - 5. Your project is now ready for you. If you select Product->Build, it will build and execute the template code in Virtual \]\[. On your first build, you may be prompted by Mac OS X to install a Java runtime. Java is required so if you get this prompt, you should install it. Once Java is installed, go back to Xcode and select Product->Clean and then Product->Build. Virtual \]\[ should launch this time. + 5. Your project is now ready for you. If you select Product->Build, it will build and execute the template code in Virtual II. On your first build, you may be prompted by Mac OS X to install a Java runtime. Java is required so if you get this prompt, you should install it. Once Java is installed, go back to Xcode and select Product->Clean and then Product->Build. Virtual II should launch this time. 6. At this point everything should work and you should see "HELLO, WORLD!" in the emulator. Press any key in the emulator to quit the executable and go back to the BASIC prompt. 7. Review the Makefile and set any options you want. The file has lots of comments to help you understand the configuration options. - 8. Change main.c (or main.s if you created an assembly project) and write more code in new C or assembly files until you have the program you always wanted to build. To add new files, select File->New->File. In the dialog, you will see an Apple \]\[ option in the OS X section. Select that and in there, you will see options to create a new C file or a new Assembly File. Select the one you want to add the file to your project. Put the new file in the same directory as Makefile. You can add assembly files in a C project or add C files in an assembly project. The only difference between them is the type of the default source file in the project template. + 8. Change main.c (or main.s if you created an assembly project) and write more code in new C or assembly files until you have the program you always wanted to build. To add new files, select File->New->File. In the dialog, you will see an Apple II option in the OS X section. Select that and in there, you will see options to create a new C file or a new Assembly File. Select the one you want to add the file to your project. Put the new file in the same directory as Makefile. You can add assembly files in a C project or add C files in an assembly project. The only difference between them is the type of the default source file in the project template. UNIX Installation: ------------------ @@ -49,9 +49,9 @@ $ make -f make/gcc.mak $ sudo make -f make/gcc.mak install -Once that is done, you can edit the Makefile from the Apple \]\[ build pipeline and add new source files as described above. Be sure to set PGM to the name of your executable in the Makefile. When you build the project in a non-Mac environment, you should end up with a .dsk file but it will not try to execute that like it would on a Mac. In theory, other emulators on the Mac or on other host systems could be added to the build infrastructure and feel free to add support for your favourite. +Once that is done, you can edit the Makefile from the Apple II build pipeline and add new source files as described above. Be sure to set PGM to the name of your executable in the Makefile. When you build the project in a non-Mac environment, you should end up with a .dsk file but it will not try to execute that like it would on a Mac. In theory, other emulators on the Mac or on other host systems could be added to the build infrastructure and feel free to add support for your favourite. Acknowledgements: ----------------- -Thanks to Quinn Dunki and Carrington Vanston who were instrumental in getting this working. [Carrington's presentation](http://monsterfeet.com/kfest/) at KansasFest 2014 is where the basic concepts of a better Apple \]\[ build environment were demonstrated. [Quinn built on that](http://quinndunki.com/blondihacks/?p=1904) and included support for automatically starting the program in Virtual \]\[ using Applescript. Without their work, I wouldn't have been able to create this. Thanks! +Thanks to Quinn Dunki and Carrington Vanston who were instrumental in getting this working. [Carrington's presentation](http://monsterfeet.com/kfest/) at KansasFest 2014 is where the basic concepts of a better Apple II build environment were demonstrated. [Quinn built on that](http://quinndunki.com/blondihacks/?p=1904) and included support for automatically starting the program in Virtual II using Applescript. Without their work, I wouldn't have been able to create this. Thanks! diff --git a/make/head.mk b/make/head.mk index 6fc2e73..0710ce8 100644 --- a/make/head.mk +++ b/make/head.mk @@ -2,7 +2,7 @@ # head.mk # Apple2BuildPipelineSample # -# Part of a sample build pipeline for Apple ][ software development +# Part of a sample build pipeline for Apple II software development # # Created by Quinn Dunki on 8/15/14. # One Girl, One Laptop Productions @@ -27,4 +27,4 @@ MACHINE=apple2 CPU=6502 CFLAGS= ASMFLAGS= -LDFLAGS= \ No newline at end of file +LDFLAGS= diff --git a/make/tail.mk b/make/tail.mk index 10a2aa9..8c246d2 100644 --- a/make/tail.mk +++ b/make/tail.mk @@ -2,7 +2,7 @@ # tail.mk # Apple2BuildPipelineSample # -# Part of a sample build pipeline for Apple ][ software development +# Part of a sample build pipeline for Apple II software development # # Created by Quinn Dunki on 8/15/14. # One Girl, One Laptop Productions diff --git a/pkg/Distribution.xml b/pkg/Distribution.xml index 1d03e41..adfb576 100644 --- a/pkg/Distribution.xml +++ b/pkg/Distribution.xml @@ -1,6 +1,6 @@ - Apple ][ XCode Template + Apple II XCode Template diff --git a/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/TemplateInfo.plist similarity index 98% rename from pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/TemplateInfo.plist rename to pkg/Templates/Apple II/Apple II Asm Project.xctemplate/TemplateInfo.plist index e1258be..ad1235e 100644 --- a/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/TemplateInfo.plist +++ b/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/TemplateInfo.plist @@ -95,7 +95,7 @@ Concrete Description - This template creates an Apple ][ assembly code project. The project starts with a single assembly file which you can modify. You can also add more assembly or C files as you may like. + This template creates an Apple II assembly code project. The project starts with a single assembly file which you can modify. You can also add more assembly or C files as you may like. Options Targets diff --git a/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/main.s b/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/main.s similarity index 100% rename from pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/main.s rename to pkg/Templates/Apple II/Apple II Asm Project.xctemplate/main.s diff --git a/pkg/Templates/Apple ][/Apple ][ C Project.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple II/Apple II C Project.xctemplate/TemplateInfo.plist similarity index 98% rename from pkg/Templates/Apple ][/Apple ][ C Project.xctemplate/TemplateInfo.plist rename to pkg/Templates/Apple II/Apple II C Project.xctemplate/TemplateInfo.plist index 9d04886..352c1a1 100644 --- a/pkg/Templates/Apple ][/Apple ][ C Project.xctemplate/TemplateInfo.plist +++ b/pkg/Templates/Apple II/Apple II C Project.xctemplate/TemplateInfo.plist @@ -95,7 +95,7 @@ Concrete Description - This template creates an Apple ][ C code project. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + This template creates an Apple II C code project. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. Options Targets diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon.png similarity index 100% rename from pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon.png rename to pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon.png diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon@2x.png similarity index 100% rename from pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon@2x.png rename to pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon@2x.png diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateInfo.plist similarity index 100% rename from pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateInfo.plist rename to pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateInfo.plist diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/___FILEBASENAME___.s b/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/___FILEBASENAME___.s similarity index 100% rename from pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/___FILEBASENAME___.s rename to pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/___FILEBASENAME___.s diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/Default/___FILEBASENAME___.c b/pkg/Templates/File Templates/Apple II/C File.xctemplate/Default/___FILEBASENAME___.c similarity index 100% rename from pkg/Templates/File Templates/Apple ][/C File.xctemplate/Default/___FILEBASENAME___.c rename to pkg/Templates/File Templates/Apple II/C File.xctemplate/Default/___FILEBASENAME___.c diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple II/C File.xctemplate/TemplateIcon.png similarity index 100% rename from pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon.png rename to pkg/Templates/File Templates/Apple II/C File.xctemplate/TemplateIcon.png diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple II/C File.xctemplate/TemplateIcon@2x.png similarity index 100% rename from pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon@2x.png rename to pkg/Templates/File Templates/Apple II/C File.xctemplate/TemplateIcon@2x.png diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple II/C File.xctemplate/TemplateInfo.plist similarity index 100% rename from pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateInfo.plist rename to pkg/Templates/File Templates/Apple II/C File.xctemplate/TemplateInfo.plist diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.c b/pkg/Templates/File Templates/Apple II/C File.xctemplate/WithHeader/___FILEBASENAME___.c similarity index 100% rename from pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.c rename to pkg/Templates/File Templates/Apple II/C File.xctemplate/WithHeader/___FILEBASENAME___.c diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.h b/pkg/Templates/File Templates/Apple II/C File.xctemplate/WithHeader/___FILEBASENAME___.h similarity index 100% rename from pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.h rename to pkg/Templates/File Templates/Apple II/C File.xctemplate/WithHeader/___FILEBASENAME___.h diff --git a/pkg/createPackage b/pkg/createPackage index ce91221..d505cc6 100755 --- a/pkg/createPackage +++ b/pkg/createPackage @@ -4,14 +4,14 @@ TMPDIR=/tmp/pkg.$$ cp -R pkg/Templates $TMPDIR -cp -R make $TMPDIR/'Apple ][/Apple ][ C Project.xctemplate/' -cp Makefile $TMPDIR/'Apple ][/Apple ][ C Project.xctemplate/' -cp main.c $TMPDIR/'Apple ][/Apple ][ C Project.xctemplate/' +cp -R make $TMPDIR/'Apple II/Apple II C Project.xctemplate/' +cp Makefile $TMPDIR/'Apple II/Apple II C Project.xctemplate/' +cp main.c $TMPDIR/'Apple II/Apple II C Project.xctemplate/' -cp -R make $TMPDIR/'Apple ][/Apple ][ Asm Project.xctemplate/' -cp Makefile $TMPDIR/'Apple ][/Apple ][ Asm Project.xctemplate/' +cp -R make $TMPDIR/'Apple II/Apple II Asm Project.xctemplate/' +cp Makefile $TMPDIR/'Apple II/Apple II Asm Project.xctemplate/' -pkgbuild --root $TMPDIR --version 1.2 --identifier com.halcyontouch.Apple2Template.pkg --install-location /Library/Developer/Xcode/Templates/ --scripts pkg/scripts/ AppleXcodeTemplate.pkg +pkgbuild --root $TMPDIR --version 1.3 --identifier com.halcyontouch.Apple2Template.pkg --install-location /Library/Developer/Xcode/Templates/ --scripts pkg/scripts/ AppleXcodeTemplate.pkg productbuild --distribution pkg/Distribution.xml --resource ./pkg temp.pkg rm AppleXcodeTemplate.pkg productsign --sign "Developer ID Installer" temp.pkg AppleXcodeTemplate.pkg diff --git a/pkg/scripts/preinstall b/pkg/scripts/preinstall index 49a0001..135e3d6 100755 --- a/pkg/scripts/preinstall +++ b/pkg/scripts/preinstall @@ -1,8 +1,9 @@ #!/bin/bash -OLDTEMPLATE=~/"Library/Developer/Xcode/Templates/Apple ][/Apple ][ Project.xctemplate" - -if [ -d "$OLDTEMPLATE" ] -then - rm -rf "$OLDTEMPLATE" -fi +for item in ~/"Library/Developer/Xcode/Templates/Apple ][" ~/"Library/Developer/Xcode/Templates/File Templates/Apple ][" +do + if [ -d "$item" ] + then + rm -rf "$item" + fi +done