# $Id: Makefile,v 2.67 2012/11/12 19:50:52 ksb Exp $ # Build the base tar-blob that all of my tools need --ksb # Find all the level2 products this package incorporates: # $Level2s: %|/##/%J ksh %j %f ##tr -s ' \t' ' ' <$1 | sed -n -e '/^ *#/d' \ ## -e '/^ rcsvg ${VGOPTS} -S $@ `verof` *$/d' \ ## -e 's!^ cd ${MSRC}\([^ ]*\) && rcsvg.*-S $@ *\([A-Za-z0-9.\\$]*\)$!\2 ${MSRC}\1!p' \ ## -e 's!^ rcsvg ${VGOPTS} -S $[{STAGE}@]* \([A-Za-z0-9.\\$]*\)!\1 '"`pwd`"'!p' # $Level2s: %j%^ $$ Also used by level3s # # Stop msrc from trying to push this, but allow msync to process it: INTO= _This _is _a _package _makefile, _it _cannot _be _pushed. MSRC=/usr/msrc TMP=/tmp VERSION=2.39 STAGE=${TMP}/msrc_base-${VERSION} VGOPTS=-m SOURCE= Makefile Makefile.meta Makefile.host Msrc.hxmd ITO.spec README \ make-msrc.sh msrc.html error.html options.html \ patch-client.c patch-gram.y patch-setargs.c quit: echo "You are not in the right place to make all, for sure" 1>&2 false all: msource sub_sync: FRC MK=-s mk -mLevel2s Makefile |\ sed -e 's|$${MSRC}|${MSRC}|g' |\ xapply -f 'msync' - msync: FRC TDir=$$(mktemp -d /var/tmp/$${USER:-nobody}XXXXXX) && \ MSRC="-y INTO=$${TDir}" msync $(MSYNC_OPTS); \ rmdir $${TDir} # This is the level3 package builder interface I used to make the tar files ${TMP}: echo "Cannot find ${TMP}, which we will not build." false ${TMP}/msrc_base-${VERSION}.tgz: ${TMP} stage cd ${TMP} && gtar zcf msrc_base-${VERSION}.tgz msrc_base-${VERSION} ${TMP}/msrc_base-${VERSION}.tbz: ${TMP} stage cd ${TMP} && gtar cf - msrc_base-${VERSION} |bzip2 -9 >msrc_base-${VERSION}.tbz ${STAGE}: -rm -rf $@ mkdir $@ rcsvg ${VGOPTS} -S $@ Two rm -f $@/Makefile mv $@/Makefile.meta $@/Makefile ${STAGE}/local ${STAGE}/Pkgs: ${STAGE} mkdir $@ ${STAGE}/cgi-bin: ${STAGE} cd ${MSRC}/local/cgi-bin/manpage && rcsvg ${VGOPTS} -S $@ One ${STAGE}/local/bin ${STAGE}/local/sbin ${STAGE}/local/lib: ${STAGE}/local mkdir $@ ${STAGE}/css: cd ${MSRC}/css && rcsvg ${VGOPTS} -S $@ One ${STAGE}/local/bin/mkcmd: ${STAGE}/local/bin cd ${MSRC}/local/bin/mkcmd && rcsvg ${VGOPTS} -S $@ Eight ${STAGE}/local/lib/mkcmd: ${STAGE}/local/lib cd ${MSRC}/local/lib/mkcmd && rcsvg ${VGOPTS} -S $@ Eight ${STAGE}/local/bin/explode: ${STAGE}/local/bin cd ${MSRC}/local/bin/explode && rcsvg ${VGOPTS} -S $@ Six ${STAGE}/local/lib/explode: ${STAGE}/local/lib cd ${MSRC}/local/lib/explode && rcsvg ${VGOPTS} -S $@ Six ${STAGE}/local/bin/ptbw: ${STAGE}/local/bin cd ${MSRC}/local/bin/ptbw && rcsvg ${VGOPTS} -S $@ One ${STAGE}/local/bin/xclate: ${STAGE}/local/bin cd ${MSRC}/local/bin/xclate && rcsvg ${VGOPTS} -S $@ Two ${STAGE}/local/bin/xapply: ${STAGE}/local/bin cd ${MSRC}/local/bin/xapply && rcsvg ${VGOPTS} -S $@ Three ${STAGE}/local/sbin/hxmd: ${STAGE}/local/sbin cd ${MSRC}/local/sbin/hxmd && rcsvg ${VGOPTS} -S $@ One ${STAGE}/local/lib/hxmd: ${STAGE}/local/lib cd ${MSRC}/local/lib/hxmd && rcsvg ${VGOPTS} -S $@ One ${STAGE}/local/sbin/msrc: ${STAGE}/local/sbin cd ${MSRC}/local/sbin/msrc && rcsvg ${VGOPTS} -S $@ One cd $@ && make source # Include the package source and and op rule to change the package ownership. # We could use verof to find the release version, but version Zero is the # example version. ${STAGE}/Pkgs/msrc_base: ${STAGE}/Pkgs rcsvg ${VGOPTS} -S $@ `verof` co -p -rZero /usr/msrc/local/lib/op/remote/level2s.cf.host >$@/level2s.cf.host # sleep to make our timestamp gt than msrc's, and our depends gt that. ${STAGE}/local/sbin/mmsrc: ${STAGE}/local/sbin sleep 1 cd ${MSRC}/local/sbin/mmsrc && rcsvg ${VGOPTS} -S $@ One sleep 1 cd $@ && make restart __msrc cd $@ && chmod u+w mmsrc.[ch] ${STAGE}/local/bin/wrapw: ${STAGE}/local/bin cd ${MSRC}/local/bin/wrapw && rcsvg ${VGOPTS} -S $@ One stage: ${STAGE} ${STAGE}/local/bin/mkcmd ${STAGE}/local/lib/mkcmd \ ${STAGE}/local/bin/explode ${STAGE}/local/lib/explode \ ${STAGE}/local/bin/ptbw ${STAGE}/local/bin/xclate \ ${STAGE}/local/bin/xapply ${STAGE}/local/sbin/hxmd \ ${STAGE}/local/lib/hxmd ${STAGE}/local/sbin/msrc \ ${STAGE}/local/sbin/mmsrc ${STAGE}/local/bin/wrapw ${STAGE}/css \ ${STAGE}/cgi-bin ${STAGE}/Pkgs/msrc_base addlic ${STAGE} rm -f `find ${STAGE}/*/ -name \*.spec -print` -op -u source level2s-chown ${STAGE} check: FRC cd ${STAGE} && \ find local css Pkgs -type f |grep -v level2s.cf.host |\ xapply -f 'diff %1 /usr/msrc/%1' - clean: FRC -[ -d ${STAGE} ] && op -u $${USER:-$$LOGNAME} level2s-chown ${STAGE} rm -rf ${STAGE} ${SOURCE}: co -q $@ sanity: FRC cd ${STAGE} && ( find * -type f -print |grep -v "^README" |xapply -f 'diff -u2 %1 /usr/msrc/%1' - ) 2>&1 source: ${SOURCE} FRC: