vp

git clone git://oldgit.suckless.org/vp/
Log | Files | Refs | README

mkfile (696B)


      1 MKSHELL=rc
      2 
      3 MAINSCRIPTS = \
      4 	vp\
      5 	vp-base\
      6 	vp-patterns\
      7 	vp-ytlogin\
      8 
      9 script = <{ls vp-*} <{ls $MAINSCRIPTS}
     10 SUBSCRIPTS = `{eval comm -23 $script}
     11 
     12 SCRIPTS = $MAINSCRIPTS $SUBSCRIPTS
     13 
     14 <config.mk
     15 <`{test -f config.local.mk && echo config.local.mk || echo /dev/null}
     16 
     17 default:V: all
     18 all:V: $SCRIPTS
     19 
     20 install:V: ${SCRIPTS:%=$BIN/%}
     21 
     22 uninstall:V:
     23 	rm -f ${SCRIPTS:%=$BIN/%}
     24 
     25 $BIN/%: %
     26 	cp -f $stem $target
     27 	chmod 0755 $target
     28 
     29 vp-patterns: $SUBSCRIPTS mkfile
     30 	{
     31 		cat <<'!'
     32 		for(s in $SUBSCRIPTS) {
     33 			sed 's,/,\\/,g' $s |
     34 			sed -n 's,.*Pattern: (.*),	/\1/ { print "'$s'"; exits=0; exit },p'
     35 		}
     36 		echo '''}'
     37 	} >$target
     38 	fn vp_findscript {
     39 		echo $* | awk -v 'exits=1' '
     40 		END { exit exits }
     41 	!
     42