The following is a sample of a DOS batch (BAT) file. The sample demonstrates:
- Setting of the environmental variables.
- Using the compiler to compile and link a set of files.
Listing: Sample DOS batch file
REM *** set CodeWarrior path ***
set CWFolder=C:\Freescale\CW MCU v10.x
REM *** set includes path ***
set MWCIncludes=%CWFolder%\MCU\M56800E Support
set MWLibraries=%CWFolder%\MCU\M56800E Support
set MWLibraryFiles="%MWLibraries%\runtime_56800E\lib\Runtime 56800E.Lib" "%MWLibraries%\msl\MSL_C\DSP_56800E\lib\MSL C 56800E.lib"
REM *** add CLT directory to PATH ***
set PATH=%PATH%;%CWFolder%\MCU\DSP56800x_EABI_Tools\Command_Line_Tools\
REM *** compile options and files ***
set COPTIONS=-c -I- -ir "%MWCIncludes%"
set CFILELIST=file1.c file2.c
set AOPTIONS=-c
set AFILELIST=file3.asm file4.asm
set LOPTIONS=-g -o output.elf
set LFILELIST=file1.o file2.o file3.o file4.o
set LCF=linker.cmd
REM *** compile, assemble and link ***
mwcc56800e %COPTIONS% %CFILELIST%
mwasm56800e %AOPTIONS% %AFILELIST%
mwld56800e %LOPTIONS% %LFILELIST% %LCF% %MWLibraryFiles%