Norimasa Okamoto
/
pymite
python-on-a-chip online compiler
makebat
make.bat
rem make.bat 2013/3/2 set PYTHON=c:\python26\python.exe IF NOT EXIST %PYTHON% GOTO exit set TOOLS=../../tools/ set LIB=../../lib/ set VM=../../vm/ set PMIMGCREATOR=%TOOLS%pmImgCreator.py IF NOT EXIST %PMIMGCREATOR% GOTO exit set PMGENPMFEATURES=%TOOLS%pmGenPmFeatures.py IF NOT EXIST %PMIMGCREATOR% GOTO exit set PMSTDLIB_SOURCES=%LIB%__bi.py %LIB%dict.py %LIB%list.py %LIB%string.py %LIB%sys.py set PMSTDLIB_SOURCES=%PMSTDLIB_SOURCES% %LIB%ipm.py set SOURCE_IMG=pmstdlib_img.cpp set SOURCE_NAT=pmstdlib_nat.cpp set ZIP=pymite.zip IF NOT EXIST pmfeatures.py GOTO exit %PYTHON% %PMGENPMFEATURES% pmfeatures.py > pmfeatures.h IF ERRORLEVEL 1 GOTO exit %PYTHON% %PMIMGCREATOR% -c -u -f pmfeatures.py -o main_img.cpp --native-file=main_nat.cpp main.py mbed.py IF ERRORLEVEL 1 GOTO exit %PYTHON% %PMIMGCREATOR% -b -u -f pmfeatures.py -o main_img.img main.py mbed.py IF ERRORLEVEL 1 GOTO exit IF NOT EXIST %LIB%__bi.py GOTO exit %PYTHON% %PMIMGCREATOR% -c -s -f pmfeatures.py --memspace=flash -o %SOURCE_IMG% --native-file=%SOURCE_NAT% %PMSTDLIB_SOURCES% IF ERRORLEVEL 1 GOTO exit IF NOT EXIST %VM%pm.h GOTO exit set SCRIPT="es=['*.h','*.c','*.cpp'];import zipfile;import glob;import os;z=zipfile.ZipFile('%ZIP%','w'); set SCRIPT=%SCRIPT%[[z.write(f,'/vm/'+os.path.basename(f)) for f in glob.glob('%VM%'+e)] for e in es]; set SCRIPT=%SCRIPT%[[z.write(f,'/platform/mbed/'+os.path.basename(f)) for f in glob.glob('./'+e)] for e in es]; set SCRIPT=%SCRIPT%z.close()" %PYTHON% -c %SCRIPT% IF ERRORLEVEL 1 GOTO exit %PYTHON% -c "import zipfile;z=zipfile.ZipFile('%ZIP%','r');z.printdir()" IF ERRORLEVEL 1 GOTO exit ECHO SUCCESS!!! PLEASE IMPORT %ZIP% :exit EXIT/B