Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Neumann <s.neumann@raumfeld.com>
To: buildroot@busybox.net
Subject: [Buildroot] Please help with pkg infrastructure
Date: Mon, 03 Sep 2012 18:17:22 +0200	[thread overview]
Message-ID: <1346689042.29515.6.camel@sven> (raw)

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

             reply	other threads:[~2012-09-03 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 16:17 Sven Neumann [this message]
2012-09-04  5:50 ` [Buildroot] Please help with pkg infrastructure Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346689042.29515.6.camel@sven \
    --to=s.neumann@raumfeld.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox