diff options
-rwxr-xr-x | gen_makefile.py | 8 |
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)) |