Update the build engine used by abCalc.

This commit is contained in:
Jeremy Rand 2019-08-07 22:21:32 -04:00
parent 616cfc5f11
commit c994634c64
16 changed files with 880 additions and 538 deletions

File diff suppressed because it is too large Load Diff

View File

@ -64,6 +64,18 @@
argument = "$PROJECT_DIR/abCalc"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "TARGET_BUILD_DIR=$TARGET_BUILD_DIR"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "DERIVED_SOURCES_DIR=$DERIVED_SOURCES_DIR"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "OBJECT_FILE_DIR=$OBJECT_FILE_DIR"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "execute"
isEnabled = "YES">

View File

@ -4,28 +4,25 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>Binary.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>DiskImage.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>abCalc.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>doNotBuild.xcscheme</key>
<key>doNotBuild.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9D1B83D71F677D78006AA28A</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9D1B83DB1F677D78006AA28A</key>
<dict>
<key>primary</key>
<true/>
<integer>3</integer>
</dict>
</dict>
</dict>

View File

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

View File

@ -1,6 +1,5 @@
#!/bin/sh
set -x
MOUNTDIR=/tmp/a2gs_mount.$$
TMPDISKIMAGE=/tmp/a2gs_diskimage_$$.2mg
@ -90,8 +89,20 @@ do
cd "$OLDDIR"
done
umount "$MOUNTDIR"
if [ $? != 0 ]
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 ]
then
echo Unable to unmount the disk image.
cleanupAndExit

View File

@ -8,12 +8,40 @@ ORCA_BINDIR = /usr/local/bin
export ORCA=$(ORCA_BINDIR)/orca
AC=make/AppleCommander.jar
TARGETTYPE=shell
ASSEMBLER=orcam
MERLIN_DIR=/usr/local
export MERLIN_BIN=$(MERLIN_DIR)/bin/Merlin32
export MERLIN_LIB=$(MERLIN_DIR)/lib/Merlin
MERLIN_ASM=make/merlin-asm
SRCDIRS=.
# Check for Xcode build variables for the locations of build outputs and fall back
# to the current directory if not set.
ifeq ($(OBJECT_FILE_DIR),)
OBJDIR=.
else
export OBJECT_FILE_DIR
OBJDIR=$(OBJECT_FILE_DIR)
endif
ifeq ($(DERIVED_SOURCES_DIR),)
GENDIR=.
else
export DERIVED_SOURCES_DIR
GENDIR=$(DERIVED_SOURCES_DIR)
endif
ifeq ($(TARGET_BUILD_DIR),)
TARGETDIR=.
else
export TARGET_BUILD_DIR
TARGETDIR=$(TARGET_BUILD_DIR)
endif
COMPILE=make/orca-cc
CFLAGS= -P -I
ROOTCFILE=main.c
@ -37,6 +65,11 @@ CHTYP=$(ORCA) chtyp
RM=rm -f
CP=cp
MV=mv
MKDIR=mkdir -p
DESKTOP_RES_MODE=640
MESSAGE_CENTER=0
GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus
GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport
@ -44,9 +77,19 @@ GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport
export GSPLUS
export GSPORT
XCODE_PATH=/Applications/Xcode.app
XCODE_INFO=$(XCODE_PATH)/Contents/Info.plist
ORCAM_PLUGIN_PATH=$(HOME)/Library/Developer/Xcode/Plug-ins/OrcaM.ideplugin
ORCAM_PLUGIN_INFO=$(ORCAM_PLUGIN_PATH)/Contents/Info.plist
XCODE_PLUGIN_COMPATIBILITY=DVTPlugInCompatibilityUUID
.PHONY: all gen genclean
all:
$(MKDIR) $(OBJDIR) $(GENDIR) $(TARGETDIR)
@make gen
@make build

View File

@ -16,7 +16,14 @@ then
exit 1
fi
DISKIMAGE="$1"
if echo $DISKIMAGE | grep -v '^/' > /dev/null
then
DISKIMAGE="$PWD/$DISKIMAGE"
fi
cd make
sed -i "" "s:^s7d1 *=.*$:s7d1 = $DISKIMAGE:" config.txt
# This magic ensure that clicking stop in Xcode results in the emulator terminating.

View File

