python/codegen/makeutils.py
author Gaia Pushbot <release+gaiajson@mozilla.com>
Fri, 21 Jun 2013 07:10:21 -0700
changeset 147598 9abebeb1a290ca9e22631509cca7ee8a03603829
parent 139179 260999a5d63b383d04c070410417828db69196d6
permissions -rw-r--r--
Bumping gaia.json for 4 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/8dbe6215ffc8 Author: Anthony Ricaud <anthony@ricaud.me> Desc: Merge pull request #10509 from Rik/latest-closure-linter-870729 Bug 870729 - Disable specific code errors instead of --nojsdoc r=yurenju ======== https://hg.mozilla.org/integration/gaia-central/rev/7370a7fe21a8 Author: Anthony Ricaud <anthony@ricaud.me> Desc: Bug 870729 - Disable specific code errors instead of --nojsdoc This will let us use the latest closure-linter ======== https://hg.mozilla.org/integration/gaia-central/rev/4c5c1fb7d3db Author: Ben Francis <ben@tola.me.uk> Desc: Merge pull request #10522 from daleharvey/806556 Bug 806556 - Change wording of url placeholder text r=benfrancis ======== https://hg.mozilla.org/integration/gaia-central/rev/a90a109458af Author: Dale Harvey <dale@arandomurl.com> Desc: Bug 806556 - Change wording of url placeholder text

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

import errno
import os

dependencies = []
targets = []

def makeQuote(filename):
    return filename.replace(' ', '\\ ')  # enjoy!

def writeMakeDependOutput(filename):
    print "Creating makedepend file", filename
    dir = os.path.dirname(filename)
    if dir and not os.path.exists(dir):
        try:
            os.makedirs(dir)
        except OSError as error:
            if error.errno != errno.EEXIST:
                raise

    with open(filename, 'w') as f:
        if len(targets) > 0:
            f.write("%s:" % makeQuote(targets[0]))
            for filename in dependencies:
                f.write(' \\\n\t\t%s' % makeQuote(filename))
            f.write('\n')
            for filename in targets[1:]:
                f.write('%s: %s\n' % (makeQuote(filename), makeQuote(targets[0])))
            for filename in dependencies:
                f.write('%s:\n' % filename)