]> git.lizzy.rs Git - rust.git/commit
Redesign output flags for rustc
authorAlex Crichton <alex@alexcrichton.com>
Mon, 3 Feb 2014 23:27:54 +0000 (15:27 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 6 Feb 2014 19:14:13 +0000 (11:14 -0800)
commit6e7968b10a32cbef810dcb9e3d5bc736dbf61d1f
treea29bfa4399ab691503396ecec2b5f7dc686c2e51
parentf039d10cf73d8bc9a57fcdfe38c5f0b0a3a98b5a
Redesign output flags for rustc

This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib,
--lib, and --bin flags from rustc, adding the following flags:

* --emit=[asm,ir,bc,obj,link]
* --crate-type=[dylib,rlib,staticlib,bin,lib]

The -o option has also been redefined to be used for *all* flavors of outputs.
This means that we no longer ignore it for libraries. The --out-dir remains the
same as before.

The new logic for files that rustc emits is as follows:

1. Output types are dictated by the --emit flag. The default value is
   --emit=link, and this option can be passed multiple times and have all
   options stacked on one another.
2. Crate types are dictated by the --crate-type flag and the #[crate_type]
   attribute. The flags can be passed many times and stack with the crate
   attribute.
3. If the -o flag is specified, and only one output type is specified, the
   output will be emitted at this location. If more than one output type is
   specified, then the filename of -o is ignored, and all output goes in the
   directory that -o specifies. The -o option always ignores the --out-dir
   option.
4. If the --out-dir flag is specified, all output goes in this directory.
5. If -o and --out-dir are both not present, all output goes in the current
   directory of the process.
6. When multiple output types are specified, the filestem of all output is the
   same as the name of the CrateId (derived from a crate attribute or from the
   filestem of the crate file).

Closes #7791
Closes #11056
Closes #11667
30 files changed:
man/rustc.1
mk/crates.mk
mk/tests.mk
src/compiletest/runtest.rs
src/doc/rust.md
src/doc/tutorial.md
src/etc/zsh/_rust
src/librustc/back/link.rs
src/librustc/back/lto.rs
src/librustc/driver/driver.rs
src/librustc/driver/session.rs
src/librustc/lib.rs
src/librustc/middle/trans/base.rs
src/librustdoc/core.rs
src/librustdoc/test.rs
src/test/run-make/crate-data-smoke/Makefile
src/test/run-make/dep-info-custom/Makefile
src/test/run-make/dep-info-custom/Makefile.foo
src/test/run-make/dep-info/Makefile
src/test/run-make/dep-info/Makefile.foo
src/test/run-make/duplicate-output-flavors/Makefile
src/test/run-make/mixing-libs/Makefile
src/test/run-make/no-intermediate-extras/Makefile
src/test/run-make/output-type-permutations/Makefile [new file with mode: 0644]
src/test/run-make/output-type-permutations/foo.rs [new file with mode: 0644]
src/test/run-make/prefer-dylib/Makefile
src/test/run-make/prefer-rlib/Makefile
src/test/run-make/simple-dylib/Makefile
src/test/run-make/simple-rlib/Makefile
src/test/run-make/volatile-intrinsics/Makefile