r26292: Make sure swig directory exists.
[jelmer/samba4-debian.git] / source / lib / talloc / Makefile.in
index a986d7766cd4ef9ee488001a6f9df07ead2b52b5..a33085f95bf5bffc7c685c1b96d349ed859a8fb5 100644 (file)
@@ -1,44 +1,75 @@
-#OPT = -g -ftest-coverage -fprofile-arcs 
-#LIBS = -lgcov
-OPT = -O
+#!gmake
+#
 prefix = @prefix@
+datarootdir = @datarootdir@
 exec_prefix = @exec_prefix@
 includedir = @includedir@
 libdir = @libdir@
 mandir = @mandir@
+VPATH = @srcdir@:@libreplacedir@
+srcdir = @srcdir@
+builddir = @builddir@
 XSLTPROC = @XSLTPROC@
-INSTALLCMD=@INSTALL@
+INSTALLCMD = @INSTALL@
+CC = @CC@
+CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H= -I. -I@srcdir@
+EXTRA_TARGETS = @DOC_TARGET@
+PICFLAG = @PICFLAG@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+SHLIBEXT = @SHLIBEXT@
+SHLD = @SHLD@
+SHLD_FLAGS = @SHLD_FLAGS@
 
-CFLAGS = $(OPT) -Wall
+.SUFFIXES: .c .o .3 .3.xml .xml .html
 
-LIBOBJ = talloc.o
+LIBOBJ = @TALLOC_OBJ@ @LIBREPLACEOBJ@
 
-all: libtalloc.a testsuite 
+SOLIB = libtalloc.$(SHLIBEXT).$(PACKAGE_VERSION)
+SONAME = libtalloc.$(SHLIBEXT).1
+
+.c.o:
+       $(CC) $(PICFLAG) -o $@ -c $< $(CFLAGS)
+
+all: showflags libtalloc.a $(SOLIB) testsuite $(EXTRA_TARGETS)
+
+showflags:
+       @echo 'talloc will be compiled with flags:'
+       @echo '  CFLAGS = $(CFLAGS)'
+       @echo '  LIBS = $(LIBS)'
 
 testsuite: $(LIBOBJ) testsuite.o
        $(CC) $(CFLAGS) -o testsuite testsuite.o $(LIBOBJ) $(LIBS)
 
-libtalloc.a: libtalloc.a($(LIBOBJ))
+libtalloc.a: $(LIBOBJ)
+       ar -rv $@ $(LIBOBJ)
+       @-ranlib $@
 
-install: all doc
-       ${INSTALLCMD} -d ${libdir}
-       ${INSTALLCMD} -m 755 libtalloc.a $(libdir)
-       ${INSTALLCMD} -d ${includedir}
-       ${INSTALLCMD} -m 644 talloc.h $(includedir)
-       ${INSTALLCMD} -m 644 talloc.pc $(libdir)/pkgconfig
-       ${INSTALLCMD} -d ${mandir}/man3
-       ${INSTALLCMD} -m 644 talloc.3 $(mandir)/man3
+$(SOLIB): $(LIBOBJ)
+       $(SHLD) $(SHLD_FLAGS) -o $@ $(LIBOBJ) @SONAMEFLAG@$(SONAME)
 
-doc: talloc.3
+install: all 
+       ${INSTALLCMD} -d $(DESTDIR)$(libdir)
+       ${INSTALLCMD} -d $(DESTDIR)$(libdir)/pkgconfig
+       ${INSTALLCMD} -m 755 libtalloc.a $(DESTDIR)$(libdir)
+       ${INSTALLCMD} -m 755 $(SOLIB) $(DESTDIR)$(libdir)
+       ${INSTALLCMD} -d $(DESTDIR)${includedir}
+       ${INSTALLCMD} -m 644 $(srcdir)/talloc.h $(DESTDIR)$(includedir)
+       ${INSTALLCMD} -m 644 talloc.pc $(DESTDIR)$(libdir)/pkgconfig
+       if [ -f talloc.3 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man3; fi
+       if [ -f talloc.3 ];then ${INSTALLCMD} -m 644 talloc.3 $(DESTDIR)$(mandir)/man3; fi
+       which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)`swig -swiglib` || true
+       which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)`swig -swiglib` || true
 
-%.3: %.3.xml
-       $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+doc: talloc.3 talloc.3.html
 
-%.html: %.xml
-       $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
+.3.xml.3:
+       -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
+.xml.html:
+       -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
 
 clean:
-       rm -f *~ *.o testsuite *.gc??
+       rm -f *~ $(LIBOBJ) $(SOLIB) libtalloc.a testsuite testsuite.o *.gc?? talloc.3 talloc.3.html
 
 test: testsuite
        ./testsuite
@@ -48,3 +79,11 @@ gcov:
 
 installcheck: 
        $(MAKE) test
+
+distclean: clean
+       rm -f *~ */*~
+       rm -f Makefile
+       rm -f config.log config.status config.h config.cache
+
+realdistclean: distclean
+       rm -f configure config.h.in