From b6b8942068e049c81103f7b7e771f39224a65b9e Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Wed, 10 Sep 2014 22:21:21 -0400 Subject: [PATCH] Only try to launch Virtual ][ if building from Mac OSX. Enforce Prodos and DOS 3.3 filename limits when creating the disk image. --- Makefile | 3 ++- make/V2Make.scpt | Bin 4764 -> 4742 bytes make/createDiskImage | 25 ++++++++++++++++++++++++- make/tail.mk | 9 ++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 75656c4..fc158c7 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ include make/head.mk # target, where in memory to put it, etc. # The name of your system or binary file to build goes here: -PGM=example +PGM=notaslon # Set the config you are building for. See these pages for details: # http://cc65.github.io/cc65/doc/apple2.html#s4 @@ -33,6 +33,7 @@ PGM=example # MACHINE = apple2enh-system # MACHINE = apple2enh-loader # MACHINE = apple2enh-reboot +MACHINE = apple2-loader # Uncomment and set this to your starting address in Apple ][ memory # if necessary: diff --git a/make/V2Make.scpt b/make/V2Make.scpt index 52d451d938406b185f6305c4e11a3010e829738c..7f623e571add293dbb6d675a4096a017b360293e 100644 GIT binary patch delta 35 pcmbQE+NQeUsi2?$LmopuLkUA7Loq`Rkd-(2i(m;O!{kOGX#lyx3Ge^_ delta 57 zcmZououj(psUSZeLn=cBLn1>iLjgk$L+a#jf+dm?3{DI|4518u3Px# diff --git a/make/createDiskImage b/make/createDiskImage index 4ac697f..a774419 100755 --- a/make/createDiskImage +++ b/make/createDiskImage @@ -28,6 +28,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=15 ;; apple2enh) @@ -38,6 +39,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=15 ;; apple2-dos33) @@ -48,6 +50,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=30 ;; apple2enh-dos33) @@ -58,6 +61,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=30 ;; apple2-system) @@ -68,6 +72,7 @@ case "$MACHINE" in HASHEADER=0 FILETYPE="sys" TARGETFILE=`basename $PROGRAM`.system + MAXFILENAMELEN=15 ;; apple2enh-system) @@ -78,6 +83,7 @@ case "$MACHINE" in HASHEADER=0 FILETYPE="sys" TARGETFILE=`basename $PROGRAM`.system + MAXFILENAMELEN=15 ;; apple2-loader) @@ -88,6 +94,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=15 ;; apple2-reboot) @@ -98,6 +105,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=15 ;; apple2enh-loader) @@ -108,6 +116,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=15 ;; apple2enh-reboot) @@ -118,6 +127,7 @@ case "$MACHINE" in HASHEADER=1 FILETYPE="bin" TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=8 ;; *) @@ -126,6 +136,12 @@ case "$MACHINE" in ;; esac +if [ ${#TARGETFILE} -gt $MAXFILENAMELEN ] +then + echo "The filename $TARGETFILE exceeds the max name length of the filesystem ($MAXFILENAMELEN)" + exit 1 +fi + if [ ! -f "$TEMPLATE" ] then echo "Cannot file template disk image $TEMPLATE" @@ -141,7 +157,14 @@ fi if [ $RENAMELOADER -eq 1 ] then - java -jar "$APPLECOMMANDER" -e "$DISKIMAGE" LOADER.SYSTEM | java -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE".system sys + LOADERFILE=${TARGETFILE}.system + if [ ${#LOADERFILE} -gt $MAXFILENAMELEN ] + then + echo "The filename $LOADERFILE exceeds the max name length of the filesystem ($MAXFILENAMELEN)" + 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 fi diff --git a/make/tail.mk b/make/tail.mk index 917fc62..4600f6d 100644 --- a/make/tail.mk +++ b/make/tail.mk @@ -25,6 +25,12 @@ LINK_ARGS= EXECCMD= +ALLTARGET=$(DISKIMAGE) +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + ALLTARGET=execute +endif + ifneq ($(START_ADDR),) # If the MACHINE is set to an option which does not support a variable start # address, then error. @@ -32,6 +38,7 @@ ifneq ($(START_ADDR),) $(error You cannot change start address with this machine type) endif else + # If not set, then use the default for the config as per cc65 documentation ifneq ($(filter $(MACHINE), apple2 apple2-dos33 apple2enh apple2enh-dos33),) START_ADDR=803 endif @@ -60,7 +67,7 @@ endif .PHONY: all execute clean -all: execute +all: $(ALLTARGET) clean: rm -f $(PGM)