/*
 *	 Imakefile for asedit Release 1.3
 *	 (C) A. Stochniol, 1993 - 1994
 *	 24 June 1994
 */

#include "As.rul"

#ifndef XCOMM
#define XCOMM #
#endif


/*   -----------------
 *   *** 1. SELECT ***
 *
 *   which Motif, Xt Toolkit and X library are you using ?
 *
 *   Usually you do NOT have to change XMLIB, XTOOLLIB and XLIB definitions 
 *   that follows unless you use non-standard libraries (for example 
 *   shared libraries in IRIX 4, in which case you would probably use 
 *   "-lXm_s -lPW", "-lXt_s", "-lX11_s" respectively).
 *   Note that on some systems you might not need PW library at all (see below).
 *
 *   If you use libraries located in non-standard tree you might define
 *   my LOCAL_X_LIBDIR variable instead of specifiying the full pathname for
 *   each library (see the SUN example).
 */

LOCAL_X_LIBDIR =

XMLIB    = -lXm -lPW

XCOMM - HP PW setup:  		XMLIB = -lXm -lc -lPW
XCOMM - SUN setup:    		XMLIB = -lXm
XCOMM - SUN SOLARIS 2.x setup: 	XMLIB = -lXm -lgen

/*
 *   Do NOT specify XTOOLLIB and XLIB unless you have to;
 *   Under X11R6 (w/o fix-01) you have to add also -lSM -lICE -lXext;
 *   The default setting for pre X11R6  is shown bellow
 *   Note that for some platforms you might need to specify them!
 */
XCOMM XTOOLLIB = -lXt
XCOMM XLIB     = -lX11

/*
 *  DEC settings (old)
 */
XCOMM  XMLIB = /usr/lib/DXM/lib/Xm/libXm.a
XCOMM  XTOOLLIB = /usr/lib/DXM/lib/Xt/libXt.a
XCOMM  STD_INCLUDES = -I/usr/lib/DXM/lib -I/usr/lib/DXM/lib/Xt
XCOMM
/*  
    SUN settings (to use uncomment the lines below)	
*/
XCOMM  LOCAL_X_LIBDIR =  -L/usr/local/motif/1.2.1/lib
XCOMM  STD_INCLUDES = -I/usr/local/motif/1.2.1/include

/*
    SOLARIS settings (to use uncomment the lines below)
*/
XCOMM SOLARIS2  LOCAL_X_LIBDIR =  -L/usr/ccs/lib -L/usr/openwin/lib -L/usr/local/motif/lib -R/usr/openwin/lib:/usr/local/motif/lib
XCOMM SOLARIS2  STD_INCLUDES = -I/usr/openwin/include -I/usr/local/motif/include

/* 
 *  Settings for X11R6 installed in /usr/local/X11R6
 */
XCOMM LOCAL_X_LIBDIR =  -L/usr/local/X11R6/lib
XCOMM STD_INCLUDES = -I/usr/local/X11R6/include

/*
 *  for SUN you might have to to declare additionally
 *  Xext and m (mathematical) libraries ... (uncomment the next line)
 *  (do NOT do this unless you have problems )
 */
XCOMM      XLIB     = -lXext -lX11 -lm
 
/*
 *   HP-UX 8.x settings (to use uncomment the lines below)
 */
XCOMM   LOCAL_X_LIBDIR =  -L/usr/lib/Motif1.1 -L/usr/lib/X11R4
XCOMM   STD_INCLUDES = -I/usr/include/Motif1.1 -I/usr/include/X11R4



SYS_LIBRARIES =  $(LOCAL_X_LIBDIR) $(XMLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)


/*   -----------------------------------------------------
 *   *** 2. DEFINE *** backup file suffix (default: .bak )
 *   (it might be overriden by the user using asedit backupFileSuffix X resource)
 */

Backup_file_suffix = .bak



/*   ----------------------------------
 *   *** 3. WHERE *** to install asedit
 *
 *   If you install contributed X applications in their standard place you do
 *   NOT have to change the default definitions for BINDIR, XAPPLOADDIR, MANDIR
 *   and LIBDIR.  But if you would like to install asedit somewhere else
 *   you have to uncomment the lines that defines those names and explicitly
 *   define appropriate directories (bear in mind that what is currently written
 *   are the most often used X-Window defaults obtained after applying standard
 *   X11 templates, i.e. they might be different on your system).
 *   BINDIR 		- defines where the executables are installed
 *   XAPPLOADDIR 	- defines where the app defaults files are installed
 *   MANDIR      	- defines where the man pages are installed (standard suffix assumed)
 *   LIBDIR      	- defines where the help file(s), etc. are installed
 *
 *   Note: for the international Release we redefine XAPPLOADDIR to take
 *   into account the INST_LANG environment variable! This allow us installing
 *   multiple language versions with a single Makefile.
 *   If the INST_LANG is not defined the default appdefs will be taken and they
 *   will be installed in a standard place (*without* LANG prefix). Set this 
 *   variable when you call Makefile, if necessary.
 */

XCOMM   BINDIR  = /usr/bin/X11
XCOMM   MANDIR = /usr/man/mann
XCOMM   LIBDIR = /usr/lib/X11

XAPPLOADDIR = ${LIBDIR}/${INST_LANG}/app-defaults


/*   The main application defaults file ...
 */

AD_FILE = ./${INST_LANG}/Asedit

/*
 *   Special note for IBM RS/6000
 *   If you would like to install asedit in the standard IBM X examples tree
 *   you might do that easily just specifying appropriately the TOP variable.
 *   If that's the case uncommenting the following "TOP=..." line should do.
 */
 
XCOMM   TOP=/usr/lpp/X11/Xamples


