/*
** CL special rules
**
** History:
**	12-Apr-89 (GordonW)
**		first history entry..
**		added copying of rcpconfig.default to $ING_BUILD/files
**	10-may-1989 (boba)
**		Renamed to MINGH.  Remove obsolite rules for .capabilities,
**		rcpconfig.default, and cltest.  Integrated rules from 5.0.
**	27-jul-1989 (dds)
**		$(ING_VERS)/src to path of ccpp files so they can be found!
**	13-mar-1990 (boba)
**		Make usable by both PD and UG by using $(NOISE) which
**		is set to /$(ING_VERS)/src by mkgeneric in generic.h
**		if ING_VERS is set.  Also remove obsolete dyld.ccpp
**		and dynamic linking stuff and add other symbols from
**		UG 6.2 version of this file.
**	05-apr-1990 (boba)
**		Add II_DUMP for 6.3.
**	10-apr-1990 (boba)
**		Remove rule for utexe.def.  This now comes from 
**		front/frontcl/files_unix.
**	29-may-90 (blaise)
**	    Integrated changes from 61 and ingresug:
**		Touch symbol.tbl to get around a known bug in ingsetenv;
**		Add default for II_FIFO_PATH;
**		Add special sun3 case for _setjmp.o, to be put into COMPAT.
**      29-may-90 (blaise)
**	    Inserted missing tab.
**	25-july-1990 (jonb)
**	    	Change rule for creating utld.def to use definitions from
**		ming/default.h.
**	21-nov-90 (sandyd)
**		Restore rule for utexe.def, since it is now back in the CL!
**	04-feb-91 (bonobo)
**		Added BAROQUE flag and some NOISE for use in development 
**		environment.
**	06-mar-91 (bonobo)
**		Added NOISE2 to prevent BAROQUE disaster where current 
**		installation's symbol.tbl is trashed by someone doing a
**		build.  Also prevents resetting of II_INSTALLATION and 
**		II_GCNXX_LCL_VNODE in the BAROQUE environment.
**	15-mar-91 (mikem/fredp)
**		DBE support.  Add support for carrying around special in CM
**		a special library of dbe versions of some object modules to 
**	        support 1024 file descriptors in a process.  The special
**		support is ifdef'd on compiler constants "sun" and "sparc"
**		because the config string is not available (following the
**		example of the "setjmp" special case previously implemented).
**	18-apr-1991 (bonobo)
**		Added a "DO_INGSET" variable to disable the symbol.tbl build
**		for dbmspe.  Also added a more convenient way to initialize
**		II_GCNII_LCL_VNODE (thanks jonb!).
**	25-sep-1991 (mikem) integrated following change: 21-aug-1991 (jonb)
**		Furthermore, disable the symbol.tbl build if we see evidence
**		that it's already been built.
**      04-nov-1992 (peterw) Integrated change from ingres63p to add 
**              utldcob rule for cobol.
**	03-dec-92 (kirke)
**		Add ingsetenv II_WORK for 6.5.
**	30-dec-92 (mikem)
**	        su4_us5 port of 6.5.  Got rid of DBE 1024 file descriptor 
**	        support.  It is not needed for solaris 2.0 and higher and 6.5
**	        will not be supported on versions below solaris 2.0.
**	18-jan-93 (dianeh)
**		Added II_LOG_FILE_PATH, and II_LOG_FILE_NAME to list of
**		symbols to set in symbol.tbl file target.
**	19-jan-93 (mikem)
**	        Backing out DBE support was premature, we will need to run
**	        on it at least through Beta.  This change effectively backs
**	        out the "30-dec-92 (mikem)" change.
**	27-jan-93 (lauraw)
**		Added II_TIMEZONE_NAME to ingsetenv list.
**	18-feb-93 (dianeh)
**		Removed special setting of HDR1; removed symbol.tbl target
**		(now gets created by the iisudbms utility); removed the
**		setjmp.o target (Sun3 not supported for 6.5); added an "o" flag
**		to the DBE .o targets (preserves the real date); added a new
**		target, dbe, which only gets called if VERS==su4_u42, and added
**		dbe.done to avoid having this whole thing get done every time
**		through.
**	16-mar-93 (dianeh)
**		Added SPECDIR symbol to point to local directory and added
**		a cd to $(SPECDIR) before running 'ming dbe' for those people
**		who continue to willfully and recklessly run ming at the
**		facility level.
**	31-mar-93 (vijay)
**		Add shadow password support.
**	31-mar-93 (vijay)
**		Change buildvalidpw to bvalidpw.
**	13-sep-93 (dianeh)
**		Changed the Sun4 RPC library stuff to just be a library in
**		$ING_BUILD/lib, and include it in Sun4's LDLIBMACH (in
**		default.h (mkdefault)).
**	19-oct-93 (robf)
**          Add su4_cmw to build dbe SunOS support
**	05-jan-94 (dianeh)
**		Changed where default.h is found -- it's in tools/port/hdr now.
**	06-jan-94 (dianeh)
**		Oops -- can't use NOISE for hdr directories, since they don't
**		have /src in their path.
**      29-sep-98 (yeema01)
**              Created file utcom.w4g which is required to compile
**              OpenRoad 3GL user procedures. 
**      11-Sep-2001 (hweho01)
**              Added entry for cktmpl_cpio.def file.
**      08-Dec-2003 (horda03) INGSRV 877 (Bug 97269)
**              Added entry for cktmpl_wrap.tpl file.
**      27-Apr-2004 (fanch01)
**              Added entry for cktmpl_ocfs.def file for OCFS support.
*/

