include ../Makefile.inc
################################################################
 # Run Time Access
 # Copyright (C) 2003 Robert W Smith (bsmith@linuxtoys.org)
 #
 #  This program is distributed under the terms of the GNU LGPL.
 #  See the file COPYING file.
################################################################

################################################################
# Makefile -- to make the rta library.
#    Add or remove debug stuff to meet your needs.  
#    The "standard" target runs the source through indent to
# give the source a standardized look.
################################################################
# We use the default make rules for .c and .l 

OBJS   = api.o token.o parse.tab.o do_sql.o rtatables.o
SQLINCLUDES = -I. -I..
LIBS   = 
LEX    = flex
LEXLIBS= @LEXLIBS@
YACC   = yacc


all: librtadb.a

redoparser:
	$(LEX) -otoken.c token.l 
	$(YACC) -dv -bparse parse.y 

.c.o:
	$(CC) $(SQLINCLUDES) $(CFLAGS) -c $<


librtadb.a: $(OBJS)
	ar -rcs librtadb.a $(OBJS)

token.o: parse.tab.c do_sql.h

api.o: api.c rta.h do_sql.h

do_sql.o: do_sql.c do_sql.h rta.h

rtatables.o: rtatables.c do_sql.h rta.h

install:
	$(INSTALL_DATA) rta.h $(INCDIRECTORY)

DISTFILES =*.c *.h *.y *.l README Makefile.in

dist:
	@for file in $(DISTFILES); do \
		cp -pr $$file $(DISTDIR)/$$file; \
	done

clean: 
	rm -rf *.o lib* Makefile parse.output parse.save

distclean:
	rm -rf *.o lib* Makefile parse.output parse.save

