{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052\deftab360{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fmodern\fprq1\fcharset0 Courier New;}{\f3\fswiss\fprq2\fcharset0 Arial;}} {\colortbl ;\red8\green96\blue168;\red0\green0\blue0;} {\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}} {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Name\par \pard\nowidctlpar\sb200\cf2\b0\fs18 Trim.exe or Trim.py \endash Convert the preprocessed source files by C compiler to the expected style file to be processed further by EDKII tool.\f1\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\tx1440\cf1\b\f0\fs28 Synopsis\par \pard\nowidctlpar\sb200\cf2\fs18 trim [-s|-r|-a|-8] [-c] [-v|-d |-q] [-o ] \f1\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\f0\fs28 Description\par \pard\nowidctlpar\sb200\cf2\b0\fs18 Trim tool is used to process the preprocessed file by Compiler to remove the unused content to generate the file to be processed further by EDKII tools.\f1\par \f0 Trim tool can also be used to process the source file to generate the expected source file to work with EDKII build system and EDKII core code. \f1\par \f0 Trim tool is a usual tool to process the source file to generate the file that can be used in EDKII build system. It extends EDKII build system to support more source file type.\f1\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Options\par \pard\nowidctlpar\sb200\cf2\fs18 input_file\par \tab\b0 The input file may be the preprocessed source code, the preprocessed VFR file, ASL file or R8 framework source file.\f1\par \b\f0 -s, --source-code \par \pard\li360\b0 The input file is preprocessed source code, including C or assembly code. All generated codes from the include header files are remove all. Only content in source file is kept.\f1\par \pard\nowidctlpar\sb200\b\f0 -r, --vfr-file \par \pard\li360\b0 The input file is preprocessed VFR file. All generated codes from the include header files are remove except for the typedef structure.\f1\par \pard\nowidctlpar\sb200\b\f0 -a, --asl-file \par \pard\fi360\b0 The input file is ASL file. The asl source include style Include(*.asi) will be changed to C style #include *.asi. The preprocessed asl file can be preprocessed by C compiler. \f1\par \pard\nowidctlpar\sb200\b\f0 -8, --r8-source-code \par \pard\li360\b0 The input file is the EDK style source code to be trimmed for ECP platform. Some EDK framework source file will be modified to work with EDKII thunk and core drivers. A window script tool \ldblquote ImportTool.bat\rdblquote is created to process a group of EDK framework source files in the same file directory. \cf0\f2\fs20\par \pard\nowidctlpar\sb200\cf2\b\f0\fs18 -c, --convert-hex \par \pard\fi360\b0 Convert standard hex format (0xabcd) to MASM format (abcdh).\f1\par \pard\nowidctlpar\sb200\b\f0 -o OUTPUTFILE, --output=OUTPUTFILE\par \pard\fi360\b0 The output file is to store the trimmed content.\f1\par \pard\nowidctlpar\sb200\b\f0 -v, --verbose\f1\par \b0\f0 \tab Run with verbose information.\f1\par \b\f0 -d LOGLEVEL, --debug=LOGLEVEL [0-9]\f1\par \pard\nowidctlpar\fi360\sb200\b0\f0 Enable debug messages at specified level.\par \pard\nowidctlpar\sb200\b -q, --quiet\f1\par \pard\nowidctlpar\fi360\sb200\b0\f0 Run with little information in quiet mode.\f1\par \pard\nowidctlpar\sb200\b\f0 --version\f1\par \pard\nowidctlpar\fi360\sb200\b0\f0 Show program's version number and exit\par \pard\nowidctlpar\sb200\b -h, -?, --help\par \pard\nowidctlpar\li360\sb200\b0 Show this help message and exit\f1\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Example\par \pard\nowidctlpar\sb200\cf2\b0\fs18 1. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.s) to the output file test.iii, which only contains the content in this source file (test.s).\f1\par \b\f0 Trim --source-code -o test.iii test.i\f1\par \b0\f0 2. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.asm) and convert standard hex format (0xabcd) to MASM format (abcdh) to the output file test.iii, which only contains the content in this source file (test.s).\par \b Trim --source-code --convert-hex -o test.iii test.i\f1\par \b0\f0 3. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.vfr) except for the typedef structures to the output file (test.iii).\f1\par \b\f0 Trim --vfr-file -o test.iii test.i\f1\par \b0\f0 4. Trim ASL source file (test.asl) to convert the ASL style Include(*.asi) to the C style #include *.asi. The update ASL will output to test.i.\f1\par \b\f0 Trim --asl-file -o test.i test.asl\f1\par \b0\f0 5. Modify an EDK style framework source file to work with EDKII thunk and core drivers.\f1\par \b\f0 Trim --r8-source-code -o test.c test.c\f1\par \b0\f0 5. Modify all EDK style framework source files (*.c and *.h) in current directory to work with EDKII thunk and core drivers by the script \ldblquote ImportTool.bat\rdblquote .\f1\par \b\f0 ImportTool *.c\f1\par \f0 ImportTool *.h\par \f1\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\f0\fs28 Bugs\par \pard\nowidctlpar\sb200\cf2\b0\fs18 No known bugs.\par Report bugs to edk2-buildtools-devel@lists.sourceforge.net\f1\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\f0\fs28 Files\par \pard\nowidctlpar\sb200\cf2\b0\fs18 None\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\fs28 See also\par \pard\nowidctlpar\sb200\cf2\b0\fs18 None\par \pard\keep\keepn\nowidctlpar\s2\li-1440\sb400\sa60\sl-340\slmult0\cf1\b\fs28 License\par \pard\nowidctlpar\cf2\b0\fs18 Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.\par This program and the accompanying materials are licensed and made available \par under the terms and conditions of the BSD License which accompanies this \par distribution. The full text of the license may be found at\par http://opensource.org/licenses/bsd-license.php\par \par THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\par \pard\nowidctlpar\sb200 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\par \cf0\f1\par \pard\nowidctlpar\f3\fs20\par }