a563d613d64c9dc0ff5ff40f488f7feb55b9aaed
[ira/wip.git] / lib / talloc / talloc.mk
1 TALLOC_OBJ = $(tallocdir)/talloc.o 
2
3 TALLOC_SOLIB = libtalloc.$(SHLIBEXT).$(TALLOC_VERSION)
4 TALLOC_SONAME = libtalloc.$(SHLIBEXT).$(TALLOC_VERSION_MAJOR)
5 TALLOC_STLIB = libtalloc.a
6
7 all:: $(TALLOC_STLIB) $(TALLOC_SOLIB) testsuite
8
9 testsuite:: $(LIBOBJ) testsuite.o testsuite_main.o
10         $(CC) $(CFLAGS) -o testsuite testsuite.o testsuite_main.o $(LIBOBJ) $(LIBS)
11
12 $(TALLOC_STLIB): $(LIBOBJ)
13         ar -rv $@ $(LIBOBJ)
14         @-ranlib $@
15
16 install:: all 
17         ${INSTALLCMD} -d $(DESTDIR)$(libdir)
18         ${INSTALLCMD} -d $(DESTDIR)$(libdir)/pkgconfig
19         ${INSTALLCMD} -m 755 $(TALLOC_STLIB) $(DESTDIR)$(libdir)
20         ${INSTALLCMD} -m 755 $(TALLOC_SOLIB) $(DESTDIR)$(libdir)
21         ${INSTALLCMD} -d $(DESTDIR)${includedir}
22         ${INSTALLCMD} -m 644 $(srcdir)/talloc.h $(DESTDIR)$(includedir)
23         ${INSTALLCMD} -m 644 talloc.pc $(DESTDIR)$(libdir)/pkgconfig
24         if [ -f talloc.3 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man3; fi
25         if [ -f talloc.3 ];then ${INSTALLCMD} -m 644 talloc.3 $(DESTDIR)$(mandir)/man3; fi
26         which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)`swig -swiglib` || true
27         which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)`swig -swiglib` || true
28
29 doc:: talloc.3 talloc.3.html
30
31 clean::
32         rm -f *~ $(LIBOBJ) $(TALLOC_SOLIB) $(TALLOC_STLIB) testsuite testsuite.o testsuite_main.o *.gc?? talloc.3 talloc.3.html
33         rm -fr abi
34         rm -f talloc.exports.sort talloc.exports.check talloc.exports.check.sort
35         rm -f talloc.signatures.sort talloc.signatures.check talloc.signatures.check.sort
36
37 test:: testsuite
38         ./testsuite
39
40 abi_checks::
41         @echo ABI checks:
42         @./script/abi_checks.sh talloc talloc.h
43
44 test:: abi_checks
45
46 gcov::
47         gcov talloc.c