forked from Nitrate/Nitrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
85 lines (59 loc) · 1.9 KB
/
Makefile
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
SPECFILE=nitrate.spec
default: help
DIST_DIR=$(shell pwd)/dist/
DEFINE_OPTS=--define "_sourcedir $(PWD)/dist" --define "_srcrpmdir $(PWD)/dist" --define "_rpmdir $(PWD)/dist"
.PHONY: tarball
tarball:
@python setup.py sdist
.PHONY: srpm
srpm:
@rpmbuild $(DEFINE_OPTS) -bs $(SPECFILE)
.PHONY: rpm
rpm:
@rpmbuild $(DEFINE_OPTS) -ba $(SPECFILE)
.PHONY: build
build:
python setup.py build
.PHONY: install
install:
python setup.py install
FLAKE8_EXCLUDE=.git,tcms/settings,*sqls.py,urls.py,wsgi.py,*settings.py,*raw_sql.py,*xml2dict*
.PHONY: flake8
flake8:
@flake8 --exclude=$(FLAKE8_EXCLUDE) tcms *.py
ifeq ($(strip $(TEST_TARGET)),)
TEST_TARGET=
else
TEST_TARGET=$(strip (TEST_TARGET))
endif
.PHONY: test
test:
@pytest $(TEST_TARGET)
.PHONY: check
check: flake8 test
.PHONY: tags
tags:
@rm -f .tags
@ctags -R --languages=Python,CSS,Javascript --python-kinds=-im \
--exclude=build --exclude=tcms/static/js/lib -f .tags
.PHONY: etags
etags:
@rm -f TAGS
@ctags -R -e --languages=Python,CSS,Javascript --python-kinds=-im \
--exclude=build --exclude=tcms/static/js/lib -f TAGS
.PHONY: help
help:
@echo 'Usage: make [command]'
@echo ''
@echo 'Available commands:'
@echo ''
@echo ' rpm - Create RPM'
@echo ' srpm - Create SRPM'
@echo ' tarball - Create tarball. Run command: python setup.py sdist'
@echo ' flake8 - Check Python code style throughout whole source code tree'
@echo ' test - Run all tests default. Set TEST_TARGET to run part tests of specific apps'
@echo ' build - Run command: python setup.py build'
@echo ' install - Run command: python setup.py install'
@echo ' tags - Refresh tags for VIM. Default filename is .tags'
@echo ' etags - Refresh tags for Emacs. Default filename is TAGS'
@echo ' help - Show this help message and exit. Default if no command is given'