/*   -------------------------------------------------------------------
 *   *** 4. SPECIFY **** where do you want the help file to be installed
 *   (it might be overriden by the user using asedit helpDir X resource)
 */

Help_dir = ${LIBDIR}


/*
 *   --------------------------------------------------------------------
 *   *** 5. TUNE **** specifically to your system if something goes wrong
 *
 *
 *   you might need to increase the String literal space for asedit.c compilation: if
 *   it is needed (because of the fallbacks), simply uncomment one of the STRING_INC
 *   lines below.
 *
 */
 
XCOMM (SGI & DEC)   STRING_INC  = -Wf,-XNl4096
XCOMM (HP-UX ?)     STRING_INC  = -Wp,-H50000

/*   If you find that prototypes are not supported on your system
 *   (non ANSI C, vanilla SUN, etc.) then uncomment the next line
 *   that defines No_proto_def
 */
 
XCOMM   No_proto_def = -D_NO_PROTO

/*
 *   If you find that MAXPATHLEN is not defined then uncomment the next line
 */
XCOMM   No_maxpathlen_def = -DMAXPATHLEN=1024

/*   Do NOT read this paragraph unless you have buggy Motif 1.1 implementation.
 *   I have used a focusCallback to set focus to a text widget inside  prompt
 *   dialogs (& inside other dialogs) when the dialog is first managed.
 *   UNFORTUNATELY this trick corrupts the dialog callback list on ONE computer.
 *   It is a DEC running X11R4 and Motif 1.1.  So I think it might be a bug.
 *   The corruption happens when you manage a dialog (for example Search/Go to line..)
 *   & set a focus to the dialog, next take away the focus & next set a focus
 *   to the dialog (using for example a pointer). At that stage the program
 *   blows up ! I've tried different ways to get around that problem  and preserve
 *   setting the focus to the text widget but I've failed. So if you get such
 *   a problem the only work around is to define XFOCUS_BUG and rebuild asedit
 *   (but you won't get the text widget focused when you first manage dialogs!
 *    Define xfocus_bug as -DXFOCUS_BUG below).
 */
XCOMM   xfocus_bug  = -DXFOCUS_BUG

 
/* For HP-UX 8.x add in the  DEFINES line the following extra element:
 *              -Aa -D_HP_UX_SOURCE
 * For IBM RS/6000 with AIX 3.2.5 you might add extra memory for optimizations as
 * in the following line:
	-qmaxmem=4000
 */

XCOMM ISPELL vers.  DEFINES = -O  -DISPELL $(No_proto_def) $(No_maxpathlen_def) $(xfocus_bug)
DEFINES = -O  $(No_proto_def) $(No_maxpathlen_def) $(xfocus_bug)


/*
 *    END of customisation part of the Imakefile
 */



      SRCS = asedit.c as_menuh.c file_rw.c clipbrd.c \
	     write_l.c find_pos.c asutil.c undo.c ht_help.c  mk_asdat.c\
	     file_dlg.c file_act.c srch_dlg.c srch_act.c editarea.c \
	     calc_lc.c exec_cmd.c tool_dlg.c

      OBJS = asedit.o as_menuh.o file_rw.o clipbrd.o \
	     write_l.o find_pos.o asutil.o undo.o ht_help.o  mk_asdat.o\
	     file_dlg.o file_act.o srch_dlg.o srch_act.o editarea.o \
	     calc_lc.o exec_cmd.o tool_dlg.o




/*   asedit dependencies .....	*/

asedit.o  :	asedit.h clipbrd.h machine.h xresrc.h asedit.ico Asedit.ad.h version.h

as_menuh.o:	asedit.h
asutil.o:	asedit.h  asedit.ico
editarea.o:	asedit.h
file_act.o:	asedit.h
file_dlg.o:	asedit.h 
file_rw.o:	asedit.h
ht_help.o:	asedit.h
mk_asdat.o:	asedit.h
srch_act.o:	asedit.h
srch_dlg.o:	asedit.h
undo.o:		asedit.h
calc_lc.o:	asedit.h
exec_cmd.o:	asedit.h
tool_dlg.o:	asedit.h

clipbrd.o :	clipbrd.h

/*
 *   A rule to convert the X resource file into C declarations,
 *   appropriate for inclusion as fallback resources.
 *   The following rule ensures that asedit always has the latest version of its
 *   resources compiled into the executable.
 *
 *   Note: SUN's make doesn't like extended AD_FILE definition with INST_LANG
 *   (so we replace the following Asedit.ad.h dependence with a simpler one
 *   in the free release; you might restore the original if you want)
 */
XCOMM (orig. see above) Asedit.ad.h:    ${AD_FILE}.ad Imakefile

Asedit.ad.h:    Imakefile
	./ad2c.scr ${AD_FILE}.ad > Asedit.ad.h

NormalLibraryObjectRule()
SpecialObjectRule(asedit.o,Imakefile,${STRING_INC})
SpecialObjectRule(ht_help.o,Imakefile,'-DHELPDIR="${Help_dir}"')
SpecialObjectRule(file_rw.o,Imakefile,'-DBACKUP_FILE_SUFFIX="${Backup_file_suffix}"')

ComplexProgramTarget(asedit)
AllTarget(asedit)

/*
 *   Install all application defaults files (version related!)
 */
InstallAppDefaultsLong($(AD_FILE),Asedit)
InstallAppDefaultsLong(./${INST_LANG}/Asedit-sgi,Asedit-sgi)

InstallAppDefaultsLong(./${INST_LANG}/Asedit_em,Asedit_em)
InstallAppDefaultsLong(./${INST_LANG}/Asedit_em-sgi,Asedit_em-sgi)

/*   Install the help files	*/
InstallNonExec(asedit.hlp,${Help_dir})
InstallNonExec(asedit_em.hlp,${Help_dir})


/*   That's it ! */



