File: py_rules.mk

package info (click to toggle)
python-slip 0.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 252 kB
  • sloc: python: 951; makefile: 61
file content (62 lines) | stat: -rw-r--r-- 1,094 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# License: GPL v2 or later
# Copyright Red Hat Inc. 2008

ifndef DESTDIR
	DESTDIR = /
endif

ifndef PREFIX
	PREFIX = /usr
endif

ifndef EXEC_PREFIX
	EXEC_PREFIX = $(PREFIX)
endif

ifndef PY_SOURCES
	PY_SOURCES = $(wildcard src/*.py)
endif

ifndef SETUP_PY
	SETUP_PY = setup.py
endif

ifndef PY_TOPDIR
	PY_TOPDIR = $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
endif

ifndef PYTHON
	PYTHON = python
endif

_SETUP_PY = $(PY_TOPDIR)/$(SETUP_PY)

$(_SETUP_PY):	$(_SETUP_PY).in $(PKGNAME).spec
	cd $(PY_TOPDIR); \
	sed -e 's/@VERSION@/$(PKGVERSION)/g' < $< > $@

py-build-ext:	$(_SETUP_PY) $(PY_SOURCES)
	cd $(PY_TOPDIR); \
	$(PYTHON) $(SETUP_PY) build_ext -i

py-build:   $(_SETUP_PY) $(PY_SOURCES)
	cd $(PY_TOPDIR); \
	$(PYTHON) $(SETUP_PY) build

py-install:	$(_SETUP_PY)
	cd $(PY_TOPDIR); \
	$(PYTHON) $(SETUP_PY) install -O1 \
		--root $(DESTDIR) \
		--prefix $(PREFIX) \
		--exec-prefix $(EXEC_PREFIX) \
		--skip-build

py-clean:	$(_SETUP_PY)
	cd $(PY_TOPDIR); \
	$(PYTHON) $(SETUP_PY) clean; \
	rm -f $(SETUP_PY); \
	rm -rf build

py-check:
	pychecker -F pycheckrc $(PY_SOURCES)