diff --git a/Apple2Template.pmdoc/01apple-contents.xml b/Apple2Template.pmdoc/01apple-contents.xml deleted file mode 100644 index f139d74..0000000 --- a/Apple2Template.pmdoc/01apple-contents.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Apple2Template.pmdoc/01apple.xml b/Apple2Template.pmdoc/01apple.xml deleted file mode 100644 index d4d2703..0000000 --- a/Apple2Template.pmdoc/01apple.xml +++ /dev/null @@ -1 +0,0 @@ -com.halcyontouch.Apple2Template.pkg1.0./Library/Developer/Xcode/Templates/Apple ][/Apple ][ Project.xctemplateinstallTo.isRelativeTypeinstallTorelocatableinstallFrom.pathidentifierparentrequireAuthorizationinstallTo.pathinstallFrom.isRelativeType01apple-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/Apple2Template.pmdoc/index.xml b/Apple2Template.pmdoc/index.xml deleted file mode 100644 index 42907a1..0000000 --- a/Apple2Template.pmdoc/index.xml +++ /dev/null @@ -1 +0,0 @@ -Apple ][ XCode Template/Volumes/BigHD/jrand/Desktop/Apple ][ XCode Template.pkgcom.halcyontouch01apple.xmlproperties.titleproperties.userDomainproperties.anywhereDomain \ No newline at end of file diff --git a/README.md b/README.md index 727a40f..caa4f81 100644 --- a/README.md +++ b/README.md @@ -21,22 +21,21 @@ 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. 2. Install the [cc65 v2.13.3 package](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.0/cc65.2.13.3.pkg). - 4. Install the [Apple // project template](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.0/Apple.XCode.Template.pkg). - 5. Install [Virtual \]\[](http://www.virtualii.com). + 4. Install the [Apple // project template](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.1/AppleXcodeTemplate.pkg). + 5. Install and setup [Virtual \]\[](http://www.virtualii.com). Your First Project: ------------------- Everything you need is now installed. To create a new Apple \]\[ 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 \]\[ Project". Click "Next". + 2. In the dialog, you will see an Apple \]\[ option below the OS X section. Select that and select "Apple \]\[ C 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". 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. - 6. The build environmnt includes a template Virtual \]\[ machine configuration, but it is possible that the configuration will not be able to find your ROM file. If so, select Setup from the toolbar and set the folder with your ROM file. You can also change any attributes of the machine on which you want to execute your program here. When you are done, be sure to select File->Save Configuration. Try your build again from Xcode now that you have your machine configuration set. - 7. 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. - 8. Review the Makefile and set any options you want. The file has lots of comments to help you understand the configuration options. - 9. Change main.c and write more code in new C or assembly files until you have the program you always wanted to build... + 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 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 file in the same directory as main.c. UNIX Installation: ------------------ diff --git a/make/tail.mk b/make/tail.mk index e47cb4b..10a2aa9 100644 --- a/make/tail.mk +++ b/make/tail.mk @@ -79,9 +79,11 @@ clean: rm -f $(ASM_LSTS) rm -f $(DISKIMAGE) +createPackage: + pkg/createPackage + cleanMacCruft: - rm -rf Apple2Template.pmdoc - rm -rf TemplateInfo.plist + rm -rf pkg $(PGM): $(OBJS) $(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o $(PGM) $(OBJS) diff --git a/pkg/.createPackage.swp b/pkg/.createPackage.swp new file mode 100644 index 0000000..3bd996e Binary files /dev/null and b/pkg/.createPackage.swp differ diff --git a/pkg/Distribution.xml b/pkg/Distribution.xml new file mode 100644 index 0000000..1d03e41 --- /dev/null +++ b/pkg/Distribution.xml @@ -0,0 +1,17 @@ + + + Apple ][ XCode Template + + + + + + + + + + + + + AppleXcodeTemplate.pkg + diff --git a/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..e1258be --- /dev/null +++ b/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/TemplateInfo.plist @@ -0,0 +1,136 @@ + + + + + Nodes + + main.s + Makefile + make/AppleCommander.jar + make/createDiskImage + make/DevApple.vii + make/dos33_template.dsk + make/head.mk + make/prodos_template.dsk + make/tail.mk + make/V2Make.scpt + + Definitions + + main.s + + Path + main.s + + make/V2Make.scpt + + Group + make + Path + make/V2Make.scpt + + make/tail.mk + + Group + make + Path + make/tail.mk + + make/prodos_template.dsk + + Group + make + Path + make/prodos_template.dsk + + make/head.mk + + Group + make + Path + make/head.mk + + make/dos33_template.dsk + + Group + make + Path + make/dos33_template.dsk + + make/DevApple.vii + + Group + make + Path + make/DevApple.vii + + make/createDiskImage + + Group + make + Path + make/createDiskImage + + make/AppleCommander.jar + + Path + make/AppleCommander.jar + Group + make + + Makefile + + Path + Makefile + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2AsmBuildSystem + Ancestors + + com.apple.dt.unit.externalBuildSystem + + 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. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + + diff --git a/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/main.s b/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/main.s new file mode 100644 index 0000000..ac4ec38 --- /dev/null +++ b/pkg/Templates/Apple ][/Apple ][ Asm Project.xctemplate/main.s @@ -0,0 +1,30 @@ +; +; ___FILENAME___ +; ___PROJECTNAME___ +; +; Created by ___FULLUSERNAME___ on ___DATE___. +;___COPYRIGHT___ +; + + +COUT = $fded +KEYBOARD = $c000 +STROBE = $c010 + +main: + ldx #$00 +loop: + lda msg, X + beq wait + ora #$80 + jsr COUT + inx + jmp loop + +wait: + lda KEYBOARD + bpl wait + lda STROBE + rts + +msg: .asciiz "HELLO, WORLD" diff --git a/TemplateInfo.plist b/pkg/Templates/Apple ][/Apple ][ C Project.xctemplate/TemplateInfo.plist similarity index 92% rename from TemplateInfo.plist rename to pkg/Templates/Apple ][/Apple ][ C Project.xctemplate/TemplateInfo.plist index 8edebc1..9d04886 100644 --- a/TemplateInfo.plist +++ b/pkg/Templates/Apple ][/Apple ][ C Project.xctemplate/TemplateInfo.plist @@ -87,7 +87,7 @@ Kind Xcode.Xcode3.ProjectTemplateUnitKind Identifier - com.halcyontouch.apple2BuildSystem + com.halcyontouch.apple2CBuildSystem Ancestors com.apple.dt.unit.externalBuildSystem @@ -95,7 +95,7 @@ Concrete Description - This template builds Apple ][ programs using cc65. + 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. Options Targets diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..4786b7e Binary files /dev/null and b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon.png differ diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..21d5bd1 Binary files /dev/null and b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateIcon@2x.png differ diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..ea02c9e --- /dev/null +++ b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/TemplateInfo.plist @@ -0,0 +1,16 @@ + + + + + DefaultCompletionName + File + Description + An assembly source file. + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + MainTemplateFile + ___FILEBASENAME___.s + Summary + An assembly source file + + diff --git a/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/___FILEBASENAME___.s b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/___FILEBASENAME___.s new file mode 100755 index 0000000..b03c9e2 --- /dev/null +++ b/pkg/Templates/File Templates/Apple ][/Assembly File.xctemplate/___FILEBASENAME___.s @@ -0,0 +1,7 @@ +; +; ___FILENAME___ +; ___PROJECTNAME___ +; +; Created by ___FULLUSERNAME___ on ___DATE___. +;___COPYRIGHT___ +; diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/Default/___FILEBASENAME___.c b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/Default/___FILEBASENAME___.c new file mode 100644 index 0000000..8743098 --- /dev/null +++ b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/Default/___FILEBASENAME___.c @@ -0,0 +1,9 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +//___COPYRIGHT___ +// + +#include diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..f52abe3 Binary files /dev/null and b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon.png differ diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..f3e884c Binary files /dev/null and b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateIcon@2x.png differ diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..77652aa --- /dev/null +++ b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/TemplateInfo.plist @@ -0,0 +1,53 @@ + + + + + AllowedTypes + + public.c-source + + DefaultCompletionName + File + Description + An empty C file. + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + MainTemplateFile + ___FILEBASENAME___.c + Options + + + Description + The name of the file to create + Identifier + productName + Name + Name: + NotPersisted + + Required + + Type + text + + + Default + true + Description + Whether to create a header file with the same name + Identifier + WithHeader + Name + Also create a header file + NotPersisted + + Type + checkbox + + + SortOrder + 2 + Summary + An empty C file. + + diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.c b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.c new file mode 100644 index 0000000..8922fef --- /dev/null +++ b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.c @@ -0,0 +1,9 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +//___COPYRIGHT___ +// + +#include "___FILEBASENAME___.h" diff --git a/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.h b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.h new file mode 100644 index 0000000..a5112a0 --- /dev/null +++ b/pkg/Templates/File Templates/Apple ][/C File.xctemplate/WithHeader/___FILEBASENAME___.h @@ -0,0 +1,14 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +//___COPYRIGHT___ +// + +#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ +#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ + + + +#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */ diff --git a/pkg/createPackage b/pkg/createPackage new file mode 100755 index 0000000..45d48ec --- /dev/null +++ b/pkg/createPackage @@ -0,0 +1,20 @@ +#!/bin/bash + +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 ][/Apple ][ Asm Project.xctemplate/' +cp Makefile $TMPDIR/'Apple ][/Apple ][ Asm Project.xctemplate/' + +pkgbuild --root $TMPDIR --version 1.1 --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 +rm temp.pkg + +rm -rf $TMPDIR diff --git a/pkg/scripts/.preinstall.swp b/pkg/scripts/.preinstall.swp new file mode 100644 index 0000000..19facba Binary files /dev/null and b/pkg/scripts/.preinstall.swp differ diff --git a/pkg/scripts/preinstall b/pkg/scripts/preinstall new file mode 100755 index 0000000..49a0001 --- /dev/null +++ b/pkg/scripts/preinstall @@ -0,0 +1,8 @@ +#!/bin/bash + +OLDTEMPLATE=~/"Library/Developer/Xcode/Templates/Apple ][/Apple ][ Project.xctemplate" + +if [ -d "$OLDTEMPLATE" ] +then + rm -rf "$OLDTEMPLATE" +fi