/**/#	Copyright 1988 Massachusetts Institute of Technology.
/**/#
/**/#	For copying and distribution information, see the file
/**/#	"mit-copyright.h". 
/**/#
/**/#	$Source: /mit/zephyr/src/zwgc/RCS/Imakefile,v $
/**/#	$Author: jtkohl $
/**/#	$Header: Imakefile,v 1.5 89/05/30 09:40:28 jtkohl Exp $
/**/#

#ifdef X11
#define have_subdirs
SUBDIRS= zbrowser
LIBS = $(X11_LIB) $(ZEPHYR_LIB) $(KRB_LIB) $(DES_LIB) $(COMERR_LIB)
LINTLIBS = $(X11_LINTLIB) $(ZEPHYR_LINTLIB) $(KRB_LINTLIB) $(DES_LINTLIB) \
	$(COMERR_LINTLIB)
#else /* !X11 */
LIBS = $(ZEPHYR_LIB) $(KRB_LIB) $(DES_LIB) $(COMERR_LIB)
LINTLIBS = $(ZEPHYR_LINTLIB) $(KRB_LINTLIB) $(DES_LINTLIB) $(COMERR_LINTLIB)
#endif /* X11 */
#if defined(X11) && ! defined(X11R3)
/**/# XTextExt bug fix, pending X11R3
XHDRS= Xlibint.h Xlibos.h
XFIX= XTextExt.c
XFIXOBJ= XTextExt.o
#else /* !(X11 && !X11R3) */
XHDRS=
XFIX=
XFIXOBJ=
#endif /* X11 && !X11R3 */
SRCS = comp_grid.c debug.c draw.c eval.c eval_show.c inter_zep.c lexer.c \
	loader.c main.c panic_desc.c parse.c parse_show.c ropes.c \
	support.c wg_errors.c ${XFIX}
OTHERSRCS= zwgc.vers
LINCLUDES = -I../zwgc
HDRS= ${XHDRS} cmds.h comp_types.h draw.h eval_stat.h minmax.h \
	file_defs.h ropes.h support.h
CONFIG_FILES= zephyr.desc zephyr.vars

SRCDIR= ${SRCTOP}/zwgc
CODE= ${HDRS} ${SRCS} ${OTHERSRCS} ${CONFIG_FILES} Imakefile

/*
 * The pathname for the installed version of zctl.
 */
ZCTLPROG=$(CLIENTDIR)/zctl

/*
 * The pathname for the installed default description file.
 */
ZCTLDESC=$(ETCATHDIR)/zephyr.desc

DEFINES= -DZCTLPROG=\"$(ZCTLPROG)\" -DDEFDESC=\"$(ZCTLDESC)\"

/**/# -I. should do, but makedepend bug screws up with X11/X11/X.h
OBJECTS = comp_grid.o debug.o draw.o eval.o eval_show.o inter_zep.o \
	lexer.o loader.o main.o panic_desc.o parse.o parse_show.o ropes.o \
	support.o wg_errors.o ${XFIXOBJ}


OUTPUT= zwgc

normal_obj_rule()

program($(OUTPUT),$(OBJECTS),,$(LIBS),$(USRETCDIR))

#if defined(X11) && ! defined(X11R3)
/**/# Special crafted entry for X bug.
XTextExt.o: XTextExt.c Xlibint.h Xlibos.h
	$(CC) $(CFLAGS) -c XTextExt.c
#endif

#ifdef ibm032
/* This patch only applies to the IBM RT/PC */
#define last_licks()							@@\
/**/# this is to get around problem HC has with X11 Xt.  This must end	@@\
/**/# up in the resulting Makefile AFTER the foreach... stuff.		@@\
all::									@@\
	(chdir zbrowser; make ${MFLAGS} DESTDIR=${DESTDIR} CC=pcc all)
#endif ibm032

install::
	$(RM) $(DESTDIR)$(ETCATHDIR)/zephyr.desc
	$(CP) zephyr.desc $(DESTDIR)$(ETCATHDIR)/zephyr.desc
	$(RM) $(DESTDIR)$(ETCATHDIR)/zephyr.vars
	$(CP) zephyr.vars $(DESTDIR)$(ETCATHDIR)/zephyr.vars
