
#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
# This makefile is automatically generated by imake... do not modify
# or you may lose your changes when imake generates makefiles again.
# Ignore this message if you are not using imake.
#
#	$Source: /afs/athena.mit.edu/mit/zephyr/src/config/RCS/Imake.template,v $
#	$Author: jtkohl $
#	$Header: Imake.template,v 1.2 89/03/23 16:16:50 jtkohl Exp $
#

NEWTOP=../.
BUILDTOP=../.

INCLUDE= $(LINCLUDES) -I/usr/athena/include
CFLAGS=$(DBG) $(INCLUDE) $(DEFINES) $(GLOBAL_CDEFS)
LINTFLAGS= -bhz $(LLINTFLAGS) $(INCLUDE) $(DEFINES) $(GLOBAL_CDEFS)

#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
#	$Source: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/config.Imakefile,v $
#	$Author: jtkohl $
#	$Header: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/config.Imakefile,v 1.18 89/10/19 13:09:47 jtkohl Exp $
#

SRCTOP=/afs/athena.mit.edu/astaff/project/zephyr/src

IMAKE=$(BUILDTOP)/imake/imake -I$(BUILDTOP)/config

GLOBALCDEFS=

DESTDIR=

CLIENTDIR= /usr/athena
ETCATHDIR= /etc/athena
USRETCDIR= /usr/etc
LIBDIR= /usr/athena/lib
LINTLIBDIR= /usr/lib/lint
MANDIR=/usr/man
ACLDIR=/usr/athena/lib/zephyr

LINTLIBFLAG=-C

X_CDEFS= -DX11

X11_LIB=-lX11
XAW_LIB=-lXaw
XT_LIB=-lXt
XMU_LIB=-lXmu

X11_LINTLIB=-lX11
XAW_LINTLIB=-lXaw
XT_LINTLIB=-lXt
XMU_LINTLIB=-lXmu

X3_CDEFS=-DX11R3

KRB_CDEFS=-DKERBEROS
KRB_LIB=-lkrb
KRB_LINTLIB=-lkrb
DES_LIB=-ldes
DES_LINTLIB=-ldes

HES_CDEFS=-DHESIOD
HES_LIB=-lhesiod
HES_LINTLIB=-lhesiod

GLOBAL_CDEFS = $(KRB_CDEFS) $(HES_CDEFS) $(X_CDEFS) $(X3_CDEFS) $(GLOBALCDEFS)

SS_LIB=-lss
SS_LINTLIB=-lss
COMERR_LIB=-lcom_err
COMERR_LINTLIB=-lcom_err
COMPILE_ET=compile_et
MAKE_COMMANDS=mk_cmds

DEPEND=makedepend

ARCHIVE= ar cru

RANLIB= ranlib

INSTALLFILE= install -c -m 444

INSTALLLIB= install -c -m 444

INSTALLPROG= install -c -s -m 555

INSTALLSCRIPT= install -c -m 555

INSTALLRAW= install

INSTALLSUID= install -c -m 4555 -o root

LD=ld

AS=as

LINT=lint

CC=gcc

HCC=$(CC)

CPP=$(CC) -E

DBG=-g

HCFLAGS=$(CFLAGS)

TAGGER=etags

MAKE=make
RM=rm -f
MV=mv
CP=cp
LN=ln -s
LPR=lpr -p
CHMOD=chmod

#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
#	$Source: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/Imake.rules,v $
#	$Author: jtkohl $
#	$Header: /afs/athena.mit.edu/astaff/project/zephyr/src/config/RCS/Imake.rules,v 1.20 89/10/19 17:59:11 jtkohl Exp $
#

ZEPHYR_LIB=/mit/zephyr/tba/warlord/bin/libzephyr.a
ZEPHYR_LINTLIB=$(BUILDTOP)/libs/llib-lzephyr.ln

#	Copyright 1988 Massachusetts Institute of Technology.
#
#	For copying and distribution information, see the file
#	"mit-copyright.h".
#
#	$Source: /afs/athena.mit.edu/astaff/project/zephyr/src/zwgc/RCS/Imakefile,v $
#	$Author: jtkohl $
#	$Id: Imakefile,v 1.5 89/11/16 10:22:01 jtkohl Exp $
#

SUBDIRS= Memory String Dictionary
LIBS = $(X11_LIB) $(ZEPHYR_LIB) $(KRB_LIB) $(DES_LIB) $(EXTRA_LIBS) \
	$(COMERR_LIB) -ltermcap $(RESOLV)
LINTLIBS = $(X11_LINTLIB) $(ZEPHYR_LINTLIB) $(KRB_LINTLIB) $(DES_LINTLIB) \
	$(COMERR_LINTLIB) -ltermcap
SRCS = parser.y lexer.c node.c exec.c buffer.c main.c zephyr.c X_driver.c\
          substitute.c port.c xshow.c \
          mux.c eval.c subscriptions.c notice.c xcut.c regexp.c\
	  character_class.c text_operations.c file.c error.c variables.c\
	  formatter.c X_fonts.c X_gram.c tty_filter.c standard_ports.c\
	  xselect.c xmark.c xrevstack.c xerror.c
OBJS = parser.o lexer.o node.o exec.o buffer.o main.o zephyr.o X_driver.o\
          substitute.o port_dictionary.o port.o xshow.o pointer_dictionary.o\
          mux.o eval.o subscriptions.o notice.o xcut.o regexp.o\
	  character_class.o text_operations.o file.o error.o variables.o\
	  formatter.o X_fonts.o X_gram.o tty_filter.o standard_ports.o\
	  xselect.o xmark.o xrevstack.o xerror.o ulong_dictionary.o
