96869e30e3ba1bf073ae99c520dd5f0880eefd71
[sliver-openvswitch.git] / python / automake.mk
1 ovstest_pyfiles = \
2         python/ovstest/__init__.py \
3         python/ovstest/args.py \
4         python/ovstest/rpcserver.py \
5         python/ovstest/tcp.py \
6         python/ovstest/udp.py \
7         python/ovstest/util.py \
8         python/ovstest/vswitch.py
9
10 ovs_pyfiles = \
11         python/ovs/__init__.py \
12         python/ovs/daemon.py \
13         python/ovs/db/__init__.py \
14         python/ovs/db/data.py \
15         python/ovs/db/error.py \
16         python/ovs/db/idl.py \
17         python/ovs/db/parser.py \
18         python/ovs/db/schema.py \
19         python/ovs/db/types.py \
20         python/ovs/fatal_signal.py \
21         python/ovs/json.py \
22         python/ovs/jsonrpc.py \
23         python/ovs/ovsuuid.py \
24         python/ovs/poller.py \
25         python/ovs/process.py \
26         python/ovs/reconnect.py \
27         python/ovs/socket_util.py \
28         python/ovs/stream.py \
29         python/ovs/timeval.py \
30         python/ovs/unixctl/__init__.py \
31         python/ovs/unixctl/client.py \
32         python/ovs/unixctl/server.py \
33         python/ovs/util.py \
34         python/ovs/version.py \
35         python/ovs/vlog.py
36
37 PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles)
38 EXTRA_DIST += $(PYFILES)
39 PYCOV_CLEAN_FILES += $(PYFILES:.py=.py,cover)
40
41 if HAVE_PYTHON
42 nobase_pkgdata_DATA = $(ovs_pyfiles) $(ovstest_pyfiles)
43 ovs-install-data-local:
44         $(MKDIR_P) python/ovs
45         (echo "import os" && \
46          echo 'PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """$(pkgdatadir)""")' && \
47          echo 'RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")' && \
48          echo 'LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")' && \
49          echo 'BINDIR = os.environ.get("OVS_BINDIR", """$(bindir)""")') \
50                 > python/ovs/dirs.py.tmp
51         $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
52         $(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
53         rm python/ovs/dirs.py.tmp
54 else
55 ovs-install-data-local:
56         @:
57 endif
58 install-data-local: ovs-install-data-local
59
60 UNINSTALL_LOCAL += ovs-uninstall-local
61 ovs-uninstall-local:
62         rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
63
64 ALL_LOCAL += $(srcdir)/python/ovs/version.py
65 $(srcdir)/python/ovs/version.py: config.status
66         $(ro_shell) > $(@F).tmp
67         echo 'VERSION = "$(VERSION)"' >> $(@F).tmp
68         if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi