3 Copyright (c) 2004 - 2009, Intel Corporation
4 All rights reserved. This program and the accompanying materials
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
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.
20 #ifndef _VFRCOMPILER_H_
21 #define _VFRCOMPILER_H_
26 #include "VfrFormPkg.h"
27 #include "VfrUtilityLib.h"
29 #define PROGRAM_NAME "VfrCompile"
30 #define VFR_COMPILER_VERSION "UEFI 2.1"
33 // This is how we invoke the C preprocessor on the VFR source file
34 // to resolve #defines, #includes, etc. To make C source files
35 // shareable between VFR and drivers, define VFRCOMPILE so that
36 // #ifdefs can be used in shared .h files.
38 #define PREPROCESSOR_COMMAND "cl "
39 #define PREPROCESSOR_OPTIONS "/nologo /E /TC /DVFRCOMPILE "
42 // Specify the filename extensions for the files we generate.
44 #define VFR_PREPROCESS_FILENAME_EXTENSION ".i"
45 #define VFR_PACKAGE_FILENAME_EXTENSION ".hpk"
46 #define VFR_RECORDLIST_FILENAME_EXTENSION ".lst"
49 INT8 VfrFileName
[MAX_PATH
];
50 INT8 RecordListFile
[MAX_PATH
];
51 INT8 PkgOutputFileName
[MAX_PATH
];
52 INT8 COutputFileName
[MAX_PATH
];
53 bool CreateRecordListFile
;
54 bool CreateIfrPkgFile
;
55 INT8 OutputDirectory
[MAX_PATH
];
56 INT8 PreprocessorOutputFileName
[MAX_PATH
];
57 INT8 VfrBaseFileName
[MAX_PATH
]; // name of input VFR file with no path or extension
59 INT8
*CPreprocessorOptions
;
63 STATUS_INITIALIZED
= 1,
70 } COMPILER_RUN_STATUS
;
74 COMPILER_RUN_STATUS mRunStatus
;
79 VOID
OptionInitialization (IN INT32
, IN INT8
**);
80 VOID
AppendIncludePath (IN INT8
*);
81 VOID
AppendCPreprocessorOptions (IN INT8
*);
82 INT8
SetBaseFileName (VOID
);
83 INT8
SetPkgOutputFileName (VOID
);
84 INT8
SetCOutputFileName(VOID
);
85 INT8
SetPreprocessorOutputFileName (VOID
);
86 INT8
SetRecordListFileName (VOID
);
88 VOID
SET_RUN_STATUS (IN COMPILER_RUN_STATUS
);
89 BOOLEAN
IS_RUN_STATUS (IN COMPILER_RUN_STATUS
);
92 COMPILER_RUN_STATUS
RunStatus (VOID
) {
97 CVfrCompiler (IN INT32
, IN INT8
**);
102 VOID
PreProcess (VOID
);
104 VOID
GenBinary (VOID
);
105 VOID
GenCFile (VOID
);
106 VOID
GenRecordListFile (VOID
);