mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-23 23:33:03 +00:00
Added Makefile and a02.sh shell script
This commit is contained in:
parent
470e89210e
commit
44410ce0ce
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
gccopts=-Wno-format-extra-args
|
||||||
|
incfiles=common.c files.c label.c asm.c parse.c vars.c expr.c cond.c stmnt.c include.c
|
||||||
|
mainfile=c02.c
|
||||||
|
outfile=c02
|
||||||
|
c02: ${incfiles} ${mainfile}
|
||||||
|
gcc ${gccopts} ${incfiles} ${mainfile} -o ${outfile}
|
||||||
|
clean:
|
||||||
|
rm *.o ${outfile}
|
||||||
|
|
24
a02.sh
Normal file
24
a02.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Assemble C02 Program
|
||||||
|
|
||||||
|
#Check for Command Line Argument
|
||||||
|
if [[ "$1" = "" ]]; then
|
||||||
|
echo "Usage: $SNAM file[.asm]"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Split File Name Parts
|
||||||
|
FSPC=$1; #File Spec
|
||||||
|
FNAM=${FSPC%.*}; #File Name without Extension
|
||||||
|
FEXT=${FSPC##*.}; #File Extension
|
||||||
|
|
||||||
|
#Assemble ASM File
|
||||||
|
dasm $FNAM.asm -f3 -o$FNAM.bin -l$FNAM.lst -s$FNAM.sym
|
||||||
|
ESTS=$?; #Exit Status
|
||||||
|
if [[ $ESTS -ne 0 ]]; then
|
||||||
|
echo "Error compiling file $FNAM.asm"
|
||||||
|
exit $ESTS
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Report Successful Completion
|
||||||
|
echo "Successfully assembled file $FSPC"
|
Loading…
Reference in New Issue
Block a user