#! /bin/csh

# Create help file for GNU Tools assembly

echo "ASSEMBLE"						>  __spec.s
echo "	NIBASC /HPHP48-X/	* Download header"	>> __spec.s
echo "	INCLUDE	SupRomEntr.a	* Supported Entries"	>> __spec.s
echo "	INCLUDE	__head.a	* Library header"	>> __spec.s
echo "	LISTM			* List includes"	>> __spec.s
echo "RPL"						>> __spec.s
echo "	INCLUDE	../global.s	* ALG48 Definitions"	>> __spec.s
echo "	INCLUDE	../equ.s	* ALG48 Romptrs"	>> __spec.s
echo "	INCLUDE	../extern.h	* ALG48 Externals"	>> __spec.s
echo "	INCLUDE specfun.s	* SPECFUN"		>> __spec.s
echo "ASSEMBLE"						>> __spec.s
echo "	CLRLIST	INCLUDE"				>> __spec.s
echo "	INCLUDE	__hash.a	* Library tables"	>> __spec.s
echo "	INCLUDE	__end.a		* Library end"		>> __spec.s
echo "RPL"						>> __spec.s

######################################################################
echo Assembling rpl..
rplcomp __spec.s __spec.a __spec.ext
######################################################################

echo Building tables..
echo "TITLE SPECFUN Library"			> __build.mn
echo "OUTPUT __xx.o"				>> __build.mn
echo "LLIST __xx.lr"				>> __build.mn
echo "CONFIGURE SPECcfg"			>> __build.mn
# echo "MESSAGE SPECmsg"			>> __build.mn
echo "NAME SPECFUN 4.0:c96 Fin"			>> __build.mn
echo "ROMPHEAD __head.a"			>> __build.mn
echo "REL __spec.o"				>> __build.mn
echo "TABLE __hash.a"				>> __build.mn
echo "FINISH __end.a"				>> __build.mn
echo "END"					>> __build.mn

makerom __build.mn __build.m

######################################################################

echo Assembling code..
if ($1 == -l) then
	sasm -EH __spec
	mv __spec.l spec.l
else
	sasm -EHN __spec
endif
lbcrc __spec.o
mv __spec.o specfun.lib

######################################################################
