On Tue, 10 May 2016 16:42:25 +0200, Marc Espie wrote: > Both bmake and gmake support a list of files in include/sinclude > "systemV style". > > Adding this to our make would make us slightly more compatible. > > It also allows modern dependency patterns a la > > .sinclude ${SRC:R:=.d} > > Just went thru a full make build. > could use a few eyes. > > The change is straightforward, but the patch a bit long, because I have > to move the location of Var_Substs... keep it simple in the bsd make case (we > don't want to create syntax by substituting variables). And so the handling > of string intervals trickles down the chain of function. > > I refrained from also supporting gmake's glob extension, where they can do > .sinclude *.d > > We have the match code in dir_expand.c, but this would be complicated to > mesh with the include directory lookup in resolve_include_filename. > > Comments and okays welcome.
Looks OK but one minor comment: > Index: parse.c > =================================================================== > RCS file: /cvs/src/usr.bin/make/parse.c,v > retrieving revision 1.115 > diff -u -p -r1.115 parse.c > --- parse.c 22 Dec 2015 21:50:54 -0000 1.115 > +++ parse.c 10 May 2016 14:35:26 -0000 > @@ -1133,25 +1132,19 @@ resolve_include_filename(const char *fil > if (isSystem) > return NULL; > else > - return Dir_FindFile(file, systemIncludePath); > + return Dir_FindFilei(file, efile, systemIncludePath); > } > > static void > -handle_include_file(const char *name, const char *ename, bool isSystem, > +handle_include_file(const char *file, const char *efile, bool isSystem, > bool errIfNotFound) > { > - char *file; > char *fullname; > > - /* Substitute for any variables in the file name before trying to > - * find the thing. */ > - file = Var_Substi(name, ename, NULL, false); > - > - fullname = resolve_include_filename(file, isSystem); > + fullname = resolve_include_filename(file, efile, isSystem); > if (fullname == NULL && errIfNotFound) > - Parse_Error(PARSE_FATAL, "Could not find %s", file); > - free(file); > - > + Parse_Error(PARSE_FATAL, "Could not find %s", > + Str_dupi(file, efile)); I don't think you need that Str_dupi() if you do: Parse_Error(PARSE_FATAL, "Could not find %.*s", (int)(efile - file), file); > if (fullname != NULL) { > FILE *f;