Fix more compiler warnings.
[ira/wip.git] / lib / tevent / tevent.mk
1 TEVENT_SONAME = libtevent.$(SHLIBEXT).0
2 TEVENT_SOLIB = libtevent.$(SHLIBEXT).$(PACKAGE_VERSION)
3 TEVENT_STLIB = libtevent.a
4
5 $(TEVENT_STLIB): $(TEVENT_OBJ)
6         ar -rv $(TEVENT_STLIB) $(TEVENT_OBJ)
7
8 libtevent.$(SHLIBEXT): $(TEVENT_SOLIB)
9         ln -fs $< $@
10
11 $(TEVENT_SONAME): $(TEVENT_SOLIB)
12         ln -fs $< $@
13
14 dirs::
15         @mkdir -p lib
16
17 installdirs::
18         mkdir -p $(DESTDIR)$(includedir)
19         mkdir -p $(DESTDIR)$(libdir)
20         mkdir -p $(DESTDIR)$(libdir)/pkgconfig
21
22 installheaders:: installdirs
23         cp $(srcdir)/tevent.h $(DESTDIR)$(includedir)
24         cp $(srcdir)/tevent_internal.h $(DESTDIR)$(includedir)
25         cp $(srcdir)/tevent_util.h $(DESTDIR)$(includedir)
26
27 installlibs:: installdirs
28         cp tevent.pc $(DESTDIR)$(libdir)/pkgconfig
29         cp $(TEVENT_STLIB) $(TEVENT_SOLIB) $(DESTDIR)$(libdir)
30
31 install:: all installdirs installheaders installlibs $(PYTHON_INSTALL_TARGET)
32
33 clean::
34         rm -f $(TEVENT_SONAME) $(TEVENT_SOLIB) $(TEVENT_STLIB) libtevent.$(SHLIBEXT)
35         rm -f tevent.pc
36         rm -f tevent.$(SHLIBEXT)
37
38 #python stuff
39
40 check-python:: build-python
41         $(LIB_PATH_VAR)=. PYTHONPATH=".:$(teventdir)" $(PYTHON) $(teventdir)/tests.py
42
43 build-python:: tevent.$(SHLIBEXT)
44
45 pytevent.o: $(teventdir)/pytevent.c
46         $(CC) $(PICFLAG) -c $(teventdir)/pytevent.c $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
47
48 tevent.$(SHLIBEXT): libtevent.$(SHLIBEXT) pytevent.o
49         $(SHLD) $(SHLD_FLAGS) -o $@ pytevent.o -L. -ltevent `$(PYTHON_CONFIG) --libs`
50
51 install-python:: build-python
52         mkdir -p $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0, prefix='$(prefix)')"` \
53                 $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
54         cp tevent.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
55