/*
**  FRONT specials.
**
** History:
**	09-may-1989 (boba)
**		Converted from 5.0.  NOTE: I couldn't get the generation
**		of abfurts.h working, so the the default version in 
**		front/frontcl/files is currently being delivered.
**	10-may-1989 (boba)
**		Added initialization of dayfile from dayfile.dst, fixed
**		the commenting out of the abfurts.h rule, and added some
**		header comments.
**	27-jul-1989 (kimman)
**		Added dnet (DECnet) to list of libraries for abf.opt 
**	31-Jul-89 (GordonW)
**		Added -lcrypt for Sequent
**	15-Aug-89 (kimman)
**		Added abfimain to list of libs similiar to abfmain.
**		This will put abfimain.obj into libs.  (as per jonathan wong)
**	03-oct-1989 (kimman)
**		Removed dnet (DECnet) to list of libraries for abf.opt 
**	14-dec-1989 (rudyw)
**		Removed references to abf.stb which is no longer used
**		and caused error messages to appear during 'mk' in front
**	10-Jan-1990 (blaise)
**		Replaced abf.opt with abflnk.opt and abfdyn.opt, the two
**		files which have replaced abf.opt. Call ccpp rather than
**		/lib/cpp when building these files, for the interpretation
**		of "#ifdef xxx_ooo" in the .ccpp file. Added nsl_s to the
**		list of libraries used to build abflnk.opt & abfdyn.opt.
**	12-Jan-1990 (blaise)
**		Change so that abflnk.opt and abfdyn.opt are both built from
**		abfopt.ccpp, instead of having separate ccpp files.
**	01-Mar-1990 (kimman)
**		Fixed typo.
**	12-Nov-1990 (jonb)
**		Use the configabf install script to create the abfdyn.opt
**		and abflnk.opt files.
**	30-dec-1991 (sandyd)
**		Added rules for w4gl05sq.o, which allows Windows4GL/05 users
**		to use make3gllib with 3GL that was preprocessed under 6.4 SQL.
**		(This is a workaround for bug 41576.)
**	6-mar-1992 (jonb)
**		Add rule for oslhdr.h.  It needs to be preprocessed to get
**		some definitions propagated from bzarch.h.
**	22-apr-1992 (mgw)
**		Add sed rule for translating DUMMY_ALIGN to ALIGN_RESTRICT
**		in oslhdr.h rule to facilitate getting the ALIGN_RESTRICT
**		value from bzarch.h and correctly into the oslhd.h.
**	14-sep-92 (deannaw)
**		Changed @ to % since AIX cpp does not like @'s.  Changed
**		MINGH to accept this change.
**	18-feb-93 (dianeh)
**		Removed w4lq stuff; removed explicit echo (for configabf);
**		removed large commented-out block, since there's really no
**		need to keep it in here (you can always retrieve it from
**		a previous version).
**	09-mar-93 (sandyd)
**		Added steps to get customer deliverables "iixa.h" and "xa.h"
**		from embed/hdr into $(FRONTFILES) so the manifest can pick 
**		them up.  (Also removed the comment from the top of this file,
**		since it is no longer true.)
**	17-mar-93 (dianeh)
**		Changed call to configabf to iisuabf (configabf is gone for
**		6.5, replaced by iisuabf); added a config.done so it doesn't
**		keep doing it over again; general clean-up (use .FILE rule,
**		add .USE rules, etc.)
**	18-mar-93 (dianeh)
**		Keep forgetting the world uses 8-space tabstops...
**	31-mar-93 (vijay)
**		set permissions on oslhdr.h.
**	20-Apr-93 (fredv)
**		abfmain.o should not be hard coded in the .USE rules.
**		Fixed it so that the rules can be used for abfimain.o.
**	5-May-93  (tomm)
**		Solaris ar will always extract into current working
**		directory.  Changed rules to unpack into CWD, mv
**		into place then link.  Basically, put back rules prior to
**		version 7 changes.
**	4-may-93  (dianeh)
**		Reinstate earlier improvement, but specify just the filename
**		for the ar extraction and add a mv for the .o's; also, use
**		Mingbase variable rather than command names and flags.
**	26-aug-93  (dianeh)
**		Put the .o/.obj files into the files target -- these aren't
**		libraries (though they build into $ING_BUILD/lib), and having
**		them be a libs target has them getting done too early in the
**		build process.
**	03-sep-93  (dianeh)
**		Add a missing backslash after abfimain.obj.
**      10-Jul-2001 (hweho01)
**              Replaced the hard coded option for ar command
**              with AREXTRFLAGS, allow platform specific entries.
*/

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

/* target to effect creation of big libraries on System V */

all : files abfconfig

files : \
	$(FRONTLIB)/abfmain.o   \
	$(FRONTLIB)/abfimain.o \
	$(FRONTLIB)/abfmain.obj \
	$(FRONTLIB)/abfimain.obj \
	$(FRONTFILES)/dayfile \
	$(FRONTFILES)/iixa.h \
	$(FRONTFILES)/oslhdr.h \
	$(FRONTFILES)/startup \
	$(FRONTFILES)/startsql \
	$(FRONTFILES)/xa.h

.ABFO : .USE
	@-
	echo "$(AR) $(AREXTRFLAGS) $(ABFRTSLIB) $(<:B:S) ..."
	$(AR) $(AREXTRFLAGS) $(ABFRTSLIB) $(<:B:S)
	echo "$(MV) $(MVFLAGS) $(<:B:S) $(FRONTLIB) ..."
	$(MV) $(MVFLAGS) $(<:B:S) $(FRONTLIB)
	echo "$(CHMOD) $(LIBMODE) $(<) ..."
	$(CHMOD) $(LIBMODE) $(<)

.ABFLN : .USE
	@-
	echo "$(RM) $(RMFLAGS) $(<) ..."
	$(RM) $(RMFLAGS) $(<)
	echo "$(LN) $(>) $(<) ..."
	$(LN) $(>) $(<)

$(FRONTLIB)/abfmain.o : $(ABFRTSLIB) .ABFO
$(FRONTLIB)/abfimain.o : $(ABFRTSLIB) .ABFO

$(FRONTLIB)/abfmain.obj :  $(FRONTLIB)/abfmain.o .ABFLN
$(FRONTLIB)/abfimain.obj : $(FRONTLIB)/abfimain.o .ABFLN

$(FRONTFILES)/dayfile : $(FRONTFILES)/dayfile.dst .FILE
$(FRONTFILES)/iixa.h : $(EMBED_HDR_DIR)/iixa.h .FILE
$(FRONTFILES)/startup : $(FRONTFILES)/startup.dst .FILE
$(FRONTFILES)/startsql : $(FRONTFILES)/startsql.dst .FILE
$(FRONTFILES)/xa.h : $(EMBED_HDR_DIR)/xa.h .FILE

$(FRONTFILES)/oslhdr.h : oslhdr.cpp
	ccpp $(>) | sed -e 's/\/%/\/\*/g' \
			-e 's/%\//\*\//g' \
			-e 's/DUMMY_ALIGN/ALIGN_RESTRICT/g' \
			-e 's/^%//' > $(<) 
	$(CHMOD) $(FILEMODE) $(<)


abfconfig :
	@-
	if [ ! -f $(ING_SRC)/front/frontcl$(NOISE)/specials_unix/config.done ]
	then
	  iisuabf -batch && touch config.done
	fi

