3 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
4 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 UTILITY_NAME "VfrCompile"
30 #define UTILITY_VERSION "v1.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 bool SkipCPreprocessor
;
60 INT8
*CPreprocessorOptions
;
64 STATUS_INITIALIZED
= 1,
71 } COMPILER_RUN_STATUS
;
75 COMPILER_RUN_STATUS mRunStatus
;
80 VOID
OptionInitialization (IN INT32
, IN INT8
**);
81 VOID
AppendIncludePath (IN INT8
*);
82 VOID
AppendCPreprocessorOptions (IN INT8
*);
83 INT8
SetBaseFileName (VOID
);
84 INT8
SetPkgOutputFileName (VOID
);
85 INT8
SetCOutputFileName(VOID
);
86 INT8
SetPreprocessorOutputFileName (VOID
);
87 INT8
SetRecordListFileName (VOID
);
89 VOID
SET_RUN_STATUS (IN COMPILER_RUN_STATUS
);
90 BOOLEAN
IS_RUN_STATUS (IN COMPILER_RUN_STATUS
);
93 COMPILER_RUN_STATUS
RunStatus (VOID
) {
98 CVfrCompiler (IN INT32
, IN INT8
**);
103 VOID
PreProcess (VOID
);
105 VOID
GenBinary (VOID
);
106 VOID
GenCFile (VOID
);
107 VOID
GenRecordListFile (VOID
);