]> xenbits.xensource.com Git - libvirt.git/commitdiff
makefile: Move include/Makefile.am to include/libvirt/Makefile.am
authorErik Skultety <eskultet@redhat.com>
Tue, 5 Apr 2016 19:04:06 +0000 (21:04 +0200)
committerErik Skultety <eskultet@redhat.com>
Fri, 15 Apr 2016 07:44:04 +0000 (09:44 +0200)
The reason for this is to fix the automatic rebuild of libvirt-common.h.in.
All *.in files should be automatically rebuilt each time they're modified.
It works well for makefiles and pkgconfig files, since they do have a valid
dependency in the top-level Makefile. However, with libvirt-common.h.in
there is no dependency in the top-level Makefile and there's no need for it
either, so this rule

include/libvirt/libvirt-common.h: $(top_builddir)/config.status \
        $(top_srcdir)/include/libvirt/libvirt-common.h.in
    cd $(top_builddir) && $(SHELL) ./config.status $@

is never hit and should be moved to include/Makefile, but that's automake's
job. According to GNU automake docs:

"Files created by AC_CONFIG_FILES, be they
Automake Makefiles or not, are all removed by ‘make distclean’. Their inputs
are automatically distributed, unless they are the output of prior
AC_CONFIG_FILES commands. Finally, rebuild rules are generated in the Automake
Makefile existing in the subdirectory of the output file, if there is one, or
in the top-level Makefile otherwise."

Which means that if we want to have the rule for libvirt-common.h automatically
generated by automake, the include/Makefile.am needs to be moved into libvirt/
subdirectory and $SUBDIRS in the top-level Makefile need to be adjusted as
well. This patch moves Makefile.am from include/ to include/libvirt, adjusting
the prefixes accordingly as well as updates the top-level Makefile $SUBDIRS to
properly hint automake to generate all rules at proper places.

Best way to see the changes, use -M with 'git show'.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Makefile.am
configure.ac
include/Makefile.am [deleted file]
include/libvirt/Makefile.am [new file with mode: 0644]

index ffe051793ad060f9031256871a2dd71c28fe72f9..92980824e7c852472f6c2c83272848a94fff1548 100644 (file)
@@ -19,7 +19,7 @@
 LCOV = lcov
 GENHTML = genhtml
 
-SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \
+SUBDIRS = . gnulib/lib include/libvirt src daemon tools docs gnulib/tests \
   tests po examples
 
 ACLOCAL_AMFLAGS = -I m4
index b1500f60bc5da3a99c48cc30651ecc1129f4847d..80e720a0f2030a79a472cb97cf2e79b5575442f4 100644 (file)
@@ -2757,7 +2757,7 @@ AC_DEFINE_UNQUOTED([base64_encode_alloc],[libvirt_gl_base64_encode_alloc],[Hack
 AC_CONFIG_FILES([run],
                 [chmod +x,-w run])
 AC_CONFIG_FILES([\
-        Makefile src/Makefile include/Makefile docs/Makefile \
+        Makefile src/Makefile include/libvirt/Makefile docs/Makefile \
         gnulib/lib/Makefile \
         gnulib/tests/Makefile \
         libvirt.pc \
diff --git a/include/Makefile.am b/include/Makefile.am
deleted file mode 100644 (file)
index dde955e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-## Copyright (C) 2005-2011, 2013-2016 Red Hat, Inc.
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library.  If not, see
-## <http://www.gnu.org/licenses/>.
-
-virincdir = $(includedir)/libvirt
-
-allheaders = $(wildcard $(srcdir)/libvirt/*.h)
-virinc_HEADERS = $(filter-out $(srcdir)/libvirt/libvirt-admin.h \
-                                $(srcdir)/libvirt/libvirt-common.h, $(allheaders))
-virinc_HEADERS += libvirt/libvirt-common.h
-
-EXTRA_DIST = libvirt/libvirt-common.h.in
-
-# Temporarily disabled, but we need it for building
-EXTRA_DIST += libvirt/libvirt-admin.h
-
-install-exec-hook:
-       $(mkinstalldirs) $(DESTDIR)$(virincdir)
diff --git a/include/libvirt/Makefile.am b/include/libvirt/Makefile.am
new file mode 100644 (file)
index 0000000..a59b8ab
--- /dev/null
@@ -0,0 +1,32 @@
+## Process this file with automake to produce Makefile.in
+
+## Copyright (C) 2005-2011, 2013-2016 Red Hat, Inc.
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+virincdir = $(includedir)/libvirt
+
+allheaders = $(wildcard $(srcdir)/*.h)
+virinc_HEADERS = $(filter-out $(srcdir)/libvirt-admin.h \
+                                $(srcdir)/libvirt-common.h, $(allheaders))
+virinc_HEADERS += libvirt-common.h
+
+EXTRA_DIST = libvirt-common.h.in
+
+# Temporarily disabled, but we need it for building
+EXTRA_DIST += libvirt-admin.h
+
+install-exec-hook:
+       $(mkinstalldirs) $(DESTDIR)$(virincdir)