]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/Makefile.in
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / findlib / Makefile.in
index be830fe1c18d07afc6f584adab31cf4252a71924..2b92e33742e29bc95c91357d597293a88fda5c10 100644 (file)
@@ -1,4 +1,7 @@
 #
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
 #  Find files library Makefile
 #
 @MCOMMON@
@@ -20,57 +23,90 @@ first_rule: all
 dummy:
 
 #
-LIBSRCS = find.c match.c find_one.c
-LIBOBJS = find.o match.o find_one.o
+# include files installed when using libtool
+#
+INCLUDE_FILES = bfile.h find.h protos.h win32filter.h
+
+#
+LIBBACFIND_SRCS = find.c match.c find_one.c attribs.c create_file.c \
+                 bfile.c drivetype.c enable_priv.c fstype.c mkpath.c \
+                 savecwd.c namedpipe.c win32filter.c
+LIBBACFIND_OBJS = $(LIBBACFIND_SRCS:.c=.o)
+LIBBACFIND_LOBJS = $(LIBBACFIND_SRCS:.c=.lo)
 
-FINDSRCS = testfind.c
-FINDOBJS = testfind.o
+LIBBACFIND_LT_RELEASE = @LIBBACFIND_LT_RELEASE@
 
-.SUFFIXES:     .c .o
+.SUFFIXES:     .c .o .lo
 .PHONY:
 .DONTCARE:
 
 # inference rules
 .c.o:
-       $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+       @echo "Compiling $<"
+       $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+
+.c.lo:
+       @echo "Compiling $<"
+       $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
 #-------------------------------------------------------------------------
-all: Makefile libfind.a ../lib/libbac.a
+all: Makefile libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
        @echo "==== Make of findlib is good ===="
        @echo " "
 
-libfind.a: $(LIBOBJS) 
-       $(RMF) libfind.a
-       $(AR) cru $@ $(LIBOBJS)
+libbacfind.a: $(LIBBACFIND_OBJS)
+       @echo "Making $@ ..."
+       $(AR) rc  $@ $(LIBBACFIND_OBJS)
        $(RANLIB) $@
 
-testfind: libfind.a $(FINDOBJS)
-       $(CC) -g $(LDFLAGS) -L. -L../lib -o $@ $(FINDOBJS) $(LIBS) $(DLIB) -lfind -lbac -lm
+libbacfind.la: Makefile $(LIBBACFIND_LOBJS)
+       @echo "Making $@ ..."
+       $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACFIND_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACFIND_LT_RELEASE)
 
 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
        cd $(topdir) \
          && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-install:
+install-includes:
+       $(MKDIR) $(DESTDIR)/$(includedir)/bacula/findlib
+       for I in $(INCLUDE_FILES); do \
+          $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/findlib/`basename $$I`; \
+       done
 
-uninstall:
+uninstall-includes:
+       for I in $(INCLUDE_FILES); do \
+          $(RMF) $(DESTDIR)$(includedir)/bacula/findlib/`basename $$I`; \
+       done
 
+libtool-install: all
+       $(MKDIR) $(DESTDIR)$(libdir)
+       $(RMF) $(DESTDIR)$(libdir)/libbacfind-*.so $(DESTDIR)$(libdir)/libbacfind.la
+       $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbacfind$(DEFAULT_ARCHIVE_TYPE) $(DESTDIR)$(libdir)
 
-clean:
-       $(RMF) find testfind core a.out *.a *.o *.bak *~ *.intpro *.extpro 1 2 3
+libtool-uninstall:
+       $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacfind.la
 
-realclean: clean
-       $(RMF) tags
+install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
 
-distclean: realclean
-       if test $(srcdir) = .; then $(MAKE) realclean; fi
-       (cd $(srcdir); $(RMF) Makefile)
+uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
 
-install:
+libtool-clean:
+       @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
+       @$(RMF) *.la
+       @$(RMF) -r .libs _libs
 
+clean: libtool-clean
+       @$(RMF) find core a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
 
-uninstall:
+realclean: clean
+       @$(RMF) tags
 
+distclean: realclean
+       if test $(srcdir) = .; then $(MAKE) realclean; fi
+       (cd $(srcdir); $(RMF) Makefile)
 
+devclean: realclean
+       if test $(srcdir) = .; then $(MAKE) realclean; fi
+       (cd $(srcdir); $(RMF) Makefile)
 
 # Semi-automatic generation of dependencies:
 # Use gcc -M  because X11 `makedepend' doesn't work on all systems
@@ -81,12 +117,14 @@ depend:
        @$(MV) Makefile Makefile.bak
        @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
        @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
-       @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
+       @for src in $(LIBBACFIND_SRCS); do \
+           $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $$src >> Makefile; \
+       done
        @if test -f Makefile ; then \
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------