summaryrefslogtreecommitdiffstats
path: root/AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makemakefile.py
diff options
context:
space:
mode:
Diffstat (limited to 'AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makemakefile.py')
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makemakefile.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makemakefile.py b/AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makemakefile.py
new file mode 100644
index 0000000000..0b818904c4
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/makemakefile.py
@@ -0,0 +1,29 @@
+# Write the actual Makefile.
+
+import os
+
+def makemakefile(outfp, makevars, files, target):
+ outfp.write("# Makefile generated by freeze.py script\n\n")
+
+ keys = makevars.keys()
+ keys.sort()
+ for key in keys:
+ outfp.write("%s=%s\n" % (key, makevars[key]))
+ outfp.write("\nall: %s\n\n" % target)
+
+ deps = []
+ for i in range(len(files)):
+ file = files[i]
+ if file[-2:] == '.c':
+ base = os.path.basename(file)
+ dest = base[:-2] + '.o'
+ outfp.write("%s: %s\n" % (dest, file))
+ outfp.write("\t$(CC) $(CFLAGS) $(CPPFLAGS) -c %s\n" % file)
+ files[i] = dest
+ deps.append(dest)
+
+ outfp.write("\n%s: %s\n" % (target, ' '.join(deps)))
+ outfp.write("\t$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) %s -o %s $(LDLAST)\n" %
+ (' '.join(files), target))
+
+ outfp.write("\nclean:\n\t-rm -f *.o %s\n" % target)