/*
 * To make SOCKSified xgopher, you must define the macro SOCKS
 * and provide the full pathname of the SOCKS library
 */
SOCKS = -DSOCKS
SOCKS_LIB = /projects/insg/socks.cstc.4.1.pre/lib/libsocks.a

     XGOPHERDIR = $(LIBDIR)/xgopher

    /* You may add -O to the next line if you'd like.  There will
       not be too much difference for most machines. */

    CDEBUGFLAGS = -g


/*************************************************************************
 **	for compiling Xgopher with Sun's OpenWindows 3, uncomment       **
 **	the following 3 lines:                                          **
 **     You may (not certain) need to add -lresolv to second of these   **
 **     two lines if you have trouble connecting to other hosts.        **
 **     In other words, maybe use:  EXTRA_LIBRARIES  = -lresolv -lm     **
 *************************************************************************/
/*
  MKDIRHIER        = BourneShell $(BINDIR)/mkdirhier 
  EXTRA_LIBRARIES  = -lm
  XMULIB           = -lm -Bstatic -lXmu -Bdynamic
*/

/*************************************************************************
 **	for compiling Xgopher under Solaris 2.1, you may need to add    **
 **	the following additional defines if they are not supplied by    **
 **     your Imake configuration files already (it won't hurt to        **
 **     include them a second time).                                    **
 *************************************************************************/
/*
  LOCAL_DEFINES    = -DSYSV -DSVR4
  EXTRA_LIBRARIES = -lresolv -lnsl -lsocket
*/

/* Irix should use: */
/*
  LOCAL_DEFINES = -cckr
  EXTRA_LIBRARIES = -lsun
 */

/* AIX should use: */
/*
  LOCAL_DEFINES    = -DBSD -DNONSTD_TYPES -D_NO_PROTO -DAIX
  EXTRA_LIBRARIES = -lbsd
 */

/* Alpha OSF should use: */
/*
  LOCAL_DEFINES    = -DSYSV -DDEC -DR5_XLIB -DSMT
  EXTRA_LIBRARIES = -lresolv -lm
 */

/*************************************************************************
 ** The following symbols are defined by Imake and used by the program: **
 **                                                                     **
 **	$(XAPPLOADDIR) is normally /usr/lib/X11/app-defaults            **
 **	$(HELP_FILE) is path to help file; usually /usr/lib/X11/Xgopher **
 *************************************************************************/

RESOURCE_DEFINES= -DHELP_FILE=\"$(XGOPHERDIR)/xgopher.help\"
        DEFINES = $(SOCKS) $(RESOURCE_DEFINES) $(LOCAL_DEFINES)

        DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(SOCKS_LIB) $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
           SRCS = xgopher.c item.c itemList.c dir.c dirList.c markList.c \
                  util.c misc.c net.c \
                  gui.c resources.c help.c status.c jobs.c \
                  panel.c save.c text.c error.c cso.c index.c \
                  bkmkfile.c options.c version.c single.c itemInfo.c\
		  subst.c \
		  sc_dir.c sc_index.c sc_telnet.c sc_tn3270.c \
		  sc_cso.c sc_image.c sc_sound.c sc_text.c sc_binary.c \
		  sc_extend.c \
                  KeyWSink.c

           OBJS = xgopher.o item.o itemList.o dir.o dirList.o markList.o \
                  util.o misc.o net.o \
                  gui.o resources.o help.o status.o jobs.o \
                  panel.o save.o text.o error.o cso.o index.o \
                  bkmkfile.o options.o version.o single.o itemInfo.o\
		  subst.o \
		  sc_dir.o sc_index.o sc_telnet.o sc_tn3270.o \
		  sc_cso.o sc_image.o sc_sound.o sc_text.o sc_binary.o \
		  sc_extend.o \
        	  KeyWSink.o

ComplexProgramTarget(xgopher)


/*************************************************************************
 ** X11R4 does not include the "InstallNonExecFile" rule, so make one,  **
 ** The macro definitions are copied from the X11R5 distribution        **
 *************************************************************************/

#ifndef InstallNonExecFile
/*
 * InstallNonExecFile - generate rules to install a data file
 */
#define	InstallNonExecFile(file,dest)					@@\
install:: file								@@\
	MakeDir($(DESTDIR)dest)						@@\
	$(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest
#else /* InstallNonExecFile */
#define	XgopherX11R5
#endif /* InstallNonExecFile */

/*
 * InstallNamedNonExec - generate rules to install a data file
 */
#ifndef InstallNamedNonExec
#define	InstallNamedNonExec(srcname,dstname,dest)			@@\
install:: srcname							@@\
	MakeDir($(DESTDIR)dest)						@@\
	$(INSTALL) -c $(INSTDATFLAGS) srcname $(DESTDIR)dest/dstname
#endif /* InstallNamedNonExec */

/*************************************************************************
 ** Install the application help and resource files                     **
 *************************************************************************/

InstallNonExecFile(xgopher.help,$(XGOPHERDIR))
InstallAppDefaults(Xgopher)

#ifndef	XgopherX11R5		/* we're probably not running X11R5 */
InstallNamedNonExec(Xgopher-complete.ad,Xgopher-color,$(XAPPLOADDIR))
#else	/* XgopherX11R5 */
InstallAppDefaults(Xgopher-color)
#endif	/* XgopherX11R5 */
