3 # Copyright (c) 2004 - 2007, 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.
18 # This makefile is used to build the NT emulation.
23 # Everything depends on EDK_SOURCE & EDK_TOOLS_PATH. Make sure it's defined
26 !ERROR EDK_SOURCE environmental variable not set
29 !IFNDEF EDK_TOOLS_PATH
30 !MESSAGE EDK_TOOLS_PATH environmental variable not set
, default setting used
34 # Set the processor type
39 # Define a toolchain so we can pick up the basic defines from
40 # the EFI tool setup file.
42 TOOLCHAIN
= TOOLCHAIN_MSVC
44 !INCLUDE PlatformTools.env
52 # Target to build customer config
54 customer
: tempstamp_file build_tools makefiles builds
57 # Target to build everything quickly
59 fast
: build_tools fast_makefiles builds
62 # Create a file to store the date and time, and used by SetStamp.exe
65 !IF DEFINED
(DATE_STAMP
) && DEFINED
(TIME_STAMP
)
66 @echo
$(DATE_STAMP
) $(TIME_STAMP
) > GenStamp.txt
67 !ELSEIF EXIST
(GenStamp.txt
)
72 # Make all the EFI build tools by calling the makefile
75 -if not exist
$(EDK_TOOLS_OUTPUT
) mkdir
$(EDK_TOOLS_OUTPUT
)
76 -if exist
$(EDK_TOOLS_BIN
)\
*.
* copy
$(EDK_TOOLS_BIN
)\
*.
* $(EDK_TOOLS_OUTPUT
)
77 $(MAKE
) -f
$(EDK_TOOLS_SOURCE
)\makefile PROCESSOR
=$(PROCESSOR
) BUILD_DIR
=$(BUILD_DIR
)
78 $(GUIDCHK
) -b
$(EDK_TOOLS_OUTPUT
)\GuidDatabase.txt
81 # Run ProcessDsc on our main description files to generate the
82 # makefiles and package files. Specify -v option for more verbose output.
83 # Specify "-xref filename" to generate a cross-reference file of
84 # basename-to-fileguid that can be used by VolInfo.
88 -d EFI_SOURCE
=$(EDK_SOURCE
) \
89 -d EDK_SOURCE
=$(EDK_SOURCE
) \
90 -d PROCESSOR
=$(PROCESSOR
) \
91 -d PROJECT_NAME
=$(PROJECT_NAME
) \
92 -d COMPRESS_METHOD
=$(COMPRESS_METHOD
) \
93 -d OEMTOOLPATH
=$(EDK_TOOLS_OUTPUT
) \
94 -d SHELL_INF
=$(SHELL_INF
) \
95 -d UEFI_PREFIX
=$(UEFI_PREFIX
) \
96 -d PI_PREFIX
=$(PI_PREFIX
) \
97 -d CAPSULE_INF
=$(CAPSULE_INF
) \
98 -d ATAPI_PASS_THRU_INF
=$(ATAPI_PASS_THRU_INF
) \
99 -d DEVPATH_INF
=$(DEVPATH_INF
) \
100 -d GRAPHICS_INF
=$(GRAPHICS_INF
) \
101 -g
$(EDK_TOOLS_OUTPUT
)\GuidDatabase.txt \
106 # Build faster by not building components with FV=NULL. Override in the
107 # DSC file by adding SKIP_FV_NULL=0 on the component lines you want built
108 # but still have FV=NULL. For example:
110 # Dxe\Drivers\MyDriver\MyDriver.inf FV=NULL SKIP_FV_NULL=0
114 -d EFI_SOURCE
=$(EDK_SOURCE
) \
115 -d EDK_SOURCE
=$(EDK_SOURCE
) \
116 -d PROCESSOR
=$(PROCESSOR
) \
117 -d PROJECT_NAME
=$(PROJECT_NAME
) \
118 -d COMPRESS_METHOD
=$(COMPRESS_METHOD
) \
119 -d OEMTOOLPATH
=$(EDK_TOOLS_OUTPUT
) \
120 -d SHELL_INF
=$(SHELL_INF
) \
121 -d UEFI_PREFIX
=$(UEFI_PREFIX
) \
122 -d PI_PREFIX
=$(PI_PREFIX
) \
123 -d CAPSULE_INF
=$(CAPSULE_INF
) \
124 -d ATAPI_PASS_THRU_INF
=$(ATAPI_PASS_THRU_INF
) \
125 -d DEVPATH_INF
=$(DEVPATH_INF
) \
126 -d GRAPHICS_INF
=$(GRAPHICS_INF
) \
127 -g
$(EDK_TOOLS_OUTPUT
)\GuidDatabase.txt \
133 # Create the guid-to-basename cross reference file of protocols
134 # used by volinfo for decoding dependency expressions.
137 -@if not exist fv mkdir FV
139 $(GUIDCHK
) -g
-u
$(BUILD_TARGET_DIRECTORY
) -e inf
-x
> $(BUILD_DIR
)\Fv\protocols.xref
143 # Call all the makefiles that were generated by ProcessDsc. ProcessDsc
144 # creates the makefile.out that calls all the component makefiles.
147 $(MAKE
) -f makefile.out
154 # Define a pseudo-target that skips over compiling the build tools and
155 # also skips creation of the makefiles for the components. The user
156 # has to be aware that any changes to INF files renders this target
162 # Define a pseudo-target to start building with the libraries or with the
166 $(MAKE
) -f makefile.out libraries
169 $(MAKE
) -f makefile.out components
172 # Make a pseudo-target to simplify running of the NT emulation.
174 !IF
"$(EFI_WIN_NT_FILE_SYSTEM)" == ""
175 EFI_WIN_NT_FILE_SYSTEM
= $(EDK_SOURCE
)\Other\Maintained\Application\
$(UEFI_PREFIX
)Shell
\bin\ia32\Apps
177 EFI_WIN_NT_FILE_SYSTEM
= $(EFI_WIN_NT_FILE_SYSTEM
)!$(EDK_SOURCE
)\Other\Maintained\Application\
$(UEFI_PREFIX
)Shell
\bin\ia32\Apps
181 # Make browse info file
184 - dir /s
/b
*.sbr
> $(PROCESSOR
)\temp.
rm
185 $(BSCMAKE
) /n
/o
$(PROCESSOR
)\
$(PROJECT_NAME
).bsc
"@$(PROCESSOR)\temp.rm"
188 # Create a target to clean up all build directories
191 - @if exist vc??.
* del vc??.
* > NUL
192 - @if exist
*.bak del
*.bak
> NUL
193 - @if exist
$(PROCESSOR
) rd
/s
/q
$(PROCESSOR
) > NUL
194 - @if exist ipf rd
/s
/q ipf
> NUL
195 - @if exist ebc rd
/s
/q ebc
> NUL
196 - @if exist fv rd
/s
/q fv
> NUL
197 - @if exist Tools rd
/s
/q Tools
> NUL
198 - @if exist makefile.out del makefile.out
> NUL
199 - @if exist module.
* del module.
* > NUL
200 - @echo All targets cleaned
203 # Clean up all build directories except for tools.
206 - @if exist
*.bak del
*.bak
> NUL
207 - @if exist
$(PROCESSOR
) rd
/s
/q
$(PROCESSOR
) > NUL
208 - @if exist ipf rd
/s
/q ipf
> NUL
209 - @if exist ebc rd
/s
/q ebc
> NUL
210 - @if exist fv rd
/s
/q fv
> NUL
211 - @if exist makefile.out del makefile.out
> NUL
212 - @if exist module.
* del module.
* > NUL
213 - @echo All modules cleaned
216 # Clean up only the tools
219 - @if exist vc??.
* del vc??.
* > NUL
220 - @if exist Tools rd
/s
/q Tools
> NUL
221 - @echo All tools cleaned
224 # Rebuild target, clean and build all
229 # cleanall target to clean all build directories.