1 # Copyright (C) 2009, 2010, 2011, 2012 Nicira, 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 \
89 lib/netdev-provider.h \
118 lib/ovsdb-idl-provider.h \
160 lib/stream-provider.h \
193 lib/vconn-provider.h \
208 nodist_lib_libopenvswitch_a_SOURCES = \
210 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
212 noinst_LIBRARIES += lib/libsflow.a
213 lib_libsflow_a_SOURCES = \
217 lib/sflow_sampler.c \
220 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
222 lib_libsflow_a_CFLAGS += -Wno-unused
224 if HAVE_WNO_UNUSED_PARAMETER
225 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
229 lib_libopenvswitch_a_SOURCES += \
236 lib/netlink-notifier.c \
237 lib/netlink-notifier.h \
238 lib/netlink-protocol.h \
239 lib/netlink-socket.c \
240 lib/netlink-socket.h \
241 lib/rtnetlink-link.c \
242 lib/rtnetlink-link.h \
248 lib_libopenvswitch_a_SOURCES += \
252 lib/route-table-bsd.c
256 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
257 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
258 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
259 (echo '#include "lib/dhparams.h"' && \
260 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
261 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
262 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
263 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
264 mv lib/dhparams.c.tmp lib/dhparams.c
266 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
278 lib/coverage-unixctl.man \
281 lib/leak-checker.man \
282 lib/memory-unixctl.man \
284 lib/ssl-bootstrap.man \
285 lib/ssl-bootstrap-syn.man \
286 lib/ssl-peer-ca-cert.man \
289 lib/stress-unixctl.man \
292 lib/unixctl-syn.man \
293 lib/vconn-active.man \
294 lib/vconn-passive.man \
295 lib/vlog-unixctl.man \
303 lib/vswitch-idl.ovsidl
305 EXTRA_DIST += lib/vswitch-idl.ann
306 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
307 lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
308 $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
311 lib/dirs.c: lib/dirs.c.in Makefile
312 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
313 -e 's,[@]srcdir[@],$(srcdir),g' \
314 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
315 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
316 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
317 -e 's,[@]bindir[@],"$(bindir)",g' \
318 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
319 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
321 mv lib/dirs.c.tmp lib/dirs.c
323 $(srcdir)/lib/ofp-errors.inc: \
324 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
325 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
326 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
327 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
328 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
330 $(srcdir)/lib/ofp-msgs.inc: \
331 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
332 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
333 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
334 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
335 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
337 INSTALL_DATA_LOCAL += lib-install-data-local
338 lib-install-data-local:
339 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
340 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
341 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
342 $(MKDIR_P) $(DESTDIR)$(DBDIR)
344 if !USE_LINKER_SECTIONS
345 # All distributed sources, with names adjust properly for referencing
348 `for file in $(DIST_SOURCES); do \
349 if test -f $$file; then \
352 echo $(VPATH)/$$file; \
356 lib/coverage.$(OBJEXT): lib/coverage.def
357 lib/coverage.def: $(DIST_SOURCES)
358 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
359 CLEANFILES += lib/coverage.def
361 lib/stress.$(OBJEXT): lib/stress.def
362 lib/stress.def: $(DIST_SOURCES)
363 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
364 CLEANFILES += lib/stress.def
366 lib/vlog.$(OBJEXT): lib/vlog-modules.def
367 lib/vlog-modules.def: $(DIST_SOURCES)
368 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 > $@
369 CLEANFILES += lib/vlog-modules.def