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 = \
48 lib/dynamic-string.c \
49 lib/dynamic-string.h \
74 lib/learning-switch.c \
75 lib/learning-switch.h \
91 lib/netdev-provider.h \
116 lib/ofp-version-opt.h \
117 lib/ofp-version-opt.c \
124 lib/ovsdb-idl-provider.h \
166 lib/stream-provider.h \
199 lib/vconn-provider.h \
214 nodist_lib_libopenvswitch_a_SOURCES = \
216 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
218 noinst_LIBRARIES += lib/libsflow.a
219 lib_libsflow_a_SOURCES = \
223 lib/sflow_sampler.c \
226 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
228 lib_libsflow_a_CFLAGS += -Wno-unused
230 if HAVE_WNO_UNUSED_PARAMETER
231 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
235 lib_libopenvswitch_a_SOURCES += \
240 lib/netlink-notifier.c \
241 lib/netlink-notifier.h \
242 lib/netlink-protocol.h \
243 lib/netlink-socket.c \
244 lib/netlink-socket.h \
245 lib/rtnetlink-link.c \
246 lib/rtnetlink-link.h \
252 lib_libopenvswitch_a_SOURCES += \
253 lib/route-table-stub.c
257 lib_libopenvswitch_a_SOURCES += \
261 lib/route-table-bsd.c
265 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
266 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
267 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
268 (echo '#include "lib/dhparams.h"' && \
269 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
270 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
271 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
272 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
273 mv lib/dhparams.c.tmp lib/dhparams.c
275 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
287 lib/coverage-unixctl.man \
290 lib/leak-checker.man \
291 lib/memory-unixctl.man \
292 lib/ofp-version.man \
294 lib/ssl-bootstrap.man \
295 lib/ssl-bootstrap-syn.man \
296 lib/ssl-peer-ca-cert.man \
299 lib/stress-unixctl.man \
302 lib/unixctl-syn.man \
303 lib/vconn-active.man \
304 lib/vconn-passive.man \
305 lib/vlog-unixctl.man \
311 $(srcdir)/lib/vswitch-idl.c \
312 $(srcdir)/lib/vswitch-idl.h \
313 $(srcdir)/lib/vswitch-idl.ovsidl
315 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
316 VSWITCH_IDL_FILES = \
317 $(srcdir)/vswitchd/vswitch.ovsschema \
318 $(srcdir)/lib/vswitch-idl.ann
319 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
320 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
323 lib/dirs.c: lib/dirs.c.in Makefile
324 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
325 -e 's,[@]srcdir[@],$(srcdir),g' \
326 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
327 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
328 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
329 -e 's,[@]bindir[@],"$(bindir)",g' \
330 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
331 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
333 mv lib/dirs.c.tmp lib/dirs.c
335 $(srcdir)/lib/ofp-errors.inc: \
336 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
337 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
338 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
339 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
340 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
342 $(srcdir)/lib/ofp-msgs.inc: \
343 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
344 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
345 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
346 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
347 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
349 INSTALL_DATA_LOCAL += lib-install-data-local
350 lib-install-data-local:
351 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
352 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
353 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
354 $(MKDIR_P) $(DESTDIR)$(DBDIR)
356 if !USE_LINKER_SECTIONS
357 # All distributed sources, with names adjust properly for referencing
360 `for file in $(DIST_SOURCES); do \
361 if test -f $$file; then \
364 echo $(VPATH)/$$file; \
368 lib/coverage.$(OBJEXT): lib/coverage.def
369 lib/coverage.def: $(DIST_SOURCES)
370 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
371 CLEANFILES += lib/coverage.def
373 lib/stress.$(OBJEXT): lib/stress.def
374 lib/stress.def: $(DIST_SOURCES)
375 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
376 CLEANFILES += lib/stress.def
378 lib/vlog.$(OBJEXT): lib/vlog-modules.def
379 lib/vlog-modules.def: $(DIST_SOURCES)
380 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 > $@
381 CLEANFILES += lib/vlog-modules.def