summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-03-01 14:53:03 +0000
committerOlivier Gayot <duskcoder@gmail.com>2015-03-01 15:02:18 +0000
commit9e9c334b402fe79befb82153027e316a6cb1ff5c (patch)
treeb090b20a7cdd93e3a963c5a3245c9a497897e528
parentb518ed8dc4a884f9c48998367db17b3f96561ca7 (diff)
avoid trailing spaces
if no dependencies are given, we should not print a space after the colon. fixed by checking if dependencies are given Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
-rwxr-xr-xgen_makefile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gen_makefile.py b/gen_makefile.py
index 2f4e3f8..6585f3b 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -34,7 +34,11 @@ class makefile_generator():
print('')
def append_rule(self, target, dep='', cmds=[]):
- print('%s: %s' % (target, dep))
+ print(target + ':', end='')
+ if dep is not '':
+ print(' ', end='')
+
+ print(dep)
for cmd in cmds:
print('\t%s' % (cmd))