diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-12-23 10:56:56 -0800 |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-12-23 10:56:56 -0800 |
commit | 06a5096ffd4752538f2889aa86bda6855c383dc9 (patch) | |
tree | 897f260e3b35f08c1de420ec3de005c8c299aeda /make.bat | |
parent | b840490057173cc324f0f9b4fe5c7d9bc8c1c286 (diff) | |
download | psutil-06a5096ffd4752538f2889aa86bda6855c383dc9.tar.gz |
build.bat refactoring
Diffstat (limited to 'make.bat')
-rw-r--r-- | make.bat | 69 |
1 files changed, 34 insertions, 35 deletions
@@ -19,72 +19,71 @@ SET PATH=%PYTHON%;%PATH% SET PATH=C:\MinGW\bin;%PATH% -if "%1" == "" goto help if "%1" == "help" ( :help - echo Please use `make ^<target^>` where ^<target^> is one of: - echo clean build install uninstall test - goto :EOF + echo Run `make ^<target^>` where ^<target^> is one of: + echo clean clean build files + echo build compile without installing + echo install compile and install + echo uninstall uninstall + echo test run tests + echo create-exes create exe installers in dist directory + goto :eof ) if "%1" == "clean" ( - call :clean - goto :EOF + :clean + for /r %%R in (__pycache__) do if exist %%R (rmdir /S /Q %%R) + for /r %%R in (*.pyc) do if exist %%R (del /s %%R) + if exist build (rmdir /S /Q build) + if exist dist (rmdir /S /Q dist) + goto :eof ) if "%1" == "build" ( - call :build - goto :EOF + :build + if %PYTHON%==C:\Python24\python.exe ( + %PYTHON% setup.py build -c mingw32 + ) else if %PYTHON%==C:\Python25\python.exe ( + %PYTHON% setup.py build -c mingw32 + ) else ( + %PYTHON% setup.py build + ) + goto :eof ) if "%1" == "install" ( - call :install - goto :EOF + install: + call :build + %PYTHON% setup.py install + goto :eo ) if "%1" == "uninstall" ( + uninstall: rmdir /S /Q %PYTHON%\Lib\site-packages\psutil del /F /S /Q %PYTHON%\Lib\site-packages\psutil* del /F /S /Q %PYTHON%\Lib\site-packages\_psutil* - goto :EOF + goto :eof ) if "%1" == "test" ( + test: call :install %PYTHON% test/test_psutil.py - goto :EOF + goto :eof ) if "%1" == "create-exes" ( + create-exes: call :clean C:\Python26\python.exe setup.py build bdist_wininst C:\Python27\python.exe setup.py build bdist_wininst C:\Python33\python.exe setup.py build bdist_wininst - goto :EOF + goto :eof ) - goto :help -:install - call :build - %PYTHON% setup.py install - goto :EOF - -:build - if %PYTHON%==C:\Python24\python.exe ( - %PYTHON% setup.py build -c mingw32 - ) else if %PYTHON%==C:\Python25\python.exe ( - %PYTHON% setup.py build -c mingw32 - ) else ( - %PYTHON% setup.py build - ) - goto :EOF - -:clean - for /F "tokens=*" %%G IN ('dir /B /AD /S __pycache__') DO rmdir /S /Q %%G - for /r %%R in (*.pyc) do if exist %%R (del /s %%R) - if exist build (rmdir /S /Q build) - if exist dist (rmdir /S /Q dist) - goto :EOF +:eof
\ No newline at end of file |