]>
Commit | Line | Data |
---|---|---|
5b19df7f LG |
1 | /*++ |
2 | ||
3e99020d | 3 | Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR> |
4b1e1121 | 4 | This program and the accompanying materials |
5b19df7f LG |
5 | are licensed and made available under the terms and conditions of the BSD License |
6 | which accompanies this distribution. The full text of the license may be found at | |
7 | http://opensource.org/licenses/bsd-license.php | |
3e99020d | 8 | |
5b19df7f LG |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
11 | ||
12 | Module Name: | |
13 | ||
3e99020d | 14 | VfrCompiler.h |
5b19df7f LG |
15 | |
16 | Abstract: | |
17 | ||
18 | --*/\r | |
19 | \r | |
95d675b5 | 20 | #ifndef _VFRCOMPILER_H_\r |
21 | #define _VFRCOMPILER_H_\r | |
22 | \r | |
23 | #include "Tiano.h"\r | |
24 | #include "EfiTypes.h"\r | |
25 | #include "EfiVfr.h"\r | |
26 | #include "VfrFormPkg.h"\r | |
27 | #include "VfrUtilityLib.h"\r | |
28 | \r | |
3e99020d LG |
29 | #define UTILITY_NAME "VfrCompile"\r |
30 | #define UTILITY_VERSION "v1.1"\r | |
95d675b5 | 31 | \r |
32 | //\r | |
33 | // This is how we invoke the C preprocessor on the VFR source file\r | |
34 | // to resolve #defines, #includes, etc. To make C source files\r | |
35 | // shareable between VFR and drivers, define VFRCOMPILE so that\r | |
36 | // #ifdefs can be used in shared .h files.\r | |
37 | //\r | |
38 | #define PREPROCESSOR_COMMAND "cl "\r | |
39 | #define PREPROCESSOR_OPTIONS "/nologo /E /TC /DVFRCOMPILE "\r | |
40 | \r | |
41 | //\r | |
42 | // Specify the filename extensions for the files we generate.\r | |
43 | //\r | |
44 | #define VFR_PREPROCESS_FILENAME_EXTENSION ".i"\r | |
45 | #define VFR_PACKAGE_FILENAME_EXTENSION ".hpk"\r | |
46 | #define VFR_RECORDLIST_FILENAME_EXTENSION ".lst"\r | |
47 | \r | |
48 | typedef struct {\r | |
49 | INT8 VfrFileName[MAX_PATH];\r | |
50 | INT8 RecordListFile[MAX_PATH];\r | |
51 | INT8 PkgOutputFileName[MAX_PATH];\r | |
52 | INT8 COutputFileName[MAX_PATH];\r | |
53 | bool CreateRecordListFile;\r | |
54 | bool CreateIfrPkgFile;\r | |
55 | INT8 OutputDirectory[MAX_PATH];\r | |
56 | INT8 PreprocessorOutputFileName[MAX_PATH];\r | |
57 | INT8 VfrBaseFileName[MAX_PATH]; // name of input VFR file with no path or extension\r | |
58 | INT8 *IncludePaths;\r | |
3e99020d | 59 | bool SkipCPreprocessor; |
95d675b5 | 60 | INT8 *CPreprocessorOptions;\r |
61 | } OPTIONS;\r | |
62 | \r | |
63 | typedef enum {\r | |
64 | STATUS_INITIALIZED = 1,\r | |
65 | STATUS_PREPROCESSED,\r | |
66 | STATUS_COMPILEED,\r | |
67 | STATUS_GENBINARY,\r | |
68 | STATUS_FINISHED,\r | |
69 | STATUS_FAILED,\r | |
70 | STATUS_DEAD,\r | |
71 | } COMPILER_RUN_STATUS;\r | |
72 | \r | |
73 | class CVfrCompiler {\r | |
74 | private:\r | |
75 | COMPILER_RUN_STATUS mRunStatus;\r | |
76 | OPTIONS mOptions;\r | |
77 | INT8 *mPreProcessCmd;\r | |
78 | INT8 *mPreProcessOpt;\r | |
79 | \r | |
80 | VOID OptionInitialization (IN INT32 , IN INT8 **);\r | |
81 | VOID AppendIncludePath (IN INT8 *);\r | |
82 | VOID AppendCPreprocessorOptions (IN INT8 *);\r | |
83 | INT8 SetBaseFileName (VOID);\r | |
84 | INT8 SetPkgOutputFileName (VOID);\r | |
85 | INT8 SetCOutputFileName(VOID);\r | |
86 | INT8 SetPreprocessorOutputFileName (VOID);\r | |
87 | INT8 SetRecordListFileName (VOID);\r | |
88 | \r | |
89 | VOID SET_RUN_STATUS (IN COMPILER_RUN_STATUS);\r | |
90 | BOOLEAN IS_RUN_STATUS (IN COMPILER_RUN_STATUS);\r | |
91 | \r | |
92 | public:\r | |
93 | COMPILER_RUN_STATUS RunStatus (VOID) {\r | |
94 | return mRunStatus;\r | |
95 | }\r | |
96 | \r | |
97 | public:\r | |
98 | CVfrCompiler (IN INT32 , IN INT8 **);\r | |
99 | ~CVfrCompiler ();\r | |
100 | \r | |
101 | VOID Usage (VOID);\r | |
102 | \r | |
103 | VOID PreProcess (VOID);\r | |
104 | VOID Compile (VOID);\r | |
105 | VOID GenBinary (VOID);\r | |
106 | VOID GenCFile (VOID);\r | |
107 | VOID GenRecordListFile (VOID);\r | |
108 | };\r | |
109 | \r | |
110 | #endif\r |