Update the build environment for this project to the latest.

This commit is contained in:
Jeremy Rand 2021-07-06 17:02:37 -04:00
parent e04819b4b1
commit c5afd07c71
23 changed files with 1079 additions and 601 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -18,3 +18,5 @@ The abCalc binary is a shell command you can use from GNO/ME:
And abCalcNDA is a new desk accessory which you can use from within GS/OS applications:
![abCalc NDA Screenshot](/abCalc/screenshots/abCalcNDA.png "abCalc NDA Screenshot")
[abCalc NDA Documentation](/abCalc/abCalcHelp.md)

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:abCalc.xcodeproj">
location = "self:">
</FileRef>
</Workspace>

View File

@ -61,7 +61,7 @@
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "$PROJECT_DIR/abCalc"
argument = "&quot;$PROJECT_DIR/abCalc&quot;"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument

View File

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9D1B83DB1F677D78006AA28A"
BuildableName = "doNotBuild"
BlueprintName = "doNotBuild"
ReferencedContainer = "container:abCalc.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9D1B83DB1F677D78006AA28A"
BuildableName = "doNotBuild"
BlueprintName = "doNotBuild"
ReferencedContainer = "container:abCalc.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9D1B83DB1F677D78006AA28A"
BuildableName = "doNotBuild"
BlueprintName = "doNotBuild"
ReferencedContainer = "container:abCalc.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9D1B83DB1F677D78006AA28A"
BuildableName = "doNotBuild"
BlueprintName = "doNotBuild"
ReferencedContainer = "container:abCalc.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -4,6 +4,11 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>Archive.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Binary.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
@ -12,7 +17,7 @@
<key>DiskImage.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>4</integer>
</dict>
<key>abCalc.xcscheme_^#shared#^_</key>
<dict>

View File

@ -1,16 +1,16 @@
all:
make -f nda.mk gen
make -f nda.mk build
all:
make -f shell.mk gen
make -f shell.mk build
make -f nda.mk gen
make -f nda.mk build
gen:
make -f nda.mk gen
make -f shell.mk gen
make -f nda.mk gen
build:
make -f nda.mk build
make -f shell.mk build
make -f nda.mk build
clean:
make -f shell.mk clean
@ -18,4 +18,4 @@ clean:
execute:
make -f nda.mk execute
# make -f shell.mk execute
# make -f shell.mk execute

1
abCalc/abCalcHelp.md Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
# GSplus configuration file version 0.14
# GSport configuration file version 0.31
s5d1 =
s5d2 =
@ -6,8 +6,9 @@ s5d2 =
s6d1 =
s6d2 =
s7d1 = /Users/jrand/Library/Developer/Xcode/DerivedData/abCalc-bpuqqdowxwsrymetcyxvfclvynre/Build/Products/Debug/abCalcNDA.2mg
s7d1 =
g_joystick_type = 0
g_limit_speed = 0

View File

