[Build-common-hackers] cdbs v2 buildcore.mk idea

Chris Cheney ccheney@cheney.cx
Sat, 15 Nov 2003 01:15:42 -0600


--z9U9oWULJx7fFSwf
Content-Type: multipart/mixed; boundary="iGS4/Q/M16VRPju2"
Content-Disposition: inline


--iGS4/Q/M16VRPju2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Here is my idea of a restructuring of buildcore.mk.in for cdbs v2.

Any comments?

Chris Cheney

--iGS4/Q/M16VRPju2
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="buildcore.mk.in.2"
Content-Transfer-Encoding: quoted-printable

# -*- mode: makefile; coding: utf-8 -*-
# Copyright =A9 2002,2003 Colin Walters <walters@debian.org>
# Description: Defines the rule framework
#
# 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, 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., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.

ifndef _cdbs_bootstrap
_cdbs_scripts_path ?=3D /usr/lib/cdbs
_cdbs_rules_path ?=3D /usr/share/cdbs/1/rules
_cdbs_class_path ?=3D /usr/share/cdbs/1/class
endif

ifndef _cdbs_rules_buildcore
_cdbs_rules_buildcore :=3D 1

include $(_cdbs_rules_path)/buildvars.mk$(_cdbs_makefile_suffix)


#
# testdir/testroot
#
testdir:
	@echo "testdir"
	@test -x debian/rules

testroot:
	@echo testroot
	@test "`id -u`" =3D 0

#
# Here are the clean targets.
#
buildcore-clean-prehook-arch:: testdir testroot stamp-buildcore-clean-preho=
ok-arch
stamp-buildcore-clean-prehook-arch:
buildcore-clean-prehook-indep:: testdir testroot stamp-buildcore-clean-preh=
ook-indep
stamp-buildcore-clean-prehook-indep:

$(patsubst %,buildcore-clean-prehook-%,$(DEB_ARCH_PACKAGES)) :: buildcore-c=
lean-prehook-% : buildcore-clean-prehook-arch stamp-buildcore-clean-prehook=
-%
$(patsubst %,stamp-buildcore-clean-prehook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-clean-prehook-%,$(DEB_INDEP_PACKAGES)) :: buildcore-=
clean-prehook-% : buildcore-clean-prehook-indep stamp-buildcore-clean-preho=
ok-%
$(patsubst %,stamp-buildcore-clean-prehook-%,$(DEB_INDEP_PACKAGES)):

