# $Id: Makefile.in 3956 2010-01-05 20:56:56Z zacheiss $

SHELL=/bin/sh
@SET_MAKE@

CC=@CC@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
DEFS=@DEFS@
ALL_CFLAGS=-I$(srcdir) $(CPPFLAGS) $(CFLAGS) $(DEFS)
LIBTOOL=@LIBTOOL@
PRO_C=@PRO_C@
PRO_C_DEFS=@PRO_C_DEFS@
PRO_C_INCLUDES=@PRO_C_INCLUDES@
PRO_C_OPTS=@PRO_C_OPTS@
PRO_C_FLAGS=$(PRO_C_OPTS) $(PRO_C_DEFS) $(PRO_C_INCLUDES)
LDFLAGS=@LDFLAGS@
LIBS=@SQL_LIBS@ @LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@

srcdir=@srcdir@
VPATH=@srcdir@
SRCTOP=@top_srcdir@
top_builddir=@top_builddir@
BUILDTOP=..
mrbindir=@mrbindir@

BOBJS=dump_db.lo bkup1.lo bkup.lo dumprest.lo 
ROBJS=rest_db.lo rest1.lo rest.lo dumprest.lo

CFILES=dump_db.c rest_db.c bkup.c bkup1.c rest.c rest1.c dumprest.c
GENFILES=bkup.pc bkup1.pc bkup.h rest.pc rest1.pc rest.h

TARGET=mrbackup mrrestore

.SUFFIXES: .pc .lo

.pc.c:
	$(PRO_C) $(PRO_C_FLAGS) INAME=$< ONAME=$@

.c.lo:
	$(LIBTOOL) --mode=compile $(CC) -c $(ALL_CFLAGS) $<

all: $(TARGET)

clean:
	$(LIBTOOL) --mode=clean rm -f $(BOBJS) $(ROBJS) $(CFILES) $(GENFILES) $(TARGET)

cleandir distclean: clean
	rm -f Makefile

depend: $(GENFILES) $(CFILES)

install:
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) mrbackup $(DESTDIR)$(mrbindir)
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) mrrestore $(DESTDIR)$(mrbindir)
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(srcdir)/report.pl $(DESTDIR)$(mrbindir)

mrbackup: $(BOBJS) $(MR_LIBDEP)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(BOBJS) $(LIBS)

mrrestore: $(ROBJS) $(MR_LIBDEP)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(ROBJS) $(LIBS)

bkup.pc bkup1.pc bkup.h: $(SRCTOP)/db/schema.sql $(srcdir)/db2bkup.awk
	awk -f $(srcdir)/db2bkup.awk < $(SRCTOP)/db/schema.sql > bkup.pc

rest.pc rest1.pc rest.h: $(SRCTOP)/db/schema.sql $(srcdir)/db2rest.awk
	awk -f $(srcdir)/db2rest.awk < $(SRCTOP)/db/schema.sql > rest.pc
