11 # this dir relative to top dir
15 MKDIR=$(topdir)/autoconf/mkinstalldirs
23 SVRSRCS = cats.c sql.c
24 SVROBJS = cats.o sql.o
26 LIBSRCS = mysql.c bdb.c bdb_create.c bdb_get.c bdb_update.c \
27 bdb_delete.c bdb_find.c bdb_list.c \
28 sql.c sql_create.c sql_delete.c sql_find.c \
29 sql_get.c sql_list.c sql_update.c sqlite.c \
31 LIBOBJS = mysql.o bdb.o bdb_create.o bdb_get.o bdb_update.o \
32 bdb_delete.o bdb_find.o bdb_list.o \
33 sql.o sql_create.o sql_delete.o sql_find.o \
34 sql_get.o sql_list.o sql_update.o sqlite.o \
43 $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
44 #-------------------------------------------------------------------------
45 all: Makefile libsql.a
46 @echo "==== Make of cats is good ===="
50 $(AR) rc $@ $(LIBOBJS)
53 cats: $(SVROBJS) ../findlib/libfind.a
54 $(CC) $(WLDFLAGS) $(LDFLAGS) -L../findlib -L../lib -o $@ $(SVROBJS) $(LIBS) $(DB_LIBS) -lfind -lbac
56 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
58 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
62 $(RMF) cats core a.out *.o *.a *.bak *~ *.intpro *.extpro 1 2 3
67 $(RMF) create_bacula_database update_bacula_tables make_bacula_tables
68 $(RMF) grant_bacula_privileges drop_bacula_tables drop_bacula_database
70 $(RMF) create_bdb_database update_bdb_tables make_bdb_tables
71 $(RMF) grant_bdb_privileges drop_bdb_tables drop_bdb_database
73 $(RMF) create_mysql_database update_mysql_tables make_mysql_tables
74 $(RMF) grant_mysql_privileges drop_mysql_tables drop_mysql_database
76 $(RMF) create_postgresql_database update_postgresql_tables make_postgresql_tables
77 $(RMF) grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
79 $(RMF) create_sqlite_database update_sqlite_tables make_sqlite_tables
80 $(RMF) grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
82 $(RMF) mysql sqlite postgresql
83 $(RMF) make_catalog_backup delete_catalog_backup
86 if test $(srcdir) = .; then $(MAKE) realclean; fi
87 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
90 if test $(srcdir) = .; then $(MAKE) realclean; fi
91 (cd $(srcdir); $(RMF) Makefile)
94 $(INSTALL_SCRIPT) create_@DB_NAME@_database $(DESTDIR)$(scriptdir)/create_@DB_NAME@_database
95 $(INSTALL_SCRIPT) update_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/update_@DB_NAME@_tables
96 $(INSTALL_SCRIPT) make_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/make_@DB_NAME@_tables
97 $(INSTALL_SCRIPT) grant_@DB_NAME@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_NAME@_privileges
98 $(INSTALL_SCRIPT) drop_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/drop_@DB_NAME@_tables
99 $(INSTALL_SCRIPT) drop_@DB_NAME@_database $(DESTDIR)$(scriptdir)/drop_@DB_NAME@_database
101 $(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database
102 $(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables
103 $(INSTALL_SCRIPT) make_bacula_tables $(DESTDIR)$(scriptdir)/make_bacula_tables
104 $(INSTALL_SCRIPT) grant_bacula_privileges $(DESTDIR)$(scriptdir)/grant_bacula_privileges
105 $(INSTALL_SCRIPT) drop_bacula_tables $(DESTDIR)$(scriptdir)/drop_bacula_tables
106 $(INSTALL_SCRIPT) drop_bacula_database $(DESTDIR)$(scriptdir)/drop_bacula_database
108 @filename=make_catalog_backup; \
109 if test -f ${DESTDIR}${scriptdir}/$$filename; then \
110 destname=$$filename.new; \
111 echo " ==> Found existing $$filename, installing new file as $$destname"; \
113 destname=$$filename; \
115 echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
116 ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
117 @filename=delete_catalog_backup; \
118 if test -f ${DESTDIR}${scriptdir}/$$filename; then \
119 destname=$$filename.new; \
120 echo " ==> Found existing $$filename, installing new file as $$destname"; \
122 destname=$$filename; \
124 echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
125 ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
128 (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_NAME@_database)
129 (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_NAME@_tables)
130 (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_NAME@_tables)
131 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_NAME@_privileges)
132 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_NAME@_tables)
133 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_NAME@_database)
135 (cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database)
136 (cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables)
137 (cd $(DESTDIR)$(scriptdir); $(RMF) make_bacula_tables)
138 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_bacula_privileges)
139 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_tables)
140 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_database)
142 (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup)
143 (cd $(DESTDIR)$(scriptdir); $(RMF) delete_catalog_backup)
146 # Semi-automatic generation of dependencies:
147 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
148 # and it also includes system headers.
149 # `semi'-automatic since dependencies are generated at distribution time.
152 @$(MV) Makefile Makefile.bak
153 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
154 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
155 @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
156 @if test -f Makefile ; then \
157 $(RMF) Makefile.bak; \
159 $(MV) Makefile.bak Makefile; \
160 echo -e "Something went wrong\n\a"; \
163 # -----------------------------------------------------------------------
164 # DO NOT DELETE: nice dependency list follows