2011-10-06 11:46:31 +03:00
# stage 4: dive into mkimage
2010-12-03 16:53:02 +02:00
2011-10-06 11:46:31 +03:00
GLOBAL_BUILDDIR ?= $( shell pwd )
2011-11-05 11:03:48 +02:00
CURRENT_LINK := mkimage-profiles
OUT_LINK := out
2011-06-12 18:06:36 +03:00
2011-10-06 11:46:31 +03:00
i n c l u d e d i s t c f g . m k
2010-08-28 19:28:42 +03:00
i n c l u d e f u n c t i o n s . m k
2010-09-27 22:02:57 +03:00
i n c l u d e $( MKIMAGE_PREFIX ) / c o n f i g . m k
2010-08-28 19:28:42 +03:00
2011-10-06 11:46:31 +03:00
# reconstruct instead of passing yet another variable
2011-11-05 11:03:48 +02:00
IMAGE_LINK := $( IMAGE_NAME) .$( IMAGE_TYPE)
2011-10-06 11:46:31 +03:00
IMAGE_OUTFILE := $( IMAGE_NAME) -$( DATE) -$( ARCH) .$( IMAGE_TYPE)
MKI_PACK_RESULTS = $( IMAGE_PACKTYPE) :$( IMAGE_OUTFILE)
2010-08-28 19:28:42 +03:00
2011-10-06 11:46:31 +03:00
# these get opied over as is
2010-09-09 12:50:29 +03:00
COPY_TREE = ./files
2010-08-28 19:28:42 +03:00
2011-05-11 23:40:47 +04:00
# outdir shouldn't be wiped clean before use
2011-06-14 18:25:55 +04:00
CLEANUP_OUTDIR ?=
2011-05-11 23:40:47 +04:00
2011-11-04 00:14:18 +02:00
GLOBAL_HSH_APT_CONFIG := $( wildcard $( APTCONF) )
2010-09-27 22:02:57 +03:00
2011-10-06 11:46:31 +03:00
# the lib/build-*.mk comes from features.in/build-*/lib
i n c l u d e l i b / * . m k
2010-09-08 15:47:06 +03:00
i n c l u d e $( MKIMAGE_PREFIX ) / t a r g e t s . m k
2010-08-28 19:28:42 +03:00
2011-10-06 11:46:31 +03:00
# specified only for the final image (target-specific)
pack-image : OUTDIR = $( IMAGEDIR )
pack-image : $( IMAGEDIR )
2011-07-15 00:00:46 +03:00
2011-05-11 23:40:47 +04:00
$(IMAGEDIR) :
2011-09-03 12:34:53 +03:00
@mkdir -p " $( IMAGEDIR) "
2011-05-11 23:40:47 +04:00
2011-10-06 11:46:31 +03:00
postprocess :
@OUTPATH= " $( IMAGEDIR) / $( IMAGE_OUTFILE) " ; \
2011-11-04 20:44:25 +02:00
echo " ** image: $$ OUTPATH " >& 2 && \
2011-11-05 11:03:48 +02:00
ln -sf " $( IMAGE_OUTFILE) " " $( IMAGEDIR) / $( IMAGE_LINK) " && \
ln -sf " $$ {IMAGEDIR#`pwd`/} " " $( OUT_LINK) " ; \
ln -sf " $( IMAGE_LINK) " $( OUT_LINK) /" $( CURRENT_LINK) . $( IMAGE_TYPE) " ; \
2011-10-06 11:46:31 +03:00
if [ -n " $( GLOBAL_DEBUG) " ] ; then \
cp -a build.log " $$ OUTPATH.log " ; \
cp -a distcfg.mk " $$ OUTPATH.cfg " ; \
fi
2010-09-27 22:02:57 +03:00
debug :
2011-06-14 18:25:55 +04:00
@echo " TOPDIR= $( TOPDIR) "
@echo " ARCH= $( ARCH) "
@echo " GLOBAL_HSH_APT_CONFIG= $( GLOBAL_HSH_APT_CONFIG) "