@ -1,120 +1,260 @@
#!/bin/sh
MOUNTDIR=/tmp/a2gs_mount.$$
TMPDISKIMAGE=/tmp/a2gs_diskimage_$$.2mg
TEMPLATEDISKIMAGE=make/system601.2mg
if [ $# -lt 3 ]
then
echo USAGE: $0 diskimage file directory
echo USAGE: $0 diskimage bootimage file [bootdest]
exit 1
fi
DISKIMAGE="$1"
shift
DESTBOOTIMAGE="$1"
shift
FILE="$1"
shift
DISKIMAGEDEST="$1"
shift
DEST="${MOUNTDIR}/${DISKIMAGEDEST}"
BOOTCOPYPATH="$1"
COPYDIRS=$*
PROGRAM=`basename "$FILE"`
TMPDIR=/tmp/a2gs_mount.$$
MOUNTDIR="${TMPDIR}/$PROGRAM"
TMPDISKIMAGE=/tmp/a2gs_diskimage_$$.2mg
TMPBOOTIMAGE=/tmp/a2gs_bootimage_$$.2mg
TMPARCHIVE=/tmp/s2gs_archive_$$.shk
TEMPLATEDISKIMAGE="make/empty.2mg"
TEMPLATEBOOTIMAGE="make/$BOOTIMAGE"
ARCHIVE=`dirname "$DISKIMAGE"`/"abCalc.shk"
cleanupAndExit()
# It looks like on Linux, the cp command needs a special argument to preserve the resource fork. This isn't ideal
# but for now, if uname is Darwin, then this is MacOS and we don't need any cp args. If not Darwin, then assume
# this is Linux and ask for extended attributes to be preserved through the copy.
#
# Ultimately, it could be that other platforms (BSD, does Solaris still exist?) or even other Linux versions or
# distributions need different arguments for this rather special thing. If true, this may need to be a build time
# option which can be set.
if [ "`uname`" = Darwin ]
then
CPARGS=""
else
CPARGS="--preserve=xattr"
fi
printErrorAndExit()
{
echo "`pwd`/Makefile:0:0: error: $*" >&2
umount "$MOUNTDIR" 2> /dev/null
rm -f "$TMPDISKIMAGE" 2> /dev/null
rm -f "$TMPBOOTIMAGE" 2> /dev/null
rm -f "$TMPARCHIVE" 2> /dev/null
rm -f "$DISKIMAGE" 2> /dev/null
rmdir "$MOUNTDIR" 2> /dev/null
rm -f "$DESTBOOTIMAGE" 2> /dev/null
rm -rf "$TMPDIR" 2> /dev/null
exit 1
}
unmount()
{
RETRIES=0
while [ $RETRIES -lt 5 ]
do
umount "$1"
if [ $? -eq 0 ]
then
break
fi
RETRIES=`expr $RETRIES + 1`
sleep 1
done
if [ $RETRIES -ge 5 ]
then
printErrorAndExit "Unable to unmount the disk image."
fi
}
validateProDOSName()
{
NAME=`basename $1`
echo $NAME | egrep '^[a-zA-Z][a-zA-Z0-9.]{0,14}$' > /dev/null
}
mkdirProDOS()
{
validateProDOSName "$1"
if [ $? -ne 0 ]
then
printErrorAndExit "Invalid ProDOS name of directory `basename $1`. ProDOS names must be 1 to 15 characters, start with a letter and only letters, numbers and a period can be used in the name."
fi
mkdir -p "$1"
if [ $? -ne 0 ]
then
printErrorAndExit "Unable to create directory $1"
fi
}
cpProDOS()
{
validateProDOSName "$2"
if [ $? -ne 0 ]
then
printErrorAndExit "Invalid ProDOS name of file `basename $2`. ProDOS names must be 1 to 15 characters, start with a letter and only letters, numbers and a period can be used in the name."
fi
cp $CPARGS "$1" "$2"
if [ $? -ne 0 ]
then
printErrorAndExit "Unable to create directory $1"
fi
}
copyDirs()
{
OLDDIR=`pwd`
for COPYDIR in $*
do
cd "$COPYDIR"
if [ $? != 0 ]
then
printErrorAndExit "Unable to find $COPYDIR"
fi
find . -print | while read FILEORDIR
do
if [ "$FILEORDIR" = "." ]
then
continue
fi
if [ -d "$FILEORDIR" ]
then
mkdirProDOS "${MOUNTDIR}/$FILEORDIR"
elif [ -f "$FILEORDIR" ]
then
cpProDOS "$FILEORDIR" "${MOUNTDIR}/$FILEORDIR"
fi
done
cd "$OLDDIR"
done
}
if [ ! -f "$TEMPLATEDISKIMAGE" ]
then
echo Unable to find the template disk image, $TEMPLATEDISKIMAGE
cleanupAndExit
printErrorAndExit "Unable to find the template disk image, $TEMPLATEDISKIMAGE"
fi
cp "$TEMPLATEDISKIMAGE" "$TMPDISKIMAGE"
if [ ! -f "$TEMPLATEBOOTIMAGE" ]
then
printErrorAndExit "Unable to find the template boot image, $TEMPLATEBOOTIMAGE"
fi
mkdir "$TMPDIR"
if [ $? != 0 ]
then
echo Unable to copy template disk image.
cleanupAndExit
printErrorAndExit "Unable to create the mount directory."
fi
mkdir "$MOUNTDIR"
if [ $? != 0 ]
then
echo Unable to create the mount directory.
cleanupAndExit
printErrorAndExit "Unable to create the mount directory."
fi
cp "$TEMPLATEBOOTIMAGE" "$TMPBOOTIMAGE"
if [ $? != 0 ]
then
printErrorAndExit "Unable to copy template boot image."
fi
if [ ! -z "$COPYBOOTDIRS" ] || [ ! -z "BOOTCOPYPATH" ]
then
profuse -orw "$TMPBOOTIMAGE" "$MOUNTDIR"
if [ $? != 0 ]
then
printErrorAndExit "Unable to mount the boot image."
fi
if [ ! -z "$BOOTCOPYPATH" ]
then
cpProDOS "$FILE" "$MOUNTDIR/$BOOTCOPYPATH"
if [ $? != 0 ]
then
printErrorAndExit "Unable to copy the file to the boot image."
fi
fi
copyDirs $COPYBOOTDIRS
unmount "$MOUNTDIR"
fi
cp "$TEMPLATEDISKIMAGE" "$TMPDISKIMAGE"
if [ $? != 0 ]
then
printErrorAndExit "Unable to copy template disk image."
fi
profuse -orw "$TMPDISKIMAGE" "$MOUNTDIR"
if [ $? != 0 ]
then
echo Unable to mount the disk image.
cleanupAndExit
printErrorAndExit "Unable to mount the disk image."
fi
cp "$FILE" "$DEST"
cpProDOS "$FILE" "$MOUNTDIR"
if [ $? != 0 ]
then
echo Unable to copy the file to the disk image.
cleanupAndExit
printErrorAndExit "Unable to copy the file to the disk image."
fi
# Special case for this project to copy the shell command to the distribution also.
SHELLFILE=`echo "$FILE" | sed 's/NDA$//'`
cpProDOS "$SHELLFILE" "$MOUNTDIR"
if [ $? != 0 ]
then
printErrorAndExit "Unable to copy the shell file to the disk image."
fi
copyDirs $COPYDIRS
OLDDIR=`pwd`
for COPYDIR in $COPYDIRS
do
cd "$COPYDIR"
if [ $? != 0 ]
then
echo Unable to find $COPYDIR
cleanupAndExit
fi
find . -print | while read FILEORDIR
do
if [ -d "$FILEORDIR" ]
then
mkdir -p "${MOUNTDIR}/$FILEORDIR"
elif [ -f "$FILEORDIR" ]
then
cp "$FILEORDIR" "${MOUNTDIR}/$FILEORDIR"
fi
done
cd "$OLDDIR"
done
RETRIES=0
while [ $RETRIES -lt 5 ]
do
umount "$MOUNTDIR"
if [ $? -eq 0 ]
then
break
fi
RETRIES=`expr $RETRIES + 1`
sleep 1
done
if [ $RETRIES -ge 5 ]
cd "$TMPDIR"
$ORCA "$OLDDIR/make/tar" cf "$TMPARCHIVE" "$PROGRAM"
if [ $? != 0 ]
then
echo Unable to unmount the disk image.
cleanupAndExit
printErrorAndExit "Unable to create archive."
fi
cd "$OLDDIR"
unmount "$MOUNTDIR"
cp "$TMPDISKIMAGE" "$DISKIMAGE"
if [ $? != 0 ]
then
echo Unable to copy the disk image to the destination.
cleanupAndExit
printErrorAndExit "Unable to copy the disk image to the destination."
fi
cp "$TMPBOOTIMAGE" "$DESTBOOTIMAGE"
if [ $? != 0 ]
then
printErrorAndExit "Unable to copy the boot image to the destination."
fi
cp "$TMPARCHIVE" "$ARCHIVE"
if [ $? != 0 ]
then
printErrorAndExit "Unable to copy the archive to the destination."
fi
rm -f "$TMPDISKIMAGE"
rmdir "$MOUNTDIR"
rm -f "$TMPBOOTIMAGE"
rm -f "$TMPARCHIVE"
rm -rf "$TMPDIR"
exit 0

BIN
abCalc/make/empty.2mg Normal file

Binary file not shown.

View File

@ -72,10 +72,40 @@ DESKTOP_RES_MODE=640
MESSAGE_CENTER=0
GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus
GSPLUSARGS=
GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport
GSPORTARGS=
MAME=/Applications/Ample.app/Contents/MacOS/mame64
MAMELIB=$(HOME)/Library/Application Support/Ample
MAMEARGS=apple2gs -skip_gameinfo -speed 2 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202
export GSPLUS
export GSPLUSARGS
export GSPORT
export GSPORTARGS
export MAME
export MAMELIB
export MAMEARGS
ifneq (,$(wildcard $GSPLUS))
EMULATOR=gsplus
else ifneq (,$(wildcard $MAME))
EMULATOR=mame
else ifneq (,$(wildcard $GSPORT))
EMULATOR=gsport
else
EMULATOR=gsplus
endif
export EMULATOR
BOOTIMAGE=system601.2mg
export BOOTIMAGE
COPYDIRS=
export COPYDIRS
COPYBOOTDIRS=
export COPYBOOTDIRS
XCODE_PATH=/Applications/Xcode.app
XCODE_INFO=$(XCODE_PATH)/Contents/Info.plist
@ -90,6 +120,6 @@ XCODE_PLUGIN_COMPATIBILITY=DVTPlugInCompatibilityUUID
all:
$(MKDIR) $(OBJDIR) $(GENDIR) $(TARGETDIR)
@make gen
@make build
@make -f $(firstword $(MAKEFILE_LIST)) gen
@make -f $(firstword $(MAKEFILE_LIST)) build

View File

@ -1,18 +1,29 @@
#!/bin/sh
if [ ! -z "$GSPLUS" ] && [ -x "$GSPLUS" ]
then
EMULATORPATH="$GSPLUS"
elif [ ! -z "$GSPORT" ] && [ -x "$GSPORT" ]
then
EMULATORPATH="$GSPORT"
fi
TMPDIR="/tmp/a2gs_emulator.$$"
if [ -z "$EMULATORPATH" ]
cleanupAndExit()
{
cd
if [ ! -z $PID ]
then
kill $PID 2> /dev/null
fi
rm -rf $TMPDIR
exit 0
}
createConfigTxt()
{
mkdir "$TMPDIR"
sed "s:^s7d1 *=.*$:s7d1 = $BOOTIMAGE:
s:^s5d1 *=.*:s5d1 = $DISKIMAGE:" < make/config.txt > "$TMPDIR/config.txt"
}
if [ $# -ne 2 ]
then
echo Unable to find GSplus or GSport at these locations.
echo " GSPLUS=$GSPLUS"
echo " GSPORT=$GSPORT"
echo USAGE $0: diskimage bootimage
exit 1
fi
@ -22,15 +33,52 @@ then
DISKIMAGE="$PWD/$DISKIMAGE"
fi
cd make
sed -i "" "s:^s7d1 *=.*$:s7d1 = $DISKIMAGE:" config.txt
BOOTIMAGE="$2"
if echo $BOOTIMAGE | grep -v '^/' > /dev/null
then
BOOTIMAGE="$PWD/$BOOTIMAGE"
fi
case "$EMULATOR" in
gsplus)
EMULATORPATH="$GSPLUS"
EMULATORARGS="$GSPLUSARGS"
EMULATORDIR="$TMPDIR"
createConfigTxt
;;
gsport)
EMULATORPATH="$GSPORT"
EMULATORARGS="$GSPORTARGS"
EMULATORDIR="$TMPDIR"
createConfigTxt
;;
mame)
EMULATORPATH="$MAME"
EMULATORARGS="$MAMEARGS -hard1 "$BOOTIMAGE" -flop3 "$DISKIMAGE""
EMULATORDIR="$MAMELIB"
;;
*)
echo Invalid emulator specified, \"$EMULATOR\"
exit 1
;;
esac
if [ ! -x "$EMULATORPATH" ]
then
echo Unable to find $EMULATOR at $EMULATORPATH
exit 1
fi
if [ ! -d "$EMULATORDIR" ]
then
echo Unable to find $EMULATOR library at $EMULATORDIR
exit 1
fi
cd "$EMULATORDIR"
# This magic ensure that clicking stop in Xcode results in the emulator terminating.
$EMULATORPATH &
"$EMULATORPATH" $EMULATORARGS &
PID=$!
trap 'kill $PID' SIGTERM SIGINT SIGHUP EXIT
trap cleanupAndExit SIGTERM SIGINT SIGHUP EXIT
wait
exit 0

