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 \
74 lib/learning-switch.c \
75 lib/learning-switch.h \
89 lib/netdev-provider.h \
114 lib/ovsdb-idl-provider.h \
154 lib/stream-provider.h \
185 lib/vconn-provider.h \
198 nodist_lib_libopenvswitch_a_SOURCES = \
200 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
202 noinst_LIBRARIES += lib/libsflow.a
203 lib_libsflow_a_SOURCES = \
207 lib/sflow_sampler.c \
210 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
212 lib_libsflow_a_CFLAGS += -Wno-unused
214 if HAVE_WNO_UNUSED_PARAMETER
215 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
219 lib_libopenvswitch_a_SOURCES += \
226 lib/netlink-notifier.c \
227 lib/netlink-notifier.h \
228 lib/netlink-protocol.h \
229 lib/netlink-socket.c \
230 lib/netlink-socket.h \
231 lib/rtnetlink-link.c \
232 lib/rtnetlink-link.h \
238 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
239 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
240 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
241 (echo '#include "lib/dhparams.h"' && \
242 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
243 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
244 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
245 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
246 mv lib/dhparams.c.tmp lib/dhparams.c
248 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
260 lib/coverage-unixctl.man \
263 lib/leak-checker.man \
265 lib/ssl-bootstrap.man \
266 lib/ssl-bootstrap-syn.man \
267 lib/ssl-peer-ca-cert.man \
270 lib/stress-unixctl.man \
273 lib/unixctl-syn.man \
274 lib/vconn-active.man \
275 lib/vconn-passive.man \
276 lib/vlog-unixctl.man \
284 lib/vswitch-idl.ovsidl
286 EXTRA_DIST += lib/vswitch-idl.ann
287 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
288 lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
289 $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
292 lib/dirs.c: lib/dirs.c.in Makefile
293 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
294 -e 's,[@]srcdir[@],$(srcdir),g' \
295 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
296 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
297 -e 's,[@]bindir[@],"$(bindir)",g' \
298 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
299 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
301 mv lib/dirs.c.tmp lib/dirs.c
303 $(srcdir)/lib/ofp-errors.inc: \
304 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
305 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
306 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
307 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
308 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
310 INSTALL_DATA_LOCAL += lib-install-data-local
311 lib-install-data-local:
312 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
313 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
314 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
316 if !USE_LINKER_SECTIONS
317 # All distributed sources, with names adjust properly for referencing
320 `for file in $(DIST_SOURCES); do \
321 if test -f $$file; then \
324 echo $(VPATH)/$$file; \
328 lib/coverage.$(OBJEXT): lib/coverage.def
329 lib/coverage.def: $(DIST_SOURCES)
330 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
331 CLEANFILES += lib/coverage.def
333 lib/stress.$(OBJEXT): lib/stress.def
334 lib/stress.def: $(DIST_SOURCES)
335 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
336 CLEANFILES += lib/stress.def
338 lib/vlog.$(OBJEXT): lib/vlog-modules.def
339 lib/vlog-modules.def: $(DIST_SOURCES)
340 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 > $@
341 CLEANFILES += lib/vlog-modules.def