How to Rebuild the EWL Libraries

The EWL library files are present in the ewl\lib folder. To rebuild the EWL library files, perform the following steps:

Note: Ensure that you have access to a make utility within DOS, before rebuilding the EWL libraries.
  1. Open a DOS command prompt.
  2. Define the CWINSTALL environment variable.
    • If your PA product layout is in the folder C:\Program Files\Freescale\CW PA V10.x then you can define CWINSTALL as

      set CWINSTALL='C:\Program Files\Freescale\CW PA v10.x\PA'

    • If your MCU product layout is in the folder C:\Freescale\CW MCU V10.x then you can define CWINSTALL as

      set CWINSTALL='C:\Freescale\CW MCU v10.x\MCU'

      Note: The single quote character (' ) is important because there are spaces in the path.
  3. Change your working directory to the ewl folder.
    • For PA

      cd C:\Program Files\Freescale\CW PA V10.x\PA\PA_Support\ewl

    • For MCU

      cd C:\Freescale\CW MCU V10.x\MCU\PA_Support\ewl

  4. Set OSTYPE environment variable as console to run makefiles on windows command prompt.

    set OSTYPE=console

  5. Clean the existing library files using the following command:

    <CWInstallDir>\gnu\bin\make -f makefile clean PLATFORM=PA TARGETS="libm_XXX libc_XXX libc99_XXX"

    Note: The make utility is available in <CWInstallDir>\gnu\bin folder, where <CWInstallDir> is the CodeWarrior installation directory.
    • For example, in PA, the following command will delete only the libm_E500V2.a, libc_E500V2.a, libc99_E500V2.a library files.

      <CWInstallDir>\gnu\bin\make -f makefile clean PLATFORM=PA TARGETS="libm_E500V2 libc_E500V2 libc99_E500V2"

    • For example, in MCU, the following command will delete only the libm_E200z650.a , libc_E200z650.a , libc99_E200z650.a library files.

      <CWInstallDir>\gnu\bin\make -f makefile clean PLATFORM=PA TARGETS="libm_E200z650 libc_E200z650 libc99_E200z650"

  6. Rebuild a C or math or C99 library file using the following command:

    <CWInstallDir>\gnu\bin\make -f EWL_C.PA.mak -C EWL_C TARGETS="libm_XXX libc_XXX libc99_XXX"

    • For example, in PA, the following command will build the libm_E500V2.a, libc_E500V2.a, libc99_E500V2.a files:

      <CWInstallDir>\gnu\bin\make -f EWL_C.PA.mak -C EWL_C TARGETS="libm_E500V2 libc_E500V2 libc99_E500V2"

    • For example, in MCU, the following command will build the libm_E200z650.a, libc_E200z650.a, libc99_E200z650.a files:

      <CWInstallDir>\gnu\bin\make -f EWL_C.PA.mak -C EWL_C TARGETS="libm_E200z650 libc_E200z650 libc99_E200z650"

      Note: Re-building any particular C and C99 library, requires math library of the same target. It is suggested that the math library is built prior to building the C99 or C libraries.
  7. Rebuild a C++ or libc++ library file using the following command:

    <CWInstallDir>\gnu\bin\make -f EWL_C++.PA.mak -C EWL_C++ TARGETS="libstdc++_XXX libc++_XXX"

    • For example, in PA, the following command will build the libstdc++_E500V2.a, libc++_E500V2.a files:

      <CWInstallDir>\gnu\bin\make -f EWL_C++.PA.mak -C EWL_C++ TARGETS="libstdc++_E500V2 libc++_E500V2"

    • For example, in MCU, the following command will build the libstdc++_E200z0_VLE_Soft.a, libc++_E200z0_VLE_Soft.a files:

      <CWInstallDir>\gnu\bin\make -f EWL_C++.PA.mak -C EWL_C++ TARGETS="libstdc++_E200z0_VLE_Soft libc++_E200z0_VLE_Soft"

  8. Rebuild a Runtime library file using the following command:

    <CWInstallDir>\gnu\bin\make -f EWL_Runtime.PA.mak -C EWL_Runtime "librt_XXX"

    • For example, in PA, the following command will build the librt_E500V2.a file:

      <CWInstallDir>\gnu\bin\make -f EWL_Runtime.PA.mak -C EWL_Runtime "librt_E500V2"

    • For example, in MCU, the following command will build the librt_E200z0_VLE_Soft.a file:

      <CWInstallDir>\gnu\bin\make -f EWL_Runtime.PA.mak -C EWL_Runtime "librt_E200z0_VLE_Soft"

Upon successful execution of the make command, check the lib folder for the EWL libraries.