forked from rocky/shell-term-background
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (71 loc) · 1.89 KB
/
Copy pathMakefile
File metadata and controls
91 lines (71 loc) · 1.89 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# A GNU Makefile to run various tasks - compatibility for us old-timers.
# Note: This makefile include remake-style target comments.
# These comments before the targets start with #:
# remake --tasks to shows the targets and the comments
GIT2CL ?= admin-tools/git2cl
PYTHON ?= python3
PIP ?= pip3
RM ?= rm
# The output is stored in the ZSH_PATH variable.
SHELLS =
BASH_PATH := $(shell command -v bash)
ifneq ($(strip $(BASH_PATH)),)
SHELLS += $(BASH_PATH)
endif
ZSH_PATH := $(shell command -v zsh)
ifneq ($(strip $(ZSH_PATH)),)
SHELLS += $(ZSH_PATH)
endif
KSH_PATH := $(shell command -v ksh)
ifneq ($(strip $(KSH_PATH)),)
SHELLS += $(KSH_PATH)
endif
.PHONY: \
all \
build \
check \
clean develop \
dist \
doc \
python-check \
pytest \
rmChangeLog \
sdist \
shunit2-check \
test
#: Default target - same as "develop"
all: develop
#: build everything needed to install
build:
$(PYTHON) ./setup.py build
#: Set up to run from the source tree
develop:
$(PIP) install -e .
#: Install Python term-background
install:
$(PYTHON) setup.py install
#: Run all check (Python and Shell)
check: python-check shunit2-check
#: Run Python tests. You can set environment variable "o" for pytest options
python-check:
$(PYTHON) -m pytest test $o
#: Run Shell tests. You can set environment variable "o" for pytest options
shunit2-check:
@for shell in $(SHELLS); do \
shell_basename=$${shell##*/}; \
$$shell test/*.$${shell_basename} $o; \
done
# Check StructuredText long description formatting
check-rst:
$(PYTHON) setup.py --long-description | ./rst2html.py > term-background.html
#: Remove derived files
clean:
#: Remove ChangeLog
rmChangeLog:
$(RM) ChangeLog || true
#: Create source tarball
dist:
./admin-tools/make-dist-newest.sh
#: Create a ChangeLog from git via git log and git2cl
ChangeLog: rmChangeLog
git log --pretty --numstat --summary | $(GIT2CL) >$@