# This makefile needs to be fixed. Do make and then make all to make everything.

# qddb/Lib/LibQsql/Makefile.in
# 
# Copyright (C) 1993, 1994, 1995 Herrin Software Development, Inc.
# All rights reserved.
# 
# This file is part of Qddb.
# 
# Qddb is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2
# as published by the Free Software Foundation.
# 
# Qddb 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 General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Qddb; see the file LICENSE.  If not, write to:
# 
# 	Herrin Software Development, Inc. 
# 	R&D Division
# 	41 South Highland Ave. 
# 	Prestonsburg, KY 41653 
# 
YACC = bison 
YFLAGS = -d -y 
#LEX = @LEX@ -I -PQsql
#LEX = flex -I -d -PSql
LEX = flex -I 
LDFLAGS = -b -G -dy 

CC = gcc
CPPFLAGS = c
Headers = /usr/local/qddb/ ../Headers

SHELL = /bin/sh

RANLIB=ranlib 

SRCS=SqlParse.y SqlLex.l  SqlRel.c 
CSRC=SqlParse.c SqlLex.c SqlRel.c  
 
#CSRC=SqlRel.c
OBJS=SqlParse.o SqlLex.o SqlRel.o   

QSQLLIB = libQsql.so


SqlLex.o: SqlParse.h
SqlParse.h: SqlParse.o


.y.o:
	${YACC} ${YFLAGS} $<
	mv y.tab.c $*.c
	${CC} -${CPPFLAGS} ${DEFS} -I $(HOME)/project/Qddb/ravi/Headers \
	${CFLAGS} $*.c
	#rm -f $*.c
	mv y.tab.h $*.h

.l.o:
	${LEX} $<
	mv lex.yy.c lex.Sql.c
	mv lex.Sql.c $*.c
	${CC} -${CPPFLAGS} ${DEFS} -I $(HOME)/project/Qddb/Headers -I /usr/local/qddb/include\
	-I${builddir}/Headers -I. ${CFLAGS} ${CSRC}
	#rm -f $*.c

.c.o:
	${CC} -${CPPFLAGS} -g ${DEFS} -I $(HOME)/project/Qddb/ravi/Headers\
	${CFLAGS} $<

all: QSQL

QSQL:   
	#${YACC} ${YFLAGS} ${YACCSRC}
	#${LEX}
	${CC} -${CPPFLAGS} -g ${DEFS} -I $(HOME)/project/Qddb/ravi/Headers \
	${CSRC} 
	ld ${LDFLAGS} ${OBJS} -o ${QSQLLIB} 

clean:
	-rm -f ${QSQLLIB} SqlLex.c SqlParse.c SqlParse.h \
		y.tab.h *.o core core.* *\~

mostlyclean: clean

distclean: clean
	-rm -f Makefile
