Now compile the start08.c file.
The Select File to Compile dialog box appears.
The start08.c file begins compiling, as shown in the following figure. In this case, the file fails to compile.
The HC08 Compiler window provides information about the compilation process, and generates the error messages if the compilation fails. In this case, the C5200: `FileName' file not found error message appears twice, once for start08.h and once for non_bank.sgm.
A context menu appears.
The C5200: `FileName' file not found error message appears.
The Tips section in the help for the C5200 error states that the correct paths and names for the source files must be specified. The following folder contains both the missing files, start08.h and non_bank.sgm:
<CWInstallDir>\MCU\lib\hc08c\include
To resolve the error, modify the compiler configuration so that it can locate the missing files.
The Configuration dialog box appears.
The Browse for Folder dialog box appears.
The specified path appears in the lower panel.
An asterisk ( * ) now appears in the HC08 Compiler window's title bar, indicating that the configuration file contains unsaved changes.
Now that you have specified the paths to the missing files, you can try again to compile the start08.c file.
The HC08 Compiler window indicates successful compilation of the start08.c file and displays following results:
Now compile the main.c file:
The C source code file, main.c, fails to compile, as the compiler can locate only three of the four header files required. It could not find the derivative.h header file and generates another C5200 error message.
The derivative.h file is in the Project_Headers folder in the X15 project folder, so add another header path to resolve the error.
The Configuration dialog box appears.
The Browse for Folder dialog box appears.
The Browse for Folder dialog box closes.
The selected path appears in the lower panel.
If there is no other missing header file included in the derivative.h file, you are ready to compile the main.c file.
The message "*** 0 error(s)," indicates that main.c compiles without errors. Save the changes in the project configuration.
The compiler places the object file in the Sources folder, and generates output listing files in the project folder. The binary object files and the input modules have identical names except for the extension used. Any assembly output files generated for each C source code file is similarly named.
At this time, only two of the three C source code files have been compiled. Locate the remaining C source code file, MC9S08GT32.c, in the Lib folder of the current directory, X15.
The compiler places the object-code files it generates in the same folder that contains the C source code files. However, you can also specify a different location for the object-code files.
To redirect the object-code file for the MC9S08GT32.c file to another folder, modify the compiler configuration so that when the MC9S08GT32.c file is compiled, the object code file goes into a different folder. For more information, refer to the OBJPATH: Object File Path).
The Browse for Folder dialog box appears.
The Browse for Folder dialog box closes.
The new object path appears in the lower pane.
The Configuration dialog box closes.
The Select File to Compile dialog box appears.
The selected file compiles.
The Compiler log states that the object code file, MC9S08GT32.o, is created in the ObjectCode folder, as specified. Save the project configuration again in case you wish to recompile any of the C source code files in future.
The haphazard builds of this project are intentionally designed to illustrate what happens if paths are not configured properly while compiling a project using the Compiler tool. The header files may be included by either C source or other header files. The lib folder in the CodeWarrior installation directory contains derivative-specific header and other files for Microcontrollers projects.
When you build another project with the Build Tool Utilities, make sure that the settings for the input and output files are done in advance.
Now that the project's object code files are available, you can use the linker build tool, linker.exe, together with an appropriate *.prm file, to link these object-code files with the library files and create an *.abs executable output file.
Refer to the Linker section in the Build Tool Utilities Manual for details. However, the project set up and configuration is faster and easier using the New Bareboard Project wizard.