[Build-common-hackers] Proposals for multi-build
Wed, 23 Jul 2003 14:10:16 -0700
I've been thinking about the multi build again.
I think I've reduced it into a series of problems. The first of which
is that we don't have an adequeate way of using a base variable usually,
and a specific variable only when needed. This little bit of code
should demonstrate what I mean and provide what I think is an adequeate
all: a b c
cdbs_curpkg = $(filter-out %/,$(subst /,/ ,$@))
cdbs_localval = $(if $($(1)_$(cdbs_curpkg)),"$($(1)_$(cdbs_curpkg))","$($(1))")
foo = foo
foo_b = foo_b
@echo a $(call cdbs_localval,foo)
@echo b $(call cdbs_localval,foo)
@echo c $(call cdbs_localval,foo)
.PHONY: a b c all
My initial proposal is that all of our variable access switch to using
this syntax where it's reasonable that the caller might either user foo
The next proposal is much more complicated.
I've approached this with the thought I wanted to see what the
multi-build setup would look like. I think, based on our earlier
conversations, that I'd like to see this:
Right now we do all of our building in the common hooks. This is
suboptimal in that we have no per-package flexibility.
I'm assuming here that all builds define DEB_BUILD_MULTI. If the user
doesn't specify it, then we just fille it with the name of the first
package and proceed.
To handle this, then, a rule from makefile.mk might look like this right
common-build-arch common-build-indep:: common-build-impl
and instead it could look like this:
DEB_BUILD_makefile = $(DEB_BUILD_MULTI)
$(call cdbs_localval,DEB_MAKE_INVOKE) $(call cdbs_localval,DEB_MAKE_BUILD_TARGET)
I think that doing it this way means that the multi-build stuff will
work without any changes to the buildcore.mk file. We're *already*
calling these targets. The only issue then is that we don't run a make
clean between runs, so they need to do VPATH builds. This is probably
solvable somehow, too, but I haven't thought about it.
Any comments? If this looks good, I can dig in on it.
Breathe into my hands, I'll cup them like a glass to drink from...
- Tattle Tale