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 \
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 \
128 lib/ovsdb-idl-provider.h \
170 lib/stream-provider.h \
203 lib/vconn-provider.h \
218 nodist_lib_libopenvswitch_a_SOURCES = \
220 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
222 noinst_LIBRARIES += lib/libsflow.a
223 lib_libsflow_a_SOURCES = \
227 lib/sflow_sampler.c \
230 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
232 lib_libsflow_a_CFLAGS += -Wno-unused
234 if HAVE_WNO_UNUSED_PARAMETER
235 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
239 lib_libopenvswitch_a_SOURCES += \
244 lib/netlink-notifier.c \
245 lib/netlink-notifier.h \
246 lib/netlink-protocol.h \
247 lib/netlink-socket.c \
248 lib/netlink-socket.h \
249 lib/rtnetlink-link.c \
250 lib/rtnetlink-link.h \
256 lib_libopenvswitch_a_SOURCES += \
257 lib/route-table-stub.c
261 lib_libopenvswitch_a_SOURCES += \
265 lib/route-table-bsd.c
269 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
270 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
271 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
272 (echo '#include "lib/dhparams.h"' && \
273 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
274 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
275 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
276 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
277 mv lib/dhparams.c.tmp lib/dhparams.c
279 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
291 lib/coverage-unixctl.man \
294 lib/leak-checker.man \
295 lib/memory-unixctl.man \
296 lib/ofp-version.man \
298 lib/ssl-bootstrap.man \
299 lib/ssl-bootstrap-syn.man \
300 lib/ssl-peer-ca-cert.man \
303 lib/stress-unixctl.man \
306 lib/unixctl-syn.man \
307 lib/vconn-active.man \
308 lib/vconn-passive.man \
309 lib/vlog-unixctl.man \
315 $(srcdir)/lib/vswitch-idl.c \
316 $(srcdir)/lib/vswitch-idl.h \
317 $(srcdir)/lib/vswitch-idl.ovsidl
319 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
320 VSWITCH_IDL_FILES = \
321 $(srcdir)/vswitchd/vswitch.ovsschema \
322 $(srcdir)/lib/vswitch-idl.ann
323 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
324 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
327 lib/dirs.c: lib/dirs.c.in Makefile
328 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
329 -e 's,[@]srcdir[@],$(srcdir),g' \
330 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
331 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
332 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
333 -e 's,[@]bindir[@],"$(bindir)",g' \
334 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
335 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
337 mv lib/dirs.c.tmp lib/dirs.c
339 $(srcdir)/lib/ofp-errors.inc: \
340 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
341 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
342 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
343 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
344 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
346 $(srcdir)/lib/ofp-msgs.inc: \
347 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
348 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
349 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
350 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
351 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
353 INSTALL_DATA_LOCAL += lib-install-data-local
354 lib-install-data-local:
355 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
356 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
357 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
358 $(MKDIR_P) $(DESTDIR)$(DBDIR)
360 if !USE_LINKER_SECTIONS
361 # All distributed sources, with names adjust properly for referencing
364 `for file in $(DIST_SOURCES); do \
365 if test -f $$file; then \
368 echo $(VPATH)/$$file; \
372 lib/coverage.$(OBJEXT): lib/coverage.def
373 lib/coverage.def: $(DIST_SOURCES)
374 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
375 CLEANFILES += lib/coverage.def
377 lib/stress.$(OBJEXT): lib/stress.def
378 lib/stress.def: $(DIST_SOURCES)
379 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
380 CLEANFILES += lib/stress.def
382 lib/vlog.$(OBJEXT): lib/vlog-modules.def
383 lib/vlog-modules.def: $(DIST_SOURCES)
384 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 > $@
385 CLEANFILES += lib/vlog-modules.def