From a8026c6677e25442ce74c01f08dbfbd4e7f2388a Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Sat, 25 Oct 2014 22:32:07 -0400 Subject: [PATCH] Add some code to search standard Mac OS X locations for java. Bump the version number to 1.2 --- Makefile | 4 ++++ README.md | 10 +++++----- make/createDiskImage | 35 ++++++++++++++++++++++++++++------- pkg/.createPackage.swp | Bin 12288 -> 0 bytes pkg/createPackage | 2 +- pkg/scripts/.preinstall.swp | Bin 12288 -> 0 bytes 6 files changed, 38 insertions(+), 13 deletions(-) delete mode 100644 pkg/.createPackage.swp delete mode 100644 pkg/scripts/.preinstall.swp diff --git a/Makefile b/Makefile index c6dd3f2..fd44ae9 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,10 @@ PGM=___PACKAGENAME___ # this variable: # LDFLAGS += -v +# If you have java installed in a non-standard location, you can set +# the path to it by uncommenting the following line: +# export JAVA=/usr/bin/java + # Do not change anything else below here... include make/tail.mk diff --git a/README.md b/README.md index caa4f81..6e349dd 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This project was built based on the one created by [Quinn Dunki](http://quinndun * 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 \]\[ Project" option. Select that and you will have a new Apple \]\[ project ready to go. + * 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. Mac OS X Installation: ---------------------- @@ -21,21 +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.1/AppleXcodeTemplate.pkg). - 5. Install and setup [Virtual \]\[](http://www.virtualii.com). + 3. Install the [Apple // project template](https://github.com/jeremysrand/Apple2BuildPipeline/releases/download/1.1/AppleXcodeTemplate.pkg). + 4. 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 \]\[ C 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" 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". 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. 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. + 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. UNIX Installation: ------------------ diff --git a/make/createDiskImage b/make/createDiskImage index a774419..276c036 100755 --- a/make/createDiskImage +++ b/make/createDiskImage @@ -6,6 +6,27 @@ then exit 1 fi +if [ -z "$JAVA" ] +then + for item in "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home" /Library/Java/JavaVirtualMachines/*/Contents/Home /usr + do + if [ -x "$item/bin/java" ] + then + JAVA="$item/bin/java" + break + fi + done +fi + +if [ -z "$JAVA" ] +then + echo Cannot find a path to a Java runtime. + echo Go to https://java.com/download if you do not have Java. + echo If you do have Java, you may need to uncomment the JAVA + echo line in the Makefile and set it to the path for your + echo Java runtime binary. + exit 1 +fi APPLECOMMANDER=$1 MACHINE=$2 @@ -152,7 +173,7 @@ cp "$TEMPLATE" "$DISKIMAGE" if [ $DELETELOADER -eq 1 ] then - java -jar "$APPLECOMMANDER" -d "$DISKIMAGE" LOADER.SYSTEM + "$JAVA" -jar "$APPLECOMMANDER" -d "$DISKIMAGE" LOADER.SYSTEM fi if [ $RENAMELOADER -eq 1 ] @@ -164,13 +185,13 @@ then rm -f "$DISKIMAGE" exit 1 fi - java -jar "$APPLECOMMANDER" -e "$DISKIMAGE" LOADER.SYSTEM | java -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$LOADERFILE" sys - java -jar "$APPLECOMMANDER" -d "$DISKIMAGE" LOADER.SYSTEM + "$JAVA" -jar "$APPLECOMMANDER" -e "$DISKIMAGE" LOADER.SYSTEM | "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$LOADERFILE" sys + "$JAVA" -jar "$APPLECOMMANDER" -d "$DISKIMAGE" LOADER.SYSTEM fi if [ $DELETEBASIC -eq 1 ] then - java -jar "$APPLECOMMANDER" -d "$DISKIMAGE" BASIC.SYSTEM + "$JAVA" -jar "$APPLECOMMANDER" -d "$DISKIMAGE" BASIC.SYSTEM fi if [ $HASHEADER -eq 1 ] @@ -178,10 +199,10 @@ then HDR_STARTADDR=`od -t x2 -N 2 < "$PROGRAM" | head -1 | awk '{print $2}' | sed 's/^0*//'` if [ "$HDR_STARTADDR" = "$STARTADDR" ] then - dd if="$PROGRAM" bs=4 skip=1 | java -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE 0x$STARTADDR + dd if="$PROGRAM" bs=4 skip=1 | "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE 0x$STARTADDR else - java -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE 0x$STARTADDR < "$PROGRAM" + "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE 0x$STARTADDR < "$PROGRAM" fi else - java -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE < "$PROGRAM" + "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE < "$PROGRAM" fi diff --git a/pkg/.createPackage.swp b/pkg/.createPackage.swp deleted file mode 100644 index 3bd996ed18b220ad1f750d4cc28f564887b0706f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2OK%e~5XT)j@hFtX70E4;iiEOm0um<vutILNnw##~_4PG+|h%$ZN>#RGHn?vakKsms9MJ01`j~NB{{S0VIF~kN^@u0!RP} zAb}G|z=t3FAI}p~TY=!=|9|!U|N9~#zd%1hKR{nWUqEj`_d(}CXF>ZH2>Aed5Bdf^ z-hd?N8t4*e736%M0qw&%pF!_Hk3oIV0}wVOfCP{L5(#Dg+kk{BIk+@^9A(?%oj*4twD7$)M7&7p-w=gv0I2Fph)lum@9 zoi^>nsr8i-W_^|-&5N3!aUF^QWUZiTInNxX^FH=k|dG zZ!c1?$B0yCh70Ps;^^7g1SXXmqqU{=;vIm+t}v-{*z}q(lOfb!%b|oUxQ@KBulQ8Q zR%d+dsQiI}eOKl7aEfl)>98c(6QYRvD%Y%u;S-V$(d0a?IvoAUvU6 ze&LW&D;m)R(BSH-K>q4sx;1u|xVpN`2N7WQ_q diff --git a/pkg/createPackage b/pkg/createPackage index 45d48ec..ce91221 100755 --- a/pkg/createPackage +++ b/pkg/createPackage @@ -11,7 +11,7 @@ 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 +pkgbuild --root $TMPDIR --version 1.2 --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.swp b/pkg/scripts/.preinstall.swp deleted file mode 100644 index 19facbaa8088bc4f1649f7f9fea28f6957198949..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&zfJ-%90%~Ci;L0d3zU<^0g8VTT{J;)FhXQNV?s#0KLv`V*Yt|fK};Nd1zmgv zUristo}R`qz^r_meDmvFdw=@bF4v%Zeq5(JrETKcG9fSPC(XxJiM-C|NZO3zPe zk}Gvvl5yzEi8Du^H)Pc~91gg$39D!=`C%Lh)&1&kX60ZgWYiFvOQAT^S6!BbMre15 zHe9I0`f~E4CcXy-Auw|SL)$6tE|RUyjdHs7H7`$BSI%aR0Skrz1Rwwb2tWV=5P-le z3s{{a_YPn#Ls-aaZmed9C=h@E1Rwwb2tWV=5P$##AOHaf{6PWV{opSw5pwC0{{R2} z{(pDJZ!XU+Pc9EGcP^nzI=AS81_1~_00Izz00bZa0SG_<0ucCj0y3eaG^{29Vv;F&(n76r$ZYi?(@)=ZbF;Ap6B-d=2;*V3;d)