Bug 1407388 - Remove build/unix/elfhack/inject/Makefile.in and replace with generated files. r=mshal
authorChris Manchester <cmanchester@mozilla.com>
Tue, 07 Nov 2017 16:54:22 -0800
changeset 443918 98d83d839fee3cbb2cd3dc043311f75e46b029a8
parent 443917 1360d35b11dc2760a28f68d29d600a098e4b6624
child 443919 a8c72ed6284859fd0617ff09c3ad99b33e2f2ca8
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1407388
milestone58.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 1407388 - Remove build/unix/elfhack/inject/Makefile.in and replace with generated files. r=mshal MozReview-Commit-ID: Cr2RUlksKBJ
build/unix/elfhack/inject/Makefile.in
build/unix/elfhack/inject/copy_source.py
build/unix/elfhack/inject/moz.build
deleted file mode 100644
--- a/build/unix/elfhack/inject/Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# 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/.
-
-include $(topsrcdir)/config/rules.mk
-
-$(CSRCS): %.c: ../inject.c
-	cp $< $@
-
-GARBAGE += $(CSRCS)
new file mode 100644
--- /dev/null
+++ b/build/unix/elfhack/inject/copy_source.py
@@ -0,0 +1,9 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+def copy(out_file, in_path):
+    with open(in_path, 'r') as fh:
+        out_file.write(fh.read())
--- a/build/unix/elfhack/inject/moz.build
+++ b/build/unix/elfhack/inject/moz.build
@@ -12,18 +12,26 @@ DIST_INSTALL = False
 
 if CONFIG['TARGET_CPU'].endswith('86'):
     cpu = 'x86'
 elif CONFIG['TARGET_CPU'].startswith('arm'):
     cpu = 'arm'
 else:
     cpu = CONFIG['TARGET_CPU']
 
+gen_src = '%s.c' % cpu
+GENERATED_FILES += [
+    gen_src,
+]
+
+GENERATED_FILES[gen_src].script = 'copy_source.py:copy'
+GENERATED_FILES[gen_src].inputs = ['../inject.c']
+
 SOURCES += [
-    "!%s.c" % cpu,
+    '!%s' % gen_src,
 ]
 
 NO_PGO = True
 
 for v in ('OS_CPPFLAGS', 'OS_CFLAGS', 'DEBUG', 'CLANG_PLUGIN', 'OPTIMIZE',
           'FRAMEPTR'):
     flags = []
     idx = 0