11 # this dir relative to top dir
14 CPPFLAGS += -DBUILDING_CATS @DBI_DBD_DRIVERDIR@
17 MKDIR=$(topdir)/autoconf/mkinstalldirs
25 SVRSRCS = cats.c sql.c
26 SVROBJS = cats.o sql.o
28 LIBSRCS = mysql.c bdb.c dbi.c \
29 sql.c sql_cmds.c sql_create.c sql_delete.c sql_find.c \
30 sql_get.c sql_list.c sql_update.c sqlite.c \
32 LIBOBJS = mysql.o bdb.o dbi.o \
33 sql.o sql_cmds.o sql_create.o sql_delete.o sql_find.o \
34 sql_get.o sql_list.o sql_update.o sqlite.o \
44 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
45 #-------------------------------------------------------------------------
46 all: Makefile libsql.a
47 @echo "==== Make of cats is good ===="
52 $(AR) rc $@ $(LIBOBJS)
55 cats: $(SVROBJS) ../findlib/libfind.a
56 $(CC) $(WLDFLAGS) $(LDFLAGS) -L../findlib -L../lib -o $@ $(SVROBJS) $(LIBS) $(DB_LIBS) -lfind -lbac
58 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
60 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
64 $(RMF) cats core a.out *.o *.a *.bak *~ *.intpro *.extpro 1 2 3
69 $(RMF) create_bacula_database update_bacula_tables make_bacula_tables
70 $(RMF) grant_bacula_privileges drop_bacula_tables drop_bacula_database
72 $(RMF) create_bdb_database update_bdb_tables make_bdb_tables
73 $(RMF) grant_bdb_privileges drop_bdb_tables drop_bdb_database
75 $(RMF) create_mysql_database update_mysql_tables make_mysql_tables
76 $(RMF) grant_mysql_privileges drop_mysql_tables drop_mysql_database
78 $(RMF) create_postgresql_database update_postgresql_tables make_postgresql_tables
79 $(RMF) grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
81 $(RMF) create_sqlite_database update_sqlite_tables make_sqlite_tables
82 $(RMF) grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
84 $(RMF) create_sqlite3_database update_sqlite3_tables make_sqlite3_tables
85 $(RMF) grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database
87 $(RMF) mysql sqlite postgresql
88 $(RMF) make_catalog_backup delete_catalog_backup
91 if test $(srcdir) = .; then $(MAKE) realclean; fi
92 (cd $(srcdir); $(RMF) Makefile)
95 if test $(srcdir) = .; then $(MAKE) realclean; fi
96 (cd $(srcdir); $(RMF) Makefile)
99 $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database
100 $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables
101 $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables
102 $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges
103 $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables
104 $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database
106 $(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database
107 $(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables
108 $(INSTALL_SCRIPT) make_bacula_tables $(DESTDIR)$(scriptdir)/make_bacula_tables
109 $(INSTALL_SCRIPT) grant_bacula_privileges $(DESTDIR)$(scriptdir)/grant_bacula_privileges
110 $(INSTALL_SCRIPT) drop_bacula_tables $(DESTDIR)$(scriptdir)/drop_bacula_tables
111 $(INSTALL_SCRIPT) drop_bacula_database $(DESTDIR)$(scriptdir)/drop_bacula_database
113 @filename=make_catalog_backup; \
114 if test -f ${DESTDIR}${scriptdir}/$$filename; then \
115 destname=$$filename.new; \
116 echo " ==> Found existing $$filename, installing new file as $$destname"; \
118 destname=$$filename; \
120 echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
121 ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
122 @filename=delete_catalog_backup; \
123 if test -f ${DESTDIR}${scriptdir}/$$filename; then \
124 destname=$$filename.new; \
125 echo " ==> Found existing $$filename, installing new file as $$destname"; \
127 destname=$$filename; \
129 echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
130 ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
133 (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database)
134 (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables)
135 (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables)
136 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges)
137 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables)
138 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database)
140 (cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database)
141 (cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables)
142 (cd $(DESTDIR)$(scriptdir); $(RMF) make_bacula_tables)
143 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_bacula_privileges)
144 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_tables)
145 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_database)
147 (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup)
148 (cd $(DESTDIR)$(scriptdir); $(RMF) delete_catalog_backup)
151 # Semi-automatic generation of dependencies:
152 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
153 # and it also includes system headers.
154 # `semi'-automatic since dependencies are generated at distribution time.
157 @$(MV) Makefile Makefile.bak
158 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
159 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
160 @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
161 @if test -f Makefile ; then \
162 $(RMF) Makefile.bak; \
164 $(MV) Makefile.bak Makefile; \
165 echo " ===== Something went wrong in make depend ====="; \
168 # -----------------------------------------------------------------------
169 # DO NOT DELETE: nice dependency list follows