python: Fix rule for generating docs using pydoctor.
[Samba/eduardoll.git] / source4 / build / make / python.mk
blobea307da73d6f79ca54b71a108813cf6137748be1
1 pythonbuilddir = bin/python
3 installpython::
4 mkdir -p $(DESTDIR)$(pythondir)
6 # Install Python
7 # Arguments: Module path
8 define python_module_template
10 installpython:: $$(pythonbuilddir)/$(1) ;
11 mkdir -p $$(DESTDIR)$$(pythondir)/$$(dir $(1))
12 cp $$< $$(DESTDIR)$$(pythondir)/$(1)
14 uninstallpython::
15 rm -f $$(DESTDIR)$$(pythondir)/$(1) ;
17 pythonmods:: $$(pythonbuilddir)/$(1) ;
19 endef
21 define python_py_module_template
23 $$(pythonbuilddir)/$(1): $(2) ;
24 mkdir -p $$(@D)
25 cp $$< $$@
27 $(call python_module_template,$(1))
29 endef
31 # Python C module
32 # Arguments: File name, dependencies, link list
33 define python_c_module_template
35 $$(pythonbuilddir)/$(1): $(2) ;
36 @echo Linking $$@
37 @mkdir -p $$(@D)
38 @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
40 $(call python_module_template,$(1))
41 endef
43 pythonmods::
45 clean::
46 @echo "Removing python modules"
47 @rm -rf $(pythonbuilddir)
49 bin/python/%.py:
50 mkdir -p $(@D)
51 cp $< $@