#
# Makefile for the GNU LessTif clients
#
# Copyright (C) 1995 Free Software Foundation, Inc.
#
# This file is part of the GNU LessTif Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

srcdir=@srcdir@
VPATH=$(srcdir)

x_libraries=@x_libraries@
x_includes=@x_includes@
motif_libraries=@motif_libraries@
lesstif_libraries=-L../../libMrm -L../../libXm

CC=@CC@
YACC=@YACC@
LEX=@LEX@
LEXLIB=@LEXLIB@
CFLAGS=-I$(srcdir) -I$(srcdir)/../../include -I$(srcdir)/../../libMrm ${x_includes} @CFLAGS@

CLIENTS=uil
MOTIFCLIENTS=

SRCS= \
	Attribute.c Callback.c Expression.c ExpressionList.c FakeWidget.c \
	Include.c MrmTypes.c glue.c main.c uilparse.c uillex.c

OBJS=${SRCS:.c=.o}

@client_include@

clean:
	rm -f $(OBJS) $(CLIENTS) $(MOTIFCLIENTS) *~ core *.bak *.BAK \
	      uillex.c uilparse.c $(srcdir)/y.tab.h $(srcdir)/y.output

uil: ${OBJS}
	${CC} ${CFLAGS} -o $@ ${OBJS} ../lib/libltc.a \
	    ${mrm_library} ${xm_library} ${x_libraries} ${LEXLIB}

uil.motif: ${OBJS}
	${CC} ${CFLAGS} -o $@ ${OBJS} ../lib/libltc.a \
	    ${motif_mrm_library} ${motif_xm_library} ${x_libraries} ${LEXLIB}

$(srcdir)/uillex.c: lex.l
	cd $(srcdir) && ${LEX} -v lex.l
	mv -f $(srcdir)/lex.yy.c $(srcdir)/uillex.c

$(srcdir)/uilparse.c $(srcdir)/y.tab.h: yacc.y
	cd $(srcdir) && ${YACC} -v -d yacc.y
	mv -f $(srcdir)/y.tab.c $(srcdir)/uilparse.c

lex.yy.o: y.tab.h
