I want to build a library (.lib) instead of a final elf (.abs) file. How can I do this?

To build a library project, follow the steps listed below:

  1. Select the desired project in the CodeWarrior Projects view.

    The Properties for <Project_name> dialog box appears.

  2. Select Tool Chain Editor from the left panel.

    The Tool Chain Editor options page appears in the right panel.

  3. Click the Select Tools button.

    The Select tools dialog box appears.

  4. Replace Linker with Libmaker in Select tools dialog box.
    Note: For CodeWarrior for Microcontrollers v10.2, replace S08 Linker with S08Libmaker in the Select tools dialog box.
  5. Click OK.

    The Tools settings dialog box closes.

  6. Select Settings from the left panel.

    The Settings options page appears in the right panel.

  7. Click the Build Artifact tab.
  8. Change the Artifact extension to the desired extension (e.g. 'lib').
  9. Click Apply to save the settings.
  10. Click OK.

    The Properties for <Project_name> dialog box closes.

  11. Right-click the project in the CodeWarrior Projects view and select Clean Project from the context-menu.

    This removes the previous build artifact.

  12. Remove the start08.c file from the project.
  13. Change the libmaker command as listed below:
    • Change from: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} -cmd( ${INPUTS} = ${OUTPUT})
    • To: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} -cmd( ${INPUTS} = myLib.lib)

An alternate and easier way to build a library project is, while creating a new project using the New BareBoard Project wizard, select Library in the Project Type/Output option in the Devices page.