In GNU make there is a powerful concept that many users love for its compacity and expressiveness: so-called "pattern rules". The concept is extremely simple:
- you define a recipe for each file matching a certain pattern,
- that recipe typically leads to creating one or more files. The names of these files are created based on the name of the original file
For example:
%.tab.c %.tab.h: %.y
bison -d $<
tells make that the recipe bison -d foo.y will make both foo.tab.c and foo.tab.h.
Currently in the python stdlib there is a solid foundation for the "search" part of this: glob. However it remains a bit cumbersome to define glob-generated lists of (source file/folder, destination file(s)/folder(s)). fprules is an attempt to provide such functionality.
As opposed to make where the feature is integrated in the build tool, we could imagine to provide a generic mechanism allowing any build tool to leverage the generated rules. For example doit, nox, etc. fprules follows this principle: it is not tied to a build tool in particular. However it could maybe be improved to become even more expressive (see https://github.com/smarie/python-fprules/issues)
In GNU make there is a powerful concept that many users love for its compacity and expressiveness: so-called "pattern rules". The concept is extremely simple:
For example:
tells
makethat the recipebison -d foo.ywill make bothfoo.tab.candfoo.tab.h.Currently in the python stdlib there is a solid foundation for the "search" part of this:
glob. However it remains a bit cumbersome to defineglob-generated lists of(source file/folder, destination file(s)/folder(s)).fprulesis an attempt to provide such functionality.As opposed to
makewhere the feature is integrated in the build tool, we could imagine to provide a generic mechanism allowing any build tool to leverage the generated rules. For exampledoit,nox, etc.fprulesfollows this principle: it is not tied to a build tool in particular. However it could maybe be improved to become even more expressive (see https://github.com/smarie/python-fprules/issues)