-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpy_rules.mk
More file actions
62 lines (47 loc) · 1.07 KB
/
py_rules.mk
File metadata and controls
62 lines (47 loc) · 1.07 KB
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
# 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)