/*
** MING file for front!tools!erxtract
**
** History:
**	27-sep-1990 (boba)
**		Created based on the old README and erstract.sh.
**		All original files left for historical purposes.
**	27-sep-1990 (boba)
**		Added chmod to get correct permissions.
**	03-dec-1990 (sandyd)
**		Added rule to copy messages.doc file also.
**	17-feb-1993 (dianeh)
**		Modified to reflect new mkfecat, which cats all the
**		.msg files together, not just the front-end ones,
**		into fe.cat.msg; modified commands for messages.doc
**		target to use ming's automatic variables.
**	10-mar-1993 (dianeh)
**		Reinstated the er*.msg files, since mkfecat ended up
**		not cat'ing all the files together afterall, but this
**		time made them real dependencies so messages.txt only
**		rebuilds when it should; modified messages.doc target
**		to not include it's own full path for the source file
**		and to use sed and cpp rather than just cp'ing the
**		file (see messages.doc).
**	23-mar-1993 (rkumar)
**		'sed' on some platforms (Sequent, SGI etc.,) doesn't
**		work properly with comments in the script file. So, create
**		a temporary sed script file without comments and delete it
**		when done.
**	26-mar-1993 (rkumar)
**		Modify the regular expression on grep command to handle
**		comments beginning on columns other than 1.
**	26-mar-1993 (rkumar)
**		Incorporating rdrane's changes from ingres65
**		1. Fully qualifying the file names
**		2. Extending the grep to postxrct.sed file (it doesn't
**		  have any comments at the moment, but may someday ..)
**	29-mar-1993 (rdrane)
**		Add comment that contents of grep '[]' pattern is
**		exactly SPACE TAB (0x'2009'), and not simply blanks
**		or other arbitrary white space.
**	31-mar-1993 (swm)
**		Make ming rules cater for the BAROQUE environment.
**	29-sep-1993 (dianeh)
**		Deleted the sed/awk/sed-script trio and just put everything
**		into the command-block for the messages.txt target; use yapp
**		for messages.doc.
**	11-oct-1993 (dianeh)
**		Apparently, some messages start with S_.
**	04-nov-1993 (dianeh)
**		Only pick up S_DU, not all S_'s.
**	24-jan-1996 (canor01)
**		Pick up eraif.msg
**      28-jun-1999 (hanch04)
**          Changed messages.doc to messages.readme.
**	11-dec-2002 (hanch04)
**	    Updated to include all of the latest message files.
*/

$(BAROQUE:T=N)NOISE = ""
$(BAROQUE:T=V)NOISE = /$(ING_VERS)/src

MSGFILES = \
$(HDR2)/eradf.msg \
$(HDR2)/eraif.msg \
$(HDR2)/erclf.msg \
$(HDR2)/erddf.msg \
$(HDR2)/erdmf.msg \
$(HDR2)/erdo.msg \
$(HDR2)/erduf.msg \
$(HDR2)/ereo.msg \
$(HDR2)/ergcf.msg \
$(HDR2)/erglf.msg \
$(HDR2)/ergwf.msg \
$(HDR2)/erjdbc.msg \
$(HDR2)/erodbc.msg \
$(HDR2)/erom.msg \
$(HDR2)/eropf.msg \
$(HDR2)/erpsf.msg \
$(HDR2)/erpw.msg \
$(HDR2)/erqef.msg \
$(HDR2)/erqsf.msg \
$(HDR2)/errdf.msg \
$(HDR2)/errqf.msg \
$(HDR2)/erscf.msg \
$(HDR2)/erse.msg \
$(HDR2)/ersm.msg \
$(HDR2)/ersxf.msg \
$(HDR2)/ertpf.msg \
$(HDR2)/erulf.msg \
$(HDR2)/erurs.msg \
$(HDR2)/erusf.msg \
$(HDR2)/erw4.msg \
$(HDR2)/erwc.msg \
$(HDR2)/erwn.msg \
$(HDR2)/erwr.msg \
$(HDR2)/erwsf.msg \
$(HDR2)/fe.cat.msg


files: $(FRONTFILES)/english/messages/messages.txt \
	$(FRONTFILES)/english/messages/messages.readme

$(FRONTFILES)/english/messages/messages.txt: $(MSGFILES)
	@-
	$(RM) $(RMFLAGS) $(<)
	echo "Building $(<) ..."
	cat $(MSGFILES) | \
	awk '/^[EWI]_|^S_DU/ { print "" ; print ; print "" ; } \
	     /^\/\*%/,/^\*\// { print ; }' | \
	sed -e "s/User Action:/Recommendation:/" \
	    -e "s/Description:/Explanation:/" \
	    -e "s:^/\*%::" \
	    -e "s:^\*\*::" \
	    -e "s:^\*/::" > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(FRONTFILES)/english/messages/messages.readme : messages.readme
	@-
	echo "Building $(<) ..."
	yapp -H## $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)
