From f800cf250f079ab1e1bc1051c34d1d1061187447 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 14:51:57 +0200 Subject: Move standard make compilation rules to build/make. (This used to be commit ceda3312a98b069d0711f3cb33de3ae71e91ebaa) --- source4/build/make/python.mk | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 source4/build/make/python.mk (limited to 'source4/build/make/python.mk') diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk new file mode 100644 index 0000000000..57bf0169fe --- /dev/null +++ b/source4/build/make/python.mk @@ -0,0 +1,58 @@ +pythonbuilddir = $(builddir)/bin/python + +# Install Python +# Arguments: Module path +define python_module_template + +installpython:: $$(pythonbuilddir)/$(1) ; + cp $$< $$(DESTDIR)$$(PYTHONDIR)/$(1) + +uninstallpython:: + rm -f $$(DESTDIR)$$(PYTHONDIR)/$(1) ; + +pythonmods:: $$(pythonbuilddir)/$(1) ; + +endef + +define python_py_module_template + +$$(pythonbuilddir)/$(1): $(2) ; + mkdir -p $$(@D) + cp $$< $$@ + +$(call python_module_template,$(1)) + +endef + +# Python C module +# Arguments: Module path, object files +define python_c_module_template + +$$(pythonbuilddir)/$(1): $(2) ; + @echo Linking $$@ + @mkdir -p $$(@D) + @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +$(call python_module_template,$(1)) +endef + +# Swig extensions +swig:: pythonmods + +.SUFFIXES: _wrap.c .i + +.i_wrap.c: + [ "$(SWIG)" == "no" ] || $(SWIG) -O -Wall -I$(srcdir)/scripting/swig -python -keyword $< + +realdistclean:: + @echo "Removing SWIG output files" + # FIXME: Remove _wrap.c files + +pythonmods:: + +clean:: + @echo "Removing python modules" + @rm -rf $(pythonbuilddir) + +pydoctor:: pythonmods + LD_LIBRARY_PATH=bin/shared PYTHONPATH=$(pythonbuilddir) pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package $(pythonbuilddir)/samba -- cgit From d04926914ad0d9ecd7dee3e156198d6baf788598 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 01:40:32 +0200 Subject: Fix the build. (This used to be commit ecaa5bb83b5cf319718d15aff96152d70fa19f7f) --- source4/build/make/python.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/build/make/python.mk') diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk index 57bf0169fe..6c1798212e 100644 --- a/source4/build/make/python.mk +++ b/source4/build/make/python.mk @@ -56,3 +56,7 @@ clean:: pydoctor:: pythonmods LD_LIBRARY_PATH=bin/shared PYTHONPATH=$(pythonbuilddir) pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package $(pythonbuilddir)/samba + +bin/python/%.py: + mkdir -p $(@D) + cp $< $@ -- cgit From 97fbad6480b992421862eab3b347ff6a9bd33e8f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 10 May 2008 23:25:50 +0200 Subject: Install standalone python modules (so we can use stock python rather than smbpython). (This used to be commit bb5c9fc64b6ad275abdd98a19f018953c9d79cbd) --- source4/build/make/python.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/build/make/python.mk') diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk index 6c1798212e..c243b88e27 100644 --- a/source4/build/make/python.mk +++ b/source4/build/make/python.mk @@ -1,14 +1,18 @@ pythonbuilddir = $(builddir)/bin/python +installpython:: + mkdir -p $(DESTDIR)$(pythondir) + # Install Python # Arguments: Module path define python_module_template installpython:: $$(pythonbuilddir)/$(1) ; - cp $$< $$(DESTDIR)$$(PYTHONDIR)/$(1) + mkdir -p $$(DESTDIR)$$(pythondir)/$$(dir $(1)) + cp $$< $$(DESTDIR)$$(pythondir)/$(1) uninstallpython:: - rm -f $$(DESTDIR)$$(PYTHONDIR)/$(1) ; + rm -f $$(DESTDIR)$$(pythondir)/$(1) ; pythonmods:: $$(pythonbuilddir)/$(1) ; -- cgit From 12d32fb18ee3fe15ba4f7e26f49dcd8df974e089 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 May 2008 12:02:02 +0200 Subject: Allow dots in .mk file section headers, fix docstring. (This used to be commit bd3f3e7c85f1a92638d69379782aa7bfcecd9e2f) --- source4/build/make/python.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/build/make/python.mk') diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk index c243b88e27..7d957fb108 100644 --- a/source4/build/make/python.mk +++ b/source4/build/make/python.mk @@ -29,7 +29,7 @@ $(call python_module_template,$(1)) endef # Python C module -# Arguments: Module path, object files +# Arguments: File name, dependencies, link list define python_c_module_template $$(pythonbuilddir)/$(1): $(2) ; -- cgit From 9d1fd37e7914c977a79e46b31b779db9b6033620 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 May 2008 14:28:10 +0200 Subject: Use gnu make syntax for SWIG implicit rule since it allows multiple output files. (This used to be commit ce440887316d3ae379551c136f6b640c573fd702) --- source4/build/make/python.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/build/make/python.mk') diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk index 7d957fb108..66e5def8f0 100644 --- a/source4/build/make/python.mk +++ b/source4/build/make/python.mk @@ -43,9 +43,9 @@ endef # Swig extensions swig:: pythonmods -.SUFFIXES: _wrap.c .i +.SUFFIXES: _wrap.c .i .py -.i_wrap.c: +%_wrap.c %.py: %.i [ "$(SWIG)" == "no" ] || $(SWIG) -O -Wall -I$(srcdir)/scripting/swig -python -keyword $< realdistclean:: -- cgit