2ea008e22bc9eee6dd94344a7db527c3c8f5b5d4
[profile/ivi/pocketsphinx.git] / Makefile.am
1 EXTRA_DIST = pocketsphinx.c \
2         pocketsphinx.pyx \
3         pocketsphinx.pxd \
4         ps_test.py \
5         setup_win32.py
6
7 pkginclude_HEADERS = pocketsphinx.pxd
8
9 noinst_HEADERS = bogus_pygobject.h
10
11 if BUILD_PYTHON
12 # Setuptools isn't really compatible with distutils, unfortunately
13 SETUPTOOLS_CRAP = `python -c 'import setuptools' 2>/dev/null \
14         && echo --single-version-externally-managed --record filelist.txt`
15
16 all-local: pymod-build-stamp
17
18 install-exec-local: pymod-build-stamp
19         $(PYTHON) setup.py install --prefix $(DESTDIR)$(prefix) $(SETUPTOOLS_CRAP)
20
21 uninstall-local:
22         $(PYTHON) setup.py bogus_uninstall --prefix $(DESTDIR)$(prefix)
23
24 clean-local:
25         $(PYTHON) setup.py clean --all
26 # This is dumb, but distutils is completely incapable of VPATH building
27         test -z "$(VPATH)" || $(RM) pocketsphinx.c
28         $(RM) -r *.egg-info
29         $(RM) pymod-build-stamp filelist.txt
30
31 pymod-build-stamp: $(srcdir)/pocketsphinx.c
32 # This is dumb, but distutils is completely incapable of VPATH building
33         test -z "$(VPATH)" || cp "$(srcdir)/pocketsphinx.c" pocketsphinx.c
34         $(PYTHON) setup.py build
35         touch $@
36 endif
37
38 if BUILD_CYTHON
39 $(srcdir)/pocketsphinx.c: $(srcdir)/pocketsphinx.pyx $(srcdir)/pocketsphinx.pxd
40         cython -o $@ $< $(CPPFLAGS) -I$(sphinxbase)/python
41 endif