r18712 - in /desktop/unstable/pango1.0/debian: changelog rules
lool at users.alioth.debian.org
lool at users.alioth.debian.org
Thu Mar 5 13:52:45 UTC 2009
Author: lool
Date: Thu Mar 5 13:52:45 2009
New Revision: 18712
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=18712
Log:
* Rework flavor-specific vars.
- Introduce $(flavor) which is set to $* to clarify implicit rules.
- Rename common_configure_flags to configure_flags.
- Introduce the flavor_get macro to use a flavor specific override or
fallback to the common defaults for make vars.
- Use $(call flavor_get, ) to retrieve configure_flags, CFLAGS, and
LDFLAGS allowing to override these per flavor; for example:
"udeb_CFLAGS = $(CFLAGS) -Os".
Modified:
desktop/unstable/pango1.0/debian/changelog
desktop/unstable/pango1.0/debian/rules
Modified: desktop/unstable/pango1.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pango1.0/debian/changelog?rev=18712&op=diff
==============================================================================
--- desktop/unstable/pango1.0/debian/changelog (original)
+++ desktop/unstable/pango1.0/debian/changelog Thu Mar 5 13:52:45 2009
@@ -2,6 +2,14 @@
* Drop useless --disable-static and --enable-shared flags to simplify
configure flags.
+ * Rework flavor-specific vars.
+ - Introduce $(flavor) which is set to $* to clarify implicit rules.
+ - Rename common_configure_flags to configure_flags.
+ - Introduce the flavor_get macro to use a flavor specific override or
+ fallback to the common defaults for make vars.
+ - Use $(call flavor_get, ) to retrieve configure_flags, CFLAGS, and
+ LDFLAGS allowing to override these per flavor; for example:
+ "udeb_CFLAGS = $(CFLAGS) -Os".
-- Loic Minier <lool at dooz.org> Thu, 05 Mar 2009 12:07:11 +0100
Modified: desktop/unstable/pango1.0/debian/rules
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pango1.0/debian/rules?rev=18712&op=diff
==============================================================================
--- desktop/unstable/pango1.0/debian/rules (original)
+++ desktop/unstable/pango1.0/debian/rules Thu Mar 5 13:52:45 2009
@@ -18,8 +18,10 @@
DEB_BUILD_OPTIONS_PARALLEL ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += $(if $(DEB_BUILD_OPTIONS_PARALLEL),-j$(DEB_BUILD_OPTIONS_PARALLEL))
+# default CFLAGS; these can be expanded with $(call flavor_get, )
CFLAGS += -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2)
+# default LDFLAGS; these can be expanded with $(call flavor_get, )
# Ensure the build aborts when there are still references to undefined
# symbols
LDFLAGS += -Wl,-z,defs
@@ -78,37 +80,47 @@
# list of flavors to run the test suite on
CHECK_FLAVORS := $(filter shared, $(FLAVORS))
+# current flavor we're building; this is only expanded in flavor specific
+# targets
+current_flavor = $*
+
+# macro to get a value for the current flavor we're building; for example
+# when building the shared flavor, $(call flavor_get,CFLAGS) will expand to
+# shared_CFLAGS if it's set or to CFLAGS otherwise; pay attention to not adding
+# superfluous spaces when for the arguments of $(call ); only some vars can
+# be expanded in this way though
+flavor_get = $(or $($(current_flavor)_$(1)),$($(1)))
+
# build dir for the current flavor; this is only expanded in flavor specific
# targets
-builddir = $(buildbasedir)/$*
+builddir = $(buildbasedir)/$(current_flavor)
buildbasedir = $(CURDIR)/debian/build
# install dir for the current flavor; this is only expanded in flavor specific
# targets
-installdir = $(installbasedir)/$*
+installdir = $(installbasedir)/$(current_flavor)
installbasedir = $(CURDIR)/debian/install
-# configure flags
-common_configure_flags := \
- --prefix=/usr \
- --libdir=/$(LIBDIR) \
- --mandir=\$${prefix}/share/man \
- --infodir=\$${prefix}/share/info \
- --with-html-dir=\$${prefix}/share/doc/$(DOC_PKG) \
- --sysconfdir=/etc \
- --build=$(DEB_BUILD_GNU_TYPE)
+# configure flags; these can be expanded with $(call flavor_get, )
+configure_flags := \
+ --prefix=/usr \
+ --libdir=/$(LIBDIR) \
+ --mandir=\$${prefix}/share/man \
+ --infodir=\$${prefix}/share/info \
+ --with-html-dir=\$${prefix}/share/doc/$(DOC_PKG) \
+ --sysconfdir=/etc \
+ --build=$(DEB_BUILD_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
- common_configure_flags += --host=$(DEB_HOST_GNU_TYPE)
+ configure_flags += --host=$(DEB_HOST_GNU_TYPE)
endif
# default is to enable shared and disable static
-shared_configure_flags := $(common_configure_flags)
-static_configure_flags := $(common_configure_flags) \
+static_configure_flags := $(configure_flags) \
--disable-shared \
--with-included-modules \
--enable-static
-udeb_configure_flags := $(common_configure_flags) \
+udeb_configure_flags := $(configure_flags) \
--without-x \
--disable-debug
@@ -140,8 +152,9 @@
dh_testdir
mkdir -p $(builddir)
cd $(builddir) && \
- CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
- $(CURDIR)/configure $($*_configure_flags)
+ CFLAGS="$(call flavor_get,CFLAGS)" \
+ LDFLAGS="$(call flavor_get,LDFLAGS)" \
+ $(CURDIR)/configure $(call flavor_get,configure_flags)
touch $@
configure: $(addprefix $(STAMP_DIR)/configure-stamp-, $(FLAVORS))
More information about the pkg-gnome-commits
mailing list