Bug 916257 - part 1 - convert ipdlsrcs.mk writing to use mozbuild.makeutil; r=gps
authorNathan Froyd <froydnj@mozilla.com>
Fri, 13 Sep 2013 14:57:32 -0400
changeset 148814 deade1888427
parent 148813 7f6a64558d02
child 148815 34649bc0a5e2
push id25360
push userryanvm@gmail.com
push date2013-09-27 01:29 +0000
treeherdermozilla-central@4313ea50a8ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs916257
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 916257 - part 1 - convert ipdlsrcs.mk writing to use mozbuild.makeutil; r=gps
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -6,16 +6,17 @@ from __future__ import unicode_literals
 
 import errno
 import logging
 import os
 import types
 
 from collections import namedtuple
 
+import mozbuild.makeutil as mozmakeutil
 from mozpack.copier import FilePurger
 from mozpack.manifests import (
     InstallManifest,
 )
 import mozpack.path as mozpath
 
 from .common import CommonBackend
 from ..frontend.data import (
@@ -549,31 +550,35 @@ class RecursiveMakeBackend(CommonBackend
 
             self._update_from_avoid_write(bf.close())
             self.summary.managed_count += 1
 
 
         # Write out a master list of all IPDL source files.
         ipdls = FileAvoidWrite(os.path.join(self.environment.topobjdir,
             'ipc', 'ipdl', 'ipdlsrcs.mk'))
+        mk = mozmakeutil.Makefile()
+
         for p in sorted(self._ipdl_sources):
-            ipdls.write('ALL_IPDLSRCS += %s\n' % p)
+            mk.add_statement('ALL_IPDLSRCS += %s\n' % p)
             base = os.path.basename(p)
             root, ext = os.path.splitext(base)
 
             # Both .ipdl and .ipdlh become .cpp files
-            ipdls.write('CPPSRCS += %s.cpp\n' % root)
+            mk.add_statement('CPPSRCS += %s.cpp\n' % root)
             if ext == '.ipdl':
                 # .ipdl also becomes Child/Parent.cpp files
-                ipdls.write('CPPSRCS += %sChild.cpp\n' % root)
-                ipdls.write('CPPSRCS += %sParent.cpp\n' % root)
+                mk.add_statement('CPPSRCS += %sChild.cpp\n' % root)
+                mk.add_statement('CPPSRCS += %sParent.cpp\n' % root)
 
-        ipdls.write('IPDLDIRS := %s\n' % ' '.join(sorted(set(os.path.dirname(p)
+        mk.add_statement('IPDLDIRS := %s\n' % ' '.join(sorted(set(os.path.dirname(p)
             for p in self._ipdl_sources))))
 
+        mk.dump(ipdls)
+
         self._update_from_avoid_write(ipdls.close())
         self.summary.managed_count += 1
 
         # Write out master lists of WebIDL source files.
         webidls = FileAvoidWrite(os.path.join(self.environment.topobjdir,
               'dom', 'bindings', 'webidlsrcs.mk'))
 
         for webidl in sorted(self._webidl_sources):