aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-10-02 12:57:09 +0200
committerMattias Andrée <maandree@operamail.com>2015-10-02 12:57:55 +0200
commitc0fdaeb534fb7ff55110630250dfeeef476e5564 (patch)
tree0a3196d2678ef4114bc1ba3e9d09d07e39fd078e /Makefile
parentupdate dist (diff)
downloadsolar-python-0257f7bec47551782ba6f0d192df6e8e3cf8dbd2.tar.gz
solar-python-0257f7bec47551782ba6f0d192df6e8e3cf8dbd2.tar.bz2
solar-python-0257f7bec47551782ba6f0d192df6e8e3cf8dbd2.tar.xz
update makefile for python 3.52.1.1
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 70adaff..66c1156 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ PKGNAME ?= solar-python
# The major version number of the current Python installation
PY_MAJOR = 3
# The minor version number of the current Python installation
-PY_MINOR = 4
+PY_MINOR = 5
# The version number of the current Python installation without a dot
PY_VER = $(PY_MAJOR)$(PY_MINOR)
# The version number of the current Python installation with a dot
@@ -36,6 +36,13 @@ PY_VERSION = $(PY_MAJOR).$(PY_MINOR)
# The modules this library is comprised of
SRC = solar_python
+# Filename extension for -OO optimised python files
+ifeq ($(shell test $(PY_VER) -ge 35 ; echo $$?),0)
+PY_OPT2_EXT = opt-2.pyc
+else
+PY_OPT2_EXT = pyo
+endif
+
.PHONY: all
@@ -45,13 +52,13 @@ all: compiled optimised
compiled: $(foreach M,$(SRC),src/__pycache__/$(M).cpython-$(PY_VER).pyc)
.PHONY: optimised
-optimised: $(foreach M,$(SRC),src/__pycache__/$(M).cpython-$(PY_VER).pyo)
+optimised: $(foreach M,$(SRC),src/__pycache__/$(M).cpython-$(PY_VER).$(PY_OPT2_EXT))
src/__pycache__/%.cpython-$(PY_VER).pyc: src/%.py
python -m compileall $<
-src/__pycache__/solar_python.cpython-$(PY_VER).pyo: src/solar_python.py
+src/__pycache__/solar_python.cpython-$(PY_VER).$(PY_OPT2_EXT): src/solar_python.py
python -OO -m compileall $<
@@ -80,7 +87,7 @@ install-compiled: $(foreach M,$(SRC),src/__pycache__/$(M).cpython-$(PY_VER).pyc)
install -m644 $^ -- "$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/__pycache__"
.PHONY: install-optimised
-install-optimised: $(foreach M,$(SRC),src/__pycache__/$(M).cpython-$(PY_VER).pyo)
+install-optimised: $(foreach M,$(SRC),src/__pycache__/$(M).cpython-$(PY_VER).$(PY_OPT2_EXT))
install -dm755 -- "$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/__pycache__"
install -m644 $^ -- "$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/__pycache__"
@@ -105,7 +112,7 @@ uninstall:
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
- -rm -- $(foreach M,$(SRC),"$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/__pycache__/$(M).cpython-$(PY_VER).pyo")
+ -rm -- $(foreach M,$(SRC),"$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/__pycache__/$(M).cpython-$(PY_VER).$(PY_OPT2_EXT)")
-rm -- $(foreach M,$(SRC),"$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/__pycache__/$(M).cpython-$(PY_VER).pyc")
-rm -- $(foreach M,$(SRC),"$(DESTDIR)$(LIBDIR)/python$(PY_VERSION)/$(M).py")