]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Makefile
Add some EDK build configuration files and EDK DSC file as the templates to build...
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Platform / Nt32 / Build / Makefile
1 #/*++
2 #
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
8 #
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 #
14 # Makefile
15 #
16 # Abstract:
17 #
18 # This makefile is used to build the NT emulation.
19 #
20 #--*/
21
22 #
23 # Everything depends on EDK_SOURCE & EDK_TOOLS_PATH. Make sure it's defined
24 #
25 !IFNDEF EDK_SOURCE
26 !ERROR EDK_SOURCE environmental variable not set
27 !ENDIF
28
29 !IFNDEF EDK_TOOLS_PATH
30 !MESSAGE EDK_TOOLS_PATH environmental variable not set, default setting used
31 !ENDIF
32
33 #
34 # Set the processor type
35 #
36 PROCESSOR = IA32
37
38 #
39 # Define a toolchain so we can pick up the basic defines from
40 # the EFI tool setup file.
41 #
42 TOOLCHAIN = TOOLCHAIN_MSVC
43
44 !INCLUDE PlatformTools.env
45
46 #
47 # Default target
48 #
49 all : customer
50
51 #
52 # Target to build customer config
53 #
54 customer : tempstamp_file build_tools makefiles builds
55
56 #
57 # Target to build everything quickly
58 #
59 fast : build_tools fast_makefiles builds
60
61 #
62 # Create a file to store the date and time, and used by SetStamp.exe
63 #
64 tempstamp_file:
65 !IF DEFINED(DATE_STAMP) && DEFINED(TIME_STAMP)
66 @echo $(DATE_STAMP) $(TIME_STAMP) > GenStamp.txt
67 !ELSEIF EXIST(GenStamp.txt)
68 - @del GenStamp.txt
69 !ENDIF
70
71 #
72 # Make all the EFI build tools by calling the makefile
73 #
74 build_tools :
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
79
80 #
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.
85 #
86 makefiles :
87 $(PROCESSDSC) \
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 \
102 -xref FV\Guid.xref \
103 $(PROJECT_NAME).dsc
104
105 #
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:
109 #
110 # Dxe\Drivers\MyDriver\MyDriver.inf FV=NULL SKIP_FV_NULL=0
111 #
112 fast_makefiles :
113 $(PROCESSDSC) \
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 \
128 -xref FV\Guid.xref \
129 -d SKIP_FV_NULL=1 \
130 $(PROJECT_NAME).dsc
131
132 #
133 # Create the guid-to-basename cross reference file of protocols
134 # used by volinfo for decoding dependency expressions.
135 #
136 protocols.xref :
137 -@if not exist fv mkdir FV
138 cd $(EDK_SOURCE)
139 $(GUIDCHK) -g -u $(BUILD_TARGET_DIRECTORY) -e inf -x > $(BUILD_DIR)\Fv\protocols.xref
140 cd $(BUILD_DIR)
141
142 #
143 # Call all the makefiles that were generated by ProcessDsc. ProcessDsc
144 # creates the makefile.out that calls all the component makefiles.
145 #
146 builds :
147 $(MAKE) -f makefile.out
148
149 #
150 # Useful targets
151 #
152
153 #
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
157 # invalid.
158 #
159 quick : builds
160
161 #
162 # Define a pseudo-target to start building with the libraries or with the
163 # components.
164 #
165 libraries :
166 $(MAKE) -f makefile.out libraries
167
168 components :
169 $(MAKE) -f makefile.out components
170
171 #
172 # Make a pseudo-target to simplify running of the NT emulation.
173 #
174 !IF "$(EFI_WIN_NT_FILE_SYSTEM)" == ""
175 EFI_WIN_NT_FILE_SYSTEM = $(EDK_SOURCE)\Other\Maintained\Application\$(UEFI_PREFIX)Shell\bin\ia32\Apps
176 !ELSE
177 EFI_WIN_NT_FILE_SYSTEM = $(EFI_WIN_NT_FILE_SYSTEM)!$(EDK_SOURCE)\Other\Maintained\Application\$(UEFI_PREFIX)Shell\bin\ia32\Apps
178 !ENDIF
179
180 #
181 # Make browse info file
182 #
183 bsc:
184 - dir /s /b *.sbr > $(PROCESSOR)\temp.rm
185 $(BSCMAKE) /n /o $(PROCESSOR)\$(PROJECT_NAME).bsc "@$(PROCESSOR)\temp.rm"
186
187 #
188 # Create a target to clean up all build directories
189 #
190 clean :
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
201
202 #
203 # Clean up all build directories except for tools.
204 #
205 cleanbuilds :
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
214
215 #
216 # Clean up only the tools
217 #
218 cleantools :
219 - @if exist vc??.* del vc??.* > NUL
220 - @if exist Tools rd /s /q Tools > NUL
221 - @echo All tools cleaned
222
223 #
224 # Rebuild target, clean and build all
225 #
226 rebuild : clean all
227
228 #
229 # cleanall target to clean all build directories.
230 #
231 cleanall : clean