2
0
mirror of https://frontier.innolan.net/github/amigaos-cross-toolchain6.git synced 2024-10-19 10:29:55 +00:00

@N added xbuild - to build without updateing, also build checks now for changes and rebuilds submodules

This commit is contained in:
bebbo
2017-03-22 16:07:34 +01:00
parent d8ff900ff6
commit 8f19190db2
2 changed files with 66 additions and 27 deletions

View File

@ -345,37 +345,16 @@ def recipe(name, nargs=0):
def wrapper(*args, **kwargs):
target = [str(arg) for arg in args[:min(nargs, len(args))]]
if len(target) > 0:
mtarget = target[0]
target = [target[0], fill_in(name)] + target[1:]
target = '-'.join(target)
else:
target = fill_in(name)
mtarget = target
target = target.replace('_', '-')
target = target.replace('/', '-')
stamp = path.join('{stamps}', target)
if not path.exists('{stamps}'):
mkdir('{stamps}')
if name == 'make' and path.exists(stamp):
mfile = ''
mmax = 0
for root, dirs, files in os.walk('submodules/' + mtarget):
for filename in files:
mf = os.path.join(root, filename)
mt = os.stat(mf).st_mtime
if mt > mmax:
mfile = mf
mmax = mt
if mmax > os.stat(stamp).st_mtime:
mstamp = path.join('{stamps}', mtarget + '-make*')
info('removing stamp for "%s"\n\tcaused by "%s" %s'
'\n\tstamp is "%s" %s', mstamp, mfile, datetime.datetime.fromtimestamp(mmax),
stamp, datetime.datetime.fromtimestamp(os.stat(stamp).st_mtime))
for f in glob(mstamp):
remove(f)
if not path.exists(stamp):
fn(*args, **kwargs)
touch(stamp)
@ -443,6 +422,34 @@ def unpack(name, work_dir='{sources}', top_dir=None, dst_dir=None):
copytree(path.join(tmpdir, top_dir or name), dst)
rmtree(tmpdir)
def removemodule(name):
mbuild = path.join('{build}', name)
info('removing build for module %s : "%s"', name, mbuild)
mstamp = path.join('{stamps}', name + '-*')
for f in glob(mstamp):
remove(f)
rmtree(mbuild)
def checkstamps(name):
target = fill_in(name)
target = target.replace('_', '-')
target = target.replace('/', '-') + "-make"
stamp = path.join('{stamps}', target)
info('checking %s with %s', name, stamp)
mtime = 0
if path.exists(stamp):
mtime = os.stat(stamp).st_mtime
submodule = path.join('submodules/', name)
for root, dirs, files in os.walk(submodule):
for filename in files:
mf = os.path.join(root, filename)
mt = os.stat(mf).st_mtime
if mt > mtime:
return True
return False
@recipe('patch', 1)
def patch(name, work_dir='{sources}'):
@ -523,4 +530,5 @@ __all__ = ['setvar', 'panic', 'cmpver', 'find_executable', 'chmod', 'execute',
'rmtree', 'mkdir', 'copy', 'copytree', 'unarc', 'fetch', 'cwd',
'symlink', 'remove', 'move', 'find', 'textfile', 'env', 'path',
'add_site_dir', 'find_site_dir', 'python_setup', 'recipe',
'unpack', 'patch', 'configure', 'make', 'require_header', 'touch']
'unpack', 'patch', 'configure', 'make', 'require_header', 'touch',
'checkstamps', 'removemodule']