forked from bartvdbraak/blender
e46a6d2611
I also moved it so that it gets put in: $(OCGDIR)/blender/bpython/$(DEBUG_DIR)libfrozen.a and removed the stuff from the readme on how to do it by hand. (I made one other small change and that was to comment out the ssr target on solaris and freebsd in source/Makefile I forgot to commit it yesterday) Kent -- mein@cs.umn.edu
61 lines
1.3 KiB
Python
61 lines
1.3 KiB
Python
# Write the actual Makefile.
|
|
##
|
|
##
|
|
## Customized makemakefile for NaN
|
|
##
|
|
##
|
|
## 1.11.2001, strubi@blender.nl
|
|
##
|
|
##
|
|
|
|
|
|
import os
|
|
import string
|
|
|
|
def makemakefile(outfp, makevars, files, target):
|
|
outfp.write("# Makefile generated by freeze.py script\n\n")
|
|
|
|
target = "frozen"
|
|
libtarget = "lib" + target
|
|
targetlib = libtarget + ".a"
|
|
#targetlib = "libpyfrozen.a"
|
|
|
|
keys = makevars.keys()
|
|
keys.sort()
|
|
for key in keys:
|
|
outfp.write("%s=%s\n" % (key, makevars[key]))
|
|
|
|
outfp.write("\n\ninclude nan_definitions.mk\n")
|
|
outfp.write("\nall: %s\n\n" % libtarget)
|
|
|
|
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)
|
|
|
|
mainfile = 'M___main__.o'
|
|
|
|
try:
|
|
deps.remove(mainfile)
|
|
except:
|
|
pass
|
|
outfp.write("OBJS = %s\n" % string.join(deps))
|
|
|
|
# libfiles.remove('M___main__.o') # don't link with __main__
|
|
|
|
outfp.write("\n%s: $(OBJS)\n" % (libtarget))
|
|
outfp.write("\t$(AR) ruv %s%s $(OBJS)\n" %
|
|
("$(OCGDIR)/blender/bpython/$(DEBUG_DIR)", targetlib))
|
|
|
|
outfp.write("\n%s: %s $(OBJS)\n" % (target, mainfile))
|
|
outfp.write("\t$(CC) %s %s -o %s $(LDLAST)\n" %
|
|
(mainfile, " ".join(deps), target))
|
|
|
|
outfp.write("\nclean:\n\t-rm -f *.o *.a %s\n" % target)
|