From e98fff55cf94c3355a4a9fe1804bb6b2f16c82c2 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 6 Dec 2018 19:17:57 -0500 Subject: project: added the bits for python's {prefix}/bin script-based tools. --- project/extras.mk | 4 ++++ project/pytools.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++ project/tree.mk | 1 + 3 files changed, 49 insertions(+) create mode 100644 project/pytools.mk diff --git a/project/extras.mk b/project/extras.mk index b30e289..d11402d 100644 --- a/project/extras.mk +++ b/project/extras.mk @@ -1,5 +1,6 @@ # build info PYTHON_VER = 2.7 +PYTHON_MAJOR = 2 CFLAGS_COMMON += -I$(PROJECT_DIR)/profiles CFLAGS_COMMON += -I$(SOURCE_DIR)/Include @@ -104,3 +105,6 @@ include $(PROJECT_DIR)/project/pydist.mk # pycgen (python's distributed .pyc objects) include $(PROJECT_DIR)/project/pycgen.mk + +# pytools (python's {prefix}/bin script-based tools) +include $(PROJECT_DIR)/project/pytools.mk diff --git a/project/pytools.mk b/project/pytools.mk new file mode 100644 index 0000000..d9c967a --- /dev/null +++ b/project/pytools.mk @@ -0,0 +1,44 @@ +PYTOOL_2TO3 = 2to3 +PYTOOL_IDLE = idle +PYTOOL_PYDOC = pydoc +PYTOOL_SRCDIR = tools +PYTOOL_DSTDIR = $(DESTDIR)/$(BINDIR) + +$(PYTOOL_SRCDIR)/%: $(SOURCE_DIR)/Tools/scripts/% + PYCOPY_PYTHON=$(PYCOPY_PYTHON) \ + PYCOPY_PREFIX=$(PYCOPY_PREFIX) \ + PYCOPY_DSTDIR=$(PYTOOL_SRCDIR) \ + $(PYCOPY) $< + +PYTOOLS = \ + $(PYTOOL_SRCDIR)/$(PYTOOL_2TO3) \ + $(PYTOOL_SRCDIR)/$(PYTOOL_IDLE) \ + $(PYTOOL_SRCDIR)/$(PYTOOL_PYDOC) + +pytools: $(PYTOOLS) + +pytools-clean: + rm -f $(PYTOOLS) + +pytools-install:$(PYTOOLS) + mkdir -p $(PYTOOL_DSTDIR) + + cp -p $(PYTOOL_SRCDIR)/$(PYTOOL_2TO3) $(PYTOOL_DSTDIR)/$(PYTOOL_2TO3)-$(PYTHON_VER) + cp -p $(PYTOOL_SRCDIR)/$(PYTOOL_IDLE) $(PYTOOL_DSTDIR)/$(PYTOOL_IDLE)$(PYTHON_VER) + cp -p $(PYTOOL_SRCDIR)/$(PYTOOL_PYDOC) $(PYTOOL_DSTDIR)/$(PYTOOL_PYDOC)$(PYTHON_VER) + + ln -s $(PYTOOL_2TO3)-$(PYTHON_VER) $(PYTOOL_DSTDIR)/$(PYTOOL_2TO3)-$(PYTHON_MAJOR).tmp + ln -s $(PYTOOL_IDLE)$(PYTHON_VER) $(PYTOOL_DSTDIR)/$(PYTOOL_IDLE)$(PYTHON_MAJOR).tmp + ln -s $(PYTOOL_PYDOC)$(PYTHON_VER) $(PYTOOL_DSTDIR)/$(PYTOOL_PYDOC)$(PYTHON_MAJOR).tmp + + mv $(PYTOOL_DSTDIR)/$(PYTOOL_2TO3)-$(PYTHON_MAJOR).tmp $(PYTOOL_DSTDIR)/$(PYTOOL_2TO3)-$(PYTHON_MAJOR) + mv $(PYTOOL_DSTDIR)/$(PYTOOL_IDLE)$(PYTHON_MAJOR).tmp $(PYTOOL_DSTDIR)/$(PYTOOL_IDLE)$(PYTHON_MAJOR) + mv $(PYTOOL_DSTDIR)/$(PYTOOL_PYDOC)$(PYTHON_MAJOR).tmp $(PYTOOL_DSTDIR)/$(PYTOOL_PYDOC)$(PYTHON_MAJOR) + +all: pytools + +install: pytools-install + +clean: pytools-clean + +.PHONY: pytools pytools-install diff --git a/project/tree.mk b/project/tree.mk index 4af315d..5544bfe 100644 --- a/project/tree.mk +++ b/project/tree.mk @@ -1,5 +1,6 @@ tree.tag: mkdir -p pyext + mkdir -p tools mkdir -p Modules mkdir -p Modules/cjkcodecs mkdir -p Modules/zlib -- cgit v1.2.3