summaryrefslogtreecommitdiff
path: root/gen_makefile.py
diff options
context:
space:
mode:
Diffstat (limited to 'gen_makefile.py')
-rwxr-xr-xgen_makefile.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/gen_makefile.py b/gen_makefile.py
index 0940739..3b70af4 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -33,7 +33,7 @@ class makefile_generator():
def append_separator(self):
print('')
- def append_rule(self, target, dep='', cmds={}):
+ def append_rule(self, target, dep='', cmds=[]):
print('%s: %s' % (target, dep))
for cmd in cmds:
@@ -41,7 +41,7 @@ class makefile_generator():
self.append_separator()
- def append_static_rule(self, target, dep='', cmds={}):
+ def append_static_rule(self, target, dep='', cmds=[]):
self.append_rule(target, dep, cmds)
self.phony.append(target)
@@ -68,30 +68,30 @@ class makefile_generator():
self.append_static_rule('all', '$(NAME)')
# linkage
- self.append_rule('$(NAME)', '$(OBJ)', {
+ self.append_rule('$(NAME)', '$(OBJ)', [
'$(%s) -o "$@" $^ $(LDFLAGS)' % (self._compiler_var)
- })
+ ])
# include dependencies
print('-include $(DEP)')
self.append_separator()
# rule to generate dependencies
- self.append_rule('%.d', '%%.%s' % (self._extension), {
+ self.append_rule('%.d', '%%.%s' % (self._extension), [
'$(%s) -MM $(CPPFLAGS) $(%s) $< -MF $@ -MT "$*.o $@"' %
(self._compiler_var, self._compiler_flags_var),
- })
+ ])
- self.append_static_rule('clean', cmds={
+ self.append_static_rule('clean', cmds=[
'$(RM) $(OBJ)',
'$(RM) $(NAME)',
- })
- self.append_static_rule('mrproper', 'clean', {
+ ])
+ self.append_static_rule('mrproper', 'clean', [
'$(RM) $(DEP)',
- })
- self.append_static_rule('distclean', 'mrproper', {
- '$(RM) $(addsuffix ~,$(SRC))'
- })
+ ])
+ self.append_static_rule('distclean', 'mrproper', [
+ '$(RM) $(addsuffix ~,$(SRC))',
+ ])
# phony rule
self.append_rule('.PHONY', ' '.join(self.phony))