mirror of https://github.com/python/cpython
Reindented, removed tabs.
Also added simple "clean" target (removes *.o and executable).
This commit is contained in:
parent
3c51cf2b69
commit
541e783664
|
@ -4,24 +4,30 @@ import os
|
||||||
import string
|
import string
|
||||||
|
|
||||||
def makemakefile(outfp, makevars, files, target):
|
def makemakefile(outfp, makevars, files, target):
|
||||||
outfp.write("# Makefile generated by freeze.py script\n\n")
|
outfp.write("# Makefile generated by freeze.py script\n\n")
|
||||||
|
|
||||||
keys = makevars.keys()
|
keys = makevars.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
for key in keys:
|
for key in keys:
|
||||||
outfp.write("%s=%s\n" % (key, makevars[key]))
|
outfp.write("%s=%s\n" % (key, makevars[key]))
|
||||||
outfp.write("\nall: %s\n" % target)
|
outfp.write("\nall: %s\n\n" % target)
|
||||||
|
|
||||||
deps = []
|
deps = []
|
||||||
for i in range(len(files)):
|
for i in range(len(files)):
|
||||||
file = files[i]
|
file = files[i]
|
||||||
if file[-2:] == '.c':
|
if file[-2:] == '.c':
|
||||||
base = os.path.basename(file)
|
base = os.path.basename(file)
|
||||||
dest = base[:-2] + '.o'
|
dest = base[:-2] + '.o'
|
||||||
outfp.write("%s: %s\n" % (dest, file))
|
outfp.write("%s: %s\n" % (dest, file))
|
||||||
outfp.write("\t$(CC) $(CFLAGS) -c %s\n" % file)
|
outfp.write("\t$(CC) $(CFLAGS) -c %s\n" % file)
|
||||||
files[i] = dest
|
files[i] = dest
|
||||||
deps.append(dest)
|
deps.append(dest)
|
||||||
|
|
||||||
outfp.write("\n%s: %s\n" % (target, string.join(deps)))
|
outfp.write("\n%s: %s\n" % (target, string.join(deps)))
|
||||||
outfp.write("\t$(CC) %s -o %s\n" % (string.join(files), target))
|
outfp.write("\t$(CC) %s -o %s\n" % (string.join(files), target))
|
||||||
|
|
||||||
|
outfp.write("\nclean:\n\t-rm -f *.o %s\n" % target)
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# End:
|
||||||
|
|
Loading…
Reference in New Issue