diff --git a/Makefile b/Makefile index ab229c9..0aac0de 100644 --- a/Makefile +++ b/Makefile @@ -33,11 +33,6 @@ PGM=___PACKAGENAME___ # MACHINE = apple2enh-system # MACHINE = apple2enh-loader # MACHINE = apple2enh-reboot -# -# These are special machine definitions beyond those defined in cc65 -# which are used for BASIC projects: -# MACHINE = apple2-basic -# MACHINE = apple2-dos33-basic # Uncomment and set this to your starting address in Apple II memory # if necessary: diff --git a/make/createDiskImage b/make/createDiskImage index 5b274a5..5073d32 100755 --- a/make/createDiskImage +++ b/make/createDiskImage @@ -1,5 +1,10 @@ #!/bin/sh +merlinStartAddr() { + awk '$1 ~ /^[oO][rR][gG]$/{print $2}' linkscript.s | sed 's/^[0$]*//' +} + + if [ $# -lt 5 ] then echo USAGE: $0 ' ' @@ -54,6 +59,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=1 FILETYPE="bin" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=15 ;; @@ -66,6 +72,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=1 FILETYPE="bin" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=15 ;; @@ -77,7 +84,8 @@ case "$MACHINE" in DELETEBASIC=0 COPYBINARY=1 HASHEADER=1 - FILETYPE="bin" + FILETYPE="B" + BASICFILETYPE="A" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=30 ;; @@ -89,7 +97,8 @@ case "$MACHINE" in DELETEBASIC=0 COPYBINARY=1 HASHEADER=1 - FILETYPE="bin" + FILETYPE="B" + BASICFILETYPE="A" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=30 ;; @@ -102,6 +111,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=0 FILETYPE="sys" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM`.system MAXFILENAMELEN=15 ;; @@ -114,6 +124,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=0 FILETYPE="sys" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM`.system MAXFILENAMELEN=15 ;; @@ -126,6 +137,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=1 FILETYPE="bin" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=15 ;; @@ -138,6 +150,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=1 FILETYPE="bin" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=15 ;; @@ -150,6 +163,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=1 FILETYPE="bin" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=15 ;; @@ -162,6 +176,7 @@ case "$MACHINE" in COPYBINARY=1 HASHEADER=1 FILETYPE="bin" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` MAXFILENAMELEN=15 ;; @@ -173,6 +188,7 @@ case "$MACHINE" in DELETEBASIC=0 COPYBINARY=0 FILETYPE="bas" + BASICFILETYPE="bas" TARGETFILE=`basename $PROGRAM` SOURCEFILE=${PROGRAM}.tok MAXFILENAMELEN=15 @@ -185,17 +201,54 @@ case "$MACHINE" in DELETEBASIC=0 COPYBINARY=0 FILETYPE="A" + BASICFILETYPE="A" TARGETFILE=`basename $PROGRAM` SOURCEFILE=${PROGRAM}.tok MAXFILENAMELEN=30 ;; + apple2-merlin) + TEMPLATE="make/prodos_template.dsk" + DELETELOADER=1 + RENAMELOADER=0 + DELETEBASIC=0 + COPYBINARY=1 + HASHEADER=0 + FILETYPE="bin" + BASICFILETYPE="bas" + TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=15 + + STARTADDR=`merlinStartAddr` + ;; + + apple2-dos33-merlin) + TEMPLATE="make/dos33_template.dsk" + DELETELOADER=0 + RENAMELOADER=0 + DELETEBASIC=0 + COPYBINARY=1 + HASHEADER=0 + FILETYPE="B" + BASICFILETYPE="A" + TARGETFILE=`basename $PROGRAM` + MAXFILENAMELEN=30 + + STARTADDR=`merlinStartAddr` + ;; + *) echo "Invalid machine type $MACHINE" exit 1 ;; esac +STARTARG="" +if [ ! -z "$STARTADDR" ] +then + STARTARG="0x$STARTADDR" +fi + if [ ! -f "$SOURCEFILE" ] then echo "Cannot file executable $SOURCEFILE" @@ -247,21 +300,23 @@ then HDR_STARTADDR=`od -t x2 -N 2 < "$SOURCEFILE" | head -1 | awk '{print $2}' | sed 's/^0*//'` if [ "$HDR_STARTADDR" = "$STARTADDR" ] then - dd if="$SOURCEFILE" bs=4 skip=1 | "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE 0x$STARTADDR + dd if="$SOURCEFILE" bs=4 skip=1 | "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE $STARTARG else - "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE 0x$STARTADDR < "$SOURCEFILE" + "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE $STARTARG < "$SOURCEFILE" fi else - "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE < "$SOURCEFILE" + "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$TARGETFILE" $FILETYPE $STARTARG < "$SOURCEFILE" fi fi for ITEM in $* do + # If this is a file matching *.tok, then this is an Applesoft BASIC file + # to copy to the disk image. if [ -f "$ITEM" ] && echo "$ITEM" | grep '\.tok$' > /dev/null then DESTFILE=`echo "$ITEM" | sed 's/\.tok$//'` - "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$DESTFILE" $FILETYPE 0x801 < "$ITEM" + "$JAVA" -jar "$APPLECOMMANDER" -p "$DISKIMAGE" "$DESTFILE" "$BASICFILETYPE" 0x801 < "$ITEM" continue fi diff --git a/make/head.mk b/make/head.mk index 0f3205f..86724c5 100644 --- a/make/head.mk +++ b/make/head.mk @@ -12,13 +12,17 @@ export CC65_HOME := /usr/local/lib/cc65 -CC65_BIN = /usr/local/bin +CC65_BIN=/usr/local/bin CL65=$(CC65_BIN)/cl65 CA65=$(CC65_BIN)/ca65 CC65=$(CC65_BIN)/cc65 CO65=$(CC65_BIN)/co65 +MERLIN_DIR=/usr/local +MERLIN_BIN=$(MERLIN_DIR)/bin/Merlin32 +MERLIN_LIB=$(MERLIN_DIR)/lib/Merlin + AC=make/AppleCommander.jar SRCDIRS=. diff --git a/make/tail.mk b/make/tail.mk index 2aee5ab..672ed4f 100644 --- a/make/tail.mk +++ b/make/tail.mk @@ -10,115 +10,165 @@ # http://www.quinndunki.com/blondihacks # -export PATH := $(PATH):$(CC65_BIN) +BUILD_TYPE := $(shell if echo $(MACHINE) | grep -q -- -basic; then echo basic; elif echo $(MACHINE) | grep -q -- -merlin; then echo merlin; else echo cc65; fi) CWD=$(shell pwd) -ifneq ($(DRIVERS),) - SRCDIRS+=$(DRVDIR) -endif +DISKIMAGE=$(PGM).dsk -C_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.c, $(SRCDIRS)))) -C_OBJS=$(C_SRCS:.c=.o) -C_DEPS=$(C_SRCS:.c=.u) - -ASM_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.s, $(SRCDIRS)))) -ASM_OBJS=$(ASM_SRCS:.s=.o) -ASM_LSTS=$(ASM_SRCS:.s=.lst) +EXECCMD= BASIC_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.bas, $(SRCDIRS)))) BASIC_OBJS=$(BASIC_SRCS:.bas=.tok) -OBJS=$(C_OBJS) $(ASM_OBJS) $(BASIC_OBJS) +ifeq ($(BUILD_TYPE),cc65) + export PATH := $(PATH):$(CC65_BIN) -MAPFILE=$(PGM).map -DISKIMAGE=$(PGM).dsk + ifneq ($(DRIVERS),) + SRCDIRS+=$(DRVDIR) + endif -LINK_ARGS= + C_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.c, $(SRCDIRS)))) + C_OBJS=$(C_SRCS:.c=.o) + C_DEPS=$(C_SRCS:.c=.u) -EXECCMD= + ASM_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.s, $(SRCDIRS)))) + ASM_OBJS=$(ASM_SRCS:.s=.o) + ASM_LSTS=$(ASM_SRCS:.s=.lst) -ALLTARGET=$(DISKIMAGE) + MAPFILE=$(PGM).map -ifneq ($(START_ADDR),) -# If the MACHINE is set to an option which does not support a variable start -# address, then error. - ifneq ($(filter $(MACHINE), apple2-system apple2enh-system apple2-basic apple2-dos33-basic),) - $(error You cannot change start address with this machine type) + ifneq ($(START_ADDR),) + # If the MACHINE is set to an option which does not support a variable + # start address, then error. + ifneq ($(filter $(MACHINE), apple2-system apple2enh-system),) + $(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 + ifneq ($(filter $(MACHINE), apple2-system apple2enh-system),) + START_ADDR=2000 + endif + ifneq ($(filter $(MACHINE), apple2-loader apple2-reboot apple2enh-loader apple2enh-reboot),) + START_ADDR=800 + endif + endif + + LDFLAGS += --start-addr 0x$(START_ADDR) + + ifneq ($(filter $(MACHINE), apple2 apple2enh apple2-dos33 apple2enh-dos33),) + EXECCMD=$(shell echo brun $(PGM) | tr '[a-z]' '[A-Z]') + endif + + # By default, use the a2 drivers. If the machine is one of the enhanced + # targets though, use the a2e drivers. + DRV_BASE_MACHINE=a2 + ifneq ($(filter $(MACHINE), apple2enh apple2enh-dos33 apple2enh-system apple2enh-loader apple2enh-reboot),) + DRV_BASE_MACHINE=a2e + endif + + MACHCONFIG= -t apple2 + + ifneq ($(filter $(MACHINE), apple2enh apple2enh-dos33 apple2enh-system apple2enh-loader apple2enh-reboot),) + MACHCONFIG= -t apple2enh + endif + + ifeq ($(filter $(MACHINE), apple2 apple2enh),) + MACHCONFIG += -C $(MACHINE).cfg 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 - ifneq ($(filter $(MACHINE), apple2-system apple2enh-system),) - START_ADDR=2000 - endif - ifneq ($(filter $(MACHINE), apple2-loader apple2-reboot apple2enh-loader apple2enh-reboot),) - START_ADDR=800 - endif - ifneq ($(filter $(MACHINE), apple2-basic apple2-dos33-basic),) - START_ADDR=801 - endif -endif -LDFLAGS += --start-addr 0x$(START_ADDR) + C_OBJS= + C_DEPS= -ifneq ($(filter $(MACHINE), apple2 apple2enh apple2-dos33 apple2enh-dos33),) + ASM_OBJS= + ASM_LSTS= +endif + +ifeq ($(BUILD_TYPE),merlin) + ASM_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.s, $(SRCDIRS)))) + MAPFILE=_Output.txt EXECCMD=$(shell echo brun $(PGM) | tr '[a-z]' '[A-Z]') endif -ifneq ($(filter $(MACHINE), apple2-basic apple2-dos33-basic),) +ifeq ($(BUILD_TYPE),basic) + MAPFILE= EXECCMD=$(shell echo run $(PGM) | tr '[a-z]' '[A-Z]') endif -# By default, use the a2 drivers. If the machine is one of the enhanced -# targets though, use the a2e drivers. -DRV_BASE_MACHINE=a2 -ifneq ($(filter $(MACHINE), apple2enh apple2enh-dos33 apple2enh-system apple2enh-loader apple2enh-reboot),) - DRV_BASE_MACHINE=a2e -endif +OBJS=$(C_OBJS) $(ASM_OBJS) $(BASIC_OBJS) -MACHCONFIG= -t apple2 +ALLTARGET=$(DISKIMAGE) -ifneq ($(filter $(MACHINE), apple2enh apple2apple2enh-dos33 apple2enh-system apple2enh-loader apple2enh-reboot),) - MACHCONFIG= -t apple2enh -endif -ifeq ($(filter $(MACHINE), apple2 apple2enh),) - MACHCONFIG += -C $(MACHINE).cfg -endif +.PHONY: build execute clean cleandrivers xcodefix -.PHONY: build execute clean xcodefix loresgr hiresgr auxmem joystick mouse serial - build: $(ALLTARGET) -clean: genclean - rm -f "$(PGM)" - rm -f $(OBJS) - rm -f $(C_DEPS) - rm -f $(MAPFILE) - rm -f $(ASM_LSTS) - rm -f "$(DISKIMAGE)" - rm -Rf "$(DRVDIR)" - -cleanMacCruft: - rm -rf pkg - -ifneq ($(filter $(MACHINE), apple2-basic apple2-dos33-basic),) -$(PGM): $(OBJS) - -else -$(PGM): $(OBJS) - make/errorFilter.sh $(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o "$(PGM)" $(OBJS) - -endif - $(DISKIMAGE): $(PGM) make/createDiskImage $(AC) $(MACHINE) "$(DISKIMAGE)" "$(PGM)" "$(START_ADDR)" $(BASIC_OBJS) $(COPYDIRS) execute: $(DISKIMAGE) osascript make/V2Make.scpt "$(CWD)" "$(PGM)" "$(CWD)/make/DevApple.vii" "$(EXECCMD)" +%.tok: %.bas + make/bt $< $(BASICFLAGS) -o $@ + +ifneq ($(DRIVERS),) +cleandrivers: + rm -Rf "$(DRVDIR)" + +else +cleandrivers: + +endif + +clean: genclean cleandrivers + rm -f "$(PGM)" $(OBJS) $(C_DEPS) $(MAPFILE) $(ASM_LSTS) "$(DISKIMAGE)" + +cleanMacCruft: + rm -rf pkg + +# Some gen phase stuff... +gen: xcodefix $(DRIVERS) + +xcodefix: + defaults write "$(CC65_PLUGIN_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)s -array `defaults read "$(XCODE_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)` + + +ifeq ($(BUILD_TYPE),basic) +# Build rules for BASIC projects + +$(PGM): $(OBJS) + cp $(PGM).tok $(PGM) + +$(OBJS): Makefile + + +endif + + +ifeq ($(BUILD_TYPE),merlin) +# Build rules for Merlin projects + +$(PGM): $(ASM_SRCS) Makefile + $(MERLIN_BIN) -V $(MERLIN_LIB) linkscript.s + rm -f _FileInformation.txt + +endif + + +ifeq ($(BUILD_TYPE),cc65) +# Build rules for cc65 projects + +$(PGM): $(OBJS) + make/errorFilter.sh $(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o "$(PGM)" $(OBJS) + +$(OBJS): Makefile + %.o: %.c make/errorFilter.sh $(CL65) $(MACHCONFIG) $(CFLAGS) --create-dep -c -o $@ $< sed -i .bak 's/\.s:/.o:/' $(@:.o=.u) @@ -127,19 +177,8 @@ execute: $(DISKIMAGE) %.o: %.s make/errorFilter.sh $(CL65) $(MACHCONFIG) --cpu $(CPU) $(ASMFLAGS) -l -c -o $@ $< -%.tok: %.bas - make/bt $< $(BASICFLAGS) -o $@ - -$(OBJS): Makefile - - -# Some gen phase stuff... -gen: xcodefix $(DRIVERS) - -xcodefix: - defaults write "$(CC65_PLUGIN_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)s -array `defaults read "$(XCODE_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)` - +.PHONY: loresgr hiresgr auxmem joystick mouse serial # Lores driver codegen loresgr: $(DRVDIR)/a2_lores_drv.s $(DRVDIR)/a2_lores_drv.h @@ -217,5 +256,7 @@ $(DRVDIR)/a2_serial_drv.h: echo '#include ' > $@ echo 'extern char a2_serial_drv;' >> $@ +endif + -include $(C_DEPS) diff --git a/pkg/Plug-ins/cc65.ideplugin/Contents/Resources/cc65.xcplugindata b/pkg/Plug-ins/cc65.ideplugin/Contents/Resources/cc65.xcplugindata index ed24aec..5d4e2f0 100755 --- a/pkg/Plug-ins/cc65.ideplugin/Contents/Resources/cc65.xcplugindata +++ b/pkg/Plug-ins/cc65.ideplugin/Contents/Resources/cc65.xcplugindata @@ -148,6 +148,77 @@ version 1.0 + Xcode.FileDataType.merlin.Assembly + + id + Xcode.FileDataType.merlin.Assembly + localizedDescription + Merlin Assembly Source + name + File type for Merlin assembly + point + Xcode.FileDataType + typeConformedTo + + + typeIdentifier + public.assembly-source + + + typeIdentifier + com.rand-family.xcode.merlin + version + 1.0 + + Xcode.FileDataTypeDetector.merlin.Assembly + + detectedTypeIdentifier + com.rand-family.xcode.merlin + id + Xcode.FileDataTypeDetector.merlin.Assembly + matchesExtension + s + point + Xcode.FileDataTypeDetector + + Xcode.SourceCodeLanguage.merlin-Assembly + + commentSyntax + + + prefix + ; + + + conformsTo + + + identifier + Xcode.SourceCodeLanguage.Generic + + + fileDataType + + + identifier + com.rand-family.xcode.merlin + + + id + Xcode.SourceCodeLanguage.merlin-Assembly + languageName + Merlin Assembly + languageSpecification + xcode.lang.asm.merlin + name + Merlin Assembly + point + Xcode.SourceCodeLanguage + supportsIndentation + true + version + 1.0 + diff --git a/pkg/Specifications/merlin.xclangspec b/pkg/Specifications/merlin.xclangspec new file mode 100644 index 0000000..893c62f --- /dev/null +++ b/pkg/Specifications/merlin.xclangspec @@ -0,0 +1,283 @@ +// Merlin Assembler language specs +( + +/****************************************************************************/ +// MARK: Keywords +/****************************************************************************/ + + { + Identifier = "xcode.lang.asm.merlin.identifier"; + Syntax = { + CaseSensitive = NO; + StartChars = ":;<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_{|}~"; + Chars = "0123456789:;<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_{|}~"; + Type = "xcode.syntax.identifier"; + }; + }, + + { + Identifier = "xcode.lang.asm.merlin.keyword"; + Syntax = { + CaseSensitive = NO; + StartChars = ":;<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_{|}~"; + Chars = "0123456789:;<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_{|}~"; + Words = ( + "]xcodestart", + "]xcodeend", + + "adc", + "adcl", + "and", + "andl", + "asl", + "bcc", + "blt", + "bcs", + "bge", + "beq", + "bge", + "bit", + "blt", + "bmi", + "bne", + "bpl", + "bra", + "brk", + "brl", + "bvc", + "bvs", + "clc", + "cld", + "cli", + "clv", + "cmp", + "cmpl", + "cop", + "cpa", + "cpx", + "cpy", + "dec", + "dex", + "dey", + "eor", + "eorl", + "inc", + "inx", + "iny", + "jmp", + "jmpl", + "jsl", + "jsr", + "lda", + "ldal", + "ldx", + "ldy", + "lsr", + "mvn", + "mvp", + "nop", + "ora", + "oral", + "pea", + "pei", + "per", + "pha", + "phb", + "phd", + "phk", + "php", + "phx", + "phy", + "pla", + "plb", + "pld", + "plp", + "plx", + "ply", + "rep", + "rol", + "ror", + "rti", + "rtl", + "rts", + "sbc", + "sbcl", + "sec", + "sed", + "sei", + "sep", + "sta", + "stal", + "stp", + "stx", + "sty", + "stz", + "tax", + "tay", + "tcd", + "tad", + "tas", + "tcs", + "tdc", + "tda", + "trb", + "tsb", + "tsc", + "tsa", + "tsx", + "txa", + "txs", + "txy", + "tya", + "tyx", + "wai", + "wdm", + "xba", + "swa", + "xce", + + "equ", + "ext", + "ent", + "org", + "dsk", + "sav", + "ds", + "rel", + "lnk", + "link", + "asm", + "sna", + "obj", + "put", + "putbin", + "use", + "var", + "knd", + "ali", + "typ", + "end", + "dum", + "dend", + "dat", + + "asc", + "dci", + "inv", + "fls", + "rev", + "str", + "strl", + + "da", + "dw", + "ddb", + "dfb", + "db", + "adr", + "adrl", + "hex", + "ds", + + "do", + "else", + "if", + "fin", + + "chk", + "err", + "lup", + "mx", + "usr", + "xc", + + "mac", + "eom", + "<<<", + "pmc", + ">>>", + + ); + Type = "xcode.syntax.keyword"; + AltType = "xcode.syntax.identifier"; + }; + }, + +/****************************************************************************/ +// MARK: Simple Syntax Coloring +/****************************************************************************/ + + { + Identifier = "xcode.lang.asm.merlin"; + Description = "Merlin Assembler Coloring"; + BasedOn = "xcode.lang.simpleColoring"; + IncludeInMenu = YES; + Name = "Assembly (Merlin)"; + Syntax = { + Tokenizer = "xcode.lang.asm.merlin.lexer"; + IncludeRules = ( + "xcode.lang.asm.merlin.codeblock", + ); + Type = "xcode.syntax.plain"; + }; + }, + { + Identifier = "xcode.lang.asm.merlin.lexer"; + Syntax = { + IncludeRules = ( + "xcode.lang.asm.merlin.comment.semi", + "xcode.lang.asm.merlin.comment.star", + "xcode.lang.asm.merlin.number", + "xcode.lang.asm.merlin.keyword", + "xcode.lang.asm.merlin.identifier", + ); + }; + }, + + { + Identifier = "xcode.lang.asm.merlin.comment.semi"; + Syntax = { + StartAtBOL = NO; + StartAtColumnZero = NO; + Start = ";"; + End = "\n"; + IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" ); + Type = "xcode.syntax.comment"; + }; + }, + + { + Identifier = "xcode.lang.asm.merlin.comment.star"; + Syntax = { + StartAtBOL = YES; + StartAtColumnZero = YES; + Start = "*"; + End = "\n"; + IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" ); + Type = "xcode.syntax.comment"; + }; + }, + + { + Identifier = "xcode.lang.asm.merlin.number"; + Syntax = { + StartChars = "#$%0123456789"; + Match = "[#$%0-9][<>^$]?[0-9A-Fa-f]*"; + Type = "xcode.syntax.number"; + }; + }, + + { + Identifier = "xcode.lang.asm.merlin.codeblock"; + Syntax = { + Tokenizer = "xcode.lang.asm.merlin.lexer"; + Start = "]xcodestart"; + End = "]xcodeend"; + Recursive = NO; + Foldable = YES; + Type = "xcode.syntax.definition.function"; + IncludeRules = ( + ); + }; + }, +) diff --git a/pkg/Templates/Apple II/Apple II Basic Project.xctemplate/Makefile b/pkg/Templates/Apple II/Apple II Basic Project.xctemplate/Makefile new file mode 100644 index 0000000..879a895 --- /dev/null +++ b/pkg/Templates/Apple II/Apple II Basic Project.xctemplate/Makefile @@ -0,0 +1,81 @@ +# +# Makefile +# Apple2BuildPipelineSample +# +# Part of a sample build pipeline for Apple II software development +# +# Created by Quinn Dunki on 8/15/14. +# One Girl, One Laptop Productions +# http://www.quinndunki.com +# http://www.quinndunki.com/blondihacks +# + +include make/head.mk + +# Customize this file to control what gets built, what machines to +# target, where in memory to put it, etc. + +# The name of your system or binary file to build goes here: +PGM=___PACKAGENAME___ + +# These are special machine definitions beyond those defined in cc65 +# which are used for BASIC projects: +MACHINE = apple2-basic +# MACHINE = apple2-dos33-basic + +# Add any other directories where you are putting other BASIC files +# to this list: +SRCDIRS+= + +# If you want to add arguments to the BASIC tokenizer commandline, +# add them to this valiable: +# BASICFLAGS += --optimize + +# 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 + +# If you want to copy one or more files or directories to the target disk +# image, add the root directory to this variable. All files will be +# copied from the source to the target using the same path from the source. +# +# For example, if you set COPYDIRS to dir and in your project you have +# the following files: +# dir/mySystemFile +# dir/newDir/anotherFile +# +# Then, during the copy phase, mySystemFile will be copied into the root +# of the disk and anotherFile will be copied into a directory named +# newDir. The newDir directory will be created if it does not already +# exist. +# +# The name of the file to copy is checked and if it ends in: +# .as - It assumes the file is in AppleSingle format. The .as +# suffix is stripped from the name when copied to the +# disk image. +# . - If the file ends with a single character which matches +# a DOS 3.3 file type (A, B, T, etc) it uses that value as +# the file type of the file copied to the disk image. The +# single character is removed from the file name. +# . - If the file ends with a three letter alpha extension, it +# uses that TLA as the file type of the file copied to the +# disk image. The TLA is removed from the file name. +# +# If you do not provide any type information for your filenames, +# it will be copied as a binary. +# +COPYDIRS= + +# Add any rules you want to execute before any compiles or assembly +# commands are called here, if any. You can generate .c, .s or .h +# files for example. You can generate data files. Whatever you +# might need. +gen: + +# For any files you generated in the gen target above, you should +# add rules in genclean to remove those generated files when you +# clean your build. +genclean: + +# Do not change anything else below here... +include make/tail.mk diff --git a/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/Makefile b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/Makefile new file mode 100644 index 0000000..de7af12 --- /dev/null +++ b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/Makefile @@ -0,0 +1,98 @@ +# +# Makefile +# Apple2BuildPipelineSample +# +# Part of a sample build pipeline for Apple II software development +# +# Created by Quinn Dunki on 8/15/14. +# One Girl, One Laptop Productions +# http://www.quinndunki.com +# http://www.quinndunki.com/blondihacks +# + +include make/head.mk + +# Customize this file to control what gets built, what machines to +# target, where in memory to put it, etc. + +# The name of your system or binary file to build goes here. Keep this +# name consistent with the "dsk" name from the linkscript.s file. +PGM=___PACKAGENAME___ + +# These are special machine definitions for ProDOS or DOS 3.3 Merlin +# projects: +MACHINE = apple2-merlin +# MACHINE = apple2-dos33-merlin + +# If you have a non-standard Merlin install, you may need to change +# some of these. Uncomment the following line and change it to the +# correct path to CC65_HOME if the default is not correct: +# MERLIN_DIR = /usr/local +# +# If the path to the Merlin binary is not correct, uncomment this line +# and change it: +# MERLIN_BIN = $(MERLIN_DIR)/bin/Merlin32 +# +# If the path to the Merlin library is not correct, uncomment this line +# and change it: +# MERLIN_LIB = $(MERLIN_DIR)/lib/Merlin + +# Add any other directories where you are putting C or assembly source +# files to this list. Note that you must manually add all source files +# to the linkscript.s file. All this does is help the build system +# see what files it should consider important to deciding whether to do +# a re-build. +SRCDIRS+= + +# If you want to add arguments to the BASIC tokenizer commandline, +# add them to this valiable: +# BASICFLAGS += --optimize + +# 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 + +# If you want to copy one or more files or directories to the target disk +# image, add the root directory to this variable. All files will be +# copied from the source to the target using the same path from the source. +# +# For example, if you set COPYDIRS to dir and in your project you have +# the following files: +# dir/mySystemFile +# dir/newDir/anotherFile +# +# Then, during the copy phase, mySystemFile will be copied into the root +# of the disk and anotherFile will be copied into a directory named +# newDir. The newDir directory will be created if it does not already +# exist. +# +# The name of the file to copy is checked and if it ends in: +# .as - It assumes the file is in AppleSingle format. The .as +# suffix is stripped from the name when copied to the +# disk image. +# . - If the file ends with a single character which matches +# a DOS 3.3 file type (A, B, T, etc) it uses that value as +# the file type of the file copied to the disk image. The +# single character is removed from the file name. +# . - If the file ends with a three letter alpha extension, it +# uses that TLA as the file type of the file copied to the +# disk image. The TLA is removed from the file name. +# +# If you do not provide any type information for your filenames, +# it will be copied as a binary. +# +COPYDIRS= + +# Add any rules you want to execute before any compiles or assembly +# commands are called here, if any. You can generate .c, .s or .h +# files for example. You can generate data files. Whatever you +# might need. +gen: + +# For any files you generated in the gen target above, you should +# add rules in genclean to remove those generated files when you +# clean your build. +genclean: + +# Do not change anything else below here... +include make/tail.mk diff --git a/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..729a9b9 --- /dev/null +++ b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/TemplateInfo.plist @@ -0,0 +1,214 @@ + + + + + Nodes + + linkscript.s + main.s + Makefile + make/AppleCommander.jar + make/bastokenizer-tools-bt-0.2.0.jar + make/createDiskImage + make/bt + make/DevApple.vii + make/dos33_template.dsk + make/errorFilter.sh + make/head.mk + make/prodos_template.dsk + make/tail.mk + make/V2Make.scpt + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Definitions + + linkscript.s + + Path + linkscript.s + + main.s + + Path + main.s + + make/V2Make.scpt + + Group + make + Path + make/V2Make.scpt + + make/errorFilter.sh + + Group + make + Path + make/errorFilter.sh + + 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/bt + + Group + make + Path + make/bt + + make/AppleCommander.jar + + Path + make/AppleCommander.jar + Group + make + + make/bastokenizer-tools-bt-0.2.0.jar + + Path + make/bastokenizer-tools-bt-0.2.0.jar + Group + make + + Makefile + + Path + Makefile + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + Group + + Supporting Files + + Path + ___PACKAGENAME___.xcscheme + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2MerlinAsmBuildSystem + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple II Merlin assembly code project. The project starts with a single assembly file which you can modify. + 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 + + + + + ProductType + com.apple.product-type.tool + TargetIdentifier + com.apple.dt.commandLineToolTarget + Name + doNotBuild + SharedSettings + + PRODUCT_NAME + doNotBuild + GCC_PREPROCESSOR_DEFINITIONS + __fastcall__="" + HEADER_SEARCH_PATHS + /usr/local/lib/cc65/include + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + CopyFiles + DstPath + /usr/share/man/man1/ + DstSubfolderSpec + 0 + RunOnlyForDeploymentPostprocessing + YES + + + + + + diff --git a/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/___PACKAGENAME___.xcscheme similarity index 100% rename from pkg/Templates/Apple II/Apple II Asm Project.xctemplate/___PACKAGENAME___.xcscheme rename to pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/___PACKAGENAME___.xcscheme diff --git a/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/linkscript.s b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/linkscript.s new file mode 100644 index 0000000..c04248a --- /dev/null +++ b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/linkscript.s @@ -0,0 +1,16 @@ +* +* ___FILENAME___ +* ___PROJECTNAME___ +* +* Created by ___FULLUSERNAME___ on ___DATE___. +* ___COPYRIGHT___ + + + typ $06 ; Binary file at fixed address + + dsk ___PROJECTNAME___ + org $803 + + asm main.s + sna main + diff --git a/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/main.s b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/main.s new file mode 100644 index 0000000..4781948 --- /dev/null +++ b/pkg/Templates/Apple II/Apple II Merlin Project.xctemplate/main.s @@ -0,0 +1,39 @@ +* +* ___FILENAME___ +* ___PROJECTNAME___ +* +* Created by ___FULLUSERNAME___ on ___DATE___. +* ___COPYRIGHT___ +* + +]XCODESTART ; Keep this at the start and put your code after this + +COUT equ $fded +KEYBOARD equ $c000 +STROBE equ $c010 +DOSWARM equ $3d0 +CR equ #$8d + +START lda CR + jsr COUT + + ldx #$00 +LOOP lda MSG,X + beq WAIT + jsr COUT + inx + jmp LOOP + +WAIT lda KEYBOARD + bpl WAIT + lda STROBE + + lda CR + jsr COUT + + jmp DOSWARM + +MSG asc "HELLO, WORLD",00 + +]XCODEEND ; Keep this at the end and put your code above this + diff --git a/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/TemplateInfo.plist similarity index 95% rename from pkg/Templates/Apple II/Apple II Asm Project.xctemplate/TemplateInfo.plist rename to pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/TemplateInfo.plist index 9d9cfd8..1cca47d 100644 --- a/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/TemplateInfo.plist +++ b/pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/TemplateInfo.plist @@ -121,7 +121,7 @@ Kind Xcode.Xcode3.ProjectTemplateUnitKind Identifier - com.halcyontouch.apple2AsmBuildSystem + com.halcyontouch.apple2Ca65BuildSystem Ancestors com.apple.dt.unit.externalBuildSystem @@ -129,7 +129,7 @@ Concrete Description - 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. + This template creates an Apple II ca65 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 II/Apple II C Project.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/___PACKAGENAME___.xcscheme similarity index 100% rename from pkg/Templates/Apple II/Apple II C Project.xctemplate/___PACKAGENAME___.xcscheme rename to pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/___PACKAGENAME___.xcscheme diff --git a/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/main.s b/pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/main.s similarity index 69% rename from pkg/Templates/Apple II/Apple II Asm Project.xctemplate/main.s rename to pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/main.s index 96ac6fe..235cf0c 100644 --- a/pkg/Templates/Apple II/Apple II Asm Project.xctemplate/main.s +++ b/pkg/Templates/Apple II/Apple II ca65 Project.xctemplate/main.s @@ -6,12 +6,15 @@ ; ___COPYRIGHT___ ; +.include "apple2.inc" COUT = $fded -KEYBOARD = $c000 -STROBE = $c010 +CR = $8d .proc main + lda #CR + jsr COUT + ldx #$00 loop: lda msg, X @@ -22,10 +25,15 @@ loop: jmp loop wait: - lda KEYBOARD + lda KBD bpl wait - lda STROBE - rts + lda KBDSTRB + + lda #CR + jsr COUT + + jmp DOSWARM .endproc msg: .asciiz "HELLO, WORLD" + diff --git a/pkg/Templates/Apple II/Apple II C Project.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple II/Apple II cc65 Project.xctemplate/TemplateInfo.plist similarity index 96% rename from pkg/Templates/Apple II/Apple II C Project.xctemplate/TemplateInfo.plist rename to pkg/Templates/Apple II/Apple II cc65 Project.xctemplate/TemplateInfo.plist index 890834d..51d616d 100644 --- a/pkg/Templates/Apple II/Apple II C Project.xctemplate/TemplateInfo.plist +++ b/pkg/Templates/Apple II/Apple II cc65 Project.xctemplate/TemplateInfo.plist @@ -121,7 +121,7 @@ Kind Xcode.Xcode3.ProjectTemplateUnitKind Identifier - com.halcyontouch.apple2CBuildSystem + com.halcyontouch.apple2Cc65BuildSystem Ancestors com.apple.dt.unit.externalBuildSystem @@ -129,7 +129,7 @@ Concrete Description - 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. + This template creates an Apple II cc65 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/Apple II/Apple II cc65 Project.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple II/Apple II cc65 Project.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 0000000..61815a2 --- /dev/null +++ b/pkg/Templates/Apple II/Apple II cc65 Project.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateIcon.png similarity index 100% rename from pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon.png rename to pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateIcon.png diff --git a/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateIcon@2x.png similarity index 100% rename from pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateIcon@2x.png rename to pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateIcon@2x.png diff --git a/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..590728d --- /dev/null +++ b/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/TemplateInfo.plist @@ -0,0 +1,20 @@ + + + + + AllowedTypes + + com.rand-family.xcode.merlin + + DefaultCompletionName + File + Description + A Merlin assembly source file. + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + MainTemplateFile + ___FILEBASENAME___.s + Summary + A Merlin assembly source file + + diff --git a/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/___FILEBASENAME___.s b/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/___FILEBASENAME___.s new file mode 100755 index 0000000..1253eab --- /dev/null +++ b/pkg/Templates/File Templates/Apple II/Merlin Assembly File.xctemplate/___FILEBASENAME___.s @@ -0,0 +1,16 @@ +* +* ___FILENAME___ +* ___PROJECTNAME___ +* +* Created by ___FULLUSERNAME___ on ___DATE___. +* ___COPYRIGHT___ +* + +]XCODESTART ; Keep this at the start and put your code after this + +* Put your code here. We need these markers to convince Xcode to indent +* properly. If you delete them or put your code outside the markers, your +* build will work but the Xcode editor will be annoying. + +]XCODEEND ; Keep this at the end and put your code above this + diff --git a/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..4786b7e Binary files /dev/null and b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateIcon.png differ diff --git a/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..21d5bd1 Binary files /dev/null and b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateIcon@2x.png differ diff --git a/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateInfo.plist similarity index 85% rename from pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateInfo.plist rename to pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateInfo.plist index b607635..01f3e82 100644 --- a/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/TemplateInfo.plist +++ b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/TemplateInfo.plist @@ -9,12 +9,12 @@ DefaultCompletionName File Description - An assembly source file. + A ca65 assembly source file. Kind Xcode.IDEKit.TextSubstitutionFileTemplateKind MainTemplateFile ___FILEBASENAME___.s Summary - An assembly source file + A ca65 assembly source file diff --git a/pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/___FILEBASENAME___.s b/pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/___FILEBASENAME___.s similarity index 100% rename from pkg/Templates/File Templates/Apple II/Assembly File.xctemplate/___FILEBASENAME___.s rename to pkg/Templates/File Templates/Apple II/ca65 Assembly File.xctemplate/___FILEBASENAME___.s diff --git a/pkg/createPackage b/pkg/createPackage index 23041a1..7ed022a 100755 --- a/pkg/createPackage +++ b/pkg/createPackage @@ -7,17 +7,18 @@ cp -R pkg/Templates $TMPDIR cp -R pkg/Specifications $TMPDIR cp -R pkg/Plug-ins $TMPDIR -cp -R make $TMPDIR/Templates/'Apple II/Apple II C Project.xctemplate/' -cp Makefile $TMPDIR/Templates/'Apple II/Apple II C Project.xctemplate/' -cp main.c $TMPDIR/Templates/'Apple II/Apple II C Project.xctemplate/' +cp -R make $TMPDIR/Templates/'Apple II/Apple II cc65 Project.xctemplate/' +cp Makefile $TMPDIR/Templates/'Apple II/Apple II cc65 Project.xctemplate/' +cp main.c $TMPDIR/Templates/'Apple II/Apple II cc65 Project.xctemplate/' -cp -R make $TMPDIR/Templates/'Apple II/Apple II Asm Project.xctemplate/' -cp Makefile $TMPDIR/Templates/'Apple II/Apple II Asm Project.xctemplate/' +cp -R make $TMPDIR/Templates/'Apple II/Apple II ca65 Project.xctemplate/' +cp Makefile $TMPDIR/Templates/'Apple II/Apple II ca65 Project.xctemplate/' cp -R make $TMPDIR/Templates/'Apple II/Apple II Basic Project.xctemplate/' -sed 's/^# MACHINE = apple2-basic/MACHINE = apple2-basic/' < Makefile > $TMPDIR/Templates/'Apple II/Apple II Basic Project.xctemplate'/Makefile -pkgbuild --root $TMPDIR --version 2.0 --identifier com.halcyontouch.Apple2Template.pkg --install-location /Library/Developer/Xcode/ --scripts pkg/scripts/ AppleXcodeTemplate.pkg +cp -R make $TMPDIR/Templates/'Apple II/Apple II Merlin Project.xctemplate/' + +pkgbuild --root $TMPDIR --version 2.2 --identifier com.halcyontouch.Apple2Template.pkg --install-location /Library/Developer/Xcode/ --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/postinstall b/pkg/scripts/postinstall index 67e9beb..cace3c9 100755 --- a/pkg/scripts/postinstall +++ b/pkg/scripts/postinstall @@ -1,3 +1,11 @@ #!/bin/bash -defaults write ~/Library/Developer/Xcode/Plug-ins/cc65.ideplugin/Contents/Info.plist DVTPlugInCompatibilityUUIDs -array $(defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID) +if [ ! -f /Applications/Xcode.app/Contents/Info.plist ] +then + exit 0 +fi + +UUID=`defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID` + +defaults write "$2/Plug-ins/cc65.ideplugin/Contents/Info.plist" DVTPlugInCompatibilityUUIDs -array-add "${UUID}" + diff --git a/pkg/scripts/preinstall b/pkg/scripts/preinstall index 135e3d6..d0a0464 100755 --- a/pkg/scripts/preinstall +++ b/pkg/scripts/preinstall @@ -1,9 +1,6 @@ #!/bin/bash -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 +rm -rf "$2/Templates/Apple II" +rm -rf "$2/Templates/File Templates/Apple II" +rm -rf "$2/Plug-ins/cc65.ideplugin" +