]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/Makefile.in
Add retry for opening batch db if it fails.
[bacula/bacula] / bacula / src / cats / Makefile.in
1
2 @MCOMMON@
3
4 srcdir =        .
5 .PATH:          .
6
7 # one up
8 basedir = ..
9 # top dir
10 topdir = ../..
11 # this dir relative to top dir
12 thisdir = src/cats
13
14 CPPFLAGS += -DBUILDING_CATS
15
16 DEBUG=@DEBUG@
17 MKDIR=$(topdir)/autoconf/mkinstalldirs
18
19 SQL_INC=@SQL_INCLUDE@
20
21 first_rule: all
22 dummy:
23
24 #
25 SVRSRCS = cats.c sql.c
26 SVROBJS = cats.o sql.o
27
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 \
32           postgresql.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 \
37           postgresql.o
38
39 .SUFFIXES:      .c .o
40 .PHONY:
41 .DONTCARE:
42
43 # inference rules
44 .c.o:
45         @echo "Compiling $<"
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 ===="
50         @echo " "
51
52 libsql.a: $(LIBOBJS)
53         @echo "Making $@ ..."     
54         $(AR) rc  $@ $(LIBOBJS)
55         $(RANLIB) $@
56
57 cats: $(SVROBJS) ../findlib/libfind.a
58         $(CC) $(WLDFLAGS) $(LDFLAGS) -L../findlib -L../lib -o $@ $(SVROBJS) $(LIBS) $(DB_LIBS) -lfind -lbac
59
60 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
61         cd $(topdir) \
62           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
63
64
65 clean:
66         $(RMF) cats core a.out *.o *.a *.bak *~ *.intpro *.extpro 1 2 3
67
68 realclean: clean
69         $(RMF) tags
70
71         $(RMF) create_bacula_database      update_bacula_tables     make_bacula_tables
72         $(RMF) grant_bacula_privileges     drop_bacula_tables       drop_bacula_database
73
74         $(RMF) create_bdb_database         update_bdb_tables        make_bdb_tables
75         $(RMF) grant_bdb_privileges        drop_bdb_tables          drop_bdb_database
76
77         $(RMF) create_mysql_database       update_mysql_tables      make_mysql_tables
78         $(RMF) grant_mysql_privileges      drop_mysql_tables        drop_mysql_database
79
80         $(RMF) create_postgresql_database  update_postgresql_tables make_postgresql_tables
81         $(RMF) grant_postgresql_privileges drop_postgresql_tables   drop_postgresql_database
82
83         $(RMF) create_sqlite_database      update_sqlite_tables     make_sqlite_tables
84         $(RMF) grant_sqlite_privileges     drop_sqlite_tables       drop_sqlite_database
85
86         $(RMF) create_sqlite3_database     update_sqlite3_tables     make_sqlite3_tables
87         $(RMF) grant_sqlite3_privileges    drop_sqlite3_tables      drop_sqlite3_database
88
89         $(RMF) mysql sqlite postgresql
90         $(RMF) make_catalog_backup delete_catalog_backup
91
92 distclean: realclean
93         if test $(srcdir) = .; then $(MAKE) realclean; fi
94         (cd $(srcdir); $(RMF) Makefile)
95
96 devclean: realclean
97         if test $(srcdir) = .; then $(MAKE) realclean; fi
98         (cd $(srcdir); $(RMF) Makefile)
99
100 install:
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
107
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
114
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"; \
119            else \
120               destname=$$filename; \
121            fi; \
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"; \
128            else \
129               destname=$$filename; \
130            fi; \
131            echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
132            ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
133
134 uninstall:
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)
141
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)
148
149         (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup)
150         (cd $(DESTDIR)$(scriptdir); $(RMF) delete_catalog_backup)
151
152
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.
157
158 depend:
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; \
165         else \
166            $(MV) Makefile.bak Makefile; \
167            echo " ===== Something went wrong in make depend ====="; \
168         fi
169
170 # -----------------------------------------------------------------------
171 # DO NOT DELETE: nice dependency list follows