annotate Tools/freeze/makemakefile.py @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents c3a096bfbd6b
children 063530fcc32e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1925
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 # Write the actual Makefile.
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 import os
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
4
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 def makemakefile(outfp, makevars, files, target):
7556
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
6 outfp.write("# Makefile generated by freeze.py script\n\n")
1925
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
7556
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
8 keys = makevars.keys()
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
9 keys.sort()
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
10 for key in keys:
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
11 outfp.write("%s=%s\n" % (key, makevars[key]))
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
12 outfp.write("\nall: %s\n\n" % target)
1925
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13
7556
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
14 deps = []
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
15 for i in range(len(files)):
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
16 file = files[i]
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
17 if file[-2:] == '.c':
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
18 base = os.path.basename(file)
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
19 dest = base[:-2] + '.o'
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
20 outfp.write("%s: %s\n" % (dest, file))
18016
0d6f760b6ef1 Separate CFLAGS and CPPFLAGS. CFLAGS should not contain preprocessor
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 8492
diff changeset
21 outfp.write("\t$(CC) $(CFLAGS) $(CPPFLAGS) -c %s\n" % file)
7556
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
22 files[i] = dest
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
23 deps.append(dest)
1925
a1aba4d45893 Totally new "freeze" program.
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
25219
8a7a2f1f88f0 Apply diff2.txt from SF patch http://www.python.org/sf/572113
Walter Dörwald <walter@livinglogic.de>
parents: 22799
diff changeset
25 outfp.write("\n%s: %s\n" % (target, ' '.join(deps)))
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 25219
diff changeset
26 outfp.write("\t$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) %s -o %s $(LDLAST)\n" %
25219
8a7a2f1f88f0 Apply diff2.txt from SF patch http://www.python.org/sf/572113
Walter Dörwald <walter@livinglogic.de>
parents: 22799
diff changeset
27 (' '.join(files), target))
7556
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
28
733950804a0b Reindented, removed tabs.
Guido van Rossum <guido@python.org>
parents: 1925
diff changeset
29 outfp.write("\nclean:\n\t-rm -f *.o %s\n" % target)