Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
dmd.deps
Implement the -
deps and -makedeps switches, which output dependencies of modules for build tools.
The grammar of the -
deps output is:
ImportDeclaration
::= BasicImportDeclaration [ " : " ImportBindList ] [ " -> "
ModuleAliasIdentifier ] "\n"
BasicImportDeclaration
::= ModuleFullyQualifiedName " (" FilePath ") : " Protection|"string"
" [ " static" ] : " ModuleFullyQualifiedName " (" FilePath ")"
FilePath
- any string with '(', ')' and '\' escaped with the '\' character
Make dependencies as generated by -makedeps look like this:
source/app.d: source/importa.d \ source/importb.d
License:
Source makedeps.d
Documentation https://dlang.org/phobos/dmd_deps.html
- pure void
writeMakeDeps(ref OutBufferbuf, ref const Paramparams, boollink, boollib, const(char)[]libExt); - Output the makefile dependencies for the -makedeps switchParameters:
OutBuffer bufoutbuffer to write into Param paramsdmd params bool linkan executable is being generated bool liba library is being generated const(char)[] libExtfile extension of libraries for current target - void
addImportExpDep(ref OutputmoduleDeps, ref OutputmakeDeps, const(char)[]fileNameZ, const(char)[]importString, Moduleimod); - Add an import expression to module dependenciesParameters:
Output moduleDepsoutput settings for -deps Output makeDepsoutput settings for -makedeps const(char)[] fileNameZ0-termminated string containing the import expression's resolved filename const(char)[] importStringraw string passed to import exp Module imodmodule import exp is in - void
addImportDep(ref OutputmoduleDeps, Importimp, Moduleimod); - Add an import statement to module dependenciesParameters:
Output moduleDepsoutput settings Import impimport to add Module imodmodule that the import is in - pure void
writeEscapedMakePath(ref OutBufferbuf, const(char)*fname); - Takes a path, and make it compatible with GNU Makefile format.GNU make uses a weird quoting scheme for white space. A space or tab preceded by 2N+1 backslashes represents N backslashes followed by space; a space or tab preceded by 2N backslashes represents N backslashes at the end of a file name; and backslashes in other contexts should not be doubled.Parameters:
OutBuffer bufBuffer to write the escaped path to const(char)* fnamePath to escape Examples:version (Windows) { enum input = `C:\My Project\file#4$.ext`; enum expected = `C:\My\ Project\file\#4$$.ext`; } else { enum input = `/foo\bar/weird$.:name#\ with spaces.ext`; enum expected = `/foo\bar/weird$$.\:name\#\\\ with\ spaces.ext`; } OutBuffer buf; buf.writeEscapedMakePath(input); assert(buf[] == expected);
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Mon Mar 31 10:27:50 2025