File: Makefile

package info (click to toggle)
libpillowfight 0.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,724 kB
  • sloc: ansic: 3,365; python: 635; makefile: 110; sh: 7
file content (107 lines) | stat: -rw-r--r-- 2,019 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# If you want to build in MSYS2 on Windows
# export CMAKE_OPTS=-G "MSYS Makefiles"

VERSION_FILE = src/pillowfight/_version.h
PYTHON = python3

build: build_c build_py

install: install_py install_c

uninstall: uninstall_py

build_py: ${VERSION_FILE}
	${PYTHON} ./setup.py build

build_c: ${VERSION_FILE} build/libpillowfight.so

build/libpillowfight.so: ${VERSION_FILE} build/Makefile
	(cd build && make -j4)

build/Makefile:
	mkdir -p build
	(cd build && cmake ${CMAKE_OPTS} ..)

${VERSION_FILE}:
	echo -n "#define INTERNAL_PILLOWFIGHT_VERSION \"" >| $@
	echo -n $(shell git describe --always) >> $@
	echo "\"" >> $@

version: ${VERSION_FILE}

doc: install_py
	(cd doc && make html)
	doxygen doc/doxygen.conf
	cp doc/index.html doc/build/index.html

check:
	flake8
# 	pydocstyle src

test: build_py
	tox

linux_exe:

windows_exe:

release:
ifeq (${RELEASE}, )
	@echo "You must specify a release version (make release RELEASE=1.2.3)"
else
	@echo "Will release: ${RELEASE}"
	@echo "Checking release is in ChangeLog ..."
	grep ${RELEASE} ChangeLog | grep -v "/xx"
	@echo "Releasing ..."
	git tag -a ${RELEASE} -m ${RELEASE}
	git push origin ${RELEASE}
	make clean
	make version
	${PYTHON} ./setup.py sdist upload
	@echo "All done"
endif

clean:
	rm -rf doc/build
	rm -rf build dist *.egg-info
	rm -f ${VERSION_FILE}

install_py: ${VERSION_FILE}
	${PYTHON} ./setup.py install ${PIP_ARGS}

install_c: build/Makefile ${VERSION_FILE}
	(cd build && make install)

uninstall_py:
	pip3 uninstall -y pypillowfight

uninstall_c:
	echo "Can't uninstall C library. Sorry"

help:
	@echo "make build || make build_c || make build_py"
	@echo "make check"
	@echo "make doc"
	@echo "make help: display this message"
	@echo "make install || make install_c || make install_py"
	@echo "make release"
	@echo "make test"
	@echo "make uninstall || make uninstall_py"

.PHONY: \
	build \
	build_c \
	build_py \
	check \
	doc \
	exe \
	exe \
	help \
	install \
	install_c \
	install_py \
	release \
	test \
	uninstall \
	uninstall_c \
	version