commit 94cf6683987426151661f65219c20513b03b9bc5 Author: Jeremy Rand Date: Tue May 16 22:34:15 2017 -0400 Initial commit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0dfa38c --- /dev/null +++ b/Makefile @@ -0,0 +1,59 @@ +# +# Makefile +# Apple //GS Build Engine for ORCA +# + +include make/head.mk + +# Customize this file to control what kind of project you are working on, +# where to find files, etc. + +# The name of your system or binary file to build goes here: +PGM=___PACKAGENAME___ + +# Set the target type you would like to build. The options are: +# shell - A shell command for ORCA, GNO or other GS shell +# desktop - A full desktop application +# cda - A classic desk accessory +# cdev - A control panel device +# nba - A HyperStudio new button action +# nda - A new desk accessory +# xcmd - A HyperCard XCMD or XCFN +# +TARGETTYPE=shell +# TARGETTYPE=desktop +# TARGETTYPE=cda +# TARGETTYPE=cdev +# TARGETTYPE=nba +# TARGETTYPE=nda +# TARGETTYPE=xcmd + +# Add any other directories where you are putting C or assembly source +# files to this list: +# SRCDIRS+= + +# If you put your main entry point for your project in a file called main.c +# Then you don't need to change this value. If you want to call your entry +# point something other than main.c, set this variable to point to this file. +ROOTCFILE=main.c + +# Add any arguments you want passed to the C compiler to this variable: +CFLAGS+= + +# Add any arguments you want passed to the resource compiler to this variable: +REZFLAGS+= + +# Add any arguments you want passed to the macro generator to this variable: +MACGENFLAGS+= + +# Add any other macro libraries to include in this variable: +MACGENMACROS+= + +# Add any arguments you want passed to the assembler to this variable: +ASMFLAGS+= + +# Add any arguments you want passed to the linker to this variable: +LDFLAGS+= + +# Do not change anything else below here... +include make/tail.mk diff --git a/make/.DS_Store b/make/.DS_Store new file mode 100644 index 0000000..a0d8d64 Binary files /dev/null and b/make/.DS_Store differ diff --git a/make/head.mk b/make/head.mk new file mode 100644 index 0000000..a062f62 --- /dev/null +++ b/make/head.mk @@ -0,0 +1,37 @@ +# +# head.mk +# + +ORCA_HOME := $(HOME)/orca + +ORCA_BINDIR = /usr/local/bin + +export ORCA=$(ORCA_BINDIR)/orca + +AC=make/AppleCommander.jar + +TARGETTYPE=shell + +SRCDIRS=. + +COMPILE=make/orca-cc +CFLAGS= -P -I +ROOTCFILE=main.c +DEFINES= +INCLUDE_PATHS= + +REZ=make/orca-rez +REZFLAGS= + +MACGEN=$(ORCA) macgen +MACGENFLAGS=-P +MACGENMACROS=$(wildcard $(ORCA_HOME)/libraries/ORCAInclude/m*) + +ASSEMBLE=make/orca-asm +ASMFLAGS=-P + +LINK=$(ORCA) link +LDFLAGS=-P + +RM=rm -f +CP=cp diff --git a/make/orca-asm b/make/orca-asm new file mode 100755 index 0000000..cb73ce9 --- /dev/null +++ b/make/orca-asm @@ -0,0 +1,18 @@ +#!/bin/bash + +FILENAME="$1" +shift + +if echo $FILENAME | grep -v '\.s$' > /dev/null +then + echo Expected first argument to be a *.s file but got $FILENAME + exit 1 +fi + +DIRNAME=`dirname $FILENAME` +BASENAME=`basename $FILENAME .s` + +cd "$DIRNAME" +$ORCA assemble $* keep="${BASENAME}" "${BASENAME}.s" +RESULT=$? +exit $RESULT diff --git a/make/orca-cc b/make/orca-cc new file mode 100755 index 0000000..6e7df1e --- /dev/null +++ b/make/orca-cc @@ -0,0 +1,66 @@ +#!/bin/bash + +TMPFILE=/tmp/orca-cc.$$ + +FILENAME="$1" +shift + +if echo $FILENAME | grep -v '\.c$' > /dev/null +then + echo Expected first argument to be a *.c file but got $FILENAME + exit 1 +fi + +CCARGS="" +COMPILEARGS="" +for ARG in $* +do + if echo $ARG | grep '^-[id]' > /dev/null + then + CCARGS="$CCARGS cc=$ARG" + else + COMPILEARGS="$COMPILEARGS $ARG" + fi +done + +BASENAME=`echo $FILENAME | sed 's/\.c$//'` +DEPSNAME="${BASENAME}.d" +OBJSNAME="${BASENAME}.a" +ROOTNAME="${BASENAME}.root" + +$ORCA --trace-gsos compile $COMPILEARGS "$FILENAME" keep="${BASENAME}" $CCARGS 2> $TMPFILE +RESULT=$? + +sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2 + +if [ "$RESULT" -ne 0 ] +then + rm -f $TMPFILE + rm -f $OBJSNAME + rm -f $ROOTNAME + exit $RESULT +fi + +DEPS=`awk ' + /^FastFileLoad/ { + sub(/^FastFileLoad\(/, ""); + sub(/\)$/, ""); + print}' $TMPFILE | sort -u | while read FILE + do + if [ -f "$FILE" ] + then + echo $FILE + fi + done | tr '\012' ' '` + +rm -f $TMPFILE + +# We add a dependency for both the .o and the .root file. If this is the +# main.c file being compiled, we need the dependency on the .root file. +cat > $DEPSNAME << EOF +$OBJSNAME: $DEPS + +$ROOTNAME: $DEPS +EOF + +exit 0 diff --git a/make/orca-rez b/make/orca-rez new file mode 100755 index 0000000..da6c137 --- /dev/null +++ b/make/orca-rez @@ -0,0 +1,45 @@ +#!/bin/bash + +TMPFILE=/tmp/orca-rez.$$ + +FILENAME="$1" +shift + +if echo $FILENAME | grep -v '\.rez$' > /dev/null +then + echo Expected first argument to be a *.rez file but got $FILENAME + exit 1 +fi + +BASENAME=`echo $FILENAME | sed 's/\.rez$//'` +DEPSNAME="${BASENAME}.rez.d" +OBJSNAME="${BASENAME}.r" + +$ORCA --trace-gsos compile $* keep="${OBJSNAME}" "$FILENAME" 2> $TMPFILE +RESULT=$? + +sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2 + +if [ "$RESULT" -ne 0 ] +then + rm -f $TMPFILE + rm -f $OBJSNAME + exit $RESULT +fi + +DEPS=`awk ' + /^FastFileLoad/ { + sub(/^FastFileLoad\(/, ""); + sub(/\)$/, ""); + print}' $TMPFILE | sort -u | while read FILE + do + if [ -f "$FILE" ] + then + echo $FILE + fi + done` + +echo $OBJSNAME: $DEPS > $DEPSNAME +rm -f $TMPFILE + +exit 0 diff --git a/make/tail.mk b/make/tail.mk new file mode 100644 index 0000000..09e6e8f --- /dev/null +++ b/make/tail.mk @@ -0,0 +1,111 @@ +# +# tail.mk +# + +export PATH := $(PATH):$(ORCA_BIN) + +CWD=$(shell pwd) + +ifeq ($(wildcard $(ROOTCFILE)),) + ROOTCFILE= +endif + +C_ROOTS=$(ROOTCFILE:.c=.root) +C_SRCS+=$(filter-out $(ROOTCFILE), $(patsubst ./%, %, $(wildcard $(addsuffix /*.c, $(SRCDIRS))))) +C_OBJS=$(C_SRCS:.c=.a) +C_DEPS=$(ROOTCFILE:.c=.d) $(C_SRCS:.c=.d) + +ASM_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.s, $(SRCDIRS)))) +ASM_MACROS=$(ASM_SRCS:.s=.macros) +ASM_ROOTS=$(ASM_SRCS:.s=.ROOT) +ASM_OBJS=$(ASM_SRCS:.s=.a) + +REZ_SRCS=$(patsubst ./%, %, $(wildcard $(addsuffix /*.rez, $(SRCDIRS)))) +REZ_DEPS=$(REZ_SRCS:.rez=.rez.d) +REZ_OBJS=$(REZ_SRCS:.rez=.r) + +ifneq ($(firstword $(REZ_SRCS)), $(lastword $(REZ_SRCS))) + $(error Only a single resource file supported, found $(REZ_SRCS)) +endif + +BUILD_OBJS=$(C_ROOTS) $(C_OBJS) $(ASM_ROOTS) $(REZ_OBJS) +BUILD_OBJS_NOSUFFIX=$(C_ROOTS:.root=) $(C_OBJS:.a=) $(ASM_ROOTS:.ROOT=) + +ALL_OBJS=$(C_ROOTS:.root=.a) $(C_OBJS) $(ASM_OBJS) $(REZ_OBJS) +ALL_ROOTS=$(C_ROOTS) $(C_OBJS:.a=.root) $(ASM_ROOTS) +ALL_DEPS=$(C_DEPS) $(REZ_DEPS) + +LINK_ARGS= + +EXECCMD= + +#ALLTARGET=$(DISKIMAGE) +ifeq ($(TARGETTYPE),shell) + ALLTARGET=execute +else + ALLTARGET=$(PGM) +endif + +.PHONY: all execute clean + +#.PRECIOUS: $(ASM_MACROS) + +all: $(ALLTARGET) + +clean: + $(RM) "$(PGM)" + $(RM) $(ALL_OBJS) + $(RM) $(ALL_ROOTS) + $(RM) $(ALL_DEPS) + $(RM) $(ASM_MACROS) +# $(RM) "$(DISKIMAGE)" + +createPackage: + pkg/createPackage + +cleanMacCruft: + rm -rf pkg + +$(PGM): $(BUILD_OBJS) +ifneq ($(REZ_OBJS),) + $(RM) $(PGM) + $(CP) $(REZ_OBJS) $(PGM) +endif + $(LINK) $(BUILD_OBJS_NOSUFFIX) --keep=$(PGM) $(LDFLAGS) + +#$(DISKIMAGE): $(PGM) +# make/createDiskImage $(AC) $(MACHINE) "$(DISKIMAGE)" "$(PGM)" "$(START_ADDR)" + +#execute: $(DISKIMAGE) +# osascript make/V2Make.scpt "$(CWD)" "$(PGM)" "$(CWD)/make/DevApple.vii" "$(EXECCMD)" + +execute: $(PGM) + $(ORCA) $(PGM) + +%.a: %.c + $(COMPILE) $< $(CFLAGS) --noroot + +%.root: %.c + $(COMPILE) $< $(CFLAGS) + +%.macros: %.s + $(MACGEN) $(MACGENFLAGS) $< $@ $(MACGENMACROS) + +%.ROOT: %.macros + $(ASSEMBLE) $(<:.macros=.s) $(ASMFLAGS) + +%.r: %.rez + $(REZ) $< $(REZFLAGS) + +$(OBJS): Makefile + +# This adds a dependency to force all .macro targets to be regenerated if +# any of the macro library files have changed. We can't tell which actual +# macros are used so we have to regenerate if any have changed. +ifneq ($(ASM_MACROS),) +$(ASM_MACROS): $(MACGENMACROS) +endif + +# Include the C and rez dependencies which were generated from the last build +# so we recompile correctly on .h file changes. +-include $(ALL_DEPS) diff --git a/pkg/.DS_Store b/pkg/.DS_Store new file mode 100644 index 0000000..5c6a238 Binary files /dev/null and b/pkg/.DS_Store differ diff --git a/pkg/Distribution.xml b/pkg/Distribution.xml new file mode 100644 index 0000000..3fe4299 --- /dev/null +++ b/pkg/Distribution.xml @@ -0,0 +1,17 @@ + + + Apple IIgs XCode Template + + + + + + + + + + + + + Apple2gsXcodeTemplate.pkg + diff --git a/pkg/Templates/.DS_Store b/pkg/Templates/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/pkg/Templates/.DS_Store differ diff --git a/pkg/Templates/Apple IIgs/.DS_Store b/pkg/Templates/Apple IIgs/.DS_Store new file mode 100644 index 0000000..01faf56 Binary files /dev/null and b/pkg/Templates/Apple IIgs/.DS_Store differ diff --git a/pkg/Templates/Apple IIgs/Apple IIgs Asm Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/Apple IIgs Asm Shell Command.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..7e99161 --- /dev/null +++ b/pkg/Templates/Apple IIgs/Apple IIgs Asm Shell Command.xctemplate/TemplateInfo.plist @@ -0,0 +1,112 @@ + + + + + Nodes + + main.s + Makefile + make/head.mk + make/orca-asm + make/orca-cc + make/orca-rez + make/tail.mk + + Definitions + + main.s + + Path + main.s + + make/head.mk + + Group + make + Path + make/head.mk + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsAsmShellCommand + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs assembly code project to build an ORCA or GNO shell command. 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 IIgs/Apple IIgs Asm Shell Command.xctemplate/main.s b/pkg/Templates/Apple IIgs/Apple IIgs Asm Shell Command.xctemplate/main.s new file mode 100644 index 0000000..9d7047f --- /dev/null +++ b/pkg/Templates/Apple IIgs/Apple IIgs Asm Shell Command.xctemplate/main.s @@ -0,0 +1,22 @@ +; +; ___FILENAME___ +; ___PROJECTNAME___ +; +; Created by ___FULLUSERNAME___ on ___DATE___. +;___COPYRIGHT___ +; + + mcopy main.macros + keep main + +Main start + phk + plb + jsl SystemEnvironmentInit + jsl SysIOStartup + puts #'Hello, world!',cr=t + jsl SysIOShutdown + lda #0 + rtl + end + diff --git a/pkg/Templates/Apple IIgs/Apple IIgs C Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/Apple IIgs C Shell Command.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..edc59fd --- /dev/null +++ b/pkg/Templates/Apple IIgs/Apple IIgs C Shell Command.xctemplate/TemplateInfo.plist @@ -0,0 +1,112 @@ + + + + + Nodes + + main.c + Makefile + make/head.mk + make/orca-asm + make/orca-cc + make/orca-rez + make/tail.mk + + Definitions + + main.c + + Path + main.c + + make/head.mk + + Group + make + Path + make/head.mk + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsCShellCommand + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build an ORCA or GNO shell command. 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 + + + 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 IIgs/Apple IIgs C Shell Command.xctemplate/main.c b/pkg/Templates/Apple IIgs/Apple IIgs C Shell Command.xctemplate/main.c new file mode 100644 index 0000000..170279a --- /dev/null +++ b/pkg/Templates/Apple IIgs/Apple IIgs C Shell Command.xctemplate/main.c @@ -0,0 +1,18 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#include + + +int main(void) +{ + printf("Hello, world!\n"); + return 0; +} diff --git a/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..4786b7e Binary files /dev/null and b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateIcon.png differ diff --git a/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..21d5bd1 Binary files /dev/null and b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateIcon@2x.png differ diff --git a/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..ea02c9e --- /dev/null +++ b/pkg/Templates/File Templates/Apple IIgs/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 IIgs/Assembly File.xctemplate/___FILEBASENAME___.s b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/___FILEBASENAME___.s new file mode 100755 index 0000000..a4f8eb3 --- /dev/null +++ b/pkg/Templates/File Templates/Apple IIgs/Assembly File.xctemplate/___FILEBASENAME___.s @@ -0,0 +1,14 @@ +; +; ___FILENAME___ +; ___PROJECTNAME___ +; +; Created by ___FULLUSERNAME___ on ___DATE___. +;___COPYRIGHT___ +; + + mcopy ___FILEBASENAME___.macros + keep ___FILEBASENAME___ + +___FILEBASENAME___ start + rtl + end diff --git a/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/Default/___FILEBASENAME___.c b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/Default/___FILEBASENAME___.c new file mode 100644 index 0000000..dab9047 --- /dev/null +++ b/pkg/Templates/File Templates/Apple IIgs/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 IIgs/C File.xctemplate/TemplateIcon.png b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..f52abe3 Binary files /dev/null and b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateIcon.png differ diff --git a/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateIcon@2x.png b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..f3e884c Binary files /dev/null and b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateIcon@2x.png differ diff --git a/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateInfo.plist b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..77652aa --- /dev/null +++ b/pkg/Templates/File Templates/Apple IIgs/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 IIgs/C File.xctemplate/WithHeader/___FILEBASENAME___.c b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/WithHeader/___FILEBASENAME___.c new file mode 100644 index 0000000..80ffc25 --- /dev/null +++ b/pkg/Templates/File Templates/Apple IIgs/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 IIgs/C File.xctemplate/WithHeader/___FILEBASENAME___.h b/pkg/Templates/File Templates/Apple IIgs/C File.xctemplate/WithHeader/___FILEBASENAME___.h new file mode 100644 index 0000000..db8ba8c --- /dev/null +++ b/pkg/Templates/File Templates/Apple IIgs/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..e96206e --- /dev/null +++ b/pkg/createPackage @@ -0,0 +1,20 @@ +#!/bin/bash + +TMPDIR=/tmp/pkg.$$ + +cp -R pkg/Templates $TMPDIR + +for PROJECT in "Apple IIgs C Shell Command" "Apple IIgs Asm Shell Command" +do + echo cp -R Makefile make "${TMPDIR}/Apple IIgs/${PROJECT}.xctemplate/" + cp -R Makefile make "${TMPDIR}/Apple IIgs/${PROJECT}.xctemplate/" +done + +pkgbuild --root $TMPDIR --version 0.1 --identifier com.halcyontouch.Apple2gsTemplate.pkg --install-location /Library/Developer/Xcode/Templates/ --scripts pkg/scripts/ Apple2GSXcodeTemplate.pkg +productbuild --distribution pkg/Distribution.xml --resource ./pkg temp.pkg +rm Apple2GSXcodeTemplate.pkg +#productsign --sign "Developer ID Installer: Halcyon Touch Software" temp.pkg Apple2GSXcodeTemplate.pkg +cp temp.pkg Apple2GSXcodeTemplate.pkg +rm temp.pkg + +rm -rf $TMPDIR diff --git a/pkg/scripts/preinstall b/pkg/scripts/preinstall new file mode 100755 index 0000000..a0821d0 --- /dev/null +++ b/pkg/scripts/preinstall @@ -0,0 +1,9 @@ +#!/bin/bash + +for item in ~/"Library/Developer/Xcode/Templates/Apple ][gs" ~/"Library/Developer/Xcode/Templates/File Templates/Apple ][gs" +do + if [ -d "$item" ] + then + rm -rf "$item" + fi +done