tests: Fix memory leaks in test programs.
[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/aes128.c \
12         lib/aes128.h \
13         lib/backtrace.c \
14         lib/backtrace.h \
15         lib/bitmap.c \
16         lib/bitmap.h \
17         lib/byteq.c \
18         lib/byteq.h \
19         lib/classifier.c \
20         lib/classifier.h \
21         lib/command-line.c \
22         lib/command-line.h \
23         lib/compiler.h \
24         lib/coverage.c \
25         lib/coverage.h \
26         lib/coverage-counters.h \
27         lib/csum.c \
28         lib/csum.h \
29         lib/daemon.c \
30         lib/daemon.h \
31         lib/dhcp-client.c \
32         lib/dhcp-client.h \
33         lib/dhcp.c \
34         lib/dhcp.h \
35         lib/dhparams.h \
36         lib/dirs.h \
37         lib/dpif-linux.c \
38         lib/dpif-netdev.c \
39         lib/dpif-provider.h \
40         lib/dpif.c \
41         lib/dpif.h \
42         lib/dynamic-string.c \
43         lib/dynamic-string.h \
44         lib/fatal-signal.c \
45         lib/fatal-signal.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/json.c \
53         lib/json.h \
54         lib/jsonrpc.c \
55         lib/jsonrpc.h \
56         lib/leak-checker.c \
57         lib/leak-checker.h \
58         lib/learning-switch.c \
59         lib/learning-switch.h \
60         lib/list.c \
61         lib/list.h \
62         lib/lockfile.c \
63         lib/lockfile.h \
64         lib/mac-learning.c \
65         lib/mac-learning.h \
66         lib/netdev-linux.c \
67         lib/netdev-provider.h \
68         lib/netdev.c \
69         lib/netdev.h \
70         lib/odp-util.c \
71         lib/odp-util.h \
72         lib/ofp-print.c \
73         lib/ofp-print.h \
74         lib/ofpbuf.c \
75         lib/ofpbuf.h \
76         lib/ovsdb-data.c \
77         lib/ovsdb-data.h \
78         lib/ovsdb-error.c \
79         lib/ovsdb-error.h \
80         lib/ovsdb-idl-provider.h \
81         lib/ovsdb-idl.c \
82         lib/ovsdb-idl.h \
83         lib/ovsdb-parser.c \
84         lib/ovsdb-parser.h \
85         lib/ovsdb-types.c \
86         lib/ovsdb-types.h \
87         lib/packets.c \
88         lib/packets.h \
89         lib/pcap.c \
90         lib/pcap.h \
91         lib/poll-loop.c \
92         lib/poll-loop.h \
93         lib/port-array.c \
94         lib/port-array.h \
95         lib/process.c \
96         lib/process.h \
97         lib/queue.c \
98         lib/queue.h \
99         lib/random.c \
100         lib/random.h \
101         lib/rconn.c \
102         lib/rconn.h \
103         lib/reconnect.c \
104         lib/reconnect.h \
105         lib/rtnetlink.c \
106         lib/rtnetlink.h \
107         lib/sat-math.h \
108         lib/sha1.c \
109         lib/sha1.h \
110         lib/shash.c \
111         lib/shash.h \
112         lib/signals.c \
113         lib/signals.h \
114         lib/socket-util.c \
115         lib/socket-util.h \
116         lib/sort.c \
117         lib/sort.h \
118         lib/stp.c \
119         lib/stp.h \
120         lib/stream-fd.c \
121         lib/stream-fd.h \
122         lib/stream-provider.h \
123         lib/stream-ssl.h \
124         lib/stream-tcp.c \
125         lib/stream-unix.c \
126         lib/stream.c \
127         lib/stream.h \
128         lib/svec.c \
129         lib/svec.h \
130         lib/tag.c \
131         lib/tag.h \
132         lib/timeval.c \
133         lib/timeval.h \
134         lib/type-props.h \
135         lib/unicode.c \
136         lib/unicode.h \
137         lib/unixctl.c \
138         lib/unixctl.h \
139         lib/util.c \
140         lib/util.h \
141         lib/uuid.c \
142         lib/uuid.h \
143         lib/valgrind.h \
144         lib/vconn-provider.h \
145         lib/vconn-stream.c \
146         lib/vconn.c \
147         lib/vconn.h \
148         lib/vlog-modules.def \
149         lib/vlog.c \
150         lib/vlog.h \
151         lib/xtoxll.h
152 nodist_lib_libopenvswitch_a_SOURCES = \
153         lib/coverage-counters.c \
154         lib/dirs.c
155 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
156
157 if HAVE_NETLINK
158 lib_libopenvswitch_a_SOURCES += \
159         lib/netlink-protocol.h \
160         lib/netlink.c \
161         lib/netlink.h
162 endif
163
164 if HAVE_OPENSSL
165 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
166 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
167 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
168         (echo '#include "lib/dhparams.h"' &&                            \
169          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
170          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
171          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
172         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
173         mv lib/dhparams.c.tmp lib/dhparams.c
174 endif
175
176 EXTRA_DIST += \
177         lib/dh1024.pem \
178         lib/dh2048.pem \
179         lib/dh4096.pem \
180         lib/dhparams.h
181
182 EXTRA_DIST += \
183         lib/common.man \
184         lib/common-syn.man \
185         lib/daemon.man \
186         lib/daemon-syn.man \
187         lib/dpif.man \
188         lib/leak-checker.man \
189         lib/ssl-bootstrap.man \
190         lib/ssl-bootstrap-syn.man \
191         lib/ssl-peer-ca-cert.man \
192         lib/ssl.man \
193         lib/ssl-syn.man \
194         lib/vconn-active.man \
195         lib/vconn-passive.man \
196         lib/vlog-unixctl.man \
197         lib/vlog-syn.man \
198         lib/vlog.man
199
200
201 lib/dirs.c: Makefile
202         ($(ro_c) && \
203          echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
204          echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
205          echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
206          echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
207         mv lib/dirs.c.tmp lib/dirs.c
208
209 install-data-local:
210         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
211         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
212         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
213
214 # All the source files that have coverage counters.
215 COVERAGE_FILES = \
216         lib/dpif.c \
217         lib/flow.c \
218         lib/lockfile.c \
219         lib/hmap.c \
220         lib/mac-learning.c \
221         lib/netdev.c \
222         lib/netdev-linux.c \
223         lib/netlink.c \
224         lib/odp-util.c \
225         lib/poll-loop.c \
226         lib/process.c \
227         lib/rconn.c \
228         lib/rtnetlink.c \
229         lib/stream.c \
230         lib/timeval.c \
231         lib/unixctl.c \
232         lib/util.c \
233         lib/vconn.c \
234         ofproto/ofproto.c \
235         ofproto/pktbuf.c \
236         vswitchd/bridge.c \
237         vswitchd/ovs-brcompatd.c
238 lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
239         (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
240         mv $@.tmp $@
241 EXTRA_DIST += lib/coverage-scan.pl