{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Passing m to the driver implies e and suppresses

Info iconThis preview shows pages 63–65. Sign up to view the full content.

View Full Document Right Arrow Icon
Passing ‘ -M ’ to the driver implies ‘ -E ’, and suppresses warnings with an implicit -w ’. -MM Like ‘ -M ’ but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header. This implies that the choice of angle brackets or double quotes in an ‘ #include directive does not in itself determine whether that header will appear in ‘ -MM dependency output. This is a slight change in semantics from GCC versions 3.0 and earlier. -MF file When used with ‘ -M ’ or ‘ -MM ’, specifies a file to write the dependencies to. If no ‘ -MF ’ switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output. When used with the driver options ‘ -MD ’ or ‘ -MMD ’, ‘ -MF ’ overrides the default dependency output file. -MG In conjunction with an option such as ‘ -M ’ requesting dependency generation, -MG ’ assumes missing header files are generated files and adds them to the dependency list without raising an error. The dependency filename is taken directly from the #include directive without prepending any path. ‘ -MG ’ also suppresses preprocessed output, as a missing header file renders this useless. This feature is used in automatic updating of makefiles. -MP This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing. These dummy rules work around errors make gives if you remove header files without updating the Makefile ’ to match. This is typical output: test.o: test.c test.h test.h: -MT target Change the target of the rule emitted by dependency generation. By default CPP takes the name of the main input file, deletes any directory components and any file suffix such as ‘ .c ’, and appends the platform’s usual object suffix. The result is the target.
Background image of page 63

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Chapter 12: Invocation 60 An ‘ -MT ’ option will set the target to be exactly the string you specify. If you want multiple targets, you can specify them as a single argument to ‘ -MT ’, or use multiple ‘ -MT ’ options. For example, ‘ -MT ’$(objpfx)foo.o’ ’ might give $(objpfx)foo.o: foo.c -MQ target Same as ‘ -MT ’, but it quotes any characters which are special to Make. -MQ ’$(objpfx)foo.o’ ’ gives $$(objpfx)foo.o: foo.c The default target is automatically quoted, as if it were given with ‘ -MQ ’. -MD -MD ’ is equivalent to ‘ -M -MF file ’, except that ‘ -E ’ is not implied. The driver determines file based on whether an ‘ -o ’ option is given. If it is, the driver uses its argument but with a suffix of ‘ .d ’, otherwise it takes the name of the input file, removes any directory components and suffix, and applies a ‘ .d ’ suffix.
Background image of page 64
Image of page 65
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}