Turned libtap into a proper ccan package.
[ccan] / ccan_tools / talloc / Makefile.in
1 #!gmake
2 #
3 prefix = @prefix@
4 datarootdir = @datarootdir@
5 exec_prefix = @exec_prefix@
6 includedir = @includedir@
7 libdir = @libdir@
8 mandir = @mandir@
9 VPATH = @srcdir@
10 srcdir = @srcdir@
11 builddir = @builddir@
12 XSLTPROC = @XSLTPROC@
13 INSTALLCMD = @INSTALL@
14 CC = @CC@
15 CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H= -I. -I@srcdir@
16 EXTRA_TARGETS = @DOC_TARGET@
17
18 .SUFFIXES: .c .o .3 .3.xml .xml .html
19
20 LIBOBJ = @TALLOC_OBJ@
21
22 all: showflags libtalloc.a testsuite $(EXTRA_TARGETS)
23
24 showflags:
25         @echo 'talloc will be compiled with flags:'
26         @echo '  CFLAGS = $(CFLAGS)'
27         @echo '  LIBS = $(LIBS)'
28
29 testsuite: $(LIBOBJ) testsuite.o
30         $(CC) $(CFLAGS) -o testsuite testsuite.o $(LIBOBJ) $(LIBS)
31
32 libtalloc.a: $(LIBOBJ)
33         ar -rv $@ $(LIBOBJ)
34         @-ranlib $@
35
36 install: all 
37         ${INSTALLCMD} -d $(DESTDIR)$(libdir)
38         ${INSTALLCMD} -d $(DESTDIR)$(libdir)/pkgconfig
39         ${INSTALLCMD} -m 755 libtalloc.a $(DESTDIR)$(libdir)
40         ${INSTALLCMD} -d $(DESTDIR)${includedir}
41         ${INSTALLCMD} -m 644 $(srcdir)/talloc.h $(DESTDIR)$(includedir)
42         ${INSTALLCMD} -m 644 talloc.pc $(DESTDIR)$(libdir)/pkgconfig
43         if [ -f talloc.3 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man3; fi
44         if [ -f talloc.3 ];then ${INSTALLCMD} -m 644 talloc.3 $(DESTDIR)$(mandir)/man3; fi
45
46 doc: talloc.3 talloc.3.html
47
48 .3.xml.3:
49         -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
50
51 .xml.html:
52         -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
53
54 clean:
55         rm -f *~ $(LIBOBJ) libtalloc.a testsuite testsuite.o *.gc?? talloc.3 talloc.3.html
56
57 test: testsuite
58         ./testsuite
59
60 gcov:
61         gcov talloc.c
62
63 installcheck: 
64         $(MAKE) test
65
66 distclean: clean
67         rm -f *~ */*~
68         rm -f Makefile
69         rm -f config.log config.status config.h config.cache
70
71 realdistclean: distclean
72         rm -f configure config.h.in