1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 # You can obtain one at http://mozilla.org/MPL/2.0/.
11 def makeQuote(filename
):
12 return filename
.replace(' ', '\\ ') # enjoy!
14 def writeMakeDependOutput(filename
):
15 print "Creating makedepend file", filename
16 dir = os
.path
.dirname(filename
)
17 if dir and not os
.path
.exists(dir):
20 except OSError as error
:
21 if error
.errno
!= errno
.EEXIST
:
24 with
open(filename
, 'w') as f
:
26 f
.write("%s:" % makeQuote(targets
[0]))
27 for filename
in dependencies
:
28 f
.write(' \\\n\t\t%s' % makeQuote(filename
))
30 for filename
in targets
[1:]:
31 f
.write('%s: %s\n' % (makeQuote(filename
), makeQuote(targets
[0])))
32 for filename
in dependencies
:
33 f
.write('%s:\n' % filename
)