commit 5c34ff9e1c19fd73ccc79c0f702f7c4b964840d1 from: rsc date: Sun Nov 23 18:10:54 2003 UTC make -> mk commit - bc7cb1a15a67c859c8c71c4b52bb35fe9425a63d commit + 5c34ff9e1c19fd73ccc79c0f702f7c4b964840d1 blob - /dev/null blob + 213cd0856b2b2ac34c6964462f138e120e6b5c31 (mode 644) --- /dev/null +++ src/make2mk @@ -0,0 +1,8 @@ +#!/bin/sh + +sed -E ' + s/\$\(([^)]+)\)/$\1/g + s/^(.*)\+=/\1=$\1 /g + s/^include /Makefile + chmod 444 Makefile blob - /dev/null blob + f1be2ed9287a164e9b2c6eb6308caff870c98a2e (mode 644) --- /dev/null +++ src/mkdirs @@ -0,0 +1,11 @@ +dir-%:V: + for i in $DIRS + do + (cd $i; mk $stem) + done + +all:V: dir-all +clean:V: dir-clean +install:V: dir-install +nuke:V: dir-nuke + blob - /dev/null blob + 6740a0027bf239310860a6c81ed448872cd9fff8 (mode 644) --- /dev/null +++ src/mkfile @@ -0,0 +1,53 @@ +DIRS=\ + lib9\ + libbin\ + libbio\ + libdraw\ + libflate\ + libfmt\ + libframe\ + libhttpd\ + libip\ + libregexp\ + libsec\ + libthread\ + libutf\ + libventi\ +# cmd\ + +$target + +testmkmk:V: + mk mkmk.sh + rm -f ../lib/lib*.a + mv ../bin/mk ../bin/_mk + sh -ex mkmk.sh + ls -l ../bin/mk + +testcvs:V: + cvs up -dAP + cp ../bin/_mk ../bin/mk + mk clean + rm ../lib/*.a + mv ../bin/mk ../bin/_mk + rm ../bin/* + PLAN9="`pwd`/.." export PLAN9 + PATH=$PLAN9/bin:$PATH export PATH + blob - /dev/null blob + 2cc8d973ef964041245cefa60f5017db1c49d72b (mode 644) --- /dev/null +++ src/mkhdr @@ -0,0 +1,21 @@ +SYSNAME=`uname` +OBJTYPE=`uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'` + +X11=/usr/X11R6 +LDFLAGS= +CFLAGS= +AFLAGS= + +BIN=$PLAN9/bin +LIBDIR=$PLAN9/lib + +<|sed -E '"s/(.*)\+=/\1=$\1 /g"' $PLAN9/src/Make.$SYSNAME-$OBJTYPE + +OS=$O +LD=9l +LDFLAGS=$LDFLAGS -L$LIBDIR + +CLEANFILES=*.$O +NUKEFILES= + +INSTALL=install -c blob - /dev/null blob + 5b254dbf2bb63b7d0527a8d6f2eac4b42d248d0a (mode 644) --- /dev/null +++ src/mkmany @@ -0,0 +1,73 @@ +PROGS=${TARG:%=$O.%} + +none:VQ: + echo usage: mk all, install, installall, '$O'.cmd, cmd.install, or cmd.installall + +all:V: $PROGS + +$O.%: %.$O $OFILES $LIB + $LD -o $target $prereq $LDFLAGS + +%.$O: $HFILES # don't combine with following %.$O rules + +%.$O: %.c + $CC $CFLAGS $stem.c + +%.$O: %.s + $AS $AFLAGS $stem.s + +y.tab.h y.tab.c: $YFILES + $YACC $YFLAGS $prereq + +%.install:V: $BIN/% + +$BIN/%: $O.% + $INSTALL $O.$stem $BIN/$stem + +%.installall:V: + for (objtype in $CPUS) + mk $stem.install + +install:V: + # for (i in $TARG) + # mk $MKFLAGS $i.install + for i in $TARG + do + mk $MKFLAGS $i.install + done + +installall:V: + for(objtype in $CPUS) + mk $MKFLAGS install + +%.safeinstall:V: + mk $O.$stem + test -e $BIN/$stem && mv $BIN/$stem $BIN/_$stem + mk $stem.install + +%.safeinstallall:V: + for(objtype in $CPUS) + mk $MKFLAGS $stem.safeinstall + +safeinstall:V: + for(i in $TARG) + mk $MKFLAGS $i.safeinstall + +safeinstallall:V: + for (objtype in $CPUS) + mk safeinstall + +update:V: + update $UPDATEFLAGS $UPDATE + +nuke:V: + rm -f *.[$OS] y.tab.? y.debug y.output [$OS].* *.acid $TARG $NUKEFILES + +clean:V: + rm -f *.[$OS] y.tab.? y.debug y.output [$OS].* $TARG $CLEANFILES + +%.clean:V: + rm -f $stem.[$OS] [$OS].$stem $stem.acid $stem + +%.acid: %.$O $HFILES + $CC $CFLAGS -a $stem.c >$target blob - /dev/null blob + 4cf96921a109681a82cbb2d0c116c29ac5e9adb2 (mode 644) --- /dev/null +++ src/mkmk.sh @@ -0,0 +1,116 @@ +cd libutf +9c rune.c +9c runestrcat.c +9c runestrchr.c +9c runestrcmp.c +9c runestrcpy.c +9c runestrdup.c +9c runestrlen.c +9c runestrecpy.c +9c runestrncat.c +9c runestrncmp.c +9c runestrncpy.c +9c runestrrchr.c +9c runestrstr.c +9c runetype.c +9c utfecpy.c +9c utflen.c +9c utfnlen.c +9c utfrrune.c +9c utfrune.c +9c utfutf.c +ar rvc ../../lib/libutf.a rune.o runestrcat.o runestrchr.o runestrcmp.o runestrcpy.o runestrdup.o runestrlen.o runestrecpy.o runestrncat.o runestrncmp.o runestrncpy.o runestrrchr.o runestrstr.o runetype.o utfecpy.o utflen.o utfnlen.o utfrrune.o utfrune.o utfutf.o +cd .. +cd libfmt +9c dofmt.c +9c errfmt.c +9c fltfmt.c +9c fmt.c +9c fmtfd.c +9c fmtfdflush.c +9c fmtlock.c +9c fmtprint.c +9c fmtquote.c +9c fmtrune.c +9c fmtstr.c +9c fmtvprint.c +9c fprint.c +9c print.c +9c runefmtstr.c +9c runeseprint.c +9c runesmprint.c +9c runesnprint.c +9c runesprint.c +9c runevseprint.c +9c runevsmprint.c +9c runevsnprint.c +9c seprint.c +9c smprint.c +9c snprint.c +9c sprint.c +9c strtod.c +9c vfprint.c +9c vseprint.c +9c vsmprint.c +9c vsnprint.c +9c charstod.c +9c pow10.c +9c nan64.c +ar rvc ../../lib/libfmt.a dofmt.o errfmt.o fltfmt.o fmt.o fmtfd.o fmtfdflush.o fmtlock.o fmtprint.o fmtquote.o fmtrune.o fmtstr.o fmtvprint.o fprint.o print.o runefmtstr.o runeseprint.o runesmprint.o runesnprint.o runesprint.o runevseprint.o runevsmprint.o runevsnprint.o seprint.o smprint.o snprint.o sprint.o strtod.o vfprint.o vseprint.o vsmprint.o vsnprint.o charstod.o pow10.o nan64.o +cd .. +cd libbio +9c bbuffered.c +9c bfildes.c +9c bflush.c +9c bgetc.c +9c bgetd.c +9c binit.c +9c boffset.c +9c bprint.c +9c bputc.c +9c brdline.c +9c brdstr.c +9c bread.c +9c bseek.c +9c bwrite.c +9c bgetrune.c +9c bputrune.c +ar rvc ../../lib/libbio.a bbuffered.o bfildes.o bflush.o bgetc.o bgetd.o binit.o boffset.o bprint.o bputc.o brdline.o brdstr.o bread.o bseek.o bwrite.o bgetrune.o bputrune.o +cd .. +cd libregexp +9c regcomp.c +9c regerror.c +9c regexec.c +9c regsub.c +9c regaux.c +9c rregaux.c +9c rregexec.c +9c rregsub.c +ar rvc ../../lib/libregexp9.a regcomp.o regerror.o regexec.o regsub.o regaux.o rregaux.o rregexec.o rregsub.o +cd .. +cd cmd/mk +9c arc.c +9c archive.c +9c bufblock.c +9c env.c +9c file.c +9c graph.c +9c job.c +9c lex.c +9c main.c +9c match.c +9c mk.c +9c parse.c +9c recipe.c +9c rule.c +9c run.c +9c sh.c +9c shprint.c +9c symtab.c +9c var.c +9c varsub.c +9c word.c +9c unix.c +9l -o o.mk arc.o archive.o bufblock.o env.o file.o graph.o job.o lex.o main.o match.o mk.o parse.o recipe.o rule.o run.o sh.o shprint.o symtab.o var.o varsub.o word.o unix.o -L../../../lib -lregexp9 -lbio -lfmt -lutf +install -c o.mk ../../../bin/mk +cd .. blob - /dev/null blob + 316bca937e6d1f194917dcb9de7adfd5bbc8c506 (mode 644) --- /dev/null +++ src/mkone @@ -0,0 +1,44 @@ +PROG=$O.$TARG + +all:V: $PROG + +$O.$TARG: $OFILES $LIB + $LD -o $target $prereq $LDFLAGS + +%.$O: $HFILES # don't combine with following %.$O rules + +%.$O: %.c + $CC $CFLAGS $stem.c + +%.$O: %.s + $AS $AFLAGS $stem.s + +y.tab.h y.tab.c: $YFILES + $YACC $YFLAGS $prereq + +%.install:V: $BIN/% + +$BIN/%: $O.% + $INSTALL $O.$stem $BIN/$stem + +%.installall:V: + for (objtype in $CPUS) + mk $stem.install + +install:V: $TARG.install + +installall:V: + for(objtype in $CPUS) + mk $MKFLAGS install + +nuke:V: + rm -f *.[$OS] y.tab.? y.debug y.output [$OS].* *.acid $TARG $NUKEFILES + +clean:V: + rm -f *.[$OS] y.tab.? y.debug y.output [$OS].* $TARG $CLEANFILES + +%.clean:V: + rm -f $stem.[$OS] [$OS].$stem $stem.acid $stem + +%.acid: %.$O $HFILES + $CC $CFLAGS -a $stem.c >$target blob - /dev/null blob + 9f0b5df6cb62ff171f971857f678122d3ec0648f (mode 644) --- /dev/null +++ src/mksyslib @@ -0,0 +1,11 @@ +default:V: $PLAN9/lib/$LIB + +$PLAN9/lib/$LIB:V: $OFILES # force archive even when not needed + ar rvc $PLAN9/lib/$LIB $newprereq + +&:n: &.$O + ar rvc $LIB $stem.$O + +all install:V: $PLAN9/lib/$LIB + +<$PLAN9/src/mkcommon