@ -1,18 +1,77 @@
#!/bin/bash
TMPFILE=/tmp/orca-macgen.$$
FILENAME="$1"
shift
DESTBASENAME="$1"
shift
if echo $FILENAME | grep -v '\.s$' > /dev/null
then
echo Expected first argument to be a *.s file but got $FILENAME
echo Expected second argument to be a *.s file but got $FILENAME
exit 1
fi
SRCBASENAME=`echo $FILENAME | sed 's/\.s$//'`
SRCMACROSNAME="${SRCBASENAME}.macros"
SRCROOTNAME="${SRCBASENAME}.ROOT"
SRCOBJNAME="${SRCBASENAME}.a"
DESTMACROSNAME="${DESTBASENAME}.macros"
DESTDEPSNAME="${DESTBASENAME}.macros.d"
DESTROOTNAME="${DESTBASENAME}.ROOT"
DESTOBJNAME="${DESTBASENAME}.a"
$ORCA --trace-gsos macgen $MACGENFLAGS "$FILENAME" "$SRCMACROSNAME" $MACGENMACROS < /dev/null 2> $TMPFILE
RESULT=$?
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2
if [ "$RESULT" -ne 0 ]
then
rm -f "$TMPFILE"
rm -f "$SRCMACROSNAME"
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
DIRNAME=`dirname $FILENAME`
BASENAME=`basename $FILENAME .s`
cd "$DIRNAME"
pushd "$DIRNAME" > /dev/null
$ORCA assemble $* keep="${BASENAME}" "${BASENAME}.s"
RESULT=$?
exit $RESULT
popd > /dev/null
if [ "$RESULT" -ne 0 ]
then
rm -f "$SRCROOTNAME"
rm -f "$SRCMACROSNAME"
rm -f "$SRCOBJNAME"
fi
mkdir -p `dirname "$DESTROOTNAME"`
mv -f "$SRCROOTNAME" "$DESTROOTNAME" 2> /dev/null
mv -f "$SRCMACROSNAME" "$DESTMACROSNAME" 2> /dev/null
mv -f "$SRCOBJNAME" "$DESTOBJNAME" 2> /dev/null
cat > $DESTDEPSNAME << EOF
$DESTROOTNAME: $DEPS
EOF
exit 0

View File

@ -1,10 +1,14 @@
#!/bin/bash
TMPFILE=/tmp/orca-cc.$$
STDOUTPUT=/tmp/orca-cc-std.$$
ERROUTPUT=/tmp/orca-cc-errs.$$
FILENAME="$1"
shift
DESTBASENAME="$1"
shift
if echo $FILENAME | grep -v '\.c$' > /dev/null
then
echo Expected first argument to be a *.c file but got $FILENAME
@ -23,29 +27,53 @@ do
fi
done
BASENAME=`echo $FILENAME | sed 's/\.c$//'`
DEPSNAME="${BASENAME}.d"
OBJSNAME="${BASENAME}.a"
ROOTNAME="${BASENAME}.root"
SRCBASENAME=`echo "$FILENAME" | sed 's/\.c$//'`
SRCOBJNAME="${SRCBASENAME}.a"
SRCROOTNAME="${SRCBASENAME}.root"
$ORCA --trace-gsos compile $COMPILEARGS "$FILENAME" keep="${BASENAME}" $CCARGS 2> $TMPFILE
DESTDEPSNAME="${DESTBASENAME}.d"
DESTOBJNAME="${DESTBASENAME}.a"
DESTROOTNAME="${DESTBASENAME}.root"
$ORCA --trace-gsos compile $COMPILEARGS "$FILENAME" keep="${SRCBASENAME}" $CCARGS > $STDOUTPUT 2> $ERROUTPUT
RESULT=$?
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2
awk '
{
print $0
}
$1 ~ /^[0-9][0-9]*$/ {
LINENO=$1
}
/^ *\^/ {
sub(/^ *\^/, "", $0)
printf("%s/%s:%d:0: error: %s\n", PWD, FILE, LINENO, $0)
}
' "PWD=`pwd`" "FILE=$FILENAME" $STDOUTPUT
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $ERROUTPUT >&2
if [ "$RESULT" -ne 0 ]
then
rm -f $TMPFILE
rm -f $OBJSNAME
rm -f $ROOTNAME
rm -f $ERROUTPUT
rm -f $STDOUTPUT
rm -f $SRCOBJNAME
rm -f $SRCROOTNAME
exit $RESULT
fi
mkdir -p `dirname "$DESTOBJNAME"`
mv -f "$SRCOBJNAME" "$DESTOBJNAME" 2> /dev/null
mv -f "$SRCROOTNAME" "$DESTROOTNAME" 2> /dev/null
DEPS=`awk '
/^FastFileLoad/ {
sub(/^FastFileLoad\(/, "");
sub(/\)$/, "");
print}' $TMPFILE | sort -u | while read FILE
print}' $ERROUTPUT | sort -u | while read FILE
do
if [ -f "$FILE" ]
then
@ -53,14 +81,15 @@ DEPS=`awk '
fi
done | tr '\012' ' '`
rm -f $TMPFILE
rm -f $ERROUTPUT
rm -f $STDOUTPUT
# 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
cat > $DESTDEPSNAME << EOF
$DESTOBJNAME: $DEPS
$ROOTNAME: $DEPS
$DESTROOTNAME: $DEPS
EOF
exit 0

View File

@ -1,50 +0,0 @@
#!/bin/bash
TMPFILE=/tmp/orca-macgen.$$
MACGENFLAGS="$1"
FILENAME="$2"
shift
shift
if echo $FILENAME | grep -v '\.s$' > /dev/null
then
echo Expected second argument to be a *.s file but got $FILENAME
exit 1
fi
BASENAME=`echo $FILENAME | sed 's/\.s$//'`
MACROSNAME="${BASENAME}.macros"
DEPSNAME="${MACROSNAME}.d"
$ORCA --trace-gsos macgen $MACGENFLAGS "$FILENAME" $* < /dev/null 2> $TMPFILE
RESULT=$?
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2
if [ "$RESULT" -ne 0 ]
then
rm -f $TMPFILE
rm -f $MACROSNAME
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
cat > $DEPSNAME << EOF
$MACROSNAME: $DEPS
EOF
exit 0

View File

@ -1,37 +1,60 @@
#!/bin/bash
TMPFILE=/tmp/orca-rez.$$
ERROUTPUT=/tmp/orca-rez-err.$$
FILENAME="$1"
shift
DESTBASENAME="$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"
SRCBASENAME=`echo $FILENAME | sed 's/\.rez$//'`
SRCOBJNAME="${SRCBASENAME}.r"
$ORCA --trace-gsos compile $* keep="${OBJSNAME}" "$FILENAME" 2> $TMPFILE
DESTDEPSNAME="${DESTBASENAME}.rez.d"
DESTOBJNAME="${DESTBASENAME}.r"
$ORCA --trace-gsos compile "$@" keep="${SRCOBJNAME}" "$FILENAME" 2> $ERROUTPUT
RESULT=$?
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2
awk '
/^[A-Za-z][A-Za-z]*\(.*\)$/ {
next
}
{
print
}
/^File [^ ]*; Line [0-9][0-9]*;/ {
sub(/;/,"",$4)
LINENO=$4
sub(/^File [^ ]*; Line [0-9][0-9]*/, "", $0)
printf("%s/%s:%d:0: error: %s\n", PWD, FILE, LINENO, $0)
}
' "PWD=`pwd`" "FILE=$FILENAME" $ERROUTPUT >&2
if [ "$RESULT" -ne 0 ]
then
rm -f $TMPFILE
rm -f $OBJSNAME
rm -f $ERROUTPUT
rm -f $SRCOBJNAME
exit $RESULT
fi
mkdir -p `dirname "$DESTOBJNAME"`
mv -f "$SRCOBJNAME" "$DESTOBJNAME" 2> /dev/null
DEPS=`awk '
/^FastFileLoad/ {
sub(/^FastFileLoad\(/, "");
sub(/\)$/, "");
print}' $TMPFILE | sort -u | while read FILE
print}' $ERROUTPUT | sort -u | while read FILE
do
if [ -f "$FILE" ]
then
@ -39,7 +62,7 @@ DEPS=`awk '
fi
done`
echo $OBJSNAME: $DEPS > $DEPSNAME
rm -f $TMPFILE
echo $DESTOBJNAME: $DEPS > $DESTDEPSNAME
rm -f $ERROUTPUT
exit 0

