* [Buildroot] Please help with pkg infrastructure
@ 2012-09-03 16:17 Sven Neumann
2012-09-04 5:50 ` Arnout Vandecappelle
0 siblings, 1 reply; 2+ messages in thread
From: Sven Neumann @ 2012-09-03 16:17 UTC (permalink / raw)
To: buildroot
Hi,
I am trying to simplify our custom buildroot packages that define the
build rules for our internal software packages. So far these packages
duplicate a lot of akward code in their .mk files. I'd like to move this
to a central place. So what I did is to add code like this to
package/raumfeld/raumfeld.mk:
-------------------------------------------------------------------------
################################################################################
# inner-raumfeld-autotools-package
#
# argument 1 is the lowercase package name
# argument 2 is the uppercase package name
# argument 3 is the package directory prefix
################################################################################
define inner-raumfeld-autotools-package
ifndef $(2)_BRANCH
$(2)_BRANCH = $(call qstrip,$(BR2_PACKAGE_RAUMFELD_BRANCH))
endif
ifndef $(2)_MODULE
$(2)_MODULE = $($(1))
endif
ifndef $(2)_VERSION
$(2)_VERSION = $($(2)_BRANCH)
endif
# Call the generic autotools package infrastructure to generate the necessary
# make targets
$(call inner-autotools-package,$(1),$(2),$(2),$(3),target)
################################################################################
# raumfeld-autotools-package
# -- the target generator macro for Raumfeld autotools packages
################################################################################
raumfeld-autotools-package = $(call inner-raumfeld-autotools-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir))
################################################################################
################################################################################
include package/raumfeld/*/*.mk
-------------------------------------------------------------------------
As you can probably guess the idea here is to define PKG_BRANCH, PKG_MODULE
and PKG_VERSION with default values but still leave the possibility to
override these from the respective pkg.mk files.
So what am I doing wrong here, because PKG_VERSION ends up being
"undefined" instead of defaulting to the value of
$BR2_PACKAGE_RAUMFELD_BRANCH ?
Thanks for your help,
Sven
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Buildroot] Please help with pkg infrastructure
2012-09-03 16:17 [Buildroot] Please help with pkg infrastructure Sven Neumann
@ 2012-09-04 5:50 ` Arnout Vandecappelle
0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2012-09-04 5:50 UTC (permalink / raw)
To: buildroot
On 09/03/12 18:17, Sven Neumann wrote:
> So what am I doing wrong here, because PKG_VERSION ends up being
> "undefined" instead of defaulting to the value of
> $BR2_PACKAGE_RAUMFELD_BRANCH ?
>
I don't see anything wrong with your definitions. Try running 'make -p'
and see which _BRANCH symbols are defined.
BTW, if _BRANCH turns out to be an empty string, make interprets that
the same way as undefined. So in that case, the _VERSION can be expected
to de 'undefined'.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-04 5:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03 16:17 [Buildroot] Please help with pkg infrastructure Sven Neumann
2012-09-04 5:50 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox