/*
	catcomp.srx

	Compile a catalog description file to an C header file.

	© 1996/97 HAAGE & PARTNER GmbH

	$VER catcomp.srx 1.1 (14.2.97)

	Warning: The function "GetString()" which will be generated by catcomp and
	used by setting "#define CATCOMP_CODE" ever uses the global symbol
	_LocaleBase for calling the function "GetCatalogStr()" from locale.library
	and not the expression li->li_LocaleBase.

*/

/* Don't forget the point '.' at the end      \/        */
PARSE ARG '"' filename '"' '"' projectname '"' .

/* Replace suffix ".cd" by ".h" */
objectname = LEFT(filename,LASTPOS('.cd',filename)-1)||"CD.h"
objectname2 = LEFT(filename,LASTPOS('.cd',filename)-1)||"CD.asm"

SAY ""
SAY "Catcomp Script ©1996/97 HAAGE & PARTNER GmbH"
SAY "Compile "||filename||" to header "||objectname||"."

/* set object file of catalog file */
OBJECTS filename objectname objectname2

/* compile */
ADDRESS COMMAND "catcomp "||filename||" CFILE "||objectname||" ASMFILE "||objectname2||" XDEF"

/* add object file to project */
ADDFILE objectname QUIET
ADDFILE objectname2 QUIET

SAY "Done."
