blob: 7fa9d639a72b83820316bab4457f41cf2f0a58f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
--- tools/gyp/pylib/gyp/generator/make.py (revision 839)
+++ tools/gyp/pylib/gyp/generator/make.py (working copy)
@@ -497,6 +497,12 @@
return string
+def StringToMakefileVariable(string):
+ """Convert a string to a value that is acceptable as a make variable name."""
+ # TODO: replace other metacharacters that we encounter.
+ return string.replace(' ', '_')
+
+
srcdir_prefix = ''
def Sourceify(path):
"""Convert a path to its source directory form."""
@@ -656,7 +662,7 @@
part_of_all: flag indicating this target is part of 'all'
"""
for action in actions:
- name = self.target + '_' + action['action_name']
+ name = self.target + '_' + StringToMakefileVariable(action['action_name'])
self.WriteLn('### Rules for action "%s":' % action['action_name'])
inputs = action['inputs']
outputs = action['outputs']
@@ -725,7 +731,7 @@
part_of_all: flag indicating this target is part of 'all'
"""
for rule in rules:
- name = self.target + '_' + rule['rule_name']
+ name = self.target + '_' + StringToMakefileVariable(rule['rule_name'])
count = 0
self.WriteLn('### Generated for rule %s:' % name)
|