11 # this dir relative to top dir
14 CPPFLAGS += -DBUILDING_CATS @DBI_DBD_DRIVERDIR@
17 MKDIR=$(topdir)/autoconf/mkinstalldirs
25 # include files installed when using libtool
27 INCLUDE_FILES = cats.h protos.h sql_cmds.h
29 LIBBACSQL_SRCS = mysql.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 ingres.c myingres.c \
34 LIBBACSQL_OBJS = $(LIBBACSQL_SRCS:.c=.o)
35 LIBBACSQL_LOBJS = $(LIBBACSQL_SRCS:.c=.lo)
37 LIBBACSQL_LT_CURRENT = @LIBBACSQL_LT_CURRENT@
38 LIBBACSQL_LT_REVISION = @LIBBACSQL_LT_REVISION@
39 LIBBACSQL_LT_AGE = @LIBBACSQL_LT_AGE@
48 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
52 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) $(DINCLUDE) $(CFLAGS) $<
54 #-------------------------------------------------------------------------
55 all: Makefile libbacsql$(DEFAULT_ARCHIVE_TYPE)
56 @echo "==== Make of sqllib is good ===="
60 @echo "Generating myingres.c from myingres.sc"
61 $(NO_ECHO)$(II_SYSTEM)/ingres/bin/esqlcc -multi -extension=c myingres.sc
62 @echo "Generating myingres.h from myingres.sh"
63 $(NO_ECHO)$(II_SYSTEM)/ingres/bin/esqlcc -extension=h myingres.sh
65 libbacsql.a: $(LIBBACSQL_OBJS)
67 $(AR) rc $@ $(LIBBACSQL_OBJS)
70 libbacsql.la: Makefile $(LIBBACSQL_LOBJS)
72 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACSQL_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACSQL_LT_CURRENT).$(LIBBACSQL_LT_REVISION).$(LIBBACSQL_LT_AGE) $(DB_LIBS)
74 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
76 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
79 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
81 @$(RMF) -r .libs _libs
84 @$(RMF) core a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
89 $(RMF) create_bacula_database update_bacula_tables make_bacula_tables
90 $(RMF) grant_bacula_privileges drop_bacula_tables drop_bacula_database
92 $(RMF) create_bdb_database update_bdb_tables make_bdb_tables
93 $(RMF) grant_bdb_privileges drop_bdb_tables drop_bdb_database
95 $(RMF) create_mysql_database update_mysql_tables make_mysql_tables
96 $(RMF) grant_mysql_privileges drop_mysql_tables drop_mysql_database
98 $(RMF) create_postgresql_database update_postgresql_tables make_postgresql_tables
99 $(RMF) grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
101 $(RMF) create_ingres_database update_ingres_tables make_ingres_tables
102 $(RMF) grant_ingres_privileges drop_ingres_tables drop_ingres_database
104 $(RMF) create_sqlite_database update_sqlite_tables make_sqlite_tables
105 $(RMF) grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
107 $(RMF) create_sqlite3_database update_sqlite3_tables make_sqlite3_tables
108 $(RMF) grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database
110 $(RMF) mysql sqlite postgresql ingres
111 $(RMF) make_catalog_backup make_catalog_backup.pl delete_catalog_backup
114 if test $(srcdir) = .; then $(MAKE) realclean; fi
115 (cd $(srcdir); $(RMF) Makefile)
118 if test $(srcdir) = .; then $(MAKE) realclean; fi
119 (cd $(srcdir); $(RMF) Makefile)
122 $(MKDIR) $(DESTDIR)/$(includedir)/bacula/sql
123 for I in $(INCLUDE_FILES); do \
124 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/sql/`basename $$I`; \
128 for I in $(INCLUDE_FILES); do \
129 $(RMF) $(DESTDIR)$(includedir)/bacula/sql/`basename $$I`; \
133 $(MKDIR) $(DESTDIR)$(libdir)
134 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacsql$(DEFAULT_ARCHIVE_TYPE) $(DESTDIR)$(libdir)
137 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacsql.la
139 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
140 $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database
141 $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables
142 $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables
143 $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges
144 $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables
145 $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database
147 $(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database
148 $(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables
149 $(INSTALL_SCRIPT) make_bacula_tables $(DESTDIR)$(scriptdir)/make_bacula_tables
150 $(INSTALL_SCRIPT) grant_bacula_privileges $(DESTDIR)$(scriptdir)/grant_bacula_privileges
151 $(INSTALL_SCRIPT) drop_bacula_tables $(DESTDIR)$(scriptdir)/drop_bacula_tables
152 $(INSTALL_SCRIPT) drop_bacula_database $(DESTDIR)$(scriptdir)/drop_bacula_database
154 @filename=make_catalog_backup.pl; \
155 if test -f $(DESTDIR)$(scriptdir)/$$filename; then \
156 destname=$$filename.new; \
157 echo " ==> Found existing $$filename, installing new file as $$destname"; \
159 destname=$$filename; \
161 echo "$(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname"; \
162 $(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname
163 @filename=make_catalog_backup; \
164 if test -f $(DESTDIR)$(scriptdir)/$$filename; then \
165 destname=$$filename.new; \
166 echo " ==> Found existing $$filename, installing new file as $$destname"; \
168 destname=$$filename; \
170 echo "$(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname"; \
171 $(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname
172 @filename=delete_catalog_backup; \
173 if test -f $(DESTDIR)$(scriptdir)/$$filename; then \
174 destname=$$filename.new; \
175 echo " ==> Found existing $$filename, installing new file as $$destname"; \
177 destname=$$filename; \
179 echo "$(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname"; \
180 $(INSTALL_SCRIPT) $$filename $(DESTDIR)$(scriptdir)/$$destname
182 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
183 (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database)
184 (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables)
185 (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables)
186 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges)
187 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables)
188 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database)
190 (cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database)
191 (cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables)
192 (cd $(DESTDIR)$(scriptdir); $(RMF) make_bacula_tables)
193 (cd $(DESTDIR)$(scriptdir); $(RMF) grant_bacula_privileges)
194 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_tables)
195 (cd $(DESTDIR)$(scriptdir); $(RMF) drop_bacula_database)
197 (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup)
198 (cd $(DESTDIR)$(scriptdir); $(RMF) make_catalog_backup.pl)
199 (cd $(DESTDIR)$(scriptdir); $(RMF) delete_catalog_backup)
201 # Semi-automatic generation of dependencies:
202 # Use gcc -M because X11 `makedepend' doesn't work on all systems
203 # and it also includes system headers.
204 # `semi'-automatic since dependencies are generated at distribution time.
206 #depend: esql <- SRE: if generating from 'real' ingres source
208 @$(MV) Makefile Makefile.bak
209 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
210 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
211 @for src in $(LIBBACSQL_SRCS); do \
212 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
214 @if test -f Makefile ; then \
215 $(RMF) Makefile.bak; \
217 $(MV) Makefile.bak Makefile; \
218 echo " ===== Something went wrong in make depend ====="; \
221 # -----------------------------------------------------------------------
222 # DO NOT DELETE: nice dependency list follows