#! /bin/csh

# Create help file for GNU Tools assembly

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

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

echo Building tables..
echo "TITLE LONG Library"			> __build.mn
echo "OUTPUT __xx.o"				>> __build.mn
echo "LLIST __xx.lr"				>> __build.mn
echo "CONFIGURE LONGcfg"			>> __build.mn
# echo "MESSAGE LONGmsg"			>> __build.mn
echo "NAME LONG 4.0:c96 Fiechter & Fin"		>> __build.mn
echo "ROMPHEAD __head.a"			>> __build.mn
echo "REL __long.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 __long
	mv __long.l long.l
else
	sasm -EHN __long
endif
lbcrc __long.o
mv __long.o long.lib

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

