8.134 --multifile, --no_multifile

Enables and disables multifile compilation.

When --multifile is selected, the compiler performs optimizations across all files specified on the command line, instead of on each individual file. The specified files are compiled into one single object file.

The combined object file is named after the first source file you specify on the command line. To specify a different name for the combined object file, use the -o filename option.

To meet the requirements of standard make systems, an empty object file is created for each subsequent source file specified on the command line. However, only a single combined object file is created if you also specify -o filename.

Note:

Compiling with --multifile has no effect if only a single source file is specified on the command line.

Default

The default is --no_multifile.

Usage

When --multifile is selected, the compiler might be able to perform additional optimizations by compiling across several source files.

There is no limit to the number of source files that can be specified on the command line. However, depending on the number of source files and structure of the program, the compiler might require significantly more memory and significantly more compilation time. For the best optimization results, choose small groups of functionally related source files.

As a guideline, you can expect --multifile to scale well up to modules in the low hundreds of thousands of lines of code.

Example

armcc -c --multifile test1.c ... testn.c -o test.o

Because -o is used, a single combined object file named test.o is created..

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.