]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/Makefile.in
87455d4dc5613400d737f19a0c571b850f80158f
[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 @DBI_DBD_DRIVERDIR@
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 # include files installed when using libtool
26 #
27 INCLUDE_FILES = bdb.h cats.h protos.h sql_cmds.h
28
29 #
30 SVRSRCS = cats.c sql.c
31 SVROBJS = cats.o sql.o
32
33 LIBSRCS = mysql.c bdb.c dbi.c \
34           sql.c sql_cmds.c sql_create.c sql_delete.c sql_find.c \
35           sql_get.c sql_list.c sql_update.c sqlite.c \
36           postgresql.c
37 LIBOBJS = $(LIBSRCS:.c=$(DEFAULT_OBJECT_TYPE))
38
39 LIBBACSQL_LT_CURRENT = 1
40 LIBBACSQL_LT_REVISION = 0
41 LIBBACSQL_LT_AGE = 0
42
43 .SUFFIXES:      .c .o .lo
44 .PHONY:
45 .DONTCARE:
46
47 # inference rules
48 .c.o:
49         @echo "Compiling $<"
50         $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
51
52 .c.lo:
53         @echo "Compiling $<"
54         $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
55 #-------------------------------------------------------------------------
56 all: Makefile libbacsql$(DEFAULT_ARCHIVE_TYPE)
57         @echo "==== Make of cats is good ===="
58         @echo " "
59
60 libbacsql.a: $(LIBOBJS)
61         @echo "Making $@ ..."     
62         $(AR) rc  $@ $(LIBOBJS)
63         $(RANLIB) $@
64
65 libbacsql.la: Makefile $(LIBOBJS)
66         @echo "Making $@ ..."     
67         $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACSQL_LT_CURRENT):$(LIBBACSQL_LT_REVISION):$(LIBBACSQL_LT_AGE) $(DB_LIBS)
68
69 cats:   Makefile $(SVROBJS) ../findlib/libfind$(DEFAULT_ARCHIVE_TYPE)
70         $(LIBTOOL_LINK) $(CC) $(WLDFLAGS) $(LDFLAGS) -L../findlib -L../lib -o $@ $(SVROBJS) $(LIBS) $(DB_LIBS) -lfind -lbac
71
72 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
73         cd $(topdir) \
74           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
75
76 libtool-clean:
77         find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
78         $(RMF) *.la
79         $(RMF) -r .libs _libs
80
81 clean: @LIBTOOL_CLEAN_TARGET@
82         $(RMF) cats core a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
83
84 realclean: clean
85         $(RMF) tags
86
87         $(RMF) create_bacula_database      update_bacula_tables     make_bacula_tables
88         $(RMF) grant_bacula_privileges     drop_bacula_tables       drop_bacula_database
89
90         $(RMF) create_bdb_database         update_bdb_tables        make_bdb_tables
91         $(RMF) grant_bdb_privileges        drop_bdb_tables          drop_bdb_database
92
93         $(RMF) create_mysql_database       update_mysql_tables      make_mysql_tables
94         $(RMF) grant_mysql_privileges      drop_mysql_tables        drop_mysql_database
95
96         $(RMF) create_postgresql_database  update_postgresql_tables make_postgresql_tables
97         $(RMF) grant_postgresql_privileges drop_postgresql_tables   drop_postgresql_database
98
99         $(RMF) create_sqlite_database      update_sqlite_tables     make_sqlite_tables
100         $(RMF) grant_sqlite_privileges     drop_sqlite_tables       drop_sqlite_database
101
102         $(RMF) create_sqlite3_database     update_sqlite3_tables     make_sqlite3_tables
103         $(RMF) grant_sqlite3_privileges    drop_sqlite3_tables      drop_sqlite3_database
104
105         $(RMF) mysql sqlite postgresql
106         $(RMF) make_catalog_backup delete_catalog_backup
107
108 distclean: realclean
109         if test $(srcdir) = .; then $(MAKE) realclean; fi
110         (cd $(srcdir); $(RMF) Makefile)
111
112 devclean: realclean
113         if test $(srcdir) = .; then $(MAKE) realclean; fi
114         (cd $(srcdir); $(RMF) Makefile)
115
116 install-includes:
117         $(MKDIR) $(DESTDIR)/$(includedir)/bacula/sql
118         for I in ${INCLUDE_FILES}; do \
119            $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/sql/`basename $$I`; \
120         done
121
122 uninstall-includes:
123         for I in ${INCLUDE_FILES}; do \
124            $(RMF) $(DESTDIR)$(includedir)/bacula/sql/`basename $$I`; \
125         done
126
127 libtool-install: all
128         $(MKDIR) $(DESTDIR)$(libdir)
129         $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacsql$(DEFAULT_ARCHIVE_TYPE) $(DESTDIR)$(libdir)
130
131 libtool-uninstall:
132         $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacsql.la
133
134 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
135         $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database
136         $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables
137         $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables
138         $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges
139         $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables
140         $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database
141
142         $(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database
143         $(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables
144         $(INSTALL_SCRIPT) make_bacula_tables $(DESTDIR)$(scriptdir)/make_bacula_tables
145         $(INSTALL_SCRIPT) grant_bacula_privileges $(DESTDIR)$(scriptdir)/grant_bacula_privileges
146         $(INSTALL_SCRIPT) drop_bacula_tables $(DESTDIR)$(scriptdir)/drop_bacula_tables
147         $(INSTALL_SCRIPT) drop_bacula_database $(DESTDIR)$(scriptdir)/drop_bacula_database
148
149         @filename=make_catalog_backup; \
150            if  test -f ${DESTDIR}${scriptdir}/$$filename; then \
151               destname=$$filename.new; \
152               echo "  ==> Found existing $$filename, installing new file as $$destname"; \
153            else \
154               destname=$$filename; \
155            fi; \
156            echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
157            ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
158         @filename=delete_catalog_backup; \
159            if  test -f ${DESTDIR}${scriptdir}/$$filename; then \
160               destname=$$filename.new; \
161               echo "  ==> Found existing $$filename, installing new file as $$destname"; \
162            else \
163               destname=$$filename; \
164            fi; \
165            echo "${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname"; \
166            ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname
167
168 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
169         (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database)
170         (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables)
171         (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables)
172         (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges)
173         (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables)
174         (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database)
175
176         (cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database)
177         (cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables)
178         (cd $(DESTDIR)$(scriptdir); $(RMF) make_bacula_tables)
179         (cd $(DESTDIR)$(scriptdir); $(RMF) grant_bacula_privileges)
180         (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_tables)
181         (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_database)
182
183         (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup)
184         (cd $(DESTDIR)$(scriptdir); $(RMF) delete_catalog_backup)
185
186 # Semi-automatic generation of dependencies:
187 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
188 # and it also includes system headers.
189 # `semi'-automatic since dependencies are generated at distribution time.
190
191 depend:
192         @$(MV) Makefile Makefile.bak
193         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
194         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
195         @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
196         @if test -f Makefile ; then \
197             $(RMF) Makefile.bak; \
198         else \
199            $(MV) Makefile.bak Makefile; \
200            echo " ===== Something went wrong in make depend ====="; \
201         fi
202
203 # -----------------------------------------------------------------------
204 # DO NOT DELETE: nice dependency list follows