third_party/sqlite/scripts/generate_amalgamation.py
def make_aggregate(config_name):
    """Generate the aggregate source files."""
    if not os.path.exists(_TEMP_CONFIG_DIR):
        os.mkdir(_TEMP_CONFIG_DIR)
    try:
        os.chdir(_TEMP_CONFIG_DIR)
        _do_configure(config_name)

        cmd = ['make', 'shell.c', 'sqlite3.h', 'sqlite3.c']
        subprocess.check_call(cmd)

        amalgamation_dir = get_amalgamation_dir(config_name)
        if not os.path.exists(amalgamation_dir):
            os.mkdir(amalgamation_dir)

        readme_dst = os.path.join(amalgamation_dir, 'README.md')
        if not os.path.exists(readme_dst):
            readme_src = os.path.join(_SQLITE_ROOT_DIR, 'scripts',
                                      'README_amalgamation.md')
            copyfile(readme_src, readme_dst)

        copyfile(
            os.path.join(_TEMP_CONFIG_DIR, 'sqlite3.c'),
            os.path.join(amalgamation_dir, 'sqlite3.c'))
        copyfile(
            os.path.join(_TEMP_CONFIG_DIR, 'sqlite3.h'),
            os.path.join(amalgamation_dir, 'sqlite3.h'))

        # shell.c must be placed in a different directory from sqlite3.h,
        # because it contains an '#include "sqlite3.h"' that we want to resolve
        # to our custom //third_party/sqlite/sqlite3.h, not to the sqlite3.h
        # produced here.
        shell_dir = os.path.join(amalgamation_dir, 'shell')
        if not os.path.exists(shell_dir):
            os.mkdir(shell_dir)
        copyfile(
            os.path.join(_TEMP_CONFIG_DIR, 'shell.c'),
            os.path.join(shell_dir, 'shell.c'))
    finally:
        rmtree(_TEMP_CONFIG_DIR)
Generate the aggregate source files.
Generate the aggregate source files.
Generate the aggregate source files .
def make_aggregate(config_name):
    if not os.path.exists(_TEMP_CONFIG_DIR):
        os.mkdir(_TEMP_CONFIG_DIR)
    try:
        os.chdir(_TEMP_CONFIG_DIR)
        _do_configure(config_name)
        cmd = ['make', 'shell.c', 'sqlite3.h', 'sqlite3.c']
        subprocess.check_call(cmd)
        amalgamation_dir = get_amalgamation_dir(config_name)
        if not os.path.exists(amalgamation_dir):
            os.mkdir(amalgamation_dir)
        readme_dst = os.path.join(amalgamation_dir, 'README.md')
        if not os.path.exists(readme_dst):
            readme_src = os.path.join(_SQLITE_ROOT_DIR, 'scripts',
                                      'README_amalgamation.md')
            copyfile(readme_src, readme_dst)
        copyfile(
            os.path.join(_TEMP_CONFIG_DIR, 'sqlite3.c'),
            os.path.join(amalgamation_dir, 'sqlite3.c'))
        copyfile(
            os.path.join(_TEMP_CONFIG_DIR, 'sqlite3.h'),
            os.path.join(amalgamation_dir, 'sqlite3.h'))
        shell_dir = os.path.join(amalgamation_dir, 'shell')
        if not os.path.exists(shell_dir):
            os.mkdir(shell_dir)
        copyfile(
            os.path.join(_TEMP_CONFIG_DIR, 'shell.c'),
            os.path.join(shell_dir, 'shell.c'))
    finally:
        rmtree(_TEMP_CONFIG_DIR)
def make_aggregate ( config_name ) : if not os . path . exists ( _TEMP_CONFIG_DIR ) : os . mkdir ( _TEMP_CONFIG_DIR ) try : os . chdir ( _TEMP_CONFIG_DIR ) _do_configure ( config_name ) cmd = [ 'make' , 'shell.c' , 'sqlite3.h' , 'sqlite3.c' ] subprocess . check_call ( cmd ) amalgamation_dir = get_amalgamation_dir ( config_name ) if not os . path . exists ( amalgamation_dir ) : os . mkdir ( amalgamation_dir ) readme_dst = os . path . join ( amalgamation_dir , 'README.md' ) if not os . path . exists ( readme_dst ) : readme_src = os . path . join ( _SQLITE_ROOT_DIR , 'scripts' , 'README_amalgamation.md' ) copyfile ( readme_src , readme_dst ) copyfile ( os . path . join ( _TEMP_CONFIG_DIR , 'sqlite3.c' ) , os . path . join ( amalgamation_dir , 'sqlite3.c' ) ) copyfile ( os . path . join ( _TEMP_CONFIG_DIR , 'sqlite3.h' ) , os . path . join ( amalgamation_dir , 'sqlite3.h' ) ) shell_dir = os . path . join ( amalgamation_dir , 'shell' ) if not os . path . exists ( shell_dir ) : os . mkdir ( shell_dir ) copyfile ( os . path . join ( _TEMP_CONFIG_DIR , 'shell.c' ) , os . path . join ( shell_dir , 'shell.c' ) ) finally : rmtree ( _TEMP_CONFIG_DIR )
Generate the aggregate source files.
Generate the aggregate source files .
"""Generate the aggregate source files.""" # shell.c must be placed in a different directory from sqlite3.h, # because it contains an '#include "sqlite3.h"' that we want to resolve # to our custom //third_party/sqlite/sqlite3.h, not to the sqlite3.h # produced here.
config_name