# this dir relative to top dir
thisdir = src/cats
+CPPFLAGS += -DBUILDING_CATS
+
DEBUG=@DEBUG@
MKDIR=$(topdir)/autoconf/mkinstalldirs
LIBSRCS = mysql.c bdb.c bdb_create.c bdb_get.c bdb_update.c \
bdb_delete.c bdb_find.c bdb_list.c \
- sql.c sql_create.c sql_delete.c sql_find.c \
+ sql.c sql_cmds.c sql_create.c sql_delete.c sql_find.c \
sql_get.c sql_list.c sql_update.c sqlite.c \
postgresql.c
LIBOBJS = mysql.o bdb.o bdb_create.o bdb_get.o bdb_update.o \
bdb_delete.o bdb_find.o bdb_list.o \
- sql.o sql_create.o sql_delete.o sql_find.o \
+ sql.o sql_cmds.o sql_create.o sql_delete.o sql_find.o \
sql_get.o sql_list.o sql_update.o sqlite.o \
postgresql.o
# inference rules
.c.o:
- $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
+ @echo "Compiling $<"
+ $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
#-------------------------------------------------------------------------
all: Makefile libsql.a
@echo "==== Make of cats is good ===="
@echo " "
libsql.a: $(LIBOBJS)
+ @echo "Making $@ ..."
$(AR) rc $@ $(LIBOBJS)
$(RANLIB) $@
$(RMF) create_sqlite_database update_sqlite_tables make_sqlite_tables
$(RMF) grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
+ $(RMF) create_sqlite3_database update_sqlite3_tables make_sqlite3_tables
+ $(RMF) grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database
+
$(RMF) mysql sqlite postgresql
$(RMF) make_catalog_backup delete_catalog_backup
(cd $(srcdir); $(RMF) Makefile)
install:
- $(INSTALL_SCRIPT) create_@DB_NAME@_database $(DESTDIR)$(scriptdir)/create_@DB_NAME@_database
- $(INSTALL_SCRIPT) update_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/update_@DB_NAME@_tables
- $(INSTALL_SCRIPT) make_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/make_@DB_NAME@_tables
- $(INSTALL_SCRIPT) grant_@DB_NAME@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_NAME@_privileges
- $(INSTALL_SCRIPT) drop_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/drop_@DB_NAME@_tables
- $(INSTALL_SCRIPT) drop_@DB_NAME@_database $(DESTDIR)$(scriptdir)/drop_@DB_NAME@_database
+ $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database
+ $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables
+ $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables
+ $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges
+ $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables
+ $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database
$(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database
$(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables
${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
uninstall:
- (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_NAME@_database)
- (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_NAME@_tables)
- (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_NAME@_tables)
- (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_NAME@_privileges)
- (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_NAME@_tables)
- (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_NAME@_database)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database)
(cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database)
(cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables)