2011-12-30 14:46:58 +04:00
# umbrella mkimage-profiles makefile:
2012-03-19 15:42:10 +04:00
# iterate over multiple goals/arches,
# collect proceedings
2011-12-30 14:46:58 +04:00
2012-05-19 23:17:41 +04:00
# preferences
- i n c l u d e $( HOME ) / . m k i m a g e / p r o f i l e s . m k
2012-03-19 15:42:10 +04:00
# for immediate assignment
2013-08-05 15:01:19 +04:00
i f n d e f A R C H
ARCH := $( shell arch \
2019-07-09 12:30:26 +03:00
| sed 's/i686/i586/; s/armv7.*/armh/; s/armv.*/arm/' )
2011-11-21 15:42:59 +04:00
e n d i f
2013-08-05 15:01:19 +04:00
i f n d e f A R C H E S
ARCHES := $( ARCH)
2011-10-06 12:46:31 +04:00
e n d i f
2013-08-05 15:01:19 +04:00
export ARCHES ARCH
2011-12-30 14:46:58 +04:00
2012-04-06 21:13:32 +04:00
export PATH := $( CURDIR) /bin:$( PATH)
2012-03-19 15:42:10 +04:00
# supervise target tracing; leave stderr alone
i f d e f R E P O R T
export REPORT_PATH := $( shell mktemp --tmpdir mkimage-profiles.report.XXXXXXX)
2012-04-06 21:13:32 +04:00
POSTPROC := | report-filter > $( REPORT_PATH)
2012-03-19 15:42:10 +04:00
e n d i f
2011-12-30 14:46:58 +04:00
# recursive make considered useful for m-p
2012-03-19 15:42:10 +04:00
MAKE += -r --no-print-directory
2011-12-30 14:46:58 +04:00
2012-07-28 13:26:08 +04:00
DIRECT_TARGETS := help help/distro help/ve help/vm clean distclean check
2012-04-24 12:11:04 +04:00
.PHONY : $( DIRECT_TARGETS )
2013-06-18 00:36:55 +04:00
# these build nothing so no use of reports either
2012-04-24 12:11:04 +04:00
$(DIRECT_TARGETS) :
2013-06-18 00:36:55 +04:00
@$( MAKE) -f main.mk REPORT = $@
2011-12-30 14:46:58 +04:00
export NUM_TARGETS := $( words $( MAKECMDGOALS) )
2012-04-25 17:56:48 +04:00
# for pipefail
SHELL = /bin/bash
2012-07-09 22:31:37 +04:00
# don't even consider remaking a configuration file
.PHONY : $( HOME ) /.mkimage /profiles .mk
2012-01-11 12:41:24 +04:00
# real targets need real work
2011-12-30 14:46:58 +04:00
% :
@n= 1; \
2012-04-25 17:56:48 +04:00
set -o pipefail; \
2012-03-19 15:42:10 +04:00
say( ) { echo " $$ @ " >& 2; } ; \
2011-12-30 14:46:58 +04:00
if [ " $( NUM_TARGETS) " -gt 1 ] ; then \
n = " `echo $( MAKECMDGOALS) \
| tr '[[:space:]]' '\n' \
| grep -nx " $@ " \
| cut -d: -f1` " ; \
2012-03-19 15:42:10 +04:00
say " ** goal: $@ [ $$ n/ $( NUM_TARGETS) ] " ; \
2011-12-30 14:46:58 +04:00
fi ; \
for ARCH in $( ARCHES) ; do \
2015-04-02 20:46:48 +03:00
if [ -z " $( QUIET) " ] ; then \
if [ " $$ ARCH " != " $( firstword $( ARCHES) ) " ] ; then \
say; \
fi ; \
say " ** ARCH: $$ ARCH " ; \
fi ; \
2012-04-23 18:07:39 +04:00
if $( MAKE) -f main.mk ARCH = $$ ARCH $@ $( POSTPROC) ; then \
if [ -n " $$ REPORT " ] ; then \
$( MAKE) -f reports.mk ARCH = $$ ARCH; \
fi ; \
fi ; \
2011-12-30 14:46:58 +04:00
done ; \
2012-03-19 15:42:10 +04:00
if [ " $$ n " -lt " $( NUM_TARGETS) " ] ; then say; fi
2012-11-05 15:08:59 +04:00
docs :
@$( MAKE) -C doc
2014-06-24 14:28:57 +04:00
docs-publish :
@$( MAKE) -C doc publish