tAdd build dependency resolution - mkports - recipes for building multiple softwares with mk(1)
 (HTM) git clone git://z3bra.org/mkports
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit d030a5c020b7a05ebfbb31d25363d4fec6567a59
 (DIR) parent a37dba44093064eed66caa71a06f9b6cde4ace6c
 (HTM) Author: z3bra <willyatmailoodotorg>
       Date:   Sat, 23 Jan 2016 14:23:01 +0100
       
       Add build dependency resolution
       
       Pack dependencies are listed in deps.mk
       To build a pack along with its dependencies, run "mk <pack>" from the
       port tree. It will build all the dependencies recursively, and install
       tthem in the $ROOT directory (defaults to the cross-compiler directory).
       Once the pack is build, all dependencies are uninstalled from the $ROOT.
       
       Diffstat:
         M config.mk                           |       1 +
         A deps.mk                             |       5 +++++
         M mkfile                              |       8 +++++++-
       
       3 files changed, 13 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/config.mk b/config.mk
       t@@ -1,6 +1,7 @@
        CROSS  = /opt/cross/x86_64
        PATH   = ${CROSS}/bin:${PATH}
        TOOLCHAIN_TRIPLET = x86_64-linux-musl
       +ROOT = ${CROSS}/${TOOLCHAIN_TRIPLET}
        NPROC = 4
        
        CC = ${TOOLCHAIN_TRIPLET}-gcc
 (DIR) diff --git a/deps.mk b/deps.mk
       t@@ -0,0 +1,5 @@
       +curl:V: libressl
       +git:V: libz
       +libmpfr:V: libgmp
       +libmpc:V: libgmp libmpfr
       +libarchive:V: libz bzip2 gzip
 (DIR) diff --git a/mkfile b/mkfile
       t@@ -1,4 +1,7 @@
       -ALL = `{ls | grep -vP 'config.mk|default.mk|mkfile'}
       +ALL = `{ls | grep -vP '[a-z]*\.mk|mkfile'}
       +
       +<config.mk
       +<deps.mk
        
        default:QV:
                echo "no default rule."
       t@@ -14,9 +17,12 @@ all:QV: ${ALL}
        # the recipe will be executed one more time for the fake
        # target "command line arguments"
        %:V:
       +        for d in $prereq; do pm -af $d/$d#*.tar.bz2; done
                cd $stem
                env -i PATH=$PATH mk
                env -i PATH=$PATH mk clean
       +        for d in $prereq; do pm -d $d; done
       +
        
        clean:QV:
                for p in ${ALL}; do (cd $p; mk clean); done