diff options
author | Mattias Andrée <maandree@kth.se> | 2023-07-01 20:04:46 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-07-01 20:04:46 +0200 |
commit | 9dcbadac655a18d5da42857341b3517d1055c8dd (patch) | |
tree | 29fc2c63423637d095a628515d9ecae943922d99 | |
parent | Improve makefile (diff) | |
download | python-bus-3.1.3.1.tar.gz python-bus-3.1.3.1.tar.bz2 python-bus-3.1.3.1.tar.xz |
Fix and improve makefile3.1.3.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | config.mk | 16 |
2 files changed, 9 insertions, 9 deletions
@@ -13,7 +13,7 @@ all: native_bus.so $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) .pyx.c: - if ! $(CYTHON) -$(PY_MAJOR) -v $< -o $@ ; then rm $@; false; fi + if ! $(CYTHON) -$(PYTHON_MAJOR) -v $< -o $@ ; then rm $@; false; fi install: native_bus.so mkdir -p -- "$(DESTDIR)$(PYTHONPKGDIR)" @@ -1,16 +1,16 @@ PREFIX = /usr MANPREFIX = $(PREFIX)/share/man -PYTHONDIR = $(PREFIX)/lib/python$(PY_MAJOR).$(PY_MINOR) +PYTHONDIR = $(PREFIX)/lib/python$(PYTHON_MAJOR).$(PYTHON_MINOR) PYTHONPKGDIR = $(PYTHONDIR)/site-packages CC = cc -CYTHON = cython -PYTHON = python$(PY_VERSION) +CYTHON = cython$(PYTHON_MAJOR) +PYTHON = python$(PYTHON_VERSION) CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOUCE -D_XOPEN_SOURCE=700 -CFLAGS = -std=c99 -O2 $$(pkg-config --cflags python$(PY_MAJOR)) -LDFLAGS = -s $$(pkg-config --libs python$(PY_MAJOR)) -lbus +CFLAGS = -std=c99 -O2 $$(pkg-config --cflags python$(PYTHON_MAJOR)) +LDFLAGS = -s $$(pkg-config --libs python$(PYTHON_MAJOR)) -lbus -PY_MAJOR = $$(python --version 2>&1 | cut -d . -f 1 | cut -d ' ' -f 2) -PY_MINOR = $$(python$(PYTHON_MAJOR) --version 2>&1 | cut -d . -f 2) -PY_VERSION = $(PY_MAJOR).$(PY_MINOR) +PYTHON_MAJOR = $$(python --version 2>&1 | cut -d ' ' -f 2 | cut -d . -f 1) +PYTHON_MINOR = $$(python$(PYTHON_MAJOR) --version 2>&1 | cut -d . -f 2) +PYTHON_VERSION = $(PYTHON_MAJOR).$(PYTHON_MINOR) |