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.
This commit is contained in:
Richard W.M. Jones
2013-06-04 11:52:18 +01:00
parent 76321709d6
commit 49bdaabc7d
30 changed files with 58 additions and 75 deletions

View File

@@ -15,8 +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.
-include $(top_builddir)/localenv
include $(top_srcdir)/common-rules.mk
ACLOCAL_AMFLAGS = -I m4

View File

@@ -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 = \

29
common-rules.mk Normal file
View File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -15,6 +15,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# subdir-rules.mk should be included in every *subdirectory* Makefile.am.
include $(top_srcdir)/common-rules.mk
# Individual Makefile.am's should define generator_built if that
# subdirectory contains any files which are built by the generator.
# Set generator_built to the list of those files.

View File

@@ -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 File

@@ -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 File

@@ -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 File

@@ -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