Cleanup mktargets.py

1.Remove semicolons
2.close file
This commit is contained in:
Varun B Patil 2014-01-19 21:38:12 +05:30
parent a50d54f8e8
commit d78906aa21

View File

@ -27,7 +27,7 @@ def write_cpp_rule_pattern(f):
dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
f.write("%s: %s\n"%(dst, src))
f.write('\t$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c $(CXX_O) $<\n');
f.write('\t$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c $(CXX_O) $<\n')
f.write("\n")
def write_asm_rule_pattern(f):
@ -35,7 +35,7 @@ def write_asm_rule_pattern(f):
dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
f.write("%s: %s\n"%(dst, src))
f.write('\t$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(' + PREFIX + '_ASMFLAGS) $(' + PREFIX + '_ASM_INCLUDES) -o $@ $<\n');
f.write('\t$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(' + PREFIX + '_ASMFLAGS) $(' + PREFIX + '_ASM_INCLUDES) -o $@ $<\n')
f.write("\n")
@ -86,7 +86,7 @@ f.write("\n")
f.write("%s_OBJS += $(%s_CPP_SRCS:%s=.o)\n"%(PREFIX, PREFIX, CPP_SUFFIX))
if len(asm) > 0:
f.write("ifeq ($(USE_ASM), Yes)\n");
f.write("ifeq ($(USE_ASM), Yes)\n")
f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
for c in asm:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
@ -102,15 +102,17 @@ if len(asm) > 0:
write_asm_rule_pattern(f)
if args.library is not None:
f.write("$(LIBPREFIX)%s.$(LIBSUFFIX): $(%s_OBJS)\n"%(args.library, PREFIX));
f.write("$(LIBPREFIX)%s.$(LIBSUFFIX): $(%s_OBJS)\n"%(args.library, PREFIX))
f.write("\trm -f $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
f.write("\t$(AR) $(AR_OPTS) $(%s_OBJS)\n"%PREFIX);
f.write("\n");
f.write("libraries: $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library);
f.write("LIBRARIES += $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library);
f.write("\t$(AR) $(AR_OPTS) $(%s_OBJS)\n"%PREFIX)
f.write("\n")
f.write("libraries: $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
f.write("LIBRARIES += $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
if args.binary is not None:
f.write("%s: $(%s_OBJS) $(LIBS) $(%s_LIBS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX, PREFIX))
f.write("\t$(CXX) $(CXX_LINK_O) $(%s_OBJS) $(%s_LDFLAGS) $(%s_LIBS) $(LDFLAGS) $(LIBS)\n\n"%(PREFIX, PREFIX, PREFIX))
f.write("binaries: %s\n"%args.binary);
f.write("BINARIES += %s\n"%args.binary);
f.write("binaries: %s\n"%args.binary)
f.write("BINARIES += %s\n"%args.binary)
f.close()