1 # Copyright (C) 2009, 2010, 2011, 2012, 2013 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 \
76 lib/learning-switch.c \
77 lib/learning-switch.h \
93 lib/netdev-provider.h \
120 lib/ofp-version-opt.h \
121 lib/ofp-version-opt.c \
130 lib/ovsdb-idl-provider.h \
172 lib/stream-provider.h \
205 lib/vconn-provider.h \
220 nodist_lib_libopenvswitch_a_SOURCES = \
222 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
224 noinst_LIBRARIES += lib/libsflow.a
225 lib_libsflow_a_SOURCES = \
229 lib/sflow_sampler.c \
232 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
234 lib_libsflow_a_CFLAGS += -Wno-unused
236 if HAVE_WNO_UNUSED_PARAMETER
237 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
241 lib_libopenvswitch_a_SOURCES += \
246 lib/netlink-notifier.c \
247 lib/netlink-notifier.h \
248 lib/netlink-protocol.h \
249 lib/netlink-socket.c \
250 lib/netlink-socket.h \
251 lib/rtnetlink-link.c \
252 lib/rtnetlink-link.h \
258 lib_libopenvswitch_a_SOURCES += \
259 lib/route-table-stub.c
263 lib_libopenvswitch_a_SOURCES += \
267 lib/route-table-bsd.c
271 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
272 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
273 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
274 (echo '#include "lib/dhparams.h"' && \
275 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
276 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
277 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
278 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
279 mv lib/dhparams.c.tmp lib/dhparams.c
281 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
293 lib/coverage-unixctl.man \
296 lib/memory-unixctl.man \
297 lib/ofp-version.man \
299 lib/ssl-bootstrap.man \
300 lib/ssl-bootstrap-syn.man \
301 lib/ssl-peer-ca-cert.man \
304 lib/stress-unixctl.man \
307 lib/unixctl-syn.man \
308 lib/vconn-active.man \
309 lib/vconn-passive.man \
310 lib/vlog-unixctl.man \
316 $(srcdir)/lib/vswitch-idl.c \
317 $(srcdir)/lib/vswitch-idl.h \
318 $(srcdir)/lib/vswitch-idl.ovsidl
320 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
321 VSWITCH_IDL_FILES = \
322 $(srcdir)/vswitchd/vswitch.ovsschema \
323 $(srcdir)/lib/vswitch-idl.ann
324 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
325 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
328 lib/dirs.c: lib/dirs.c.in Makefile
329 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
330 -e 's,[@]srcdir[@],$(srcdir),g' \
331 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
332 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
333 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
334 -e 's,[@]bindir[@],"$(bindir)",g' \
335 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
336 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
338 mv lib/dirs.c.tmp lib/dirs.c
340 $(srcdir)/lib/ofp-errors.inc: \
341 lib/ofp-errors.h include/openflow/openflow-common.h \
342 $(srcdir)/build-aux/extract-ofp-errors
343 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
344 $(srcdir)/lib/ofp-errors.h \
345 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
347 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
348 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
350 $(srcdir)/lib/ofp-msgs.inc: \
351 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
352 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
353 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
354 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
355 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
357 INSTALL_DATA_LOCAL += lib-install-data-local
358 lib-install-data-local:
359 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
360 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
361 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
362 $(MKDIR_P) $(DESTDIR)$(DBDIR)
364 if !USE_LINKER_SECTIONS
365 # All distributed sources, with names adjust properly for referencing
368 `for file in $(DIST_SOURCES); do \
369 if test -f $$file; then \
372 echo $(VPATH)/$$file; \
376 lib/coverage.$(OBJEXT): lib/coverage.def
377 lib/coverage.def: $(DIST_SOURCES)
378 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
379 CLEANFILES += lib/coverage.def
381 lib/stress.$(OBJEXT): lib/stress.def
382 lib/stress.def: $(DIST_SOURCES)
383 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
384 CLEANFILES += lib/stress.def
386 lib/vlog.$(OBJEXT): lib/vlog-modules.def
387 lib/vlog-modules.def: $(DIST_SOURCES)
388 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 > $@
389 CLEANFILES += lib/vlog-modules.def