diff options
author | Mattias Andrée <maandree@kth.se> | 2023-07-02 20:02:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-07-02 20:02:04 +0200 |
commit | c2d241eed42c85e58df18889165d3802c84a8ed7 (patch) | |
tree | c8d317633ff5de2bdd1f1a23c09c89002217fa8b | |
parent | Change license to ISC, change style, improve makefile (diff) | |
download | pylibgamma-c2d241eed42c85e58df18889165d3802c84a8ed7.tar.gz pylibgamma-c2d241eed42c85e58df18889165d3802c84a8ed7.tar.bz2 pylibgamma-c2d241eed42c85e58df18889165d3802c84a8ed7.tar.xz |
Improve makefile1.1.3.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | config.mk | 15 |
2 files changed, 16 insertions, 16 deletions
@@ -7,13 +7,6 @@ OS = linux include mk/$(OS).mk -python = python$(PYTHON_MAJOR) -python_version = $(PYTHON_MAJOR).$(PYTHON_MINOR) -python_ver = $(PYTHON_MAJOR)$(PYTHON_MINOR) -python_dir = $(PREFIX)/lib/python$(python_version)/site-packages -python_cache = $(python_dir)/__pycache__ - - OBJ =\ libgamma_native_error.o\ libgamma_native_facade.o\ @@ -38,17 +31,17 @@ libgamma_native_error.pyx: libgamma_native_error.$(PLATFORM).pyx $(CC) -o $@ $< -shared $(LDFLAGS) .c.o: - $(CC) -fPIC -c -o $@ $< $$(pkg-config --cflags $(python)) $(CFLAGS) $(CPPFLAGS) + $(CC) -fPIC -c -o $@ $< $$(pkg-config --cflags $(PYTHON)) $(CFLAGS) $(CPPFLAGS) .pyx.c: - if ! cython -$(PYTHON_MAJOR) -v $< -o $@ ; then rm $@; false; fi + if ! $(CYTHON) -$(PYTHON_MAJOR) -v $< -o $@ ; then rm $@; false; fi install: $(LIBFILES) - mkdir -p -- "$(DESTDIR)$(python_dir)" - cp -- $(FILES) "$(DESTDIR)$(python_dir)/" + mkdir -p -- "$(DESTDIR)$(PYTHON_DIR)" + cp -- $(FILES) "$(DESTDIR)$(PYTHON_DIR)/" uninstall: - -cd -- "$(DESTDIR)$(python_dir)" && rm -f -- $(FILES) + -cd -- "$(DESTDIR)$(PYTHON_DIR)" && rm -f -- $(FILES) run-test: $(LIBFILES) ./test.py @@ -1,10 +1,17 @@ PREFIX = /usr -PYTHON_MAJOR = $$(python --version 2>&1 | cut -d . -f 1 | cut -d ' ' -f 2) +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) -CC = c99 +PYTHON_VERSION = $(PYTHON_MAJOR).$(PYTHON_MINOR) +PYTHON_VER = $(PYTHON_MAJOR)$(PYTHON_MINOR) +PYTHON_DIR = $(PREFIX)/lib/python$(python_version)/site-packages +PYTHON_CACHE = $(python_dir)/__pycache__ + +CC = c99 +CYTHON = cython$(PYTHON_MAJOR) +PYTHON = python$(PYTHON_MAJOR) CPPFLAGS = -CFLAGS = -LDFLAGS = -lgamma +CFLAGS = +LDFLAGS = -lgamma |