-# Copyright (C) 2009, 2010 Nicira Networks, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
| sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
mv lib/dhparams.c.tmp lib/dhparams.c
openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
| sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
mv lib/dhparams.c.tmp lib/dhparams.c
+# vswitch IDL
+OVSIDL_BUILT += \
+ lib/vswitch-idl.c \
+ lib/vswitch-idl.h \
+ lib/vswitch-idl.ovsidl
+
+EXTRA_DIST += lib/vswitch-idl.ann
+VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
+lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
+ $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
+ mv $@.tmp $@
+
lib/dirs.c: lib/dirs.c.in Makefile
($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
-e 's,[@]srcdir[@],$(srcdir),g' \
-e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
-e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
-e 's,[@]bindir[@],"$(bindir)",g' \
lib/dirs.c: lib/dirs.c.in Makefile
($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
-e 's,[@]srcdir[@],$(srcdir),g' \
-e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
-e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
-e 's,[@]bindir[@],"$(bindir)",g' \
-e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
> lib/dirs.c.tmp
mv lib/dirs.c.tmp lib/dirs.c
-e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
> lib/dirs.c.tmp
mv lib/dirs.c.tmp lib/dirs.c
-install-data-local: lib-install-data-local
+$(srcdir)/lib/ofp-errors.inc: \
+ lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
+ $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
+ $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
+$(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
+EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
+
+INSTALL_DATA_LOCAL += lib-install-data-local
lib-install-data-local:
$(MKDIR_P) $(DESTDIR)$(RUNDIR)
$(MKDIR_P) $(DESTDIR)$(PKIDIR)
$(MKDIR_P) $(DESTDIR)$(LOGDIR)
lib-install-data-local:
$(MKDIR_P) $(DESTDIR)$(RUNDIR)
$(MKDIR_P) $(DESTDIR)$(PKIDIR)
$(MKDIR_P) $(DESTDIR)$(LOGDIR)
-# All the source files that have coverage counters.
-COVERAGE_FILES = \
- lib/dpif.c \
- lib/flow.c \
- lib/lockfile.c \
- lib/hmap.c \
- lib/mac-learning.c \
- lib/netdev.c \
- lib/netdev-linux.c \
- lib/netlink.c \
- lib/odp-util.c \
- lib/poll-loop.c \
- lib/process.c \
- lib/rconn.c \
- lib/rtnetlink.c \
- lib/stream.c \
- lib/stream-ssl.c \
- lib/timeval.c \
- lib/unixctl.c \
- lib/util.c \
- lib/vconn.c \
- ofproto/ofproto.c \
- ofproto/pktbuf.c \
- vswitchd/bridge.c \
- vswitchd/ovs-brcompatd.c
-lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
- (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
- mv $@.tmp $@
-EXTRA_DIST += lib/coverage-scan.pl
+if !USE_LINKER_SECTIONS
+# All distributed sources, with names adjust properly for referencing
+# from $(builddir).
+all_sources = \
+ `for file in $(DIST_SOURCES); do \
+ if test -f $$file; then \
+ echo $$file; \
+ else \
+ echo $(VPATH)/$$file; \
+ fi; \
+ done`
+
+lib/coverage.$(OBJEXT): lib/coverage.def
+lib/coverage.def: $(DIST_SOURCES)
+ sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
+CLEANFILES += lib/coverage.def
-ALL_LOCAL += check-vlog-modules
-check-vlog-modules:
- cd $(srcdir) && build-aux/check-vlog-modules
-.PHONY: check-vlog-modules
-EXTRA_DIST += build-aux/check-vlog-modules
+lib/stress.$(OBJEXT): lib/stress.def
+lib/stress.def: $(DIST_SOURCES)
+ sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
+CLEANFILES += lib/stress.def
+
+lib/vlog.$(OBJEXT): lib/vlog-modules.def
+lib/vlog-modules.def: $(DIST_SOURCES)
+ 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 > $@
+CLEANFILES += lib/vlog-modules.def
+endif