2019-07-17 21:32:28 +03:00
i f n e q ( c l e a n , $( MAKECMDGOALS ) )
i f n e q ( d i s t c l e a n , $( MAKECMDGOALS ) )
2019-07-18 19:03:09 +03:00
i f n d e f I N C L U D E D _ F U N C T I O N S _ M K
INCLUDED_FUNCTIONS_MK = 1
2011-10-06 12:46:31 +04:00
# globals
2016-04-07 17:04:49 +03:00
PKGDIR ?= $( GLOBAL_BUILDDIR) /pkg
2011-10-21 20:14:02 +04:00
2011-12-30 14:46:58 +04:00
# duplicated from metaprofile makefiles for the sake of "local" builds
2019-07-09 12:30:26 +03:00
ARCH ?= $( shell arch | sed 's/i686/i586/; s/armv.*/arm/' )
2011-10-06 12:46:31 +04:00
DATE ?= $( shell date +%Y%m%d)
2010-08-28 20:28:42 +04:00
2012-05-08 18:59:57 +04:00
# prefix pkglist name with its directory to form a path (relative/absolute)
rlist = $( 1:%= lists/%)
list = $( addprefix $( PKGDIR) /,$( call rlist,$( 1) ) )
2010-08-28 20:28:42 +04:00
2012-05-08 18:59:57 +04:00
# prefix/suffix group name to form a path (relative/absolute)
rgroup = $( 1:%= groups/%.directory)
group = $( addprefix $( PKGDIR) /,$( call rgroup,$( 1) ) )
2010-10-29 13:11:03 +04:00
2016-03-25 13:49:13 +03:00
# prefix/suffix pkg profile name to form a path (relative/absolute)
rprofile = $( 1:%= profiles/%.directory)
profile = $( addprefix $( PKGDIR) /,$( call rprofile,$( 1) ) )
2010-10-29 13:11:03 +04:00
# map first argument (a function) onto second one (an argument list)
map = $( foreach a,$( 2) ,$( call $( 1) ,$( a) ) )
2016-04-07 17:04:49 +03:00
# happens at least twice, and variables are the same by design
groups2lists = $( shell $( groups2lists_body) )
d e f i n e g r o u p s 2 l i s t s _ b o d y
{ i f [ - n "$(THE_GROUPS)$(MAIN_GROUPS)" ] ; t h e n \
sed -rn 's,^X-Alterator-PackageList=(.*)$$,\1,p' \
$( call map,group,$( THE_GROUPS) $( MAIN_GROUPS) ) ; \
f i ; }
e n d e f
2010-10-29 13:11:03 +04:00
# kernel package list generation; see also #24669
NULL :=
SPACE := $( NULL) # the officially documented way of getting a space
2012-05-21 18:33:39 +04:00
COMMA := ,
2011-10-06 12:46:31 +04:00
2010-10-29 13:11:03 +04:00
list2re = $( subst $( SPACE) ,| ,$( strip $( 1) ) )
2012-04-25 15:18:23 +04:00
2014-09-18 20:08:08 +04:00
# args: KFLAVOURS, KMODULES
# NB: $(2) could be empty
kpackages = $( and $( 1) , \
^kernel-( image| modules-( $( call list2re,$( 2) ) ) ) -( $( call list2re,$( 1) ) ) $$ )
2012-04-25 15:18:23 +04:00
# arg: branding subpackages
2012-06-13 23:07:10 +04:00
branding = $( and $( 1) ,^branding-$( BRANDING) -( $( call list2re,$( 1) ) ) $$ )
2019-07-17 21:32:28 +03:00
e n d i f
e n d i f
2019-07-18 19:03:09 +03:00
e n d i f