mkbuild

mk based build system
git clone git://git.2f30.org/mkbuild
Log | Files | Refs | LICENSE

mk.3rdparty (1238B)


      1 <$mkbuild/mk.config
      2 
      3 all:QV: build
      4 
      5 build:QV: fetch patch
      6 	mkdir -p $src
      7 	oldpwd=`pwd`
      8 	cd $src
      9 	for f in $mkfile; do
     10 		cachefile=$oldpwd/.cache-`basename $f`
     11 		t=$(cmp -s $f $cachefile || echo $?)
     12 		if test "$t" != ""; then
     13 			if test "${targ}" != ""; then
     14 				env -i PATH="$PATH" configmk="$configmk" mkbuild="$mkbuild" mk -f $f TARG="${targ}"
     15 			else
     16 				env -i PATH="$PATH" configmk="$configmk" mkbuild="$mkbuild" mk -f $f
     17 			fi
     18 			cp $f $cachefile
     19 		fi
     20 	done
     21 
     22 patch:QV: fetch
     23 	mkdir -p $src
     24 	cd $src
     25 	n=1
     26 	for p in $patches; do
     27 		if test "$p" = "0"; then
     28 			n=0
     29 		else
     30 			patch -p$n < $p
     31 			n=1
     32 		fi
     33 	done
     34 
     35 install:QV: all
     36 	cd $src
     37 	for f in $mkfile; do
     38 		if test "${targ}" != ""; then
     39 			env -i PATH="$PATH" configmk="$configmk" mkbuild="$mkbuild" mk -f $f install TARG="${targ}" ROOT="${ROOT}"
     40 		else
     41 			env -i PATH="$PATH" configmk="$configmk" mkbuild="$mkbuild" mk -f $f install ROOT="${ROOT}"
     42 		fi
     43 	done
     44 
     45 clean:QV:
     46 	oldpwd=`pwd`
     47 	if test -d $src; then
     48 		cd $src
     49 		for f in $mkfile; do
     50 			rm -f $oldpwd/.cache-`basename $f`
     51 			env -i PATH="$PATH" configmk="$configmk" mkbuild="$mkbuild" mk -f $f clean
     52 		done
     53 	fi
     54 
     55 distclean:QV:
     56 	if test -d $src; then
     57 		echo rm -rf $src
     58 		rm -rf $src
     59 	fi
     60 
     61 <$mkbuild/mk.fetch
     62 <$mkbuild/mk.package