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