BaseTools: Update Python Makefile not to depend on PYTHON_FREEZER_PATH
authorLiming Gao <liming.gao@intel.com>
Mon, 12 Sep 2016 07:25:07 +0000 (15:25 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 21 Sep 2016 02:49:18 +0000 (10:49 +0800)
If PYTHON_FREEZER_PATH is not set, Python tools will not be freeze.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
BaseTools/Source/Python/Makefile

index 28be6717fef6942d33e48179e8fb5b88029789f0..e7755cdbf8c8629e5faea3dc59a753e4116e421c 100644 (file)
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-!IFNDEF PYTHON_FREEZER_PATH\r
-!ERROR PYTHON_FREEZER_PATH must be defined!\r
+!IFNDEF PYTHON_HOME\r
+!ERROR PYTHON_HOME must be defined!\r
 !ENDIF\r
 \r
+!IFDEF PYTHON_FREEZER_PATH\r
 !IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze)\r
 # Using cx_Freeze 4.2.3 with Python 2.7.2\r
 FREEZE=$(PYTHON_HOME)\python $(PYTHON_FREEZER_PATH)\cxfreeze\r
 !ELSE\r
-# Using cx_Freeze 3.0.3 with Python 2.5.4\r
-FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe\r
+!ERROR PYTHON_FREEZER_PATH does not exist!\r
+!ENDIF\r
 !ENDIF\r
 \r
 MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii\r
@@ -236,7 +237,14 @@ CMD_UPT=$(BASE_TOOLS_PATH)\Source\Python\UPT\Core\DependencyRules.py \
     $(BASE_TOOLS_PATH)\Source\Python\UPT\Xml\XmlParser.py \\r
     $(BASE_TOOLS_PATH)\Source\Python\UPT\Xml\XmlParserMisc.py\r
 \r
+!IFDEF PYTHON_FREEZER_PATH\r
 all: SetPythonPath $(APPLICATIONS)\r
+!ELSE\r
+all:\r
+  @echo.\r
+  @echo !!! WARNING !!! PYTHON_FREEZER_PATH is not set.\r
+  @echo Cannot make executable from Python code, executing python scripts instead !!!\r
+!ENDIF\r
 \r
 SetPythonPath:\r
   set PYTHONPATH=$(BASE_TOOLS_PATH)\Source\Python\r
@@ -310,5 +318,6 @@ $(BIN_DIR)\TestRoot.pub.pem: $(BASE_TOOLS_PATH)\Source\Python\Pkcs7Sign\TestRoot
 clean:\r
 cleanall:  \r
   @del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll\r
+  @del /f /q $(BASE_TOOLS_PATH)\Source\Python\*.pyc\r
   @for %%i in ($(APPLICATIONS)) do @del /f /q %%i\r
 \r