ページの改善
いますぐフォークしてオンライン編集し、このページのプルリクエストを送信します。
Github へのログインが必要です。 これは小さな変更に適しています。
大きな変更を加えたい場合は、通常の cloneの使用をお勧めします。
日本語版について
個人的な学習のために、dlang.orgを翻訳したサイトです。
翻訳に際して、様々なサイトを参考にしています。
rdmd
概要
In a command prompt:> cat myprog.d
import std.stdio; void main() { writeln("Hello, world without explicit compilations!"); }
> rdmd myprog Hello, world without explicit compilations!Inside a D program:
> cat myprog.d
#!/usr/bin/env rdmd import std.stdio; void main() { writeln("Hello, world with automated script running!"); }
> ./myprog.d Hello, world with automated script running!
解説
rdmd is a companion to the dmd compiler that simplifies the typical edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle. Like make and other tools, rdmd uses the relative dates of the files involved to minimize the amount of work necessary. Unlike make, rdmd tracks dependencies and freshness without requiring additional information from the user.
rdmd:
- shields its user from the notion that producing a running program from D programming language files may entail several concerted steps against different source files producing various intermediate files;
- automatically infers and builds dependent files, transitively, by following import directives;
- recognizes and passes down all of dmd's command-line options;
- understands how various dmd compiler options (e.g. -release vs. -debug) affect generation of intermediate files, and avoids conflations (e.g., does not unwittingly run a debug executable when the release executable is asked for);
- recompiles files only on a needed basis, e.g. two invocations of rdmd in sequence without an intervening change to any relevant source file does not produce the executable again.
使用法
rdmd [dmd and rdmd options] progfile[.d] [program arguments]
In addition to dmd's options, rdmd recognizes the following:
- --build-only
- just build the executable, don't run it. By default, the executable is placed into the source file directory
- --chatty
- write dmd commands to stdout before executing them
- --compiler=/path/to/compiler
- use the specified compiler (e.g. gdmd) instead of dmd
- --dry-run
- do not compile, just show what commands would be run (implies --chatty)
- --eval=code
- evaluate code including it in
void main(string[] args) { ... }
(multiple --eval allowed, will be evaluated in turn) - --exclude=package
- exclude a package from the build (multiple --exclude allowed)
- --include=package
- negate --exclude or a standard package (std, etc, core)
- --extra-file=file
- include an extra source or object in the compilation (multiple --extra-file allowed)
- --force
- force a rebuild even if apparently not necessary
- --help
- show a help message and exit
- --loop=code
- like --eval, but code will be additionally
included in a loop
foreach (line; stdin.byLine()) { ... }
- --main
- add an empty
void main() {}
(useful for running unittests) - --makedepend
- print dependencies in makefile format and exit
- --man
- open web browser on manual page
- --shebang
- rdmd is in a shebang line (put as first argument). Example:
> cat myprog.d
#!/usr/bin/rdmd --shebang -version=test -O import std.stdio; void main() { writeln("Hello, world with automated script running!"); }
- --tmpdir
- use a different temporary directory
ダウンロード
- View syntax-colored source code
- Download
作者
Andrei AlexandrescuCopyright © 1999-2022 by the D Language Foundation | Page generated by
Ddoc on Wed Nov 23 08:31:07 2022