diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-08-25 17:45:56 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-08-25 17:45:56 +0000 |
| commit | 1223c12c3501a2659a250e44917620986064d4f5 (patch) | |
| tree | b10d4eb3174579309cda092b822e0f3bef5e5191 | |
| parent | f121fc29d5d03b9e19ba980c32d4109d6c1d4313 (diff) | |
| download | qpid-python-1223c12c3501a2659a250e44917620986064d4f5.tar.gz | |
moved compile and qpid_config sed into install target
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@807727 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | qpid/python/Makefile | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/qpid/python/Makefile b/qpid/python/Makefile index d25137f2df..0fbb6c8ce1 100644 --- a/qpid/python/Makefile +++ b/qpid/python/Makefile @@ -23,12 +23,14 @@ DATA_DIR=$(PREFIX)/share PYTHON_LIB=$(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='$(PREFIX)')") PYTHON_VERSION=$(shell python -c "from distutils.sysconfig import get_python_version; print get_python_version()") -AMQP_SPEC_DIR=$(DATA_DIR)/amqp +AMQP_SPEC_DIR=$(abspath $(DATA_DIR)/amqp) DIRS=qmf qpid mllib models examples tests tests_0-8 tests_0-9 tests_0-10 SRCS=$(shell find $(DIRS) -name "*.py") qpid_config.py BUILD=build -TARGETS=$(SRCS:%.py=$(BUILD)/%.py) $(SRCS:%.py=$(BUILD)/%.pyc) +TARGETS=$(SRCS:%.py=$(BUILD)/%.py) + +PYCC=python -c "import compileall, sys; compileall.compile_dir(sys.argv[1])" all: build @@ -36,13 +38,6 @@ $(BUILD)/%.py: %.py @mkdir -p $(shell dirname $@) ./preppy $(PYTHON_VERSION) < $< > $@ -$(BUILD)/%.pyc: $(BUILD)/%.py - python -c "import py_compile; py_compile.main()" $< - -$(BUILD)/qpid_config.py: qpid_config.py - @mkdir -p $(BUILD) - sed s@AMQP_SPEC_DIR=.*@AMQP_SPEC_DIR='"$(AMQP_SPEC_DIR)"'@ < $< > $@ - build: $(TARGETS) install: build @@ -50,28 +45,39 @@ install: build install -d $(PYTHON_LIB)/mllib install -pm 0644 LICENSE.txt NOTICE.txt $(BUILD)/mllib/*.* $(PYTHON_LIB)/mllib + $(PYCC) $(PYTHON_LIB)/mllib install -d $(PYTHON_LIB)/qpid install -pm 0644 LICENSE.txt NOTICE.txt README.txt $(BUILD)/qpid/*.* $(PYTHON_LIB)/qpid - install -pm 0644 $(BUILD)/qpid_config.py $(PYTHON_LIB) + TDIR=$(shell mktemp -d) && \ + sed s@AMQP_SPEC_DIR=.*@AMQP_SPEC_DIR='"$(AMQP_SPEC_DIR)"'@ \ + $(BUILD)/qpid_config.py > $${TDIR}/qpid_config.py && \ + install -pm 0644 $${TDIR}/qpid_config.py $(PYTHON_LIB) && \ + rm -rf $${TDIR} install -d $(PYTHON_LIB)/qpid/tests install -pm 0644 $(BUILD)/qpid/tests/*.* $(PYTHON_LIB)/qpid/tests + $(PYCC) $(PYTHON_LIB)/qpid install -d $(PYTHON_LIB)/qmf install -pm 0644 LICENSE.txt NOTICE.txt qmf/*.* $(PYTHON_LIB)/qmf + $(PYCC) $(PYTHON_LIB)/qmf install -d $(PYTHON_LIB)/tests install -pm 0644 $(BUILD)/tests/*.* $(PYTHON_LIB)/tests + $(PYCC) $(PYTHON_LIB)/tests install -d $(PYTHON_LIB)/tests_0-8 install -pm 0644 $(BUILD)/tests_0-8/*.* $(PYTHON_LIB)/tests_0-8 + $(PYCC) $(PYTHON_LIB)/tests_0-8 install -d $(PYTHON_LIB)/tests_0-9 install -pm 0644 $(BUILD)/tests_0-9/*.* $(PYTHON_LIB)/tests_0-9 + $(PYCC) $(PYTHON_LIB)/tests_0-9 install -d $(PYTHON_LIB)/tests_0-10 install -pm 0644 $(BUILD)/tests_0-10/*.* $(PYTHON_LIB)/tests_0-10 + $(PYCC) $(PYTHON_LIB)/tests_0-10 install -d $(EXEC_PREFIX) install -pm 0755 qpid-python-test commands/* $(EXEC_PREFIX) |