BIN
abCalc/make/md2teach Normal file

Binary file not shown.

View File

@ -1,6 +1,7 @@
#!/bin/bash
TMPFILE=/tmp/orca-macgen.$$
ERROUTPUT=/tmp/orca-asm-errs.$$
FILENAME="$1"
shift
@ -54,15 +55,39 @@ DIRNAME=`dirname $FILENAME`
BASENAME=`basename $FILENAME .s`
pushd "$DIRNAME" > /dev/null
$ORCA assemble $* keep="${BASENAME}" "${BASENAME}.s"
$ORCA assemble $* keep="${BASENAME}" "${BASENAME}.s" 2> $ERROUTPUT
RESULT=$?
popd > /dev/null
if [ -s $ERROUTPUT ]
then
RESULT=1
awk '
{
print $0
}
/^Error /{
$1=""
$2=""
LINENO=$3
$3=""
printf("%s/%s:%d:0: error: %s\n", PWD, FILE, LINENO, $0)
}
' "PWD=`pwd`" "FILE=${BASENAME}.s" $ERROUTPUT
fi
rm -f $ERROUTPUT
if [ "$RESULT" -ne 0 ]
then
rm -f "$SRCROOTNAME"
rm -f "$SRCMACROSNAME"
rm -f "$SRCOBJNAME"
rm -f "$DESTROOTNAME"
rm -f "$DESTMACROSNAME"
rm -f "$DESTOBJNAME"
rm -f "$DESTDEPSNAME"
exit 1
fi
mkdir -p `dirname "$DESTROOTNAME"`

