# $Id: Makefile.am,v 1.23 2002/01/18 10:53:33 mattiasa Exp $

AUTOMAKE_OPTIONS = foreign no-dependencies

bin_PROGRAMS = zwgc

foo = port_dictionary.c pointer_dictionary.c ulong_dictionary.c \
	string_dictionary.c int_dictionary.c string_dictionary_aux.c \
	parser.y lexer.c node.c exec.c buffer.c main.c zephyr.c  \
	substitute.c port.c xshow.c mux.c eval.c subscriptions.c notice.c \
	regexp.c character_class.c text_operations.c file.c error.c \
@MKWITH_X_P@	X_driver.c xselect.c xmark.c xrevstack.c xerror.c X_fonts.c \
@MKWITH_X_P@	X_gram.c xcut.c \
	variables.c formatter.c tty_filter.c \
	standard_ports.c new_string.c new_memory.c zutils.c \
	win32_driver.c plus.c 

zwgc_SOURCES = $(foo)

man_MANS = zwgc.1

zephyrdir = $(datadir)/zephyr

zephyr_DATA = zwgc.desc

sysconf_DATA = zephyr.vars

YFLAGS = -d

bar = port_dictionary.c  \
	port_dictionary.h  \
	pointer_dictionary.c  \
	pointer_dictionary.h  \
	ulong_dictionary.c  \
	ulong_dictionary.h  \
	string_dictionary.c  \
	string_dictionary.h  \
	int_dictionary.c  \
	int_dictionary.h  \
	char_stack.h \
	string_stack.h \
	xmode_stack.h

BUILT_SOURCES = $(bar) parser.c parser.h

baz = -DSYSCONFDIR="\"@sysconfdir@"\" -DDATADIR="\"@datadir@\""

INCLUDES += -I../../include -I$(srcdir)/../../include $(baz) $(CPPFLAGS_roken)

CFLAGS = @X_CFLAGS@ @CFLAGS@

# -L../../lib/et

lib_foo = ../../lib/zephyr/libzephyr.a -lcom_err $(LIB_tgetent)

x_foo = \
@MKWITH_X_P@ @X_LIBS@ @X_PRE_LIBS@ @X_EXTRA_LIBS@ @X_LIBS@ \
@MKWITH_X_P@		-lXaw -lXt -lXmu -lXext -lX11

zwgc_LDADD = $(lib_foo) $(x_foo) $(LIB_roken)
zwgc_LDFLAGS = $(KRB4_LDFLAGS)

INSTANTIATE = $(srcdir)/instantiate

port_dictionary.c port_dictionary.h: dictionary.c dictionary.h string_stack.h
	$(SHELL) $(INSTANTIATE) $(srcdir) dictionary port port.h

pointer_dictionary.c pointer_dictionary.h: dictionary.c dictionary.h
	$(SHELL)  $(INSTANTIATE) $(srcdir) dictionary pointer pointer.h

ulong_dictionary.c ulong_dictionary.h: dictionary.c dictionary.h
	$(SHELL) $(INSTANTIATE) $(srcdir) dictionary ulong sysdep.h

string_dictionary.c string_dictionary.h: dictionary.c dictionary.h
	$(SHELL) $(INSTANTIATE) $(srcdir) dictionary string new_string.h

int_dictionary.c int_dictionary.h: dictionary.c dictionary.h
	$(SHELL) $(INSTANTIATE) $(srcdir) dictionary int

char_stack.h: stack.h
	$(SHELL) $(INSTANTIATE) $(srcdir) stack char

string_stack.h: stack.h
	${INSTANTIATE} ${srcdir} stack string

xmode_stack.h: stack.h
	${INSTANTIATE} ${srcdir} stack xmode

xshow.o: xmode_stack.h
text_operations.o: char_stack.h
port.o: port_dictionary.h

CLEANFILES = $(bar)
