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 \
124 lib/ovs-atomic-c11.h \
125 lib/ovs-atomic-gcc4+.c \
126 lib/ovs-atomic-gcc4+.h \
127 lib/ovs-atomic-gcc4.7+.h \
128 lib/ovs-atomic-pthreads.c \
129 lib/ovs-atomic-pthreads.h \
137 lib/ovsdb-idl-provider.h \
179 lib/stream-provider.h \
212 lib/vconn-provider.h \
225 nodist_lib_libopenvswitch_a_SOURCES = \
227 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
229 noinst_LIBRARIES += lib/libsflow.a
230 lib_libsflow_a_SOURCES = \
234 lib/sflow_sampler.c \
237 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
239 lib_libsflow_a_CFLAGS += -Wno-unused
241 if HAVE_WNO_UNUSED_PARAMETER
242 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
246 lib_libopenvswitch_a_SOURCES += \
251 lib/netlink-notifier.c \
252 lib/netlink-notifier.h \
253 lib/netlink-protocol.h \
254 lib/netlink-socket.c \
255 lib/netlink-socket.h \
256 lib/rtnetlink-link.c \
257 lib/rtnetlink-link.h \
263 lib_libopenvswitch_a_SOURCES += \
264 lib/route-table-stub.c
268 lib_libopenvswitch_a_SOURCES += \
272 lib/route-table-bsd.c
276 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
277 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
278 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
279 (echo '#include "lib/dhparams.h"' && \
280 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
281 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
282 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
283 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
284 mv lib/dhparams.c.tmp lib/dhparams.c
286 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
298 lib/coverage-unixctl.man \
301 lib/memory-unixctl.man \
302 lib/ofp-version.man \
304 lib/ssl-bootstrap.man \
305 lib/ssl-bootstrap-syn.man \
306 lib/ssl-peer-ca-cert.man \
309 lib/stress-unixctl.man \
312 lib/unixctl-syn.man \
313 lib/vconn-active.man \
314 lib/vconn-passive.man \
315 lib/vlog-unixctl.man \
321 $(srcdir)/lib/vswitch-idl.c \
322 $(srcdir)/lib/vswitch-idl.h \
323 $(srcdir)/lib/vswitch-idl.ovsidl
325 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
326 VSWITCH_IDL_FILES = \
327 $(srcdir)/vswitchd/vswitch.ovsschema \
328 $(srcdir)/lib/vswitch-idl.ann
329 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
330 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
333 lib/dirs.c: lib/dirs.c.in Makefile
334 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
335 -e 's,[@]srcdir[@],$(srcdir),g' \
336 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
337 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
338 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
339 -e 's,[@]bindir[@],"$(bindir)",g' \
340 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
341 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
343 mv lib/dirs.c.tmp lib/dirs.c
345 $(srcdir)/lib/ofp-errors.inc: \
346 lib/ofp-errors.h include/openflow/openflow-common.h \
347 $(srcdir)/build-aux/extract-ofp-errors
348 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
349 $(srcdir)/lib/ofp-errors.h \
350 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
352 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
353 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
355 $(srcdir)/lib/ofp-msgs.inc: \
356 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
357 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
358 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
359 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
360 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
362 INSTALL_DATA_LOCAL += lib-install-data-local
363 lib-install-data-local:
364 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
365 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
366 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
367 $(MKDIR_P) $(DESTDIR)$(DBDIR)
369 if !USE_LINKER_SECTIONS
370 # All distributed sources, with names adjust properly for referencing
373 `for file in $(DIST_SOURCES); do \
374 if test -f $$file; then \
377 echo $(VPATH)/$$file; \
381 lib/coverage.$(OBJEXT): lib/coverage.def
382 lib/coverage.def: $(DIST_SOURCES)
383 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
384 CLEANFILES += lib/coverage.def
386 lib/stress.$(OBJEXT): lib/stress.def
387 lib/stress.def: $(DIST_SOURCES)
388 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
389 CLEANFILES += lib/stress.def
391 lib/vlog.$(OBJEXT): lib/vlog-modules.def
392 lib/vlog-modules.def: $(DIST_SOURCES)
393 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 > $@
394 CLEANFILES += lib/vlog-modules.def