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 \
227 nodist_lib_libopenvswitch_a_SOURCES = \
229 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
231 noinst_LIBRARIES += lib/libsflow.a
232 lib_libsflow_a_SOURCES = \
236 lib/sflow_sampler.c \
239 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
241 lib_libsflow_a_CFLAGS += -Wno-unused
243 if HAVE_WNO_UNUSED_PARAMETER
244 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
248 lib_libopenvswitch_a_SOURCES += \
253 lib/netlink-notifier.c \
254 lib/netlink-notifier.h \
255 lib/netlink-protocol.h \
256 lib/netlink-socket.c \
257 lib/netlink-socket.h \
258 lib/rtnetlink-link.c \
259 lib/rtnetlink-link.h \
265 lib_libopenvswitch_a_SOURCES += \
266 lib/route-table-stub.c
270 lib_libopenvswitch_a_SOURCES += \
274 lib/route-table-bsd.c
278 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
279 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
280 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
281 (echo '#include "lib/dhparams.h"' && \
282 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
283 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
284 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
285 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
286 mv lib/dhparams.c.tmp lib/dhparams.c
288 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
300 lib/coverage-unixctl.man \
303 lib/memory-unixctl.man \
304 lib/ofp-version.man \
306 lib/ssl-bootstrap.man \
307 lib/ssl-bootstrap-syn.man \
308 lib/ssl-peer-ca-cert.man \
311 lib/stress-unixctl.man \
314 lib/unixctl-syn.man \
315 lib/vconn-active.man \
316 lib/vconn-passive.man \
317 lib/vlog-unixctl.man \
323 $(srcdir)/lib/vswitch-idl.c \
324 $(srcdir)/lib/vswitch-idl.h \
325 $(srcdir)/lib/vswitch-idl.ovsidl
327 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
328 VSWITCH_IDL_FILES = \
329 $(srcdir)/vswitchd/vswitch.ovsschema \
330 $(srcdir)/lib/vswitch-idl.ann
331 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
332 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
335 lib/dirs.c: lib/dirs.c.in Makefile
336 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
337 -e 's,[@]srcdir[@],$(srcdir),g' \
338 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
339 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
340 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
341 -e 's,[@]bindir[@],"$(bindir)",g' \
342 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
343 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
345 mv lib/dirs.c.tmp lib/dirs.c
347 $(srcdir)/lib/ofp-errors.inc: \
348 lib/ofp-errors.h include/openflow/openflow-common.h \
349 $(srcdir)/build-aux/extract-ofp-errors
350 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
351 $(srcdir)/lib/ofp-errors.h \
352 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
354 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
355 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
357 $(srcdir)/lib/ofp-msgs.inc: \
358 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
359 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
360 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
361 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
362 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
364 INSTALL_DATA_LOCAL += lib-install-data-local
365 lib-install-data-local:
366 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
367 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
368 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
369 $(MKDIR_P) $(DESTDIR)$(DBDIR)
371 if !USE_LINKER_SECTIONS
372 # All distributed sources, with names adjust properly for referencing
375 `for file in $(DIST_SOURCES); do \
376 if test -f $$file; then \
379 echo $(VPATH)/$$file; \
383 lib/coverage.$(OBJEXT): lib/coverage.def
384 lib/coverage.def: $(DIST_SOURCES)
385 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
386 CLEANFILES += lib/coverage.def
388 lib/stress.$(OBJEXT): lib/stress.def
389 lib/stress.def: $(DIST_SOURCES)
390 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
391 CLEANFILES += lib/stress.def
393 lib/vlog.$(OBJEXT): lib/vlog-modules.def
394 lib/vlog-modules.def: $(DIST_SOURCES)
395 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 > $@
396 CLEANFILES += lib/vlog-modules.def