1 # Copyright (C) 2009, 2010, 2011, 2012 Nicira Networks, Inc.
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.
8 noinst_LIBRARIES += lib/libopenvswitch.a
10 lib_libopenvswitch_a_SOURCES = \
50 lib/dynamic-string.c \
51 lib/dynamic-string.h \
74 lib/learning-switch.c \
75 lib/learning-switch.h \
87 lib/netdev-provider.h \
112 lib/ovsdb-idl-provider.h \
150 lib/stream-provider.h \
181 lib/vconn-provider.h \
191 nodist_lib_libopenvswitch_a_SOURCES = \
193 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
195 noinst_LIBRARIES += lib/libsflow.a
196 lib_libsflow_a_SOURCES = \
200 lib/sflow_sampler.c \
203 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
205 lib_libsflow_a_CFLAGS += -Wno-unused
207 if HAVE_WNO_UNUSED_PARAMETER
208 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
212 lib_libopenvswitch_a_SOURCES += \
219 lib/netlink-notifier.c \
220 lib/netlink-notifier.h \
221 lib/netlink-protocol.h \
222 lib/netlink-socket.c \
223 lib/netlink-socket.h \
224 lib/rtnetlink-link.c \
225 lib/rtnetlink-link.h \
231 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
232 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
233 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
234 (echo '#include "lib/dhparams.h"' && \
235 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
236 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
237 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
238 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
239 mv lib/dhparams.c.tmp lib/dhparams.c
241 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
255 lib/leak-checker.man \
257 lib/ssl-bootstrap.man \
258 lib/ssl-bootstrap-syn.man \
259 lib/ssl-peer-ca-cert.man \
262 lib/stress-unixctl.man \
265 lib/unixctl-syn.man \
266 lib/vconn-active.man \
267 lib/vconn-passive.man \
268 lib/vlog-unixctl.man \
272 lib/dirs.c: lib/dirs.c.in Makefile
273 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
274 -e 's,[@]srcdir[@],$(srcdir),g' \
275 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
276 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
277 -e 's,[@]bindir[@],"$(bindir)",g' \
278 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
279 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
281 mv lib/dirs.c.tmp lib/dirs.c
283 $(srcdir)/lib/ofp-errors.inc: \
284 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
285 $(PYTHON) $(srcdir)/build-aux/extract-ofp-errors \
286 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
287 lib/ofp-errors.c: lib/ofp-errors.inc
288 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
290 INSTALL_DATA_LOCAL += lib-install-data-local
291 lib-install-data-local:
292 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
293 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
294 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
296 if !USE_LINKER_SECTIONS
297 # All distributed sources, with names adjust properly for referencing
300 `for file in $(DIST_SOURCES); do \
301 if test -f $$file; then \
304 echo $(VPATH)/$$file; \
308 lib/coverage.$(OBJEXT): lib/coverage.def
309 lib/coverage.def: $(DIST_SOURCES)
310 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
311 CLEANFILES += lib/coverage.def
313 lib/stress.$(OBJEXT): lib/stress.def
314 lib/stress.def: $(DIST_SOURCES)
315 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
316 CLEANFILES += lib/stress.def
318 lib/vlog.$(OBJEXT): lib/vlog-modules.def
319 lib/vlog-modules.def: $(DIST_SOURCES)
320 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 > $@
321 CLEANFILES += lib/vlog-modules.def