$(BAROQUE:T=V)NOISE = /$(ING_VERS)/src
$(BAROQUE:T=V)HDRNOISE = /$(ING_VERS)
$(BAROQUE:T=N)SPECDIR = $(ING_SRC)/cl/clf/specials
$(BAROQUE:T=V)SPECDIR = $(ING_SRC)/cl/clf/$(ING_VERS)/src/specials

all : files lib

files:	\
	$(CLFILES)/cktmpl.def \
	$(CLFILES)/cktmpl_cpio.def \
	$(CLFILES)/cktmpl_ocfs.def \
	$(CLFILES)/cktmpl_wrap.tpl \
	$(CLFILES)/utcom.def \
        $(CLFILES)/utcom.w4g \
	$(CLFILES)/utexe.def \
	$(CLFILES)/utld.def \
	$(CLFILES)/utldcob.def \
	$(CLFILES)/iipwd/ingvalidpw.c

/*
** files
*/

$(CLFILES)/cktmpl.def: $(CL)/clf$(NOISE)/ck/cktmpl.ccpp
	$(RM) $(RMFLAGS) $(<)
	ccpp $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/cktmpl_cpio.def: $(CL)/clf$(NOISE)/ck/cktmpl_cpio.ccpp
	$(RM) $(RMFLAGS) $(<)
	ccpp $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/cktmpl_ocfs.def: $(CL)/clf$(NOISE)/ck/cktmpl_ocfs.ccpp
	$(RM) $(RMFLAGS) $(<)
	ccpp $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/cktmpl_wrap.tpl: $(CL)/clf$(NOISE)/ck/cktmpl_wrap.ccpp
	$(RM) $(RMFLAGS) $(<)
	ccpp $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/utcom.def: $(CL)/clf$(NOISE)/ut/utcom.ccpp
	$(RM) $(RMFLAGS) $(<)
	ccpp $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/utcom.w4g: $(CL)/clf$(NOISE)/ut/utcom.ccpp
        $(RM) $(RMFLAGS) $(<)
        ccpp $(>) > $(<)
        $(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/utld.def: $(CL)/clf$(NOISE)/ut/utld.ccpp
	$(RM) $(RMFLAGS) $(<)
	grep "^#" $ING_SRC/tools/port$(HDRNOISE)/hdr/default.h | \
	  cat - $(>) | ccpp > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/utldcob.def: $(CL)/clf$(NOISE)/ut/utldcob.ccpp
	$(RM) $(RMFLAGS) $(<)
	ccpp $(>) > $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/utexe.def: $(CL)/clf$(NOISE)/ut/utexe.def
	cp $(>) $(<)
	$(CHMOD) $(FILEMODE) $(<)

$(CLFILES)/iipwd/ingvalidpw.c: $(CL)/clf$(NOISE)/handy/ingvalidpw.x
	bvalidpw

/*
** lib
*/

/*
** Link with special Sun RPC library for SunOS4.1/SunDBE so that we can
** use more than 256 file descriptors per process.
*/

RPCLIB = $(DBELIB)/rpc1024.41.a

lib : $(RPCLIB)

$(RPCLIB) : dbesunlib.enc
	@-
	if [ "$(VERS)" = su4_u42 ] ; then
	echo "Building $(<) ..."
		(
		cd $(SPECDIR)
		uudecode dbesunlib.enc
		$(MV) $(<:PBS) $(<)
		ranlib $(<)
		)
	fi
