#  Copyright (c) 2003  Aftab Jahan Subedar <jahan@bol-online.com>
#
#  This file is part of the mysql_last_value package
#   
#  mysql_last_value replaces null value of current column with 
#  value from top row (if available) os same column
#
#
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version $gplv of the License, or
#  (at your option) any later version.
#
#  This program 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 this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

NOMAN=



# Set this to your C-compiler
CC?=gcc

INSTALL=/usr/bin/install

AR?=ar

CFLAGS?=-O2 -Wall

STRIP=-s

MYSQLINC=-I/usr/local/include/mysql
MYSQLLIB=-L/usr/local/lib/mysql

INSTALLDIR=/usr/local/bin

EXTRALIBS= -lmysqlclient -lm

RM=/bin/rm -f
GZIP=/bin/gzip
TAR=/bin/tar
BZIP2=/usr/bin/bzip2

VERSION=3.2

OBJS=mysql_last_value.o

all: mysql_last_value

libdbf.a: dbf.o endian.o
	$(AR) rcs libdbf.a dbf.o endian.o

mysql_last_value: mysql_last_value.o
	$(CC) $(CFLAGS) $(STRIP) -L. $(MYSQLLIB) -o $@ mysql_last_value.o \
		$(EXTRALIBS)


mysql_last_value.o: mysql_last_value.c 
	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $(MYSQLINC) -c -o $@ mysql_last_value.c

mysql2dbf.o: mysql2dbf.c dbf.h
	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $(MYSQLINC) -c -o $@ mysql2dbf.c

install: mysql_last_value
	$(INSTALL) -m 0755 -s mysql_last_value $(INSTALLDIR)

clean:
	$(RM) $(OBJS) mysql_last_value



