.key source/a,dest/a
.bra {
.ket }

FailAt 21

P2C {source} -a -o t:P2Ctmpfile.c

IF ERROR

  QUIT 20

ENDIF

;insert the compiler options you want
cc -fa -so t:P2Ctmpfile

IF ERROR
  delete >NIL: t:P2Ctmpfile.c
  echo "Fatal error: could not compile."
  QUIT 20
ENDIF

delete >NIL: t:P2Ctmpfile.c
;insert the linker libraries you want
ln -o {dest} t:P2Ctmpfile -lp2c -lma -lc

IF ERROR
  delete >NIL: t:P2Ctmpfile.o
  echo "Fatal error: could not link."
  QUIT 20
ENDIF  

delete >NIL: t:P2Ctmpfile.o
