11 # this dir relative to top dir
14 CPPFLAGS += -DBUILDING_CATS
17 MKDIR=$(topdir)/autoconf/mkinstalldirs
25 SVRSRCS = cats.c sql.c
26 SVROBJS = cats.o sql.o
28 LIBSRCS = mysql.c bdb.c bdb_create.c bdb_get.c bdb_update.c \
29 bdb_delete.c bdb_find.c bdb_list.c \
30 sql.c sql_cmds.c sql_create.c sql_delete.c sql_find.c \
31 sql_get.c sql_list.c sql_update.c sqlite.c \
33 LIBOBJS = mysql.o bdb.o bdb_create.o bdb_get.o bdb_update.o \
34 bdb_delete.o bdb_find.o bdb_list.o \
35 sql.o sql_cmds.o sql_create.o sql_delete.o sql_find.o \
36 sql_get.o sql_list.o sql_update.o sqlite.o \
46 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
47 #-------------------------------------------------------------------------
48 all: Makefile libsql.a
49 @echo "==== Make of cats is good ===="
54 $(AR) rc $@ $(LIBOBJS)
57 cats: $(SVROBJS) ../findlib/libfind.a
58 $(CC) $(WLDFLAGS) $(LDFLAGS) -L../findlib -L../lib -o $@ $(SVROBJS) $(LIBS) $(DB_LIBS) -lfind -lbac
60 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
62 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
66 $(RMF) cats core a.out *.o *.a *.bak *~ *.intpro *.extpro 1 2 3
71 $(RMF) create_bacula_database update_bacula_tables make_bacula_tables
72 $(RMF) grant_bacula_privileges drop_bacula_tables drop_bacula_database
74 $(RMF) create_bdb_database update_bdb_tables make_bdb_tables
75 $(RMF) grant_bdb_privileges drop_bdb_tables drop_bdb_database
77 $(RMF) create_mysql_database update_mysql_tables make_mysql_tables
78 $(RMF) grant_mysql_privileges drop_mysql_tables drop_mysql_database
80 $(RMF) create_postgresql_database update_postgresql_tables make_postgresql_tables
81 $(RMF) grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
83 $(RMF) create_sqlite_database update_sqlite_tables make_sqlite_tables
84 $(RMF) grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
86 $(RMF) create_sqlite3_database update_sqlite3_tables make_sqlite3_tables
87 $(RMF) grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database
89 $(RMF) mysql sqlite postgresql
90 $(RMF) make_catalog_backup delete_catalog_backup
93 if test $(srcdir) = .; then $(MAKE) realclean; fi
94 (cd $(srcdir); $(RMF) Makefile)
97 if test $(srcdir) = .; then $(MAKE) realclean; fi
98 (cd $(srcdir); $(RMF) Makefile)
101 $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database
102 $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables
103 $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables
104 $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges
105 $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables
106 $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database
108 $(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database
109 $(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables
110 $(INSTALL_SCRIPT) make_bacula_tables $(DESTDIR)$(scriptdir)/make_bacula_tables
111 $(INSTALL_SCRIPT) grant_bacula_privileges $(DESTDIR)$(scriptdir)/grant_bacula_privileges
112 $(INSTALL_SCRIPT) drop_bacula_tables $(DESTDIR)$(scriptdir)/drop_bacula_tables
113 $(INSTALL_SCRIPT) drop_bacula_database $(DESTDIR)$(scriptdir)/drop_bacula_database
115 @filename=make_catalog_backup; \
116 if test -f ${DESTDIR}${scriptdir}/$$filename; then \
117 destname=$$filename.new; \
118 echo " ==> Found existing $$filename, installing new file as $$destname"; \
120 destname=$$filename; \
122 echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
123 ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
124 @filename=delete_catalog_backup; \
125 if test -f ${DESTDIR}${scriptdir}/$$filename; then \
126 destname=$$filename.new; \
127 echo " ==> Found existing $$filename, installing new file as $$destname"; \
129 destname=$$filename; \
131 echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
132 ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
135 (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database)
136 (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables)
137 (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables)
138 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges)
139 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables)
140 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database)
142 (cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database)
143 (cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables)
144 (cd $(DESTDIR)$(scriptdir); $(RMF) make_bacula_tables)
145 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_bacula_privileges)
146 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_tables)
147 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_database)
149 (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup)
150 (cd $(DESTDIR)$(scriptdir); $(RMF) delete_catalog_backup)
153 # Semi-automatic generation of dependencies:
154 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
155 # and it also includes system headers.
156 # `semi'-automatic since dependencies are generated at distribution time.
159 @$(MV) Makefile Makefile.bak
160 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
161 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
162 @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
163 @if test -f Makefile ; then \
164 $(RMF) Makefile.bak; \
166 $(MV) Makefile.bak Makefile; \
167 echo " ===== Something went wrong in make depend ====="; \
170 # -----------------------------------------------------------------------
171 # DO NOT DELETE: nice dependency list follows