# $Id: Makefile.in,v 1.10 1998/02/23 08:04:52 assar Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@
YACC		= @YACC@
LEX		= @LEX@
YFLAGS		= -d

INSTALL		= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
ETAGS		= etags
MAKEDEPEND	= makedepend

DEFS		= @DEFS@ -DCPP="\"@CPP@\""

SHELL		= /bin/sh

CFLAGS		= @CFLAGS@
REALCFLAGS	= -I$(srcdir) \
		  -I$(srcdir)/../util \
		  -I$(srcdir)/../lib/roken \
		  -I. \
		  $(CFLAGS) $(DEFS)
SRCS		= parse.y lex.l main.c symbol.c types.c output.c
OBJS		= parse.o lex.o main.o symbol.o types.o output.o
HDRS		= sym.h types.h output.h lex.h parse.h
PROG		= ydr

.PHONY: all install depend tags clean

.c.o:
		$(CC) -c $(CPPFLAGS) $(REALCFLAGS) $<

.l.c:
		$(LEX) $(LFLAGS) -t $< >$@

all:		$(PROG)

install:	all

$(PROG):	$(OBJS) ../util/libutil.a
		$(CC) $(LDFLAGS) -o $@ $(OBJS) ../util/libutil.a -L../lib/roken -lroken $(LIBS)

parse.h:	parse.c
		mv y.tab.h parse.h

lex.o:		parse.h

Makefile:	Makefile.in ../config.status
		cd ..; CONFIG_FILES=ydr/Makefile CONFIG_HEADERS= $(SHELL) config.status

depend:		$(SRCS) $(HDRS)
		$(MAKEDEPEND) -- $(REALCFLAGS) -- $^

tags:		TAGS

TAGS:		$(SRCS) $(HDRS)
		$(ETAGS) -t $(SRCS) $(HDRS)

clean		:
		rm -f $(OBJS) $(PROG) lex.c parse.c parse.h *~ *.o core

mostlyclean:	clean

distclean:	clean
		rm -f Makefile config.status

realclean:	distclean
		rm -f TAGS

foo:		lex.c
