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 \
91 lib/netdev-provider.h \
120 lib/ovsdb-idl-provider.h \
162 lib/stream-provider.h \
195 lib/vconn-provider.h \
210 nodist_lib_libopenvswitch_a_SOURCES = \
212 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
214 noinst_LIBRARIES += lib/libsflow.a
215 lib_libsflow_a_SOURCES = \
219 lib/sflow_sampler.c \
222 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
224 lib_libsflow_a_CFLAGS += -Wno-unused
226 if HAVE_WNO_UNUSED_PARAMETER
227 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
231 lib_libopenvswitch_a_SOURCES += \
238 lib/netlink-notifier.c \
239 lib/netlink-notifier.h \
240 lib/netlink-protocol.h \
241 lib/netlink-socket.c \
242 lib/netlink-socket.h \
243 lib/rtnetlink-link.c \
244 lib/rtnetlink-link.h \
250 lib_libopenvswitch_a_SOURCES += \
251 lib/route-table-stub.c
255 lib_libopenvswitch_a_SOURCES += \
259 lib/route-table-bsd.c
263 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
264 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
265 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
266 (echo '#include "lib/dhparams.h"' && \
267 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
268 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
269 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
270 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
271 mv lib/dhparams.c.tmp lib/dhparams.c
273 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
285 lib/coverage-unixctl.man \
288 lib/leak-checker.man \
289 lib/memory-unixctl.man \
291 lib/ssl-bootstrap.man \
292 lib/ssl-bootstrap-syn.man \
293 lib/ssl-peer-ca-cert.man \
296 lib/stress-unixctl.man \
299 lib/unixctl-syn.man \
300 lib/vconn-active.man \
301 lib/vconn-passive.man \
302 lib/vlog-unixctl.man \
308 $(srcdir)/lib/vswitch-idl.c \
309 $(srcdir)/lib/vswitch-idl.h \
310 $(srcdir)/lib/vswitch-idl.ovsidl
312 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
313 VSWITCH_IDL_FILES = \
314 $(srcdir)/vswitchd/vswitch.ovsschema \
315 $(srcdir)/lib/vswitch-idl.ann
316 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
317 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
320 lib/dirs.c: lib/dirs.c.in Makefile
321 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
322 -e 's,[@]srcdir[@],$(srcdir),g' \
323 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
324 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
325 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
326 -e 's,[@]bindir[@],"$(bindir)",g' \
327 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
328 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
330 mv lib/dirs.c.tmp lib/dirs.c
332 $(srcdir)/lib/ofp-errors.inc: \
333 lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
334 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
335 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
336 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
337 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
339 $(srcdir)/lib/ofp-msgs.inc: \
340 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
341 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
342 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
343 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
344 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
346 INSTALL_DATA_LOCAL += lib-install-data-local
347 lib-install-data-local:
348 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
349 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
350 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
351 $(MKDIR_P) $(DESTDIR)$(DBDIR)
353 if !USE_LINKER_SECTIONS
354 # All distributed sources, with names adjust properly for referencing
357 `for file in $(DIST_SOURCES); do \
358 if test -f $$file; then \
361 echo $(VPATH)/$$file; \
365 lib/coverage.$(OBJEXT): lib/coverage.def
366 lib/coverage.def: $(DIST_SOURCES)
367 sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
368 CLEANFILES += lib/coverage.def
370 lib/stress.$(OBJEXT): lib/stress.def
371 lib/stress.def: $(DIST_SOURCES)
372 sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
373 CLEANFILES += lib/stress.def
375 lib/vlog.$(OBJEXT): lib/vlog-modules.def
376 lib/vlog-modules.def: $(DIST_SOURCES)
377 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 > $@
378 CLEANFILES += lib/vlog-modules.def