Skip to content

Commit

Permalink
Makefiles: Clean and do not distribute IDL-generated files.
Browse files Browse the repository at this point in the history
IDL-generated files don't need to be distributed, and distributing them
puts them in the source directory rather than the build directory, which
causes "make distcheck" to fail if any of them need to be remade.  To
prevent this, this commit this removes them from ..._SOURCES, moving them
into nodist_..._SOURCES.

IDL-generated files all need to be cleaned, so this commit adds all of
them to CLEANFILES wholesale via a single CLEANFILES += $(OVSIDL_BUILT)
line in ovsdb/automake.mk, removing the individual additions from various
makefiles.

With this commit, "make distcheck" passes for me.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Aaron Conole <[email protected]>
  • Loading branch information
blp committed Jul 22, 2015
1 parent ea53e3a commit 90ffd53
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
7 changes: 3 additions & 4 deletions lib/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ lib_libopenvswitch_la_SOURCES = \
lib/vlandev.c \
lib/vlandev.h \
lib/vlog.c \
lib/vswitch-idl.c \
lib/vswitch-idl.h \
lib/lldp/aa-structs.h \
lib/lldp/lldp.c \
lib/lldp/lldp-const.h \
Expand Down Expand Up @@ -310,7 +308,9 @@ EXTRA_DIST += \
lib/string.h.in

nodist_lib_libopenvswitch_la_SOURCES = \
lib/dirs.c
lib/dirs.c \
lib/vswitch-idl.c \
lib/vswitch-idl.h
CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)

lib_LTLIBRARIES += lib/libsflow.la
Expand Down Expand Up @@ -447,7 +447,6 @@ OVSIDL_BUILT += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl
EXTRA_DIST += lib/vswitch-idl.ann
lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
$(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/vswitchd/vswitch.ovsschema $(srcdir)/lib/vswitch-idl.ann > $@.tmp && mv $@.tmp $@
CLEANFILES += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl

lib/dirs.c: lib/dirs.c.in Makefile
$(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
Expand Down
25 changes: 12 additions & 13 deletions ovn/lib/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,36 @@ ovn_lib_libovn_la_SOURCES = \
ovn/lib/expr.c \
ovn/lib/expr.h \
ovn/lib/lex.c \
ovn/lib/lex.h \
ovn/lib/lex.h
nodist_ovn_lib_libovn_la_SOURCES = \
ovn/lib/ovn-nb-idl.c \
ovn/lib/ovn-nb-idl.h \
ovn/lib/ovn-sb-idl.c \
ovn/lib/ovn-sb-idl.h

# ovn-sb IDL
OVSIDL_BUILT += \
$(srcdir)/ovn/lib/ovn-sb-idl.c \
$(srcdir)/ovn/lib/ovn-sb-idl.h \
$(srcdir)/ovn/lib/ovn-sb-idl.ovsidl
EXTRA_DIST += $(srcdir)/ovn/lib/ovn-sb-idl.ann
ovn/lib/ovn-sb-idl.c \
ovn/lib/ovn-sb-idl.h \
ovn/lib/ovn-sb-idl.ovsidl
EXTRA_DIST += ovn/lib/ovn-sb-idl.ann
OVN_SB_IDL_FILES = \
$(srcdir)/ovn/ovn-sb.ovsschema \
$(srcdir)/ovn/lib/ovn-sb-idl.ann
$(srcdir)/ovn/lib/ovn-sb-idl.ovsidl: $(OVN_SB_IDL_FILES)
ovn/lib/ovn-sb-idl.ovsidl: $(OVN_SB_IDL_FILES)
$(AM_V_GEN)$(OVSDB_IDLC) annotate $(OVN_SB_IDL_FILES) > $@.tmp && \
mv $@.tmp $@
CLEANFILES += ovn/lib/ovn-sb-idl.c ovn/lib/ovn-sb-idl.h

# ovn-nb IDL
OVSIDL_BUILT += \
$(srcdir)/ovn/lib/ovn-nb-idl.c \
$(srcdir)/ovn/lib/ovn-nb-idl.h \
$(srcdir)/ovn/lib/ovn-nb-idl.ovsidl
EXTRA_DIST += $(srcdir)/ovn/lib/ovn-nb-idl.ann
ovn/lib/ovn-nb-idl.c \
ovn/lib/ovn-nb-idl.h \
ovn/lib/ovn-nb-idl.ovsidl
EXTRA_DIST += ovn/lib/ovn-nb-idl.ann
OVN_NB_IDL_FILES = \
$(srcdir)/ovn/ovn-nb.ovsschema \
$(srcdir)/ovn/lib/ovn-nb-idl.ann
$(srcdir)/ovn/lib/ovn-nb-idl.ovsidl: $(OVN_NB_IDL_FILES)
ovn/lib/ovn-nb-idl.ovsidl: $(OVN_NB_IDL_FILES)
$(AM_V_GEN)$(OVSDB_IDLC) annotate $(OVN_NB_IDL_FILES) > $@.tmp && \
mv $@.tmp $@
CLEANFILES += ovn/lib/ovn-nb-idl.c ovn/lib/ovn-nb-idl.h

1 change: 1 addition & 0 deletions ovsdb/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ OVSDB_IDLC = $(run_python) $(srcdir)/ovsdb/ovsdb-idlc.in
$(AM_V_GEN)$(OVSDB_IDLC) c-idl-header $< > $@.tmp && mv $@.tmp $@

BUILT_SOURCES += $(OVSIDL_BUILT)
CLEANFILES += $(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
Expand Down
7 changes: 2 additions & 5 deletions tests/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,8 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
} >'$(srcdir)/package.m4'

noinst_PROGRAMS += tests/test-ovsdb
tests_test_ovsdb_SOURCES = \
tests/test-ovsdb.c \
tests/idltest.c \
tests/idltest.h
tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la

Expand All @@ -246,7 +244,6 @@ tests_test_lib_LDADD = lib/libopenvswitch.la
OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
EXTRA_DIST += $(IDLTEST_IDL_FILES) tests/idltest2.ovsschema
CLEANFILES += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
$(AM_V_GEN)$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp && \
mv $@.tmp $@
Expand Down
3 changes: 1 addition & 2 deletions vtep/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ VTEP_IDL_FILES = \
vtep/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
$(AM_V_GEN)$(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp && \
mv $@.tmp $@
CLEANFILES += vtep/vtep-idl.c vtep/vtep-idl.h vtep/vtep-idl.ovsidl

# libvtep
lib_LTLIBRARIES += vtep/libvtep.la
vtep_libvtep_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-Wl,--version-script=$(top_builddir)/vtep/libvtep.sym \
$(AM_LDFLAGS)
vtep_libvtep_la_SOURCES = \
nodist_vtep_libvtep_la_SOURCES = \
vtep/vtep-idl.c \
vtep/vtep-idl.h

Expand Down

0 comments on commit 90ffd53

Please sign in to comment.