-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
81 lines (67 loc) · 1.77 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
# comlex Makefile example here: https://github.com/ansible/ansible/blob/devel/Makefile
.DEFAULT_GOAL := default
unexport PYTHONDONTWRITEBYTECODE
SETUP=setup.py
PYTHON=python2
NAME=piClicker
VERSION=$(shell cat VERSION)
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g')
MYID=$(shell id -u)
ifeq ($(MYID),0)
SUDO=
else
SUDO=sudo
endif
.PHONY: default
default: python
.PHONY:
python:
@echo $(VERSION)
find -type f -name '*.pyc' -delete
$(PYTHON) setup.py sdist
help:
$(PYTHON) setup.py --help
help-cmds:
$(PYTHON) setup.py --help-commands
help-rpm:
$(PYTHON) setup.py bdist_rpm --help
.PHONY: deb
deb: clean python
$(PYTHON) setup.py --command-packages=stdeb.command bdist_deb
.PHONY: rpm
rpm: clean python
cp -f setup.cfg.rpm setup.cfg
$(PYTHON) setup.py bdist --format=rpm
rm -f setup.cfg
.PHONY: uninstall
uninstall:
$(SUDO) pip uninstall -y $(NAME)
.PHONY: lint
lint:
# Use https://github.com/nvie/vim-flake8 if you want to incorporate into vim
find src/ bin/ -type f -name '*.py' -not -name '__init__.py' | xargs flake8
# ignore non-used includes in __init__.py files
find src/ bin/ -type f -name '__init__.py' | xargs flake8 --ignore F401
.PHONY: install
install: python
$(SUDO) pip install $(shell find dist/ -type f -name '*.gz' | sort | tail -1)
.PHONY: reinstall
reinstall: clean uninstall install
.PHONY: venv
venv: clean python
mkdir -p venv/
rm -rf venv/
virtualenv venv
( \
bash -c " \
source venv/bin/activate; \
pip install --upgrade $(shell find dist/ -type f -name '*.gz' | sort | tail -1); \
" \
)
@echo Don\'t Forget to source venv/bin/activate
.PHONY: clean
clean:
#make sure these exist so we dont run into errors on mac
mkdir -p dist/ build/ deb_dist/
>setup.cfg
rm -rf dist/ build/ deb_dist/ src/cudaPyOps.egg-info setup.cfg