Binary file not shown.

View File

@ -6,53 +6,70 @@ export PATH := $(PATH):$(ORCA_BIN)
CWD=$(shell pwd)
DISKIMAGE=$(PGM).2mg
DISKIMAGE=$(TARGETDIR)/$(PGM).2mg
BUILDTARGET=$(DISKIMAGE)
EXECTARGET=executeGUI
DISKIMAGEDEST=.
AUXTYPE=
CFLAGS+=-i$(GENDIR)
vpath $(GENDIR)
ifeq ($(TARGETTYPE),shell)
FILETYPE=exe
EXECTARGET=executeShell
BUILDTARGET=$(PGM)
BUILDTARGET=$(TARGETDIR)/$(PGM)
else ifeq ($(TARGETTYPE),desktop)
FILETYPE=s16
ifeq ($(MESSAGE_CENTER),1)
AUXTYPE=-a 0x0000db07
else
AUXTYPE=-a 0x0000db03
endif
CFLAGS+=-dMESSAGE_CENTER=$(MESSAGE_CENTER)
REZFLAGS+=rez='-d DESKTOP_RES_MODE=$(DESKTOP_RES_MODE)'
REZFLAGS+=rez='-d MESSAGE_CENTER=$(MESSAGE_CENTER)'
else ifeq ($(TARGETTYPE),cda)
FILETYPE=cda
DISKIMAGEDEST=System/Desk.Accs
else ifeq ($(TARGETTYPE),cdev)
BINTARGET=$(PGM).bin
BINTARGET=$(TARGETDIR)/$(PGM).bin
FILETYPE=199
DISKIMAGEDEST=System/CDevs
REZFLAGS+=rez='-d BINTARGET="$(BINTARGET)"'
else ifeq ($(TARGETTYPE),nba)
FILETYPE=exe
BUILDTARGET=$(PGM)
BUILDTARGET=$(TARGETDIR)/$(PGM)
else ifeq ($(TARGETTYPE),nda)
FILETYPE=nda
DISKIMAGEDEST=System/Desk.Accs
else ifeq ($(TARGETTYPE),xcmd)
FILETYPE=exe
BUILDTARGET=$(PGM)
BUILDTARGET=$(TARGETDIR)/$(PGM)
endif
ifeq ($(wildcard $(ROOTCFILE)),)
ROOTCFILE=
ASM_SRCS=$(patsubst $(GENDIR)/%, %, $(patsubst ./%, %, $(wildcard $(addsuffix /*.s, $(SRCDIRS)))))
ifeq ($(ASSEMBLER),orcam)
ASM_MACROS=$(patsubst %.s, $(OBJDIR)/%.macros, $(ASM_SRCS))
ASM_DEPS=$(patsubst %.s, $(OBJDIR)/%.macros.d, $(ASM_SRCS))
ASM_ROOTS=$(patsubst %.s, $(OBJDIR)/%.ROOT, $(ASM_SRCS))
ASM_OBJS=$(patsubst %.s, $(OBJDIR)/%.a, $(ASM_SRCS))
ifeq ($(wildcard $(ROOTCFILE)),)
ROOTCFILE=
endif
C_ROOTS=$(patsubst %.c, $(OBJDIR)/%.root, $(ROOTCFILE))
C_SRCS+=$(filter-out $(ROOTCFILE), $(patsubst $(GENDIR)/%, %, $(patsubst ./%, %, $(wildcard $(addsuffix /*.c, $(SRCDIRS))))))
C_OBJS=$(patsubst %.c, $(OBJDIR)/%.a, $(C_SRCS))
C_DEPS=$(patsubst %.c, $(OBJDIR)/%.d, $(ROOTCFILE)) $(patsubst %.c, $(OBJDIR)/%.d, $(C_SRCS))
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_DEPS=$(ASM_SRCS:.s=.macros.d)
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)
REZ_SRCS=$(patsubst $(GENDIR)/%, %, $(patsubst ./%, %, $(wildcard $(addsuffix /*.rez, $(SRCDIRS)))))
REZ_DEPS=$(patsubst %.rez, $(OBJDIR)/%.rez.d, $(REZ_SRCS))
REZ_OBJS=$(patsubst %.rez, $(OBJDIR)/%.r, $(REZ_SRCS))
ifneq ($(firstword $(REZ_SRCS)), $(lastword $(REZ_SRCS)))
$(error Only a single resource file supported, found $(REZ_SRCS))
@ -70,14 +87,19 @@ ALL_DEPS=$(C_DEPS) $(ASM_DEPS) $(REZ_DEPS)
EXECCMD=
.PHONY: build execute executeShell executeGUI clean
.PHONY: build execute executeShell executeGUI clean xcodefix
.PRECIOUS: $(ASM_MACROS)
build: $(BUILDTARGET)
gen: xcodefix
xcodefix:
defaults write "$(ORCAM_PLUGIN_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)s -array `defaults read "$(XCODE_INFO)" $(XCODE_PLUGIN_COMPATIBILITY)` || true
clean: genclean
$(RM) "$(PGM)" $(BINTARGET)
$(RM) "$(TARGETDIR)/$(PGM)" $(BINTARGET)
$(RM) $(ALL_OBJS)
$(RM) $(ALL_ROOTS)
$(RM) $(ALL_DEPS)
@ -92,61 +114,110 @@ cleanMacCruft:
ifeq ($(BINTARGET),)
ifeq ($(ASSEMBLER),orcam)
# This is a standard build where we generate the resources if any and then link
# the binary over that same file creating the resource fork first and the data
# fork second.
$(PGM): $(BUILD_OBJS)
# This is a standard ORCA build where we generate the resources if any and
# then link the binary over that same file creating the resource fork first
# and the data fork second.
$(TARGETDIR)/$(PGM): $(BUILD_OBJS)
$(MKDIR) $(TARGETDIR)
ifneq ($(REZ_OBJS),)
$(RM) $(PGM)
$(CP) $(REZ_OBJS) $(PGM)
$(RM) $(TARGETDIR)/$(PGM)
$(CP) $(REZ_OBJS) $(TARGETDIR)/$(PGM)
endif
$(LINK) $(LDFLAGS) $(BUILD_OBJS_NOSUFFIX) --keep=$(PGM)
$(CHTYP) -t $(FILETYPE) $(PGM)
cd $(OBJDIR); $(LINK) $(LDFLAGS) $(patsubst $(OBJDIR)/%, %, $(BUILD_OBJS_NOSUFFIX)) --keep=$(TARGETDIR)/$(PGM)
$(CHTYP) -t $(FILETYPE) $(AUXTYPE) $(TARGETDIR)/$(PGM)
endif
ifeq ($(ASSEMBLER),merlin)
# This is a standard Merlin build where we generate the resources if any and
# then link the binary over that same file creating the resource fork first
# and the data fork second.
$(TARGETDIR)/$(PGM): $(BUILD_OBJS) $(ASM_SRCS)
$(MKDIR) $(TARGETDIR)
$(RM) $(TARGETDIR)/$(PGM)
$(MERLIN_ASM) linkscript.s $(PGM) $(TARGETDIR)/$(PGM)
ifneq ($(REZ_OBJS),)
$(CP) $(REZ_OBJS)/..namedfork/rsrc $(TARGETDIR)/$(PGM)/..namedfork/rsrc
endif
$(CHTYP) -t $(FILETYPE) $(AUXTYPE) $(TARGETDIR)/$(PGM)
endif
else
# This is a special build for CDevs (maybe others also?) where we build the binary
# into a $(PGM).bin file and then build the resources into the $(PGM) target. The
# resource compile will read the $(PGM).bin binary and load it into the resources
# also.
ifeq ($(ASSEMBLER),orcam)
# This is a special build for CDevs under ORCA where we build the binary into
# a $(PGM).bin file and then build the resources into the $(PGM) target. The
# resource compile will read the $(PGM).bin binary and load it into the
# resources also.
$(BINTARGET): $(BUILD_OBJS)
$(LINK) $(LDFLAGS) $(BUILD_OBJS_NOSUFFIX) --keep=$(BINTARGET)
cd $(OBJDIR); $(LINK) $(LDFLAGS) $(patsubst $(OBJDIR)/%, %, $(BUILD_OBJS_NOSUFFIX)) --keep=$(BINTARGET)
endif
ifeq ($(ASSEMBLER),merlin)
# This is a special build for CDevs under Merlin where we build the binary into
# a $(PGM).bin file and then build the resources into the $(PGM) target. The
# resource compile will read the $(PGM).bin binary and load it into the
# resources # also.
$(BINTARGET): $(BUILD_OBJS) $(ASM_SRCS)
$(MERLIN_ASM) linkscript.s $(PGM) $(BINTARGET)
endif
$(REZ_OBJS): $(BINTARGET)
$(PGM): $(REZ_OBJS)
$(RM) $(PGM)
$(CP) $(REZ_OBJS) $(PGM)
$(CHTYP) -t $(FILETYPE) $(PGM)
$(TARGETDIR)/$(PGM): $(REZ_OBJS)
$(MKDIR) $(TARGETDIR)
$(RM) $(TARGETDIR)/$(PGM)
$(CP) $(REZ_OBJS) $(TARGETDIR)/$(PGM)
$(CHTYP) -t $(FILETYPE) $(AUXTYPE) $(TARGETDIR)/$(PGM)
endif
$(DISKIMAGE): $(PGM)
make/createDiskImage "$(DISKIMAGE)" "$(PGM)" "$(DISKIMAGEDEST)" $(COPYDIRS)
$(DISKIMAGE): $(TARGETDIR)/$(PGM)
make/createDiskImage "$(DISKIMAGE)" "$(TARGETDIR)/$(PGM)" "$(DISKIMAGEDEST)" $(COPYDIRS)
execute: $(EXECTARGET)
executeGUI: all
make/launchEmulator -doit
make/launchEmulator $(DISKIMAGE)
executeShell: all
$(ORCA) ./$(PGM)
$(ORCA) $(TARGETDIR)/$(PGM)
%.a: %.c
$(COMPILE) $< $(CFLAGS) --noroot
$(OBJDIR)/%.a: %.c
$(COMPILE) $< $(@:.a=) $(CFLAGS) --noroot
%.root: %.c
$(COMPILE) $< $(CFLAGS)
$(OBJDIR)/%.a: $(GENDIR)/%.c
$(COMPILE) $< $(@:.a=) $(CFLAGS) --noroot
%.macros: %.s
$(MACGEN) "$(MACGENFLAGS)" $< $@ $(MACGENMACROS)
$(OBJDIR)/%.root: %.c
$(COMPILE) $< $(@:.root=) $(CFLAGS)
%.ROOT: %.macros
$(ASSEMBLE) $(<:.macros=.s) $(ASMFLAGS)
$(OBJDIR)/%.root: $(GENDIR)/%.c
$(COMPILE) $< $(@:.root=) $(CFLAGS)
%.r: %.rez
$(REZ) $< $(REZFLAGS)
$(OBJDIR)/%.ROOT: %.s
MACGENFLAGS="$(MACGENFLAGS)" MACGENMACROS="$(MACGENMACROS)" $(ASSEMBLE) $< $(@:.ROOT=) $(ASMFLAGS)
$(OBJDIR)/%.ROOT: $(GENDIR)/%.s
MACGENFLAGS="$(MACGENFLAGS)" MACGENMACROS="$(MACGENMACROS)" $(ASSEMBLE) $< $(@:.ROOT=) $(ASMFLAGS)
$(OBJDIR)/%.r: %.rez
$(REZ) $< $(@:.r=) $(REZFLAGS)
ifneq ($(RLINT_PATH),)
$(ORCA) $(RLINT_PATH) $@
endif
$(OBJDIR)/%.r: $(GENDIR)/%.rez
$(REZ) $< $(@:.r=) $(REZFLAGS)
ifneq ($(RLINT_PATH),)
$(ORCA) $(RLINT_PATH) $@
endif
$(OBJS): Makefile

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
@ -44,6 +44,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+=
@ -84,10 +91,29 @@ COPYDIRS=copydir
# If you have it in a different location, specify that here.
# GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport
# 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

View File

@ -9,7 +9,7 @@ include make/head.mk
# where to find files, etc.
# The name of your system or binary file to build goes here:
PGM=abCalcNDA
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