Merge branch 'master' of ssh://git.samba.org/data/git/samba
[nivanova/samba-autobuild/.git] / source4 / scripting / python / config.mk
index b15e1fcda78def5dbcb47e51443245dbf2d6109a..b494ee6e8d4fc968eedb287a93558601d56bd36f 100644 (file)
@@ -1,46 +1,37 @@
-[BINARY::smbpython]
-PRIVATE_DEPENDENCIES = LIBPYTHON
-OBJ_FILES = smbpython.o
-
 [SUBSYSTEM::LIBPYTHON]
 PUBLIC_DEPENDENCIES = EXT_LIB_PYTHON
+PRIVATE_DEPENDENCIES = PYTALLOC
 INIT_FUNCTION_SENTINEL = { NULL, NULL }
-OBJ_FILES = modules.o pytalloc.o
+
+LIBPYTHON_OBJ_FILES = $(addprefix $(pyscriptsrcdir)/, modules.o)
+
+[SUBSYSTEM::PYTALLOC]
+PUBLIC_DEPENDENCIES = EXT_LIB_PYTHON LIBTALLOC
+
+PYTALLOC_OBJ_FILES = $(addprefix $(pyscriptsrcdir)/, pytalloc.o)
 
 [PYTHON::python_uuid]
 PRIVATE_DEPENDENCIES = LIBNDR 
-OBJ_FILES = uuidmodule.o
+
+python_uuid_OBJ_FILES = $(pyscriptsrcdir)/uuidmodule.o
 
 [PYTHON::python_misc]
+LIBRARY_REALNAME = samba/_misc.$(SHLIBEXT)
 PRIVATE_DEPENDENCIES = LIBNDR LIBLDB SAMDB CREDENTIALS
-SWIG_FILE = misc.i
-
-# Swig extensions
-swig:: pythonmods
 
-.SUFFIXES: _wrap.c .i
+python_misc_OBJ_FILES = $(pyscriptsrcdir)/misc_wrap.o
 
-.i_wrap.c:
-       [ "$(SWIG)" == "no" ] || $(SWIG) -O -Wall -I$(srcdir)/scripting/swig -python -keyword $<
+$(python_misc_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
 
-realdistclean::
-       @echo "Removing SWIG output files"
-       @-rm -f bin/python/*
-       # FIXME: Remove _wrap.c files
+_PY_FILES = $(shell find $(pyscriptsrcdir)/samba $(pyscriptsrcdir)/subunit -name "*.py")
 
-pythonmods:: $(PYTHON_DSOS) $(PYTHON_PYS)
+$(foreach pyfile, $(_PY_FILES),$(eval $(call python_py_module_template,$(patsubst $(pyscriptsrcdir)/%,%,$(pyfile)),$(pyfile))))
 
-PYDOCTOR_MODULES=bin/python/ldb.py bin/python/auth.py bin/python/credentials.py bin/python/registry.py bin/python/tdb.py bin/python/security.py bin/python/events.py bin/python/net.py
+$(eval $(call python_py_module_template,samba/misc.py,$(pyscriptsrcdir)/misc.py))
 
-pydoctor:: pythonmods
-       LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=Samba --make-html --docformat=restructuredtext --add-package scripting/python/samba/ $(addprefix --add-module , $(PYDOCTOR_MODULES))
+EPYDOC_OPTIONS = --no-private --url http://www.samba.org/ --no-sourcecode
 
-installpython:: pythonmods
-       @$(SHELL) $(srcdir)/script/installpython.sh \
-               $(INSTALLPERMS) \
-               $(DESTDIR)$(PYTHONDIR) \
-               scripting/python bin/python
+epydoc:: pythonmods
+       PYTHONPATH=$(pythonbuilddir) epydoc $(EPYDOC_OPTIONS) samba tdb ldb subunit
 
-clean::
-       @echo "Removing python modules"
-       @rm -f bin/python/*
+install:: installpython