#
#	 Imakefile for asedit Release 1.2
#	 (C) A. Stochniol, 1993
#	 21.09.1993
#


#include "As.rules"


#   -----------------
#   *** 1. SELECT ***
#
#   which Motif, Xt Toolkit and X library are you using ?
#   Usually you do NOT change the 3 definitions that follows unless you use
#   extra shared libraries (in which case you would probably use "-lXm_s -lPW",
#   "-lXt_s", "-lX11_s" respectively; this is the case for SGI).
#   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 
XTOOLLIB = -lXt
XLIB     = -lX11

#  Note about libPW.a: it is the Programmers Workbench library, which is
#    an ATT product not included in Berkeley systems. Hence it is not found
#    in SunOS or Ultrix. The library is needed because of regex(3) routines
#    i.e. regcmp & regex, for systems that do not have them in the libc.a.
#    If you don't have libPW.a (SunOS, Ultrix) simply don't specify "-lPW".
#
#
#  On some systems the libaries and include files might be located
#  in quite strange places. Below there are lines that I've used to install
#  asedit on different systems around my place (you might find it helpful).
#
#  DEC settings (to use uncomment the lines below)
#  XMLIB = /usr/lib/DXM/lib/Xm/libXm.a
#  XTOOLLIB = /usr/lib/DXM/lib/Xt/libXt.a
#  STD_INCLUDES = -I/usr/lib/DXM/lib -I/usr/lib/DXM/lib/Xt
#
#  SUN settings (to use uncomment the lines below)
#  LOCAL_X_LIBDIR =  -L/usr/local/lib
#  STD_INCLUDES = -I/usr/local/include
#
#  for SUN with X11R4 and Motif 1.1.4 I had to declare additionally
#      Xext and m (mathematical) libraries ...
#      XLIB     = -lXext -lX11 -lm

#
#  On most SUN's there are only non-ANSI C compilers available so you might
#  have to uncomment No_proto_def and No_stdarg_def variables (see later
#  in this file).


#   XMULIB library is only needed for X11R4 and X11R5 versions !!
#   (for X11R3 the following line that defines XMULIB should be commented
#   or defined as an empty string !)

XMULIB = -lXmu

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
#

#   BINDIR  = /usr/bin/X11
#   XAPPLOADDIR = /usr/lib/X11/app-defaults
#   MANDIR = /usr/man/mann
#   LIBDIR = /usr/lib/X11


#
#   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.
#
   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
#
#
#   define increase of String literal space for asedit.c compilation: if
#   it is needed (because of the fallbacks), simply uncomment the STRING_INC
#   line below (this is the case for SGI).
#
#   STRING_INC  = -Wf,-XNl4096


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

#
#   If you find that <stdarg.h> does not exist on your system  then
#   uncomment the next line  (at that case you probably would have to uncomment
#   the line with No_proto_def above !)
#   No_stdarg_def = -D_NO_STDARG

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

#   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).
#   xfocus_bug  = -DXFOCUS_BUG
#

 
      DEFINES = $(No_proto_def) $(No_stdarg_def) $(No_maxpathlen_def) $(xfocus_bug)

#   If you are still stuck to X-Windows Release 3 (X11R3)  you should define
#   AD_FILE as X11R3  (actually, if you are, you should really upgrade
#   from that ancient version  :-)  )

AD_FILE = Asedit


#
#    END of customisation part of the Imakefile
#



      SRCS = asedit.c as_menuh.c file_rw.c clipbrd.c \
	     write_lw.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

      OBJS = asedit.o as_menuh.o file_rw.o clipbrd.o \
	     write_lw.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




#   asedit dependencies .....

asedit.o  :	asedit.h clipbrd.h asedit_icon Asedit.ad.h

as_menuh.o:	asedit.h
asutil.o:	asedit.h  asedit_icon
editarea.o:	asedit.h
file_act.o:	asedit.h
file_dlg.o:	asedit.h warning.xbm question.xbm
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

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.
#

Asedit.ad.h:    ${AD_FILE}.ad Imakefile
	./ad2c.script ${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 the application default file (version related!)
#
InstallAppDefaultsLong($(AD_FILE),Asedit)

#   Install the help file
InstallNonExec(asedit.hlp,${Help_dir})


#   That's it !



