summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-05-16 03:28:22 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-05-16 03:28:22 +0100
commit9abfc01938b40272982a592d297b8b7d2c93f925 (patch)
tree7ee4d89dc6f7cc3ff02d35b432b079ae129ddda7
parent38866a9f5fb4485d215e51dcd6bb7255d24a9cc7 (diff)
do not add a final separator.
The Makefile used to have a trailing newline at the end of the file. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
-rwxr-xr-xgen_makefile.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gen_makefile.py b/gen_makefile.py
index 93adaf0..7b66592 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -43,8 +43,6 @@ class makefile_generator():
for cmd in cmds:
print('\t%s' % (cmd))
- self.append_separator()
-
def append_static_rule(self, target, dep='', cmds=[]):
self.append_rule(target, dep, cmds)
self.phony.append(target)
@@ -70,11 +68,13 @@ class makefile_generator():
# first rule to be evaluated
self.append_static_rule('all', '$(NAME)')
+ self.append_separator()
# linkage
self.append_rule('$(NAME)', '$(OBJ)', [
'$(%s) -o "$@" $^ $(LDFLAGS)' % (self._compiler_var)
])
+ self.append_separator()
# include dependencies
print('-include $(DEP)')
@@ -85,18 +85,22 @@ class makefile_generator():
'$(%s) -MM $(CPPFLAGS) $(%s) $< -MF $@ -MT "$*.o $@"' %
(self._compiler_var, self._compiler_flags_var),
])
+ self.append_separator()
self.append_static_rule('clean', cmds=[
'$(RM) $(OBJ)',
'$(RM) $(NAME)',
])
+ self.append_separator()
self.append_static_rule('mrproper', 'clean', [
'$(RM) $(DEP)',
])
+ self.append_separator()
self.append_static_rule('distclean', 'mrproper', [
'$(RM) $(addsuffix ~,$(SRC))',
'$(RM) $(wildcard $(addsuffix .sw*,$(addprefix .,$(SRC))))',
])
+ self.append_separator()
# phony rule
self.append_rule('.PHONY', ' '.join(self.phony))