buildcore-clean-arch:: buildcore-clean-prehook-arch $(patsubst %,buildcore-=
clean-prehook-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-clean-arch
stamp-buildcore-clean-arch:
buildcore-clean-indep:: buildcore-clean-prehook-indep $(patsubst %,buildcor=
e-clean-prehook-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-clean-indep
stamp-buildcore-clean-indep:

$(patsubst %,buildcore-clean-%,$(DEB_ARCH_PACKAGES)) :: buildcore-clean-% :=
 buildcore-clean-arch stamp-buildcore-clean-%
$(patsubst %,stamp-buildcore-clean-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-clean-%,$(DEB_INDEP_PACKAGES)) :: buildcore-clean-% =
: buildcore-clean-indep stamp-buildcore-clean-%
$(patsubst %,stamp-buildcore-clean-%,$(DEB_INDEP_PACKAGES)):

buildcore-clean-posthook-arch:: buildcore-clean-arch $(patsubst %,buildcore=
-clean-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-clean-posthook-arch
stamp-buildcore-clean-posthook-arch:
buildcore-clean-posthook-indep:: buildcore-clean-indep $(patsubst %,buildco=
re-clean-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-clean-posthook-indep
stamp-buildcore-clean-posthook-indep:

$(patsubst %,buildcore-clean-posthook-%,$(DEB_ARCH_PACKAGES)) :: buildcore-=
clean-posthook-% : buildcore-clean-posthook-arch stamp-buildcore-clean-post=
hook-%
$(patsubst %,stamp-buildcore-clean-posthook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-clean-posthook-%,$(DEB_INDEP_PACKAGES)) :: buildcore=
-clean-posthook-% : buildcore-clean-posthook-indep stamp-buildcore-clean-po=
sthook-%
$(patsubst %,stamp-buildcore-clean-posthook-%,$(DEB_INDEP_PACKAGES)):

clean-arch: buildcore-clean-posthook-arch $(patsubst %,buildcore-clean-post=
hook-%,$(DEB_ARCH_PACKAGES))
clean-indep: buildcore-clean-posthook-indep $(patsubst %,buildcore-clean-po=
sthook-%,$(DEB_INDEP_PACKAGES))

clean: clean-arch clean-indep


#
# Here are the configure targets.
#
buildcore-configure-prehook-arch:: testdir stamp-buildcore-configure-prehoo=
k-arch
stamp-buildcore-configure-prehook-arch:
buildcore-configure-prehook-indep:: testdir stamp-buildcore-configure-preho=
ok-indep
stamp-buildcore-configure-prehook-indep:

$(patsubst %,buildcore-configure-prehook-%,$(DEB_ARCH_PACKAGES)) :: buildco=
re-configure-prehook-% : buildcore-configure-prehook-arch stamp-buildcore-c=
onfigure-prehook-%
$(patsubst %,stamp-buildcore-configure-prehook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-configure-prehook-%,$(DEB_INDEP_PACKAGES)) :: buildc=
ore-configure-prehook-% : buildcore-configure-prehook-indep stamp-buildcore=
-configure-prehook-%
$(patsubst %,stamp-buildcore-configure-prehook-%,$(DEB_INDEP_PACKAGES)):

buildcore-configure-arch:: buildcore-configure-prehook-arch $(patsubst %,bu=
ildcore-configure-prehook-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-configure=
-arch
stamp-buildcore-configure-arch:
buildcore-configure-indep:: buildcore-configure-prehook-indep $(patsubst %,=
buildcore-configure-prehook-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-config=
ure-indep
stamp-buildcore-configure-indep:

$(patsubst %,buildcore-configure-%,$(DEB_ARCH_PACKAGES)) :: buildcore-confi=
gure-% : buildcore-configure-arch stamp-buildcore-configure-%
$(patsubst %,stamp-buildcore-configure-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-configure-%,$(DEB_INDEP_PACKAGES)) :: buildcore-conf=
igure-% : buildcore-configure-indep stamp-buildcore-configure-%
$(patsubst %,stamp-buildcore-configure-%,$(DEB_INDEP_PACKAGES)):

buildcore-configure-posthook-arch:: buildcore-configure-arch $(patsubst %,b=
uildcore-configure-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-configure-postho=
ok-arch
stamp-buildcore-configure-posthook-arch:
buildcore-configure-posthook-indep:: buildcore-configure-indep $(patsubst %=
,buildcore-configure-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-configure-pos=
thook-indep
stamp-buildcore-configure-posthook-indep:

$(patsubst %,buildcore-configure-posthook-%,$(DEB_ARCH_PACKAGES)) :: buildc=
ore-configure-posthook-% : buildcore-configure-posthook-arch stamp-buildcor=
e-configure-posthook-%
$(patsubst %,stamp-buildcore-configure-posthook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-configure-posthook-%,$(DEB_INDEP_PACKAGES)) :: build=
core-configure-posthook-% : buildcore-configure-posthook-indep stamp-buildc=
ore-configure-posthook-%
$(patsubst %,stamp-buildcore-configure-posthook-%,$(DEB_INDEP_PACKAGES)):

configure-arch: buildcore-configure-posthook-arch $(patsubst %,buildcore-co=
nfigure-posthook-%,$(DEB_ARCH_PACKAGES))
configure-indep: buildcore-configure-posthook-indep $(patsubst %,buildcore-=
configure-posthook-%,$(DEB_INDEP_PACKAGES))

configure: configure-arch configure-indep


#
# Here are the build targets.
#
buildcore-build-prehook-arch:: configure-arch stamp-buildcore-build-prehook=
-arch
stamp-buildcore-build-prehook-arch:
buildcore-build-prehook-indep:: configure-indep stamp-buildcore-build-preho=
ok-indep
stamp-buildcore-build-prehook-indep:

$(patsubst %,buildcore-build-prehook-%,$(DEB_ARCH_PACKAGES)) :: buildcore-b=
uild-prehook-% : buildcore-build-prehook-arch stamp-buildcore-build-prehook=
-%
$(patsubst %,stamp-buildcore-build-prehook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-build-prehook-%,$(DEB_INDEP_PACKAGES)) :: buildcore-=
build-prehook-% : buildcore-build-prehook-indep stamp-buildcore-build-preho=
ok-%
$(patsubst %,stamp-buildcore-build-prehook-%,$(DEB_INDEP_PACKAGES)):

buildcore-build-arch:: buildcore-build-prehook-arch $(patsubst %,buildcore-=
build-prehook-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-build-arch
stamp-buildcore-build-arch:
buildcore-build-indep:: buildcore-build-prehook-indep $(patsubst %,buildcor=
e-build-prehook-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-build-indep
stamp-buildcore-build-indep:

$(patsubst %,buildcore-build-%,$(DEB_ARCH_PACKAGES)) :: buildcore-build-% :=
 buildcore-build-arch stamp-buildcore-build-%
$(patsubst %,stamp-buildcore-build-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-build-%,$(DEB_INDEP_PACKAGES)) :: buildcore-build-% =
: buildcore-build-indep stamp-buildcore-build-%
$(patsubst %,stamp-buildcore-build-%,$(DEB_INDEP_PACKAGES)):

buildcore-build-posthook-arch:: buildcore-build-arch $(patsubst %,buildcore=
-build-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-build-posthook-arch
stamp-buildcore-build-posthook-arch:
buildcore-build-posthook-indep:: buildcore-build-indep $(patsubst %,buildco=
re-build-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-build-posthook-indep
stamp-buildcore-build-posthook-indep:

$(patsubst %,buildcore-build-posthook-%,$(DEB_ARCH_PACKAGES)) :: buildcore-=
build-posthook-% : buildcore-build-posthook-arch stamp-buildcore-build-post=
hook-%
$(patsubst %,stamp-buildcore-build-posthook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-build-posthook-%,$(DEB_INDEP_PACKAGES)) :: buildcore=
-build-posthook-% : buildcore-build-posthook-indep stamp-buildcore-build-po=
sthook-%
$(patsubst %,stamp-buildcore-build-posthook-%,$(DEB_INDEP_PACKAGES)):

build-arch: buildcore-build-posthook-arch $(patsubst %,buildcore-build-post=
hook-%,$(DEB_ARCH_PACKAGES))
build-indep: buildcore-build-posthook-indep $(patsubst %,buildcore-build-po=
sthook-%,$(DEB_INDEP_PACKAGES))

build: build-arch build-indep


#
# Here are the install targets.
#
buildcore-install-prehook-arch:: testroot build-arch stamp-buildcore-instal=
l-prehook-arch
stamp-buildcore-install-prehook-arch:
buildcore-install-prehook-indep:: testroot build-indep stamp-buildcore-inst=
all-prehook-indep
stamp-buildcore-install-prehook-indep:

$(patsubst %,buildcore-install-prehook-%,$(DEB_ARCH_PACKAGES)) :: buildcore=
-install-prehook-% : buildcore-install-prehook-arch stamp-buildcore-install=
-prehook-%
$(patsubst %,stamp-buildcore-install-prehook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-install-prehook-%,$(DEB_INDEP_PACKAGES)) :: buildcor=
e-install-prehook-% : buildcore-install-prehook-indep stamp-buildcore-insta=
ll-prehook-%
$(patsubst %,stamp-buildcore-install-prehook-%,$(DEB_INDEP_PACKAGES)):

buildcore-install-arch:: buildcore-install-prehook-arch $(patsubst %,buildc=
ore-install-prehook-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-install-arch
stamp-buildcore-install-arch:
buildcore-install-indep:: buildcore-install-prehook-indep $(patsubst %,buil=
dcore-install-prehook-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-install-indep
stamp-buildcore-install-indep:

$(patsubst %,buildcore-install-%,$(DEB_ARCH_PACKAGES)) :: buildcore-install=
-% : buildcore-install-arch stamp-buildcore-install-%
$(patsubst %,stamp-buildcore-install-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-install-%,$(DEB_INDEP_PACKAGES)) :: buildcore-instal=
l-% : buildcore-install-indep stamp-buildcore-install-%
$(patsubst %,stamp-buildcore-install-%,$(DEB_INDEP_PACKAGES)):

buildcore-install-posthook-arch:: buildcore-install-arch $(patsubst %,build=
core-install-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-install-posthook-arch
stamp-buildcore-install-posthook-arch:
buildcore-install-posthook-indep:: buildcore-install-indep $(patsubst %,bui=
ldcore-install-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-install-posthook-in=
dep
stamp-buildcore-install-posthook-indep:

$(patsubst %,buildcore-install-posthook-%,$(DEB_ARCH_PACKAGES)) :: buildcor=
e-install-posthook-% : buildcore-install-posthook-arch stamp-buildcore-inst=
all-posthook-%
$(patsubst %,stamp-buildcore-install-posthook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-install-posthook-%,$(DEB_INDEP_PACKAGES)) :: buildco=
re-install-posthook-% : buildcore-install-posthook-indep stamp-buildcore-in=
stall-posthook-%
$(patsubst %,stamp-buildcore-install-posthook-%,$(DEB_INDEP_PACKAGES)):

install-arch: buildcore-install-posthook-arch $(patsubst %,buildcore-instal=
l-posthook-%,$(DEB_ARCH_PACKAGES))
install-indep: buildcore-install-posthook-indep $(patsubst %,buildcore-inst=
all-posthook-%,$(DEB_INDEP_PACKAGES))

install: install-arch install-indep


#
# Here are the binary targets.
#
buildcore-binary-prehook-arch:: install-arch stamp-buildcore-binary-prehook=
-arch
stamp-buildcore-binary-prehook-arch:
buildcore-binary-prehook-indep:: install-indep stamp-buildcore-binary-preho=
ok-indep
stamp-buildcore-binary-prehook-indep:

$(patsubst %,buildcore-binary-prehook-%,$(DEB_ARCH_PACKAGES)) :: buildcore-=
binary-prehook-% : buildcore-binary-prehook-arch stamp-buildcore-binary-pre=
hook-%
$(patsubst %,stamp-buildcore-binary-prehook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-binary-prehook-%,$(DEB_INDEP_PACKAGES)) :: buildcore=
-binary-prehook-% : buildcore-binary-prehook-indep stamp-buildcore-binary-p=
rehook-%
$(patsubst %,stamp-buildcore-binary-prehook-%,$(DEB_INDEP_PACKAGES)):

buildcore-binary-arch:: buildcore-binary-prehook-arch $(patsubst %,buildcor=
e-binary-prehook-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-binary-arch
stamp-buildcore-binary-arch:
buildcore-binary-indep:: buildcore-binary-prehook-indep $(patsubst %,buildc=
ore-binary-prehook-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-binary-indep
stamp-buildcore-binary-indep:

$(patsubst %,buildcore-binary-%,$(DEB_ARCH_PACKAGES)) :: buildcore-binary-%=
 : buildcore-binary-arch stamp-buildcore-binary-%
$(patsubst %,stamp-buildcore-binary-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-binary-%,$(DEB_INDEP_PACKAGES)) :: buildcore-binary-=
% : buildcore-binary-indep stamp-buildcore-binary-%
$(patsubst %,stamp-buildcore-binary-%,$(DEB_INDEP_PACKAGES)):

buildcore-binary-posthook-arch:: buildcore-binary-arch $(patsubst %,buildco=
re-binary-%,$(DEB_ARCH_PACKAGES)) stamp-buildcore-binary-posthook-arch
stamp-buildcore-binary-posthook-arch:
buildcore-binary-posthook-indep:: buildcore-binary-indep $(patsubst %,build=
core-binary-%,$(DEB_INDEP_PACKAGES)) stamp-buildcore-binary-posthook-indep
stamp-buildcore-binary-posthook-indep:

$(patsubst %,buildcore-binary-posthook-%,$(DEB_ARCH_PACKAGES)) :: buildcore=
-binary-posthook-% : buildcore-binary-posthook-arch stamp-buildcore-binary-=
posthook-%
$(patsubst %,stamp-buildcore-binary-posthook-%,$(DEB_ARCH_PACKAGES)):
$(patsubst %,buildcore-binary-posthook-%,$(DEB_INDEP_PACKAGES)) :: buildcor=
e-binary-posthook-% : buildcore-binary-posthook-indep stamp-buildcore-binar=
y-posthook-%
$(patsubst %,stamp-buildcore-binary-posthook-%,$(DEB_INDEP_PACKAGES)):

binary-arch: buildcore-binary-posthook-arch $(patsubst %,buildcore-binary-p=
osthook-%,$(DEB_ARCH_PACKAGES))
binary-indep: buildcore-binary-posthook-indep $(patsubst %,buildcore-binary=
-posthook-%,$(DEB_INDEP_PACKAGES))

binary: binary-arch binary-indep


#
# Here is the get-orig-source target.
#
get-orig-source:: testdir


#
# .PHONY
#
=2EPHONY: buildcore-clean-prehook-arch buildcore-clean-prehook-indep buildc=
ore-clean-arch buildcore-clean-indep buildcore-clean-posthook-arch buildcor=
e-clean-posthook-indep clean-arch clean-indep clean $(patsubst %,buildcore-=
clean-prehook-%,$(DEB_ALL_PACKAGES)) $(patsubst %,buildcore-clean-%,$(DEB_A=
LL_PACKAGES)) $(patsubst %,buildcore-clean-posthook-%,$(DEB_ALL_PACKAGES))

=2EPHONY: buildcore-configure-prehook-arch buildcore-configure-prehook-inde=
p buildcore-configure-arch buildcore-configure-indep buildcore-configure-po=
sthook-arch buildcore-configure-posthook-indep configure-arch configure-ind=
ep configure $(patsubst %,buildcore-configure-prehook-%,$(DEB_ALL_PACKAGES)=
) $(patsubst %,buildcore-configure-%,$(DEB_ALL_PACKAGES)) $(patsubst %,buil=
dcore-configure-posthook-%,$(DEB_ALL_PACKAGES))

=2EPHONY: buildcore-build-prehook-arch buildcore-build-prehook-indep buildc=
ore-build-arch buildcore-build-indep buildcore-build-posthook-arch buildcor=
e-build-posthook-indep build-arch build-indep build $(patsubst %,buildcore-=
build-prehook-%,$(DEB_ALL_PACKAGES)) $(patsubst %,buildcore-build-%,$(DEB_A=
LL_PACKAGES)) $(patsubst %,buildcore-build-posthook-%,$(DEB_ALL_PACKAGES))

=2EPHONY: buildcore-install-prehook-arch buildcore-install-prehook-indep bu=
ildcore-install-arch buildcore-install-indep buildcore-install-posthook-arc=
h buildcore-install-posthook-indep install-arch install-indep install $(pat=
subst %,buildcore-install-prehook-%,$(DEB_ALL_PACKAGES)) $(patsubst %,build=
core-install-%,$(DEB_ALL_PACKAGES)) $(patsubst %,buildcore-install-posthook=
-%,$(DEB_ALL_PACKAGES))

=2EPHONY: buildcore-binary-prehook-arch buildcore-binary-prehook-indep buil=
dcore-binary-arch buildcore-binary-indep buildcore-binary-posthook-arch bui=
ldcore-binary-posthook-indep binary-arch binary-indep binary $(patsubst %,b=
uildcore-binary-prehook-%,$(DEB_ALL_PACKAGES)) $(patsubst %,buildcore-binar=
y-%,$(DEB_ALL_PACKAGES)) $(patsubst %,buildcore-binary-posthook-%,$(DEB_ALL=
_PACKAGES))

=2EPHONY: $(DEB_PHONY_RULES)

endif

--iGS4/Q/M16VRPju2--

--z9U9oWULJx7fFSwf
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/tdKe0QZas444SvIRAvM2AJ48MfkqiRp/NWyeTxo0IIQxOSnhMACfZZRo
c7m+/pR+MwQVBRWCi73J8YU=
=9wYT
-----END PGP SIGNATURE-----

--z9U9oWULJx7fFSwf--