def METHOD_NAME(self, spec, prefix):
    "No make-file, must create one from scratch."
    open("mpi/param.h", "w").write(open("param.h").read())
    for fpfx in (".", "mpi"):
        vrs = "%sfftever" % ["", "", "", "p"][len(fpfx)]
        s6 = 6 * " "
        fd = open("%s/%s.f" % (fpfx, vrs), "w")
        fd.write("%ssubroutine %s(i,j,k)\n" % (s6, vrs))
        fd.write("%sinteger i,j,k\n" % s6)
        fd.write("%si=%s\n" % (s6, spec.version[0]))
        fd.write("%sj=%s\n" % (s6, spec.version[1]))
        fd.write("%sk=0\n%sreturn\n%send\n" % (3 * (s6,)))
        fd.close()
        ff, cuf, vf = [], [], []
        for f in glob.glob("%s/*.f" % fpfx):
            nf = f.replace(".f", ".o").replace("%s/" % fpfx, "")
            if "/cu" in f or "/pcu" in f:
                cuf.append(nf)
            elif "/v" in f or "/pv" in f:
                vf.append(nf)
            else:
                ff.append(nf)
        if "." == fpfx:
            lbnm = "libffte.a"
        else:
            lbnm = "libfftempi.a"
        for spc, vrf, rs, ip in (("+vector", vf, "v", 2), ("+cuda", cuf, "cu", 3)):
            if spc in spec:
                for f in vrf:  # replace with variant versions
                    orgf = f[:ip].replace(rs, "") + f[ip:]
                    if orgf in ff:  # already reference implementation?
                        del ff[ff.index(orgf)]
                ff.extend(vrf)
        aff = " ".join(ff)
        fd = open("%s/Makefile" % fpfx, "w")
        fd.write("all: %s\n" % lbnm)
        if "+mpi" in spec and "." == fpfx:
            fd.write("\tcd mpi ; $(MAKE)\n")
        fd.write("\n%s: %s\n" % (lbnm, aff))
        fd.write("\tar rc %s %s\n" % (lbnm, aff))
        fd.write("\tranlib %s\n" % lbnm)
        fd.close()