-ObjN: Object File Name Specification

Group

OUTPUT

Scope

Compilation Unit

Syntax
  -ObjN=<file> 
  
Arguments

<file>: Object filename

Default

-ObjN=%(OBJPATH)\%n.o

Defines

None

Pragmas

None

Description

The object file uses the same name as the processed source file, but with the extension "*.o". This option allows flexible object filename definition. It may contain special modifiers (refer Using Special Modifiers). When <file> in the option contains a path (absolute or relative), the Compiler ignores the OBJPATH environment variable.

Example
  -ObjN=a.out 
  

This example names the resulting object file a.out. Setting the OBJPATH environment variable to \src\obj results in an object file called \src\obj\a.out.

  fibo.c -ObjN=%n.obj

  

This results in an object file called fibo.obj.

  myfile.c -ObjN=..\objects\_%n.obj

  

The Compiler names the object file relative to the current directory, which results in an object file called ..\objects\_myfile.obj. The Compiler ignores the OBJPATH environment variable because the <file> contains a path.

See also

OBJPATH: Object File Path environment variable