-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
47 lines (38 loc) · 1.38 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
# This is the PyAudio distribution makefile.
.PHONY: docs clean build
PYTHON ?= python
BUILD_ARGS ?=
SPHINX ?= sphinx-build
DOCS_OUTPUT=docs/
PYTHON_BUILD_DIR:=$(shell $(PYTHON) -c "import distutils.util; import sys; print(f'{distutils.util.get_platform()}-{sys.version_info[0]}.{sys.version_info[1]}')")
BUILD_DIR:=lib.$(PYTHON_BUILD_DIR)
BUILD_STAMP:=$(BUILD_DIR)/build
SRCFILES := src/*.c src/*.h src/*.py
EXAMPLES := examples/*.py
TESTS := tests/*.py
what:
@echo "make targets:"
@echo
@echo " tarball : build source tarball"
@echo " docs : generate documentation (requires sphinx)"
@echo " clean : remove build files"
@echo
@echo "To build pyaudio, run:"
@echo
@echo " python setup.py install"
clean:
@rm -rf build dist build MANIFEST $(DOCS_OUTPUT) src/*.pyc src/*.egg-info
######################################################################
# Documentation
######################################################################
build: build/$(BUILD_STAMP)
build/$(BUILD_STAMP): $(SRCFILES)
$(PYTHON) setup.py build $(BUILD_ARGS)
touch $@
docs: build
PYTHONPATH=build/$(BUILD_DIR) $(SPHINX) -b html sphinx/ $(DOCS_OUTPUT)
######################################################################
# Source Tarball
######################################################################
tarball: $(SRCFILES) $(EXAMPLES) $(TESTS) MANIFEST.in
@$(PYTHON) setup.py sdist