HDRS = exec.h node.h zwgc.h parser.h port.h\
		xshow.h pointer.h substitute.h eval.h zephyr.h lexer.h\
		subscriptions.h notice.h regexp.h character_class.h\
		text_operations.h file.h error.h mux.h variables.h\
		formatter.h main.h\
		X_driver.h X_fonts.h X_gram.h xselect.h \
		buffer.h xmark.h xrevstack.h xerror.h ulong.h

LINCLUDES = -IMemory -IString -IDictionary
GENERATORS= generate_stack_instance stack.h

SRCDIR= ${SRCTOP}/zwgc
CONFIG_FILES= zwgc.desc  zephyr.vars zwgc_resources
CODE= ${GENERATORS} ${HDRS} ${SRCS} ${CONFIG_FILES} Imakefile

LIB=.
LIBRARIES = $(LIB)/String/new_string.o $(LIB)/Dictionary/string_dictionary.o\
            $(LIB)/Dictionary/string_dictionary_aux.o\
	    $(LIB)/Dictionary/int_dictionary.o\
	    $(LIB)/Memory/new_memory.o

GENERATED= port_dictionary.c port_dictionary.h \
	pointer_dictionary.c pointer_dictionary.h \
	ulong_dictionary.c ulong_dictionary.h \
	char_stack.h \
	string_stack.h \
	xmode_stack.h \
	y.tab.h

DEPENDSRCS= ${CODE} ${GENERATED}

ZWGCDESC=$(ACLDIR)/zwgc.desc

DEFINES=-DREVSTACK -DDEFDESC=\"$(ZWGCDESC)\"

.c.o:
	$(RM) $*.o
	$(CC) -c $(CFLAGS) $*.c

OUTPUT=zwgc

all::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" all "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) all ;	\
			echo "### Done with" `pwd`);		\
	done

install::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" install "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) install ;	\
			echo "### Done with" `pwd`);		\
	done

clean::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" clean "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) clean ;	\
			echo "### Done with" `pwd`);		\
	done

depend::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" depend "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) depend ;	\
			echo "### Done with" `pwd`);		\
	done

tags::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" tags "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) tags ;	\
			echo "### Done with" `pwd`);		\
	done

lint::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" lint "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) lint ;	\
			echo "### Done with" `pwd`);		\
	done

print::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" print "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) print ;	\
			echo "### Done with" `pwd`);		\
	done

src::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" src "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) src ;	\
			echo "### Done with" `pwd`);		\
	done

Makefiles::
	@echo "### Making Makefiles in" `pwd`
	@for d in $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making Makefile in" `pwd`; \
			$(MAKE) $(MFLAGS) SRCTOP=$(SRCTOP) \
			NEWTOP=../$(BUILDTOP)		\
			BUILDTOP=../$(BUILDTOP)		\
			-f ../Makefile			\
			Makefile; \
			$(MAKE) $(MFLAGS) SRCTOP=$(SRCTOP) \
			NEWTOP=../$(BUILDTOP)		\
			Makefiles; \
			echo "### Done with" `pwd`); \
	done

all:: $(OUTPUT)

$(OUTPUT): $(OBJS)  src
	$(RM) $@
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBRARIES) $(LIBS) -L/afs/athena/system/krbuser/@sys/lib -L/usr/athena/lib

install::
	$(INSTALLPROG) $(OUTPUT) $(DESTDIR)$(USRETCDIR)/$(OUTPUT)

clean::
	$(RM) $(OUTPUT) $(OBJS)

depend:: ${DEPENDSRCS}

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

YFLAGS=-d

y.tab.h: parser.o
# use implicit yacc rule for the following:
parser.o: parser.y

#
#
#
port_dictionary.c port_dictionary.h: Dictionary/dictionary.c Dictionary/dictionary.h
	Dictionary/generate_dictionary_instance ${SRCDIR}/Dictionary port port.h

#
#
#
pointer_dictionary.c pointer_dictionary.h: Dictionary/dictionary.c Dictionary/dictionary.h
	Dictionary/generate_dictionary_instance ${SRCDIR}/Dictionary pointer pointer.h

#
#
#
ulong_dictionary.c ulong_dictionary.h: Dictionary/dictionary.c Dictionary/dictionary.h
	Dictionary/generate_dictionary_instance ${SRCDIR}/Dictionary ulong ulong.h

#
#
#
char_stack.h: stack.h
	./generate_stack_instance ${SRCDIR} char
#
#
#
string_stack.h: stack.h
	./generate_stack_instance ${SRCDIR} string
#
#
#
xmode_stack.h: stack.h
	./generate_stack_instance ${SRCDIR} xmode

depend:: $(CODE)
	@echo "### Now computing dependencies"
	@$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)

clean::
	$(RM) *~ \#* *.bak $(TAGSFILE)

tags::
	$(TAGGER) *.c *.h

lint::
	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)

Makefile::
	-$(RM) Makefile.bak; $(MV) Makefile Makefile.bak
	$(IMAKE) -DNEW_TOP=$(NEWTOP) -s Makefile

print:: $(CODE)
	$(LPR) $(CODE)

src:: ${CODE}
	touch src

${CODE}:
	 $(RM) $@
	-$(LN) ${SRCDIR}/$@ $@

install::

Makefiles::

# DO NOT DELETE THIS LINE
