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 \
95 lib/netdev-provider.h \
122 lib/ofp-version-opt.h \
123 lib/ofp-version-opt.c \
126 lib/ovs-atomic-c11.h \
127 lib/ovs-atomic-gcc4+.c \
128 lib/ovs-atomic-gcc4+.h \
129 lib/ovs-atomic-gcc4.7+.h \
130 lib/ovs-atomic-pthreads.c \
131 lib/ovs-atomic-pthreads.h \
139 lib/ovsdb-idl-provider.h \
181 lib/stream-provider.h \
216 lib/vconn-provider.h \
231 nodist_lib_libopenvswitch_a_SOURCES = \
233 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
235 noinst_LIBRARIES += lib/libsflow.a
236 lib_libsflow_a_SOURCES = \
240 lib/sflow_sampler.c \
243 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
245 lib_libsflow_a_CFLAGS += -Wno-unused
247 if HAVE_WNO_UNUSED_PARAMETER
248 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
252 lib_libopenvswitch_a_SOURCES += \
257 lib/netlink-notifier.c \
258 lib/netlink-notifier.h \
259 lib/netlink-protocol.h \
260 lib/netlink-socket.c \
261 lib/netlink-socket.h \
262 lib/rtnetlink-link.c \
263 lib/rtnetlink-link.h \
269 lib_libopenvswitch_a_SOURCES += \
270 lib/route-table-stub.c
274 lib_libopenvswitch_a_SOURCES += \
278 lib/route-table-bsd.c
282 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
283 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
284 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
285 (echo '#include "lib/dhparams.h"' && \
286 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
287 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
288 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
289 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
290 mv lib/dhparams.c.tmp lib/dhparams.c
292 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
304 lib/coverage-unixctl.man \
307 lib/memory-unixctl.man \
308 lib/ofp-version.man \
310 lib/ssl-bootstrap.man \
311 lib/ssl-bootstrap-syn.man \
312 lib/ssl-peer-ca-cert.man \
315 lib/stress-unixctl.man \
318 lib/unixctl-syn.man \
319 lib/vconn-active.man \
320 lib/vconn-passive.man \
321 lib/vlog-unixctl.man \
327 $(srcdir)/lib/vswitch-idl.c \
328 $(srcdir)/lib/vswitch-idl.h \
329 $(srcdir)/lib/vswitch-idl.ovsidl
331 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
332 VSWITCH_IDL_FILES = \
333 $(srcdir)/vswitchd/vswitch.ovsschema \
334 $(srcdir)/lib/vswitch-idl.ann
335 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
336 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
339 lib/dirs.c: lib/dirs.c.in Makefile
340 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
341 -e 's,[@]srcdir[@],$(srcdir),g' \
342 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
343 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
344 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
345 -e 's,[@]bindir[@],"$(bindir)",g' \
346 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
347 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
349 mv lib/dirs.c.tmp lib/dirs.c
351 $(srcdir)/lib/ofp-errors.inc: \
352 lib/ofp-errors.h include/openflow/openflow-common.h \
353 $(srcdir)/build-aux/extract-ofp-errors
354 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
355 $(srcdir)/lib/ofp-errors.h \
356 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
358 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
359 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
361 $(srcdir)/lib/ofp-msgs.inc: \
362 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
363 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
364 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
365 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
366 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
368 INSTALL_DATA_LOCAL += lib-install-data-local
369 lib-install-data-local:
370 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
371 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
372 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
373 $(MKDIR_P) $(DESTDIR)$(DBDIR)
375 if !USE_LINKER_SECTIONS
376 # All distributed sources, with names adjust properly for referencing
379 `for file in $(DIST_SOURCES); do \
380 if test -f $$file; then \
383 echo $(VPATH)/$$file; \
387 lib/coverage.$(OBJEXT): lib/coverage.def
388 lib/coverage.def: $(DIST_SOURCES)
389 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
390 CLEANFILES += lib/coverage.def
392 lib/stress.$(OBJEXT): lib/stress.def
393 lib/stress.def: $(DIST_SOURCES)
394 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
395 CLEANFILES += lib/stress.def
397 lib/vlog.$(OBJEXT): lib/vlog-modules.def
398 lib/vlog-modules.def: $(DIST_SOURCES)
399 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 > $@
400 CLEANFILES += lib/vlog-modules.def