Check In tool source code based on Build tool project revision r1655.
[mirror_edk2.git] / BaseTools / Source / Python / Makefile
1
2 !IFNDEF PYTHON_FREEZER_PATH
3 !ERROR PYTHON_FREEZER_PATH must be defined!
4 !ENDIF
5
6 FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe
7
8 MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1
9
10 BIN_DIR=$(EDK_TOOLS_PATH)\Bin\Win32
11
12
13 APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe $(BIN_DIR)\MigrationMsa2Inf.exe $(BIN_DIR)\Fpd2Dsc.exe $(BIN_DIR)\TargetTool.exe $(BIN_DIR)\spd2dec.exe $(BIN_DIR)\GenDepex.exe
14
15 COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
16 $(BASE_TOOLS_PATH)\Source\Python\Common\Database.py \
17 $(BASE_TOOLS_PATH)\Source\Python\Common\DataType.py \
18 $(BASE_TOOLS_PATH)\Source\Python\Common\DecClassObject.py \
19 $(BASE_TOOLS_PATH)\Source\Python\Common\DecClassObjectLight.py \
20 $(BASE_TOOLS_PATH)\Source\Python\Common\Dictionary.py \
21 $(BASE_TOOLS_PATH)\Source\Python\Common\DscClassObject.py \
22 $(BASE_TOOLS_PATH)\Source\Python\Common\EdkIIWorkspace.py \
23 $(BASE_TOOLS_PATH)\Source\Python\Common\EdkIIWorkspaceBuild.py \
24 $(BASE_TOOLS_PATH)\Source\Python\Common\EdkLogger.py \
25 $(BASE_TOOLS_PATH)\Source\Python\Common\FdfClassObject.py \
26 $(BASE_TOOLS_PATH)\Source\Python\Common\FdfParserLite.py \
27 $(BASE_TOOLS_PATH)\Source\Python\Common\GlobalData.py \
28 $(BASE_TOOLS_PATH)\Source\Python\Common\Identification.py \
29 $(BASE_TOOLS_PATH)\Source\Python\Common\InfClassObject.py \
30 $(BASE_TOOLS_PATH)\Source\Python\Common\InfClassObjectLight.py \
31 $(BASE_TOOLS_PATH)\Source\Python\Common\MigrationUtilities.py \
32 $(BASE_TOOLS_PATH)\Source\Python\Common\Misc.py \
33 $(BASE_TOOLS_PATH)\Source\Python\Common\Parsing.py \
34 $(BASE_TOOLS_PATH)\Source\Python\Common\String.py \
35 $(BASE_TOOLS_PATH)\Source\Python\Common\TargetTxtClassObject.py \
36 $(BASE_TOOLS_PATH)\Source\Python\Common\ToolDefClassObject.py \
37 $(BASE_TOOLS_PATH)\Source\Python\Common\XmlParser.py \
38 $(BASE_TOOLS_PATH)\Source\Python\Common\XmlRoutines.py \
39 $(BASE_TOOLS_PATH)\Source\Python\Common\__init__.py \
40 $(BASE_TOOLS_PATH)\Source\Python\Workspace\BuildClassObject.py \
41 $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaDataTable.py \
42 $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileParser.py \
43 $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileTable.py \
44 $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceDatabase.py \
45 $(BASE_TOOLS_PATH)\Source\Python\Workspace\__init__.py \
46 $(BASE_TOOLS_PATH)\Source\Python\Autogen\AutoGen.py \
47 $(BASE_TOOLS_PATH)\Source\Python\Autogen\BuildEngine.py \
48 $(BASE_TOOLS_PATH)\Source\Python\Autogen\GenC.py \
49 $(BASE_TOOLS_PATH)\Source\Python\Autogen\GenDepex.py \
50 $(BASE_TOOLS_PATH)\Source\Python\Autogen\GenMake.py \
51 $(BASE_TOOLS_PATH)\Source\Python\Autogen\StrGather.py \
52 $(BASE_TOOLS_PATH)\Source\Python\Autogen\UniClassObject.py \
53 $(BASE_TOOLS_PATH)\Source\Python\Autogen\__init__.py
54
55
56 all: SetPythonPath $(APPLICATIONS)
57
58 SetPythonPath:
59 set PYTHONPATH=$(BASE_TOOLS_PATH)\Source\Python
60
61 $(BIN_DIR)\build.exe: $(BASE_TOOLS_PATH)\Source\Python\build\build.py $(COMMON_PYTHON)
62 @pushd . & @cd build & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) build.py & @popd
63
64 $(BIN_DIR)\GenFds.exe: $(BASE_TOOLS_PATH)\Source\Python\GenFds\GenFds.py $(COMMON_PYTHON)
65 @pushd . & @cd GenFds & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) GenFds.py & @popd
66
67 $(BIN_DIR)\Trim.exe: $(BASE_TOOLS_PATH)\Source\Python\Trim\Trim.py $(COMMON_PYTHON)
68 @pushd . & @cd Trim & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) Trim.py & @popd
69
70 $(BIN_DIR)\MigrationMsa2Inf.exe: $(BASE_TOOLS_PATH)\Source\Python\MigrationMsa2Inf\MigrationMsa2Inf.py
71 @pushd . & @cd MigrationMsa2Inf & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) MigrationMsa2Inf.py & @popd
72
73 $(BIN_DIR)\Fpd2Dsc.exe: $(BASE_TOOLS_PATH)\Source\Python\Fpd2Dsc\Fpd2Dsc.py $(COMMON_PYTHON)
74 @pushd . & @cd Fpd2Dsc & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) Fpd2Dsc.py & @popd
75
76 $(BIN_DIR)\spd2dec.exe: $(BASE_TOOLS_PATH)\Source\Python\spd2dec\Spd2Dec.py $(COMMON_PYTHON)
77 @pushd . & @cd Spd2Dec & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) Spd2Dec.py & @popd
78
79 $(BIN_DIR)\GenDepex.exe: $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenDepex.py $(COMMON_PYTHON)
80 @pushd . & @cd AutoGen & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) GenDepex.py & @popd
81
82 $(BIN_DIR)\TargetTool.exe: $(BASE_TOOLS_PATH)\Source\Python\TargetTool\TargetTool.py $(COMMON_PYTHON)
83 @pushd . & @cd TargetTool & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) TargetTool.py & @popd
84
85 clean:
86 cleanall:
87 @del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll
88 @for %%i in ($(APPLICATIONS)) do @del /f /q %%i
89