#!/usr/bin/python
import os
#import sys
ProductName = 'blaze'
TCSRCROOT = './'
TCDSTROOT = '/opt/myfroyo/'
SubDirs = ('out/target/product/' + ProductName + '/obj/lib',
'prebuilt/linux-x86/toolchain/arm-eabi-4.4.0',
'system/core/include',
'hardware/libhardware/include',
'hardware/ril/include',
'hardware/libhardware_legacy/include',
'dalvik/libnativehelper/include',
'dalvik/libnativehelper/include/nativehelper',
'frameworks/base/include',
'frameworks/base/core/jni',
'frameworks/base/libs/audioflinger',
'external/skia/include',
'external/openssl/include',
'out/target/product/' + VOTP + '/obj/include',
'bionic/libc/arch-arm/include',
'bionic/libc/include',
'bionic/libstdc++/include',
'bionic/libc/kernel/common',
'bionic/libc/kernel/arch-arm',
'bionic/libm/include',
'bionic/libm/include/arm',
'bionic/libthread_db/include',
'bionic/libm/arm',
'bionic/libm',
'external/webkit/WebCore/bridge',
'external/webkit/WebCore/plugins',
'external/webkit/WebCore/platform/android',
'external/webkit/WebKit/android/plugins')
for item in SubDirs :
target = TCDSTROOT + item
if not os.path.exists(target):
cmd = 'mkdir -p ' + target
if os.system(cmd) == 0 :
print target , 'created successfully'
source = TCSRCROOT + item + '/*'
cmd = 'cp -Rfp ' + source + ' ' + target
if os.system(cmd) == 0 :
print 'copy ', item, 'successfully'
source = TCSRCROOT + 'build/core/*.x*'
target = TCDSTROOT + 'build/core'
if not os.path.exists(target):
cmd = 'mkdir -p ' + target
if os.system(cmd) == 0 :
print target , 'created successfully'
cmd = 'cp -Rfp ' + source + ' ' + target
if os.system(cmd) == 0 :
print cmd, 'ok'
cmd = 'find ' + TCDSTROOT + ' -name *.c* ' + ' | xargs rm -f'
if os.system(cmd) == 0 :
print cmd, 'ok'