Merge citrix branch into master.
[sliver-openvswitch.git] / lib / automake.mk
1 # Copyright (C) 2009 Nicira Networks, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.  This file is offered as-is,
6 # without warranty of any kind.
7
8 noinst_LIBRARIES += lib/libopenvswitch.a
9
10 lib_libopenvswitch_a_SOURCES = \
11         lib/backtrace.c \
12         lib/backtrace.h \
13         lib/bitmap.c \
14         lib/bitmap.h \
15         lib/cfg.c \
16         lib/cfg.h \
17         lib/classifier.c \
18         lib/classifier.h \
19         lib/command-line.c \
20         lib/command-line.h \
21         lib/compiler.h \
22         lib/coverage.c \
23         lib/coverage.h \
24         lib/coverage-counters.h \
25         lib/csum.c \
26         lib/csum.h \
27         lib/daemon.c \
28         lib/daemon.h \
29         lib/dhcp-client.c \
30         lib/dhcp-client.h \
31         lib/dhcp.c \
32         lib/dhcp.h \
33         lib/dhparams.h \
34         lib/dirs.h \
35         lib/dpif-linux.c \
36         lib/dpif-netdev.c \
37         lib/dpif-provider.h \
38         lib/dpif.c \
39         lib/dpif.h \
40         lib/dynamic-string.c \
41         lib/dynamic-string.h \
42         lib/fatal-signal.c \
43         lib/fatal-signal.h \
44         lib/fault.c \
45         lib/fault.h \
46         lib/flow.c \
47         lib/flow.h \
48         lib/hash.c \
49         lib/hash.h \
50         lib/hmap.c \
51         lib/hmap.h \
52         lib/leak-checker.c \
53         lib/leak-checker.h \
54         lib/learning-switch.c \
55         lib/learning-switch.h \
56         lib/list.c \
57         lib/list.h \
58         lib/mac-learning.c \
59         lib/mac-learning.h \
60         lib/netdev-linux.c \
61         lib/netdev-provider.h \
62         lib/netdev.c \
63         lib/netdev.h \
64         lib/odp-util.c \
65         lib/odp-util.h \
66         lib/ofp-print.c \
67         lib/ofp-print.h \
68         lib/ofpbuf.c \
69         lib/ofpbuf.h \
70         lib/packets.c \
71         lib/packets.h \
72         lib/pcap.c \
73         lib/pcap.h \
74         lib/poll-loop.c \
75         lib/poll-loop.h \
76         lib/port-array.c \
77         lib/port-array.h \
78         lib/process.c \
79         lib/process.h \
80         lib/queue.c \
81         lib/queue.h \
82         lib/random.c \
83         lib/random.h \
84         lib/rconn.c \
85         lib/rconn.h \
86         lib/rtnetlink.c \
87         lib/rtnetlink.h \
88         lib/sat-math.h \
89         lib/sha1.c \
90         lib/sha1.h \
91         lib/shash.c \
92         lib/shash.h \
93         lib/signals.c \
94         lib/signals.h \
95         lib/socket-util.c \
96         lib/socket-util.h \
97         lib/stp.c \
98         lib/stp.h \
99         lib/svec.c \
100         lib/svec.h \
101         lib/tag.c \
102         lib/tag.h \
103         lib/timeval.c \
104         lib/timeval.h \
105         lib/type-props.h \
106         lib/unixctl.c \
107         lib/unixctl.h \
108         lib/util.c \
109         lib/util.h \
110         lib/valgrind.h \
111         lib/vconn-provider.h \
112         lib/vconn-ssl.h \
113         lib/vconn-stream.c \
114         lib/vconn-stream.h \
115         lib/vconn-tcp.c \
116         lib/vconn-unix.c \
117         lib/vconn.c \
118         lib/vconn.h \
119         lib/vlog-modules.def \
120         lib/vlog.c \
121         lib/vlog.h \
122         lib/xtoxll.h
123 nodist_lib_libopenvswitch_a_SOURCES = \
124         lib/coverage-counters.c \
125         lib/dirs.c
126 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
127
128 if HAVE_NETLINK
129 lib_libopenvswitch_a_SOURCES += \
130         lib/netlink-protocol.h \
131         lib/netlink.c \
132         lib/netlink.h
133 endif
134
135 if HAVE_OPENSSL
136 lib_libopenvswitch_a_SOURCES += \
137         lib/vconn-ssl.c 
138 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
139 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
140         (echo '#include "lib/dhparams.h"' &&                            \
141          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
142          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
143          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
144         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
145         mv lib/dhparams.c.tmp lib/dhparams.c
146 endif
147
148 EXTRA_DIST += \
149         lib/dh1024.pem \
150         lib/dh2048.pem \
151         lib/dh4096.pem \
152         lib/dhparams.h
153
154 EXTRA_DIST += \
155         lib/common.man \
156         lib/daemon.man \
157         lib/dpif.man \
158         lib/leak-checker.man \
159         lib/vlog-unixctl.man \
160         lib/vlog.man
161
162
163 lib/dirs.c: Makefile
164         ($(ro_c) && \
165          echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
166          echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
167          echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
168          echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
169         mv lib/dirs.c.tmp lib/dirs.c
170
171 install-data-local:
172         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
173         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
174         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
175
176 # All the source files that have coverage counters.
177 COVERAGE_FILES = \
178         lib/cfg.c \
179         lib/dpif.c \
180         lib/flow.c \
181         lib/hmap.c \
182         lib/mac-learning.c \
183         lib/netdev.c \
184         lib/netdev-linux.c \
185         lib/netlink.c \
186         lib/odp-util.c \
187         lib/poll-loop.c \
188         lib/process.c \
189         lib/rconn.c \
190         lib/rtnetlink.c \
191         lib/timeval.c \
192         lib/unixctl.c \
193         lib/util.c \
194         lib/vconn.c \
195         ofproto/ofproto.c \
196         ofproto/pktbuf.c \
197         vswitchd/bridge.c \
198         vswitchd/mgmt.c \
199         vswitchd/ovs-brcompatd.c
200 lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
201         (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
202         mv $@.tmp $@
203 EXTRA_DIST += lib/coverage-scan.pl