diff options
author | Ben Pfaff <blp@nicira.com> | 2010-01-07 15:52:58 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-01-26 09:46:42 -0800 |
commit | 00732bf5b5da6f1d71dc4f4b42f54224c03f71f6 (patch) | |
tree | 8f3ed22139ab32e9dbaf8a28c889b006d3d14239 /ovsdb/automake.mk | |
parent | bda8868801ebe49b785f4810e055fb6bf80a1dc6 (diff) | |
download | openvswitch-00732bf5b5da6f1d71dc4f4b42f54224c03f71f6.tar.gz |
Cleanly separate IDL annotations from OVSDB schema information.
Until now, the OVSDB IDL annotations have been glommed together with the
schema information in a single file, and then we've used ovsdb-idlc to
extract the schema from that file. This commit reverses the process:
the schema and the annotations are stored separately and then glommed
together as necessary at build time.
This new arrangement has a few advantages:
- We can now easily have multiple different sets of IDL annotations
for a single OVSDB schema. For example, some users may not need
access to columns that other users do.
- Bugs in ovsdb-idlc cannot screw up the underlying schema (as shown
by a recent commit).
Diffstat (limited to 'ovsdb/automake.mk')
-rw-r--r-- | ovsdb/automake.mk | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ovsdb/automake.mk b/ovsdb/automake.mk index 1596a4b5a..86054100b 100644 --- a/ovsdb/automake.mk +++ b/ovsdb/automake.mk @@ -88,15 +88,26 @@ EXTRA_DIST += \ ovsdb/ovsdb-idlc.1 DISTCLEANFILES += ovsdb/ovsdb-idlc SUFFIXES += .ovsidl .txt +OVSDB_IDLC = $(PYTHON) $(srcdir)/ovsdb/ovsdb-idlc.in .ovsidl.c: - $(PYTHON) $(srcdir)/ovsdb/ovsdb-idlc.in c-idl-source $< > $@.tmp + $(OVSDB_IDLC) c-idl-source $< > $@.tmp mv $@.tmp $@ .ovsidl.h: - $(PYTHON) $(srcdir)/ovsdb/ovsdb-idlc.in c-idl-header $< > $@.tmp - mv $@.tmp $@ -.ovsidl.ovsschema: - $(PYTHON) $(srcdir)/ovsdb/ovsdb-idlc.in ovsdb-schema $< > $@.tmp + $(OVSDB_IDLC) c-idl-header $< > $@.tmp mv $@.tmp $@ .ovsidl.txt: - $(PYTHON) $(srcdir)/ovsdb/ovsdb-idlc.in doc $< | fmt -s > $@.tmp + $(OVSDB_IDLC) doc $< | fmt -s > $@.tmp mv $@.tmp $@ + +EXTRA_DIST += $(OVSIDL_BUILT) +BUILT_SOURCES += $(OVSIDL_BUILT) + +# This must be done late: macros in targets are expanded when the +# target line is read, so if this file were to be included before some +# other file that added to OVSIDL_BUILT, then those files wouldn't get +# the dependency. +# +# However, current versions of Automake seem to output all variable +# assignments before any targets, so it doesn't seem to be a problem, +# at least for now. +$(OVSIDL_BUILT): ovsdb/ovsdb-idlc.in |