1 ################################################################################ 36 ################################################################################ 40 ifeq ($(strip $(RNMAKE_PYTHON_ENABLED)),y)
42 PYTHON_MOD_DIR ?= ./modules
44 SETUP_BUILD_DIR = ./build
45 PYTHON_BUILD_DIR = $(SETUP_BUILD_DIR).$(RNMAKE_ARCH)
48 @if [ -e $(SETUP_BUILD_DIR) ]; \
50 $(UNLINK) $(SETUP_BUILD_DIR); \
54 # Target: python-all (default) 56 # Use python's standard distutils to build and install python modules. The 57 # "build - install" sequence is equivalent to the RNMAKE "all" target with 58 # the "install" installing into the package dist/dist.<arch> directory. 60 # Note that the distutils supports where to build the intermediates but does 61 # not support the concept of source location for installing to target location, 62 # but rather always installs from the build directory. Hence the linking high 67 $(call printGoalDesc,$(PYTHON) setup.py)
69 $(PYTHON) setup.py build --build-base=$(PYTHON_BUILD_DIR)
70 $(SYMLINK) $(PYTHON_BUILD_DIR) $(SETUP_BUILD_DIR)
71 $(PYTHON) setup.py install --prefix=$(DIST_ARCH)
73 # Target: make python source documentation 76 $(call printGoalDesc,$(@),Making python source documentation)
77 @test -d
"$(DISTDIR_DOC)/pydoc" || $(MKDIR) $(DISTDIR_DOC)/pydoc
78 @$(PYTHON) $(RNMAKE_ROOT)/utils/
pydocmk.py \
79 --docroot=$(DISTDIR_DOC)/pydoc \
80 --vpath=$(DIST_VPATH_LIB) \
83 # Target: python-clean 86 $(call printGoalDesc,$(@),Removing byte-compiled python files)
87 @$(FIND) $(PYTHON_MOD_DIR) \( \
88 -name
'*.svn*' -or -wholename
'.svn' -or \
89 -wholename
'*.deps*' -or -wholename
'.deps' -or \
90 -wholename
'*obj*' -or -wholename
'obj' -or -wholename
'*.o' -or \
91 -wholename
'*.out' -or -wholename
'*.log' \
92 \) -prune -or -print | \
93 $(GREP) -e
'.py[co]' | \
96 .PHONY: python-distclean
98 $(call printGoalDesc,$(@),Removing intermediate $(PYTHON_BUILD_DIR) directory)
100 @$(RM) $(PYTHON_BUILD_DIR)
104 python-all python-doc python-clean python-distclean:
105 @printf
"python not enabled - ignoring\n"