"Compile-time" link function. Its parameters are compile-time so that it can be aliased and used at global scope in a reggafile. Links an executable from the given dependency targets. The linker used depends on the file extension of the leaf nodes of the passed-in targets. If any D files are found, the linker is the D compiler, and so on with C++ and C. If none of those apply, the D compiler is used.
Regular run-time link function. Links an executable from the given dependency targets. The linker used depends on the file extension of the leaf nodes of the passed-in targets. If any D files are found, the linker is the D compiler, and so on with C++ and C. If none of those apply, the D compiler is used.
An object file, typically from one source file in a certain language (although for D the default is a whole package. The language is determined by the file extension of the file passed in. The projDir variable is best left alone; right now only the dub targets make use of it (since dub packages are by definition outside of the project source tree).
This template function exists so as to be referenced in a reggaefile.d at top-level without being called via alias. That way it can be named and used in a further Target definition without the need to define a function returning Build. This function gets the source files to be compiled at runtime by searching for source files in the given directories, adding files and filtering as appropriate by the parameters given in sources, its first compile-time parameter. The other parameters are self-explanatory.