2011-05-11 23:40:47 +04:00
# this makefile is designed to be included in toplevel one
2011-06-12 18:06:36 +03:00
i f n d e f B U I L D D I R
$( error BUILDDIR not defined )
e n d i f
2011-05-11 23:40:47 +04:00
2011-07-15 00:00:46 +03:00
export ARCH ?= $( shell arch | sed 's/i686/i586/' )
2010-12-03 16:53:02 +02:00
# step 4 is kicked off here but actually done by image.in/Makefile
#
2010-09-14 13:18:53 +03:00
# adding boot/isolinux to prereqs is too late here,
2010-12-03 16:53:02 +02:00
# since profile/populate target is already done by now
2010-09-27 22:02:57 +03:00
#
# NB: /usr/bin/{i586,x86_64} are setarch(8) symlinks
2010-09-09 12:50:29 +03:00
iso :
2011-05-11 23:40:47 +04:00
@echo -n "** starting image build"
2011-09-14 19:37:29 +03:00
@if [ -n " $( DEBUG) " ] ; then \
2011-06-12 21:27:49 +03:00
echo " : tail -f $( BUILDLOG) " $( SHORTEN) ; \
2011-05-11 23:40:47 +04:00
else \
echo " (coffee time)" ; \
fi
2011-06-12 23:08:42 +03:00
@if time -f "%E %PCPU %Mk" $( ARCH) \
2011-05-11 23:40:47 +04:00
$( MAKE) -C $( BUILDDIR) / GLOBAL_BUILDDIR = $( BUILDDIR) $( LOG) ; \
then \
2011-06-12 21:27:49 +03:00
echo " ** build done (`tail -1 $( BUILDLOG) | cut -f1 -d. \
2011-05-11 23:40:47 +04:00
|| echo "no log" ` ) " ; \
else \
2011-06-12 21:27:49 +03:00
echo " ** build failed, see log: $( BUILDLOG) " $( SHORTEN) ; \
2011-09-14 19:37:29 +03:00
if [ -z " $( DEBUG) " ] ; then \
2011-05-11 23:40:47 +04:00
echo " (you might want to re-run with DEBUG=1)" ; \
fi ; \
2011-06-12 23:08:42 +03:00
tail -100 " $( BUILDLOG) " | egrep "^E:|[Ee]rror|[Ww]arning" ; \
2011-09-14 19:37:29 +03:00
df -P $( BUILDDIR) | awk ' END { if ( $$ 4 < 1024) \
{ print "** NB: low space on " $$ 6" (" $$ 5" used)" } } ' ; \
2011-05-11 23:40:47 +04:00
fi