summaryrefslogtreecommitdiffstats
path: root/Tools/freeze/winmakemakefile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 23:27:01 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 23:27:01 (GMT)
commit96bf7e8a37b0785b6fed2e678e289a6b1873f07f (patch)
tree1ae1603ee285ff32f0be922dc5722d2225a509ea /Tools/freeze/winmakemakefile.py
parent79139b247b0bc0bc1b1a12932140bbd4bc188df7 (diff)
downloadcpython-96bf7e8a37b0785b6fed2e678e289a6b1873f07f.zip
cpython-96bf7e8a37b0785b6fed2e678e289a6b1873f07f.tar.gz
cpython-96bf7e8a37b0785b6fed2e678e289a6b1873f07f.tar.bz2
Fix test_frozen.
Diffstat (limited to 'Tools/freeze/winmakemakefile.py')
-rw-r--r--Tools/freeze/winmakemakefile.py124
1 files changed, 62 insertions, 62 deletions
diff --git a/Tools/freeze/winmakemakefile.py b/Tools/freeze/winmakemakefile.py
index 8570f3d..e473fed 100644
--- a/Tools/freeze/winmakemakefile.py
+++ b/Tools/freeze/winmakemakefile.py
@@ -52,29 +52,29 @@ def makemakefile(outfp, vars, files, target):
def realwork(vars, moddefns, target):
version_suffix = "%r%r" % sys.version_info[:2]
- print "# Makefile for Microsoft Visual C++ generated by freeze.py script"
- print
- print 'target = %s' % target
- print 'pythonhome = %s' % vars['prefix']
- print
- print 'DEBUG=0 # Set to 1 to use the _d versions of Python.'
- print '!IF $(DEBUG)'
- print 'debug_suffix=_d'
- print 'c_debug=/Zi /Od /DDEBUG /D_DEBUG'
- print 'l_debug=/DEBUG'
- print 'temp_dir=Build\\Debug'
- print '!ELSE'
- print 'debug_suffix='
- print 'c_debug=/Ox'
- print 'l_debug='
- print 'temp_dir=Build\\Release'
- print '!ENDIF'
- print
-
- print '# The following line assumes you have built Python using the standard instructions'
- print '# Otherwise fix the following line to point to the library.'
- print 'pythonlib = "$(pythonhome)/pcbuild/python%s$(debug_suffix).lib"' % version_suffix
- print
+ print("# Makefile for Microsoft Visual C++ generated by freeze.py script")
+ print()
+ print('target = %s' % target)
+ print('pythonhome = %s' % vars['prefix'])
+ print()
+ print('DEBUG=0 # Set to 1 to use the _d versions of Python.')
+ print('!IF $(DEBUG)')
+ print('debug_suffix=_d')
+ print('c_debug=/Zi /Od /DDEBUG /D_DEBUG')
+ print('l_debug=/DEBUG')
+ print('temp_dir=Build\\Debug')
+ print('!ELSE')
+ print('debug_suffix=')
+ print('c_debug=/Ox')
+ print('l_debug=')
+ print('temp_dir=Build\\Release')
+ print('!ENDIF')
+ print()
+
+ print('# The following line assumes you have built Python using the standard instructions')
+ print('# Otherwise fix the following line to point to the library.')
+ print('pythonlib = "$(pythonhome)/pcbuild/python%s$(debug_suffix).lib"' % version_suffix)
+ print()
# We only ever write one "entry point" symbol - either
# "main" or "WinMain". Therefore, there is no need to
@@ -88,59 +88,59 @@ def realwork(vars, moddefns, target):
target_ext = ".dll"
- print "# As the target uses Python%s.dll, we must use this compiler option!" % version_suffix
- print "cdl = /MD"
- print
- print "all: $(target)$(debug_suffix)%s" % (target_ext)
- print
+ print("# As the target uses Python%s.dll, we must use this compiler option!" % version_suffix)
+ print("cdl = /MD")
+ print()
+ print("all: $(target)$(debug_suffix)%s" % (target_ext))
+ print()
- print '$(temp_dir):'
- print ' if not exist $(temp_dir)\. mkdir $(temp_dir)'
- print
+ print('$(temp_dir):')
+ print(' if not exist $(temp_dir)\. mkdir $(temp_dir)')
+ print()
objects = []
libs = ["shell32.lib", "comdlg32.lib", "wsock32.lib", "user32.lib", "oleaut32.lib"]
for moddefn in moddefns:
- print "# Module", moddefn.name
+ print("# Module", moddefn.name)
for file in moddefn.sourceFiles:
base = os.path.basename(file)
base, ext = os.path.splitext(base)
objects.append(base + ".obj")
- print '$(temp_dir)\%s.obj: "%s"' % (base, file)
- print "\t@$(CC) -c -nologo /Fo$* $(cdl) $(c_debug) /D BUILD_FREEZE",
- print '"-I$(pythonhome)/Include" "-I$(pythonhome)/PC" \\'
- print "\t\t$(cflags) $(cdebug) $(cinclude) \\"
+ print('$(temp_dir)\%s.obj: "%s"' % (base, file))
+ print("\t@$(CC) -c -nologo /Fo$* $(cdl) $(c_debug) /D BUILD_FREEZE", end=' ')
+ print('"-I$(pythonhome)/Include" "-I$(pythonhome)/PC" \\')
+ print("\t\t$(cflags) $(cdebug) $(cinclude) \\")
extra = moddefn.GetCompilerOptions()
if extra:
- print "\t\t%s \\" % (' '.join(extra),)
- print '\t\t"%s"' % file
- print
+ print("\t\t%s \\" % (' '.join(extra),))
+ print('\t\t"%s"' % file)
+ print()
# Add .lib files this module needs
for modlib in moddefn.GetLinkerLibs():
if modlib not in libs:
libs.append(modlib)
- print "ADDN_LINK_FILES=",
- for addn in vars['addn_link']: print '"%s"' % (addn),
- print ; print
-
- print "OBJS=",
- for obj in objects: print '"$(temp_dir)\%s"' % (obj),
- print ; print
-
- print "LIBS=",
- for lib in libs: print '"%s"' % (lib),
- print ; print
-
- print "$(target)$(debug_suffix)%s: $(temp_dir) $(OBJS)" % (target_ext)
- print "\tlink -out:$(target)$(debug_suffix)%s %s" % (target_ext, target_link_flags),
- print "\t$(OBJS) \\"
- print "\t$(LIBS) \\"
- print "\t$(ADDN_LINK_FILES) \\"
- print "\t$(pythonlib) $(lcustom) $(l_debug)\\"
- print "\t$(resources)"
- print
- print "clean:"
- print "\t-rm -f *.obj"
- print "\t-rm -f $(target).exe"
+ print("ADDN_LINK_FILES=", end=' ')
+ for addn in vars['addn_link']: print('"%s"' % (addn), end=' ')
+ print() ; print()
+
+ print("OBJS=", end=' ')
+ for obj in objects: print('"$(temp_dir)\%s"' % (obj), end=' ')
+ print() ; print()
+
+ print("LIBS=", end=' ')
+ for lib in libs: print('"%s"' % (lib), end=' ')
+ print() ; print()
+
+ print("$(target)$(debug_suffix)%s: $(temp_dir) $(OBJS)" % (target_ext))
+ print("\tlink -out:$(target)$(debug_suffix)%s %s" % (target_ext, target_link_flags), end=' ')
+ print("\t$(OBJS) \\")
+ print("\t$(LIBS) \\")
+ print("\t$(ADDN_LINK_FILES) \\")
+ print("\t$(pythonlib) $(lcustom) $(l_debug)\\")
+ print("\t$(resources)")
+ print()
+ print("clean:")
+ print("\t-rm -f *.obj")
+ print("\t-rm -f $(target).exe")