From: jljusten Date: Mon, 3 Dec 2007 22:54:46 +0000 (+0000) Subject: added BaseTools/Makefile X-Git-Url: http://git.etherboot.org/efi/basetools/.git/commitdiff_plain/0e30af505d793d51f5115c5212f64697f6330aa0 added BaseTools/Makefile modified BaseTools/Source/Python/Makefile modified BaseTools/toolsetup.bat Moved code from toolsetup.bat into Makefile and Source/Python/Makefile in order to separate out C and Python building. Now after the environment is initialized, you can just run nmake to build both C and Python tools. Alternatively you can run 'nmake c' or 'nmake python' to only build the applicable set of tools. git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@902 7335b38e-4728-0410-8992-fb3ffe349368 --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a16f577 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ + +SUBDIRS = Source\C Source\Python + +all: c python + +c : + @Source\C\Makefiles\NmakeSubdirs.bat all Source\C + +python: + @Source\C\Makefiles\NmakeSubdirs.bat all Source\Python + +subdirs: $(SUBDIRS) + @Source\C\Makefiles\NmakeSubdirs.bat all $** + +.PHONY: clean +clean: + @Source\C\Makefiles\NmakeSubdirs.bat clean $(SUBDIRS) + +.PHONY: cleanall +cleanall: + @Source\C\Makefiles\NmakeSubdirs.bat cleanall $(SUBDIRS) + diff --git a/Source/Python/Makefile b/Source/Python/Makefile index 3787002..f45d7a2 100644 --- a/Source/Python/Makefile +++ b/Source/Python/Makefile @@ -1,4 +1,8 @@ +!IFNDEF PYTHON_FREEZER_PATH +!ERROR PYTHON_FREEZER_PATH must be defined! +!ENDIF + FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 @@ -6,10 +10,12 @@ MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 BIN_DIR=$(EDK_TOOLS_PATH)\Bin\Win32 -APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe $(BIN_DIR)\MigrationMsa2Inf.exe $(BIN_DIR)\TargetTool.exe +APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe $(BIN_DIR)\MigrationMsa2Inf.exe $(BIN_DIR)\Fpd2Dsc.exe + +all: SetPythonPath $(APPLICATIONS) -all: $(APPLICATIONS) - +SetPythonPath: + set PYTHONPATH=$(BASE_TOOLS_PATH)\Source\Python $(BIN_DIR)\build.exe: $(BASE_TOOLS_PATH)\Source\Python\build\build.py @pushd . & @cd build & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) build.py & @popd @@ -23,9 +29,8 @@ $(BIN_DIR)\Trim.exe: $(BASE_TOOLS_PATH)\Source\Python\Trim\Trim.py $(BIN_DIR)\MigrationMsa2Inf.exe: $(BASE_TOOLS_PATH)\Source\Python\MigrationMsa2Inf\MigrationMsa2Inf.py @pushd . & @cd MigrationMsa2Inf & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) MigrationMsa2Inf.py & @popd -$(BIN_DIR)\TargetTool.exe: $(BASE_TOOLS_PATH)\Source\Python\TargetTool\TargetTool.py - @pushd . & @cd TargetTool & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) TargetTool.py & @popd - +$(BIN_DIR)\Fpd2Dsc.exe: $(BASE_TOOLS_PATH)\Source\Python\Fpd2Dsc\Fpd2Dsc.py + @pushd . & @cd Fpd2Dsc & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) Fpd2Dsc.py & @popd cleanall: @del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll diff --git a/toolsetup.bat b/toolsetup.bat index 1429983..c220e08 100755 --- a/toolsetup.bat +++ b/toolsetup.bat @@ -30,7 +30,6 @@ if defined VS71COMNTOOLS ( :check_path if not defined PYTHON_FREEZER_PATH set PYTHON_FREEZER_PATH=C:\cx_Freeze -if not exist %PYTHON_FREEZER_PATH% goto no_freezer_path pushd . cd %~dp0 @@ -74,13 +73,14 @@ IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TianoCompress.exe" goto build IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Trim.exe" goto build IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VfrCompile.exe" goto build IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Fpd2Dsc.exe" goto build +IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VolInfo.exe" goto build :skipbuild goto end :rebuild pushd . -cd %BASE_TOOLS_PATH%\Source\C +cd %BASE_TOOLS_PATH% call nmake cleanall del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.* popd @@ -90,50 +90,11 @@ REM REM Start to build the Framework Tools REM -echo. -echo Building the C Tools -echo. - pushd . -cd %BASE_TOOLS_PATH%\Source\C +cd %BASE_TOOLS_PATH% call nmake popd -echo. -echo Building the Python Tools -echo. - -set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python -pushd . - -echo Generating build.exe -cd %BASE_TOOLS_PATH%\Source\Python\build -%PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 build.py > NUL - -echo Generating GenFds.exe -cd %BASE_TOOLS_PATH%\Source\Python\GenFds -%PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 GenFds.py > NUL - -echo Generating Trim.exe -cd %BASE_TOOLS_PATH%\Source\Python\Trim -%PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 Trim.py > NUL - -echo Generating MigrationMsa2Inf.exe -cd %BASE_TOOLS_PATH%\Source\Python\MigrationMsa2Inf -%PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 MigrationMsa2Inf.py > NUL - -echo Generating Fpd2Dsc.exe -cd %BASE_TOOLS_PATH%\Source\Python\Fpd2Dsc -%PYTHON_FREEZER_PATH%\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=%EDK_TOOLS_PATH%\Bin\Win32 Fpd2Dsc.py > NUL - -popd -echo Done! -goto end - -:no_freezer_path -echo. -echo !!!WARNING!!! No cx_Freeze path found. Please install cx_Freeze and set PYTHON_FREEZER_PATH. -echo. goto end :no_tools_path