Back to index

python3.2  3.2.2
Functions
makemakefile Namespace Reference

Functions

def makemakefile

Function Documentation

def makemakefile.makemakefile (   outfp,
  makevars,
  files,
  target 
)

Definition at line 5 of file makemakefile.py.

00005 
00006 def makemakefile(outfp, makevars, files, target):
00007     outfp.write("# Makefile generated by freeze.py script\n\n")
00008 
00009     keys = sorted(makevars.keys())
00010     for key in keys:
00011         outfp.write("%s=%s\n" % (key, makevars[key]))
00012     outfp.write("\nall: %s\n\n" % target)
00013 
00014     deps = []
00015     for i in range(len(files)):
00016         file = files[i]
00017         if file[-2:] == '.c':
00018             base = os.path.basename(file)
00019             dest = base[:-2] + '.o'
00020             outfp.write("%s: %s\n" % (dest, file))
00021             outfp.write("\t$(CC) $(CFLAGS) $(CPPFLAGS) -c %s\n" % file)
00022             files[i] = dest
00023             deps.append(dest)
00024 
00025     outfp.write("\n%s: %s\n" % (target, ' '.join(deps)))
00026     outfp.write("\t$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) %s -o %s $(LDLAST)\n" %
00027                 (' '.join(files), target))
00028 
00029     outfp.write("\nclean:\n\t-rm -f *.o %s\n" % target)

Here is the call graph for this function:

Here is the caller graph for this function: