Browse files

build: Add common-rules.mk, common rules for all Makefiles.

This file is mainly a central place to:

 - include localenv if it exists, and

 - define the RHEL 5 backwards compatibility macros, instead of
   spreading them over every other file.

(cherry picked from commit 49bdaab)
  • Loading branch information...
1 parent 92cf512 commit 7bc67024f0200abf3f267ae582aab5186f4f1b70 @rwmjones rwmjones committed Jun 4, 2013
View
1 Makefile.am
@@ -18,6 +18,7 @@
-include $(top_builddir)/localenv
include $(top_srcdir)/subdir-rules.mk
+include $(top_srcdir)/common-rules.mk
ACLOCAL_AMFLAGS = -I m4
View
3 appliance/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
View
29 common-rules.mk
@@ -0,0 +1,29 @@
+# libguestfs
+# Copyright (C) 2013 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# 'common-rules.mk' should be included in every Makefile.am.
+# cf. 'subdir-rules.mk'
+
+-include $(top_builddir)/localenv
+
+# Old RHEL 5 autoconf defines these, but RHEL 5 automake doesn't
+# create variables for them. So define them here if they're not
+# defined already.
+builddir ?= @builddir@
+abs_builddir ?= @abs_builddir@
+srcdir ?= @srcdir@
+abs_srcdir ?= @abs_srcdir@
View
2 erlang/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
create_disk.erl \
View
2 examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
guestfs-examples.pod \
View
9 generator/Makefile.am
@@ -15,14 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have abs_builddir.
-abs_builddir ?= $(shell pwd)
-
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/generator && pwd)
-
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
+include $(top_srcdir)/subdir-rules.mk
# In alphabetical order.
sources = \
View
9 gobject/docs/Makefile.am
@@ -15,14 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/gobject/docs && pwd)
-
-# Old RHEL 5 autoconf doesn't have abs_builddir.
-abs_builddir ?= $(shell pwd)
+include $(top_srcdir)/subdir-rules.mk
# The name of the module, e.g. 'glib'.
DOC_MODULE=guestfs
View
3 inspector/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
export EXAMPLE_XML = \
View
3 java/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
java_prefix = com/redhat/et/libguestfs
View
2 java/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
CreateDisk.java \
View
2 lua/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
create_disk.lua \
View
6 ocaml/Makefile.am
@@ -15,12 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/ocaml && pwd)
-
include $(top_srcdir)/subdir-rules.mk
generator_built = \
View
2 ocaml/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
create_disk.ml \
View
2 perl/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
create_disk.pl \
View
3 php/Makefile.am
@@ -17,9 +17,6 @@
include $(top_srcdir)/subdir-rules.mk
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/php && pwd)
-
generator_built = \
extension/php_guestfs_php.h \
extension/guestfs_php.c
View
2 po-docs/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
# XXX The use of po4a is naive here. Also we should integrate this
# into the po/ directory and the translations into the usual
# libguestfs.pot file.
View
2 po-docs/ja/Makefile.am
@@ -19,6 +19,8 @@
# identical. If you create a new $lang.po, create the $lang/
# subdirectory and copy the Makefile.am from an existing language.
+include $(top_srcdir)/subdir-rules.mk
+
LINGUA = $(shell basename -- `pwd`)
CLEANFILES = *.1 *.3 stamp-update-po
View
2 po-docs/uk/Makefile.am
@@ -19,6 +19,8 @@
# identical. If you create a new $lang.po, create the $lang/
# subdirectory and copy the Makefile.am from an existing language.
+include $(top_srcdir)/subdir-rules.mk
+
LINGUA = $(shell basename -- `pwd`)
CLEANFILES = *.1 *.3 stamp-update-po
View
3 po/Makefile.am
@@ -17,9 +17,6 @@
include $(top_srcdir)/subdir-rules.mk
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/po && pwd)
-
DOMAIN = $(PACKAGE_NAME)
COPYRIGHT_HOLDER = Red Hat Inc.
MSGID_BUGS_ADDRESS = https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
View
3 python/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
generator_built = \
View
2 python/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
create_disk.py \
View
6 resize/Makefile.am
@@ -15,12 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/resize && pwd)
-
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
View
3 ruby/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
generator_built = \
View
2 ruby/examples/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/subdir-rules.mk
+
EXTRA_DIST = \
LICENSE \
create_disk.rb \
View
6 sparsify/Makefile.am
@@ -17,12 +17,6 @@
include $(top_srcdir)/subdir-rules.mk
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/sparsify && pwd)
-
EXTRA_DIST = \
$(SOURCES) \
virt-sparsify.pod \
View
2 subdir-rules.mk
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+include $(top_srcdir)/common-rules.mk
+
# Define a force dependency which will always be rebuilt
.PHONY: force
View
9 sysprep/Makefile.am
@@ -15,15 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/sysprep && pwd)
-
-# Old RHEL 5 autoconf doesn't have abs_builddir.
-abs_builddir ?= $(shell pwd)
-
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
View
3 tests/data/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
View
3 tests/guests/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have builddir.
-builddir ?= .
-
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
View
3 tests/xml/Makefile.am
@@ -15,9 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-# Old RHEL 5 autoconf doesn't have abs_srcdir.
-abs_srcdir ?= $(shell cd $(top_srcdir)/tests/xml && pwd)
-
include $(top_srcdir)/subdir-rules.mk
if HAVE_LIBVIRT

0 comments on commit 7bc6702

Please sign in to comment.