/*
** This directory (generic!common!hdr!oldmsg) contains preserved snapshots
** of old .msg source so that we can recreate old-format message files
** ({fast,slow}.mnx, {fast,slow}_v1.mnx, and {fast,slow}_v2.mnx) in new
** releases.
** 
** Those old .mnx files must continue to be distributed so that customers 
** won't have to relink applications that were previously linked with INGRES 
** subroutines expecting to find the old-format message files at runtime.
** 
** This directory contains the following files:
**
**	MINGH		This file.
**
**	v0_cat.msg	Concatenated snapshot of Release 6.1 message source.
**
**	v1_cat.msg	Concatenated snapshot of Release 6.2 message source.
**
**	v2_generic.msg	Concatenated snapshot of Release 6.3/02 message source
**			files that use generic error mappings.
**	v2_other.msg	Concatenated snapshot of Release 6.3/02 message source
**			files that do not use generic error mappings.
**	v2_generr.h	Snapshot of 6.3/02 generr.h file.
**
**	(Partitioning of the concatenated "v2" .msg source into separate files
**	for those messages that use generic mappings and those that don't is
**	required by the v2 ercompiler interface.)
**
** This file contains the rules to recreate each old .mnx format from the
** snapshot of the .msg source that existed at the time that old .mnx format 
** was current.  (See unix!cl!clf!erold for the ercompilers used to process 
** these old .msg files.)
**
** History:
**	29-nov-90 (sandyd)
**	    Created.  (Thanks to BobA for collecting the v0_cat.msg and
**	    v1_cat.msg source.)
**	01-Dec-1994 (kch)
**		Reverted to newline style using backslashes.
**		Previous change uncommented.
*/

GENERRNAME =		v2_generr.h

SOURCES_V0 =		v0_cat.msg
SOURCES_V1 =		v1_cat.msg
SOURCES_V2 =		v2_generic.msg v2_other.msg
SOURCES_V3 =		v3_generic.msg v3_specific.msg


files :			$(INGMSG)/fast_v3.mnx $(INGMSG)/slow_v3.mnx \
	 		$(INGMSG)/fast_v2.mnx $(INGMSG)/slow_v2.mnx \
			$(INGMSG)/fast_v1.mnx $(INGMSG)/slow_v1.mnx \
			$(INGMSG)/fast.mnx $(INGMSG)/slow.mnx


$(INGMSG)/fast_v3.mnx : $(SOURCES_V3)

	@
	$(ERCOMPILE_V3)  -g$(GENERRNAME) -f$(<) $(SOURCES_V3)
	chmod $(FILEMODE) $(<)

$(INGMSG)/slow_v3.mnx : $(SOURCES_V3)

	@
	$(ERCOMPILE_V3)  -g$(GENERRNAME) -s$(<) $(SOURCES_V3)
	chmod $(FILEMODE) $(<)


$(INGMSG)/fast_v2.mnx : $(SOURCES_V2)

	@
	$(ERCOMPILE_V2)  -g$(GENERRNAME) -f$(<) $(SOURCES_V2)
	chmod $(FILEMODE) $(<)

$(INGMSG)/slow_v2.mnx : $(SOURCES_V2)

	@
	$(ERCOMPILE_V2)  -g$(GENERRNAME) -s$(<) $(SOURCES_V2)
	chmod $(FILEMODE) $(<)


$(INGMSG)/fast_v1.mnx : $(SOURCES_V1)

	@
	$(ERCOMPILE_V1) -f$(<) $(SOURCES_V1)
	chmod $(FILEMODE) $(<)

$(INGMSG)/slow_v1.mnx : $(SOURCES_V1)

	@
	$(ERCOMPILE_V1) -s$(<) $(SOURCES_V1)
	chmod $(FILEMODE) $(<)


/*
** Note that we use the V1 ercompiler also for the V0 messages.  That is
** because (for all UNIX ports except Sun3) the V0 and V1 .mnx formats
** are actually the same.  (For more on this history, see the README in 
** unix!cl!clf!erold)
**
** Note also that ercompile always generates BOTH fast and slow .mnx output 
** files each time it runs.  But each ming rule treats only one of those
** outputs as a real target (with the other output file just getting dumped 
** into the current directory as a side-effect of ercompile).  Just to avoid
** potential mistakes, when we use the V1 ercompiler to generate V0 targets we 
** override the default "_v1.mnx" name for the side-effect output as well
** as the real target (by specifying "-sslow.mnx" or "-ffast.mnx") on the
** command line.
*/
$(INGMSG)/fast.mnx : $(SOURCES_V0)

	@
	$(ERCOMPILE_V1) -f$(<) -sslow.mnx $(SOURCES_V0)
	chmod $(FILEMODE) $(<)

$(INGMSG)/slow.mnx : $(SOURCES_V0)

	@
	$(ERCOMPILE_V1) -s$(<) -ffast.mnx $(SOURCES_V0)
	chmod $(FILEMODE) $(<)
