Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- source_files = []
- object_files = []
- optimization = "-O0"
- debug = "-g3"
- nara_dir = "../"
- system = "win32/"
- exe_name = "Nara2D.exe"
- libraries = [
- "comdlg32",
- "XInput",
- "luabindd",
- "lua51",
- "SDL2",
- "SFML-Graphics-d",
- "SFML-Audio-d",
- "SFML-System-d",
- "SFML-Window-d",
- "SFGUI-d",
- "Box2D",
- "boost_filesystem-mgw47-mt-1_55",
- "boost_thread-mgw47-mt-1_55",
- "boost_chrono-mgw47-mt-1_55",
- "boost_system-mgw47-mt-1_55"
- ]
- include_dir = nara_dir + "thirdparty/libraries/include"
- lib_dir = nara_dir + "thirdparty/libraries/" + system
- cpp_flags = optimization + " " + debug +" -Wall -fno-omit-frame-pointer -c -fmessage-length=0 -std=gnu++11 -DNARA_DEBUG -D__GXX_EXPERIMENTAL_CXX0X__"
- def grab_all_files(root, type, lst):
- for root, dirs, files in os.walk(root):
- for name in files:
- if name.endswith(type):
- lst.append(os.path.join(root, name))
- def list_to_string(lst, postfix):
- retstr = ""
- for elem in lst:
- retstr += postfix + elem + " "
- return retstr
- print("Compiling Nara2D\n")
- grab_all_files(nara_dir + "src", ".cpp", source_files)
- grab_all_files(nara_dir + "thirdparty", ".cpp", source_files)
- for source in source_files:
- print("\nCompiling " + source)
- error = os.system("g++ -IC:" + nara_dir + "/thirdparty/flux/include -IC:" + include_dir + " " + cpp_flags + " " + source)
- if error != 0:
- exit()
- print("\n Compilation step successful\n")
- grab_all_files(nara_dir+"build", ".o", object_files)
- print("Invoking Linker")
- error = os.system("g++ -LC:" + lib_dir + " -o " + exe_name + " " + list_to_string(object_files, "") + " " + list_to_string(libraries, "-l"))
- if error != 0:
- exit()
- print("\n Linking step successful")
- copyfile(exe_name, "nara_dir/"+exe_name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement