About plain2c preprocessor plugin for CodeWarrior


0. purpose

This plugin is to add capability of convert *.t file to C source to CodeWarrior. '.t' is format for implant plain text in a C source code.


1. Usage

Select '.t' file added to the project, then choose 'compile' from the project menu.
C Source file is created in the same folder, and this C source file is automatically added to the project.

This plugin has an option to determine the output location of C source file.
Make a new file named 'p2c_path.txt' and write the source top folder and the working folder in below format :

@ source	{Project}:src:
@ work	{Project}:work:

In this expample, {Project}:src:a:b.t file will be expanded as {Project}:work:a:b.c.
To specify the parent directory, use {Project}:::src: style.
Instead of use {Project}: style, you can write full path of the directories.
If the .t file is not in the source folder, or the source directory is not defined, the plugin creates a C source file in the same directory as the .t file.

This plugin is still under construction, and have some problems and limitations:

- When the corresponding C source file is opened in the editor, preprocessing is stopped with unexpected error.

- The same name files cannot be added to the project. This may be limitation of CodeWarrior 7.

- On failure of reading or writing file, SIOUX window is opened and CodeWarrior freezes... press command-Q to quit the application.



2. Install Plugin

  (1) Decompress the archive file 'plain2c.sit', then you'll get a plugin file named plain2c.

  (2) Place this file in 'CodeWarrior Plugins' folder in the same directory as the compiler.

  (3) You need to quit CodeWarrior once and re-launch to make it recognized by CodeWarrior.



3. Compile plain2c preprocessor plugin from source code

You need CodeWarrior 7, and CodeWarrior plugin SDK, available from
ftp://ftp.metrowerks.com/pub/updates/CWPRO7/CodeWarrior_Plugin_SDK.zip

'(CodeWarrior SDK)' folder must be in the same folder as the CodeWarrior.

 (1) Open a project file.

 (2) Verify the output directory is correctly set. 

This option is in the target settings window. It must be set to "{Compiler}:CodeWarrior Plugins".

 (3) Click the make button above the files list, or type command-M.

Plugin file named 'plain2c' will be generated in the plugin folder.

  (4) Quit CodeWarrior once, and re-launch.


If plugin is correctly loaded, ".t" target settings is added when factory settings is loaded in Target settings - File mapping panel.



2003.3.13
Tomoki Sekiyama <sekiyama@yahoo.co.jp>
