/*
**  Setup: after building tools; before building system.
**
** History:
**	02-jun-1989 (boba)
**		Enhancements for 6.1: build bzarch.h via mkbzarch;
**		build clsecret.h via mksecret.
**	31-jul-1989 (boba)
**		Moved from MING to MINGH and removed 5.0 stuff when 
**		added to ingresug.
**	6-oct-89 (daveb)
**		Remove mkernames stuff.  We don't generate this anymore,
**		but keep master files in CM that contain all possible errors.
**	21-dec-1989 (boba)
**		Change "$ING_SRC/cl" to "$(CL)" to fix ming problem.  Also,
**		remove dependency for clsecret.h on mksecret to make it like
**		mkbzarch & mkgv.  The porting documentation states that
**		these must be generated by direct invocation of the scripts
**		after they have been built once.  Otherwise, it's too easy
**		to update mksecret without knowing it, rebuild clsecret.h
**		and end up having to recompile the cl & relink everything.
**		Most mksecret changes are for OTHER platforms.
**    28-aug-1990 (jonb/chsieh)
**	      Ingegrate change # 260283:
**              Change the dependency of mksecret to $TOOLSBIN/mksecret instead
**              of $TOOLSBIN/mkscrtdir.
**	      Also, add rule to run mksysdep and re-mkming in the           
**	      admin/install/shell directory.
**	25-jan-1991 (jonb)
**		Building a better bootstrap: after building iisysdep,
**		use ming to copy all the install scripts to where they
**		go, and then run mkidir to create the installation
**		directories.
**	28-Oct-1991 (hallman)
**		run ming in admin/install/specials before running mksysdep
**		because it creates $ING_BUILD/utility/VERSION.ING which
**		is used by mksysdep.
**	18-may-92 (bonobo)
**		Made some additional changes for the BAROQUE environment.
**		Fixed SHDIR.  Added SPDIR.  Removed ER stuff and #include 
**		of default.h.
**	24-jun-92 (hallman)
**		Added $ING_BUILD/files to the list of directories that we
**		create manually because the ming in $(SPDIR) tries to
**		build stuff there before mkidir is run.  This is a problem
**		only the first time you run this MINGH file on a new porting
**		client.
**	10-jul-1992 (hallman)
**		Ming now knows how to build just shell (.sh) targets, so
**		when the initial build is done in tools/port and this MINGH
**		file gets run, only build the (.sh) targets in
**		admin/install/shell because when we try to build the
**		executables, ming complains about $(INGLIBS) not being
**		available.
**	18-jan-1993 (dianeh)
**		Added the VERS file in tools/port/conf as a
**		dependency for gv.h.
**	29-jan-93 (swm)
**		Corrected previous change to know about the BAROQUE enironment
**		and used ADMIN variable in preference to ING_SRC/admin.
**		Also, altered commands that create bzarch.h, clsecret.h, and
**		gv.h to remove the target file first; this avoids following
**		symbolic links, inadvertently, in the BAROQUE environment.
**	4-mar-93 (dianeh)
**		Removed the cd to admin/install/specials -- no longer
**		necessary; added an ingdirs target, since having the
**		directory stuff in the iisysdep target didn't really make
**		sense; change the iisysdep target to be the one in
**		$ING_BUILD/utility, since there's really no need to go
**		through a generated .sh file first, with the cd'ing and
**		the mkming'ing and all -- modified mksysdep.sh accordingly;
**		deleted the SHDIR and SPDIR symbols.
**	09-mar-93 (vijay)
**		iisysdep should be built after the utility directory is created.
**	10-mar-93 (vijay)
**		removing unnecessary checks for directories.
**	03-may-93 (dianeh)
**		Act on Dave Hallman's suggestion (back in March) to reorder the
**		targets on the "files:" dependency list so that the ingdirs
**		target comes before the iisysdep target, and remove the -d test
**		Vijay added; change "files:" target to be "all:", since it's
**		not just files getting built anymore.
**	03-may-93 (dianeh)
**		Back out previous change (that's what I get for reviewing old
**		mail, without reviewing all of it first.)
**	14-oct-93 (peterk)
**		Let mkidir be run for baroque environments as well; don't
**		know it was turned off, but baroque needs it for cold-start
**		scratch builds and it doesn't seem to hurt running it if the
**		directories are already there.
**	30-Apr-99 (bonro01)
**		iisysdep needs to be rebuilt if any of the files or scripts
**		that it calls get updated.  I've identified the VERS file,
**		the default.h file, and the shlibinfo script as being
**		dependancies.
**	28-Nov-00 (bonro01)
**		Fix my last change. Baroque hdr directories don't have
**		the directory src as part of the path name.
**	28-apr-2000 (somsa01)
**		When running mkgv, make sure we pass the product name.
**	2-Jan-2002 (bonro01)
**		Add CONFIG as dependancy for gv.h
*/

$(BAROQUE:T=N)HDRCL = $(CL)/clf/hdr
$(BAROQUE:T=V)HDRCL = $(CL)/clf/$(ING_VERS)/hdr
$(BAROQUE:T=N)CONFDIR = $(TOOLSSRC)/port/conf
$(BAROQUE:T=V)CONFDIR = $(TOOLSSRC)/port/$(ING_VERS)/src/conf
$(BAROQUE:T=N)HDRDIR = $(TOOLSSRC)/port/hdr
$(BAROQUE:T=V)HDRDIR = $(TOOLSSRC)/port/$(ING_VERS)/hdr
MKIDIR = mkidir

all:	$(HDR3)/gv.h $(HDR3)/bzarch.h $(HDRCL)/clsecret.h $(HDR3)/ernames.h \
	$(INGUTIL)/$(PROG1PRFX)sysdep ingdirs

$(HDR3)/bzarch.h:	$(TOOLSBIN)/mkbzarch
	( cd $(HDR3); rm -f bzarch.h ; mkbzarch )

$(HDR3)/gv.h:	$(TOOLSBIN)/mkgv $(CONFDIR)/VERS $(CONFDIR)/CONFIG
	( cd $(HDR3); rm -f gv.h ; mkgv $(PRODNAME) )

$(HDRCL)/clsecret.h:	$(TOOLSBIN)/mksecret
	( cd $(HDRCL); rm -f clsecret.h ; mksecret )

$(INGUTIL)/$(PROG1PRFX)sysdep:	$(TOOLSBIN)/mksysdep $(CONFDIR)/VERS \
	$(HDRDIR)/default.h $(TOOLSBIN)/shlibinfo
	[ -d $(INGUTIL) ] || mkdir $(INGUTIL)
	mksysdep

ingdirs:
	$(MKIDIR)
