Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: pylib/gyp/generator/make.py

Issue 3141004: make: Fixup variable names for actions and rules.... (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/make.py
===================================================================
--- pylib/gyp/generator/make.py (revision 839)
+++ 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698