Binary file not shown.

View File

@ -6,10 +6,12 @@ export PATH := $(PATH):$(ORCA_BIN)
CWD=$(shell pwd)
DISKIMAGE=$(TARGETDIR)/$(PGM).2mg
DISKIMAGE=$(TARGETDIR)/abCalc.2mg
ARCHIVE=$(TARGETDIR)/abCalc.shk
DESTBOOTIMAGE=$(TARGETDIR)/$(BOOTIMAGE)
BUILDTARGET=$(DISKIMAGE)
EXECTARGET=executeGUI
DISKIMAGEDEST=.
BOOTCOPYPATH=
AUXTYPE=
CFLAGS+=-i$(GENDIR)
@ -31,18 +33,18 @@ else ifeq ($(TARGETTYPE),desktop)
REZFLAGS+=rez='-d MESSAGE_CENTER=$(MESSAGE_CENTER)'
else ifeq ($(TARGETTYPE),cda)
FILETYPE=cda
DISKIMAGEDEST=System/Desk.Accs
BOOTCOPYPATH=System/Desk.Accs
else ifeq ($(TARGETTYPE),cdev)
BINTARGET=$(TARGETDIR)/$(PGM).bin
FILETYPE=199
DISKIMAGEDEST=System/CDevs
BOOTCOPYPATH=System/CDevs
REZFLAGS+=rez='-d BINTARGET="$(BINTARGET)"'
else ifeq ($(TARGETTYPE),nba)
FILETYPE=exe
BUILDTARGET=$(TARGETDIR)/$(PGM)
else ifeq ($(TARGETTYPE),nda)
FILETYPE=nda
DISKIMAGEDEST=System/Desk.Accs
BOOTCOPYPATH=System/Desk.Accs
else ifeq ($(TARGETTYPE),xcmd)
FILETYPE=exe
BUILDTARGET=$(TARGETDIR)/$(PGM)
@ -71,17 +73,22 @@ REZ_SRCS=$(patsubst $(GENDIR)/%, %, $(patsubst ./%, %, $(wildcard $(addsuffix /*
REZ_DEPS=$(patsubst %.rez, $(OBJDIR)/%.rez.d, $(REZ_SRCS))
REZ_OBJS=$(patsubst %.rez, $(OBJDIR)/%.r, $(REZ_SRCS))
TEACH_FILES=$(patsubst %.md, $(GENDIR)/Teach/%, $(MD_SRCS))
ifneq ($(TEACH_FILES),)
COPYDIRS+=$(GENDIR)/Teach
endif
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)
BUILD_OBJS=$(C_ROOTS) $(C_OBJS) $(ASM_ROOTS) $(TEACH_FILES)
ifeq ($(BINTARGET),)
BUILD_OBJS+=$(REZ_OBJS)
endif
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_OBJS=$(C_ROOTS:.root=.a) $(C_OBJS) $(ASM_OBJS) $(REZ_OBJS) $(TEACH_FILES)
ALL_ROOTS=$(C_ROOTS) $(C_OBJS:.a=.root) $(ASM_ROOTS)
ALL_DEPS=$(C_DEPS) $(ASM_DEPS) $(REZ_DEPS)
@ -96,7 +103,7 @@ build: $(BUILDTARGET)
gen: xcodefix
xcodefix:
defaults write "$(ORCAM_PLUGIN_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)s -array `defaults read "$(XCODE_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)` || true
[ "`uname`" = Darwin ] && defaults write "$(ORCAM_PLUGIN_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)s -array `defaults read "$(XCODE_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)` || true
clean: genclean
$(RM) "$(TARGETDIR)/$(PGM)" $(BINTARGET)
@ -105,6 +112,8 @@ clean: genclean
$(RM) $(ALL_DEPS)
$(RM) $(ASM_MACROS)
$(RM) "$(DISKIMAGE)"
$(RM) "$(DESTBOOTIMAGE)"
$(RM) "$(ARCHIVE)"
createPackage:
pkg/createPackage
@ -125,7 +134,7 @@ ifneq ($(REZ_OBJS),)
$(RM) $(TARGETDIR)/$(PGM)
$(CP) $(REZ_OBJS) $(TARGETDIR)/$(PGM)
endif
cd $(OBJDIR); $(LINK) $(LDFLAGS) $(patsubst $(OBJDIR)/%, %, $(BUILD_OBJS_NOSUFFIX)) --keep=$(TARGETDIR)/$(PGM)
cd $(OBJDIR); $(LINK) $(LDFLAGS) $(patsubst $(OBJDIR)/%, %, $(BUILD_OBJS_NOSUFFIX)) keep="$(abspath $(TARGETDIR)/$(PGM))"
$(CHTYP) -t $(FILETYPE) $(AUXTYPE) $(TARGETDIR)/$(PGM)
endif
@ -154,7 +163,7 @@ else
# resource compile will read the $(PGM).bin binary and load it into the
# resources also.
$(BINTARGET): $(BUILD_OBJS)
cd $(OBJDIR); $(LINK) $(LDFLAGS) $(patsubst $(OBJDIR)/%, %, $(BUILD_OBJS_NOSUFFIX)) --keep=$(BINTARGET)
cd $(OBJDIR); $(LINK) $(LDFLAGS) $(patsubst $(OBJDIR)/%, %, $(BUILD_OBJS_NOSUFFIX)) keep="$(abspath $(BINTARGET))"
endif
@ -178,13 +187,13 @@ $(TARGETDIR)/$(PGM): $(REZ_OBJS)
endif
$(DISKIMAGE): $(TARGETDIR)/$(PGM)
make/createDiskImage "$(DISKIMAGE)" "$(TARGETDIR)/$(PGM)" "$(DISKIMAGEDEST)" $(COPYDIRS)
$(DISKIMAGE): $(TARGETDIR)/$(PGM) make/empty.2mg make/$(BOOTIMAGE)
make/createDiskImage "$(DISKIMAGE)" $(DESTBOOTIMAGE) "$(TARGETDIR)/$(PGM)" $(BOOTCOPYPATH)
execute: $(EXECTARGET)
executeGUI: all
make/launchEmulator $(DISKIMAGE)
make/launchEmulator "$(DISKIMAGE)" "$(DESTBOOTIMAGE)"
executeShell: all
$(ORCA) $(TARGETDIR)/$(PGM)
@ -219,6 +228,10 @@ ifneq ($(RLINT_PATH),)
$(ORCA) $(RLINT_PATH) $@
endif
$(GENDIR)/Teach/%: %.md
$(MKDIR) "$(GENDIR)/Teach"
$(ORCA) make/md2teach "$<" "$@"
$(OBJS): Makefile
# Include the C and rez dependencies which were generated from the last build

BIN
abCalc/make/tar Normal file

Binary file not shown.

View File

@ -28,9 +28,24 @@ PGM=abCalcNDA
TARGETTYPE=nda
# TARGETTYPE=xcmd
# Uncomment one of the following lines to force a particular GS emulator.
# By default, specific paths are tested for these emulators in the below
# order and the first found is what will be used. You can overrride that
# here:
#
# EMULATOR=gsplus
# EMULATOR=mame
# EMULATOR=gsport
# By default, the build provides a single boot environment to test with.
# You can put other .2mg files into the make directory and override this
# variable to change what boot disk you want to use when you launch the
# emulator. The disk image you specify must be found in the make directory:
#
# BOOTIMAGE=system601.2mg
# Add any other directories where you are putting C or assembly source
# files to this list:
# SRCDIRS+=
SRCDIRS+=nda expr ops
# If you put your main entry point for your project in a file called main.c
@ -66,7 +81,14 @@ LDFLAGS+=
# Uncomment the following line if you want to build against the GNO libraries
# export ORCA=$(ORCA_BINDIR)/gno
# If you want to copy one or more files or directories to the target disk
# Add any markdown files to the MD_SRCS variable to specify which files to
# convert to a Teach text file format during the build. Using this, you can
# write your documentation in markdown in your project and at build time,
# that documentation is converted to a format that is good to package with
# your software and can be opened on a GS.
MD_SRCS=abCalcHelp.md
# If you want to copy one or more files or directories to the distribution disk
# image, add the root directory to this variable. Any directories under
# the source directory which don't exist in the target disk image will be
# created. All files will be copied from the source to the target using
@ -74,23 +96,61 @@ LDFLAGS+=
#
# For example, if you set COPYDIRS to dir and in your project you have
# the following files:
# dir/Icons/myIconFile
# dir/newDir/anotherFile
# Then, during the copy phase, myIconFile will be copied into the Icons
# folder and a folder newDir will be created and anotherFile will be copied
# into there.
COPYDIRS=
# If you want to copy one or more files or directories to the boot disk
# image, add the root directory to this variable. Any directories under
# the source directory which don't exist in the boot disk image will be
# created. All files will be copied from the source to the target using
# the same path from the source.
#
# For example, if you set COPYBOOTDIRS to dir and in your project you have
# the following files:
# dir/System/mySystemFile
# dir/newDir/anotherFile
# Then, during the copy phase, mySystemFile will be copied into the System
# folder and a folder newDir will be created and anotherFile will be copied
# into there.
COPYDIRS=copydir
COPYBOOTDIRS=
# By default, the build expects that you have GSplus in the path:
# /Applications/GSplus.app/Contents/MacOS/gsplus
# If you have it in a different location, specify that here.
# GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus
# By default, the build uses no arguments with GSplus. If you would like to
# use different arguments, specify that here.
# GSPLUSARGS=
# By default, the build expects that you have GSport in the path:
# /Applications/GSport/GSport.app/Contents/MacOS/GSport
# If you have it in a different location, specify that here.
# GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport
# By default, the build uses no arguments with GSport. If you would like to
# use different arguments, specify that here.
# GSPORTARGS=
# By default, the build expects that you have Ample/mame in the path:
# /Applications/Ample.app/Contents/MacOS/mame64
# If you have it in a different location, specify that here.
# MAME=/Applications/Ample.app/Contents/MacOS/mame64
# By default, the build expects that you have the mame ROMs/libs in the path:
# $(HOME)/Library/Application Support/Ample
# If you have it in a different location, specify that here.
# MAMELIB=$(HOME)/Library/Application Support/Ample
# By default, the build uses these arguments with mame:
# apple2gs -skip_gameinfo -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202
# If you would like to use different arguments, specify that here.
# MAMEARGS=apple2gs -skip_gameinfo -speed 2 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202
# For a desktop application, it can operate in 640x200 or 320x200
# resolution. This setting is used to define which horizontal
# resolution you want to use for a desktop application. Other

View File

@ -1,6 +1,6 @@
#
# Makefile
# Apple //GS Build Engine for ORCA
# Apple //GS Build Engine for ORCA and Merlin
#
include make/head.mk
@ -12,13 +12,13 @@ include make/head.mk
PGM=abCalc
# 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
# 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
@ -28,9 +28,24 @@ TARGETTYPE=shell
# TARGETTYPE=nda
# TARGETTYPE=xcmd
# Uncomment one of the following lines to force a particular GS emulator.
# By default, specific paths are tested for these emulators in the below
# order and the first found is what will be used. You can overrride that
# here:
#
# EMULATOR=gsplus
# EMULATOR=mame
# EMULATOR=gsport
# By default, the build provides a single boot environment to test with.
# You can put other .2mg files into the make directory and override this
# variable to change what boot disk you want to use when you launch the
# emulator. The disk image you specify must be found in the make directory:
#
# BOOTIMAGE=system601.2mg
# Add any other directories where you are putting C or assembly source
# files to this list:
# SRCDIRS+=
SRCDIRS+=shell expr ops
# If you put your main entry point for your project in a file called main.c
@ -44,6 +59,13 @@ CFLAGS+=-dABCALC_GSOS
# Add any arguments you want passed to the resource compiler to this variable:
REZFLAGS+=
# Uncomment the following line if you have installed rlint as found here:
# https://github.com/ksherlock/rlint/releases
# Assuming that it is in the path that ORCA searches (the Utilities directory is
# probably a good choice), you can just leave the value unchanged. If you have
# put the rlint somewhere weird, you can set this to the correct path
# RLINT_PATH=rlint
# Add any arguments you want passed to the macro generator to this variable:
MACGENFLAGS+=
@ -59,7 +81,14 @@ LDFLAGS+=
# Uncomment the following line if you want to build against the GNO libraries
# export ORCA=$(ORCA_BINDIR)/gno
# If you want to copy one or more files or directories to the target disk
# Add any markdown files to the MD_SRCS variable to specify which files to
# convert to a Teach text file format during the build. Using this, you can
# write your documentation in markdown in your project and at build time,
# that documentation is converted to a format that is good to package with
# your software and can be opened on a GS.
MD_SRCS=
# If you want to copy one or more files or directories to the distribution disk
# image, add the root directory to this variable. Any directories under
# the source directory which don't exist in the target disk image will be
# created. All files will be copied from the source to the target using
@ -67,27 +96,84 @@ LDFLAGS+=
#
# For example, if you set COPYDIRS to dir and in your project you have
# the following files:
# dir/Icons/myIconFile
# dir/newDir/anotherFile
# Then, during the copy phase, myIconFile will be copied into the Icons
# folder and a folder newDir will be created and anotherFile will be copied
# into there.
COPYDIRS=
# If you want to copy one or more files or directories to the boot disk
# image, add the root directory to this variable. Any directories under
# the source directory which don't exist in the boot disk image will be
# created. All files will be copied from the source to the target using
# the same path from the source.
#
# For example, if you set COPYBOOTDIRS to dir and in your project you have
# the following files:
# dir/System/mySystemFile
# dir/newDir/anotherFile
# Then, during the copy phase, mySystemFile will be copied into the System
# folder and a folder newDir will be created and anotherFile will be copied
# into there.
COPYDIRS=
COPYBOOTDIRS=
# By default, the build expects that you have GSplus in the path:
# /Applications/GSplus.app/Contents/MacOS/gsplus
# /Applications/GSplus.app/Contents/MacOS/gsplus
# If you have it in a different location, specify that here.
# GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus
# By default, the build uses no arguments with GSplus. If you would like to
# use different arguments, specify that here.
# GSPLUSARGS=
# By default, the build expects that you have GSport in the path:
# /Applications/GSport/GSport.app/Contents/MacOS/GSport
# /Applications/GSport/GSport.app/Contents/MacOS/GSport
# If you have it in a different location, specify that here.
# GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport
# By default, the build uses no arguments with GSport. If you would like to
# use different arguments, specify that here.
# GSPORTARGS=
# By default, the build expects that you have Ample/mame in the path:
# /Applications/Ample.app/Contents/MacOS/mame64
# If you have it in a different location, specify that here.
# MAME=/Applications/Ample.app/Contents/MacOS/mame64
# By default, the build expects that you have the mame ROMs/libs in the path:
# $(HOME)/Library/Application Support/Ample
# If you have it in a different location, specify that here.
# MAMELIB=$(HOME)/Library/Application Support/Ample
# By default, the build uses these arguments with mame:
# apple2gs -skip_gameinfo -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202
# If you would like to use different arguments, specify that here.
# MAMEARGS=apple2gs -skip_gameinfo -speed 2 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202
# For a desktop application, it can operate in 640x200 or 320x200
# resolution. This setting is used to define which horizontal
# resolution you want to use for a desktop application. Other
# target types ignore this value.
# DESKTOP_RES_MODE=640
# For a desktop application, it can support opening and printing
# files based on paths sent to it by the message center. This
# option controls if that is or is not supported in the
# application (note: only the C desktop template supports message
# center today)
# MESSAGE_CENTER=0
# 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.
# might need. You should generate these files in the $(GENDIR)
# directory or within a subdirectory under $(GENDIR) which you create
# yourself.
#
# All of your commands associated with a rule _must_ start with a tab
# character. Xcode makes it a bit tough to type a tab character by
# default. Press option-tab within Xcode to insert a tab character.
gen:
# For any files you generated in the gen target above, you should