Staging
v0.8.1
Revision 1a4b593dd67a9c9cbb1560f4c00ac9a63218aca7 authored by Fred Drake on 10 April 2000, 15:36:39 UTC, committed by Fred Drake on 10 April 2000, 15:36:39 UTC
Instead of assuming that the number process ids of the threads is the
same as the process id of the controlling process, use a copy of the
dictionary and check for changes in the process ids of the threads
from the thread's process ids in the parent process.  This makes the
test make more sense on systems which assign a new pid to each thread
(i.e., Linux).

This doesn't fix the other problems evident with this test on Linux.
1 parent 9706486
Raw File
makemakefile.py
# Write the actual Makefile.

import os
import string

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) -c %s\n" % file)
            files[i] = dest
            deps.append(dest)

    outfp.write("\n%s: %s\n" % (target, string.join(deps)))
    outfp.write("\t$(CC) %s -o %s $(LDLAST)\n" % 
                (string.join(files), target))

    outfp.write("\nclean:\n\t-rm -f *.o %s\n" % target)
back to top