Pixar's Devkit
|
|
|
The next section explains how the compilation and linking of DSOs and executables can customized. Default Compilation & Linking
Upon receiving the keyboard shortcut Customization, Templates & Placeholders
A template looks like an ordinary Makefile or VS .bat file except that it includes
placeholders that are replaced by specific text after the template has been copied, but
before it is saved to the users working directory. For example, this placeholder, Step 1 - User supplied Makefiles / VS .bat files?
Before using a template, Cutter checks if the user has supplied their own Makefile or
VS .bat file. For example, suppose a file named "myImplicit.cpp" is executed, Cutter
will search the parent directory in order to find, depending the operating system, a
script named,
Step 2 - Templates & Placeholders
If Cutter is unable to locate a suitably named script, or it is
tagged as one that is maintained by Cutter, a template will be used to generate a
fresh version of the Makefile or VS .bat file. Initially, Cutter searches for a suitable template
in the users |
|
Step 3 - Custom TemplatesUsers can ensure the makefiles and VS .bat files generated by Cutter are based on their custom templates. The easiest way to accomplish this is to make a copy of the default template that is relevent to the type of plugin or executible the user is developing. For example, if a user is developing some shadeops on Linux they could,
Thats all there is to it. Thereafter, Cutter will generate specific makefiles derived from the custom makefile template. |
Multiple Source FilesSuppose "myImplicit.cpp" also uses a class or classes implemented in a file named "MyUtils.cpp". In other words a successful build of the DSO depends on compiling and linking more than one source code file. Cutter determines what "extra" objs to add to the Makefile by examining the list of #include's at the top of the main file. For example, upon finding, say, #include "MyUtils.h" Cutter will search the directory in which "myImplicit.cpp" is located in order to find a file named either "MyUtils.cpp" or "MyUtils.c". If it finds either file it will append the following line in the Makefile, OBJS = myImplicit.o MyUtils.o A similiar logic is used to modify the text of a VS .bat file. |
© 2002- Malcolm Kesson. All rights reserved.