Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- UNAME = os.uname()[0]
- if UNAME == "Linux":
- LINKFLAGS = "-lSDLmain -lSDL -lglut -lGLU"
- BINARY = "wing"
- else:
- LINKFLAGS = "-lmingw32 -lSDLmain -lSDL -lOpenGL32 -lGLU32 -static-libgcc -static-libstdc++"
- BINARY = "wing.exe"
- src = [
- "main",
- "wing",
- "3d",
- "timer",
- "importers"]
- srcdir = "src/"
- srcext = ".cpp"
- cppflags = "-g"
- so_name = "libwing.so"
- so_version = "0.0.1"
- so_dir = "static/"
- import sys
- if len(sys.argv) == 2:
- do = sys.argv[2]
- else:
- do = "all"
- def command(cmd):
- print cmd
- if os.system(cmd) != 0:
- exit()
- def all():
- compile()
- test()
- def compile():
- files = ""
- for fil in src:
- files += "{}{}{} ".format(srcdir,fil,srcext)
- print command("g++ {} -o {} {} {}".format(files,BINARY,cppflags,LINKFLAGS))
- def test():
- command("./{} --test".format(BINARY))
- def run():
- command("./{}".format(BINARY))
- def so():
- statics = ""
- for fil in src:
- command ("g++ -static-libgcc -lstdc++ {} -c -fPIC {} -o {}".format(LINKFLAGS,srcdir+fil+srcext,so_dir+fil+".o"))
- #statics += so_dir+fil+".o "
- command ("g++ {0} -static-libgcc -lstdc++ -shared -Wl,-soname,{1}.1 -o libs/{1} {2}".format(LINKFLAGS, fil+".so",so_dir+fil+".o"))
- all()
Add Comment
Please, Sign In to add comment