This makes mk use the mkfile specified in $MKFILE when there is no mkfile in the current directory. Notes: Mon Mar 15 12:47:36 EST 2004 rsc I'm not convinced that this is a good idea. I admit that it provides functionality that is otherwise hard to come by, but it just feels kludgy. Reference: /n/sources/patch/sorry/defaultmkfile Date: Mon Apr 5 23:23:13 CES 2004 Reviewed-by: rsc --- /sys/src/cmd/mk/main.c Mon Apr 5 23:23:13 2004 +++ /sys/src/cmd/mk/main.c Mon Apr 5 23:23:13 2004 @@ -1,6 +1,7 @@ #include "mk.h" #define MKFILE "mkfile" +#define MKFILEVAR "MKFILE" static char *version = "@(#)mk general release 4 (plan 9)"; int debug; @@ -34,6 +35,7 @@ Biobuf tb; Bufblock *buf; Bufblock *whatif; + char *skel; /* * start with a copy of the current environment variables @@ -172,6 +174,14 @@ if(f == files){ if(access(MKFILE, 4) == 0) parse(MKFILE, open(MKFILE, 0), 0); + else { + skel = getenv(MKFILEVAR); + if (skel != nil){ + if (access(skel, 4) == 0) + parse(skel, open(skel, 0), 0); + free(skel); + } + } } else for(ff = files; ff < f; ff++) parse(*ff, open(*ff, 0), 0); --- /sys/man/1/mk Mon Apr 5 23:23:13 2004 +++ /sys/man/1/mk Mon Apr 5 23:23:13 2004 @@ -53,7 +53,13 @@ determines how many targets may be updated simultaneously; Plan 9 sets .B $NPROC -automatically to the number of CPUs on the current machine. +automatically to the number of CPUs on the current machine. The +variable +.B $MKFILE +may be set to indicate which +.B mkfile +should be read if there is no one in the current +directory. .PP Options are: .TP \w'\fL-d[egp]\ 'u