2 # GNUMakefile for util-vserver Python bindings
4 # It's too hard to integrate distutils into the autoconf/libtool
5 # framework, so run this Makefile separately from and after the normal
8 # Steve Muir <smuir@cs.princeton.edu>
9 # Mark Huang <mlhuang@cs.princeton.edu>
10 # Copyright (C) 2005 The Trustees of Princeton University
15 ALL := vserverimpl.so vduimpl.so util_vserver_vars.py
17 pythonlibdir := @libdir@/python@PYTHON_VERSION@/site-packages
22 # builds object and incompletely linked library
23 python setup.py build_ext
24 # copy to current directory
25 cp -a build/temp.*/*.o .
27 vserverimpl.so vduimpl.so: %.so: %.o
28 # relink the object against libvserver with libtool
29 ../libtool --tag=CC --mode=link $(CC) -shared -o $@ $< ../lib/libvserver.la
31 util_vserver_vars.py: ../scripts/util-vserver-vars
35 # install relinked libraries and byte-compiled scripts
36 python setup.py install --root="$(DESTDIR)"
37 # reinstall libraries with libtool so that the final path
38 # to libvserver is resolved
39 for so in $(filter %.so, $(ALL)) ; do \
40 ../libtool --tag=CC --mode=install install "$$so" `find "$(DESTDIR)" -name "$$so"` ; \
44 rm -rf $(ALL) *.o build
46 .PHONY: all install clean