port-array: Remove.
[cascardo/ovs.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010 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/byte-order.h \
18         lib/byteq.c \
19         lib/byteq.h \
20         lib/cfm.c \
21         lib/cfm.h \
22         lib/classifier.c \
23         lib/classifier.h \
24         lib/command-line.c \
25         lib/command-line.h \
26         lib/compiler.h \
27         lib/coverage.c \
28         lib/coverage.h \
29         lib/csum.c \
30         lib/csum.h \
31         lib/daemon.c \
32         lib/daemon.h \
33         lib/dummy.c \
34         lib/dummy.h \
35         lib/dhcp-client.c \
36         lib/dhcp-client.h \
37         lib/dhcp.c \
38         lib/dhcp.h \
39         lib/dhparams.h \
40         lib/dirs.h \
41         lib/dpif-netdev.c \
42         lib/dpif-provider.h \
43         lib/dpif.c \
44         lib/dpif.h \
45         lib/dynamic-string.c \
46         lib/dynamic-string.h \
47         lib/entropy.c \
48         lib/entropy.h \
49         lib/fatal-signal.c \
50         lib/fatal-signal.h \
51         lib/flow.c \
52         lib/flow.h \
53         lib/hash.c \
54         lib/hash.h \
55         lib/hmap.c \
56         lib/hmap.h \
57         lib/json.c \
58         lib/json.h \
59         lib/jsonrpc.c \
60         lib/jsonrpc.h \
61         lib/leak-checker.c \
62         lib/leak-checker.h \
63         lib/learning-switch.c \
64         lib/learning-switch.h \
65         lib/list.c \
66         lib/list.h \
67         lib/lockfile.c \
68         lib/lockfile.h \
69         lib/mac-learning.c \
70         lib/mac-learning.h \
71         lib/netdev-dummy.c \
72         lib/netdev-provider.h \
73         lib/netdev.c \
74         lib/netdev.h \
75         lib/nx-match.c \
76         lib/nx-match.def \
77         lib/nx-match.h \
78         lib/odp-util.c \
79         lib/odp-util.h \
80         lib/ofp-parse.c \
81         lib/ofp-parse.h \
82         lib/ofp-print.c \
83         lib/ofp-print.h \
84         lib/ofp-util.c \
85         lib/ofp-util.h \
86         lib/ofpbuf.c \
87         lib/ofpbuf.h \
88         lib/ovsdb-data.c \
89         lib/ovsdb-data.h \
90         lib/ovsdb-error.c \
91         lib/ovsdb-error.h \
92         lib/ovsdb-idl-provider.h \
93         lib/ovsdb-idl.c \
94         lib/ovsdb-idl.h \
95         lib/ovsdb-parser.c \
96         lib/ovsdb-parser.h \
97         lib/ovsdb-types.c \
98         lib/ovsdb-types.h \
99         lib/packets.c \
100         lib/packets.h \
101         lib/pcap.c \
102         lib/pcap.h \
103         lib/poll-loop.c \
104         lib/poll-loop.h \
105         lib/process.c \
106         lib/process.h \
107         lib/random.c \
108         lib/random.h \
109         lib/rconn.c \
110         lib/rconn.h \
111         lib/reconnect.c \
112         lib/reconnect.h \
113         lib/sat-math.h \
114         lib/sha1.c \
115         lib/sha1.h \
116         lib/shash.c \
117         lib/shash.h \
118         lib/signals.c \
119         lib/signals.h \
120         lib/socket-util.c \
121         lib/socket-util.h \
122         lib/sort.c \
123         lib/sort.h \
124         lib/stream-fd.c \
125         lib/stream-fd.h \
126         lib/stream-provider.h \
127         lib/stream-ssl.h \
128         lib/stream-tcp.c \
129         lib/stream-unix.c \
130         lib/stream.c \
131         lib/stream.h \
132         lib/stress.c \
133         lib/stress.h \
134         lib/string.h \
135         lib/svec.c \
136         lib/svec.h \
137         lib/tag.c \
138         lib/tag.h \
139         lib/timeval.c \
140         lib/timeval.h \
141         lib/type-props.h \
142         lib/unaligned.h \
143         lib/unicode.c \
144         lib/unicode.h \
145         lib/unixctl.c \
146         lib/unixctl.h \
147         lib/util.c \
148         lib/util.h \
149         lib/uuid.c \
150         lib/uuid.h \
151         lib/valgrind.h \
152         lib/vconn-provider.h \
153         lib/vconn-stream.c \
154         lib/vconn.c \
155         lib/vconn.h \
156         lib/vlog.c \
157         lib/vlog.h
158 nodist_lib_libopenvswitch_a_SOURCES = \
159         lib/dirs.c
160 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
161
162 noinst_LIBRARIES += lib/libsflow.a
163 lib_libsflow_a_SOURCES = \
164         lib/sflow_api.h \
165         lib/sflow.h \
166         lib/sflow_agent.c \
167         lib/sflow_sampler.c \
168         lib/sflow_poller.c \
169         lib/sflow_receiver.c
170 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
171 if HAVE_WNO_UNUSED
172 lib_libsflow_a_CFLAGS += -Wno-unused
173 endif
174 if HAVE_WNO_UNUSED_PARAMETER
175 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
176 endif
177
178 if HAVE_NETLINK
179 lib_libopenvswitch_a_SOURCES += \
180         lib/dpif-linux.c \
181         lib/netdev-linux.c \
182         lib/netdev-vport.c \
183         lib/netdev-vport.h \
184         lib/netlink-protocol.h \
185         lib/netlink.c \
186         lib/netlink.h \
187         lib/rtnetlink.c \
188         lib/rtnetlink.h
189 endif
190
191 if HAVE_OPENSSL
192 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
193 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
194 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
195         (echo '#include "lib/dhparams.h"' &&                            \
196          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
197          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
198          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
199         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
200         mv lib/dhparams.c.tmp lib/dhparams.c
201 endif
202
203 EXTRA_DIST += \
204         lib/dh1024.pem \
205         lib/dh2048.pem \
206         lib/dh4096.pem \
207         lib/dirs.c.in
208
209 EXTRA_DIST += \
210         lib/common.man \
211         lib/common-syn.man \
212         lib/daemon.man \
213         lib/daemon-syn.man \
214         lib/dpif.man \
215         lib/leak-checker.man \
216         lib/ssl-bootstrap.man \
217         lib/ssl-bootstrap-syn.man \
218         lib/ssl-peer-ca-cert.man \
219         lib/ssl.man \
220         lib/ssl-syn.man \
221         lib/stress-unixctl.man \
222         lib/unixctl.man \
223         lib/unixctl-syn.man \
224         lib/vconn-active.man \
225         lib/vconn-passive.man \
226         lib/vlog-unixctl.man \
227         lib/vlog-syn.man \
228         lib/vlog.man
229
230 lib/dirs.c: lib/dirs.c.in Makefile
231         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
232                 -e 's,[@]srcdir[@],$(srcdir),g' \
233                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
234                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
235                 -e 's,[@]bindir[@],"$(bindir)",g' \
236                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
237              > lib/dirs.c.tmp
238         mv lib/dirs.c.tmp lib/dirs.c
239
240 install-data-local: lib-install-data-local
241 lib-install-data-local:
242         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
243         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
244         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
245
246 if !USE_LINKER_SECTIONS
247 # All distributed sources, with names adjust properly for referencing
248 # from $(builddir).
249 all_sources = \
250         `for file in $(DIST_SOURCES); do \
251                 if test -f $$file; then \
252                         echo $$file; \
253                 else \
254                         echo $(VPATH)/$$file; \
255                 fi; \
256          done`
257
258 lib/coverage.$(OBJEXT): lib/coverage.def
259 lib/coverage.def: $(DIST_SOURCES)
260         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
261 CLEANFILES += lib/coverage.def
262
263 lib/stress.$(OBJEXT): lib/stress.def
264 lib/stress.def: $(DIST_SOURCES)
265         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
266 CLEANFILES += lib/stress.def
267
268 lib/vlog.$(OBJEXT): lib/vlog-modules.def
269 lib/vlog-modules.def: $(DIST_SOURCES)
270         sed -n 's|^VLOG_DEFINE_\(THIS_\)\{0,1\}MODULE(\([_a-zA-Z0-9]\{1,\}\)).*$$|VLOG_MODULE(\2)|p' $(all_sources) | LC_ALL=C sort -u > $@
271 CLEANFILES += lib/vlog-modules.def
272 endif