@@ -0,0 +1,1272 @@
+import glob, os, platform, subprocess%0Afrom os import path%0A%0ACC = %22g++%22%0ACFLAGS = %5B%22-std=c++11%22%5D%0A%0ASRC_FOLDER = %22R2Bot/src%22            # Source files%0AINCLUDE_FOLDER = %22R2Bot/include%22    # Header files%0AOBJ_FOLDER = %22obj%22            # Object code%0ABIN_FOLDER = %22bin%22            # Compiled executable libraries and binaries%0A%0ABINARY_NAME = %22R2Bot.%22 + (%22exe%22 if platform.system() is %22Windows%22 else %22x%22)%0A%0Aif __name__ == %22__main__%22:%0A    # Folders%0A    if not path.isdir(OBJ_FOLDER):%0A        os.mkdir(OBJ_FOLDER)%0A%0A    if not path.isdir(BIN_FOLDER):%0A        os.mkdir(BIN_FOLDER)%0A%0A    # Find all source files%0A    sources = glob.glob(%22%7Bsrc%7D/*.cpp%22.format(src=SRC_FOLDER))%0A%0A    # Compile each to objects%0A    # TODO Parallelize with multiprocessing%0A    # TODO Don't recompile unchanged files%0A    objects = %5B%5D%0A    for s in sources:%0A        o = path.join(OBJ_FOLDER, path.basename(s)%5B:-4%5D + %22.o%22)%0A        objects.append(o)%0A        args = %5BCC%5D + CFLAGS + %5B%22-c%22%5D + %5B%22-I%22, INCLUDE_FOLDER%5D + %5Bs%5D + %5B%22-o%22, o%5D%0A        print(%22Executing %7B%7D%22.format(args))%0A        subprocess.check_output(args)%0A%0A    # Build the binary%0A    args = %5BCC%5D + CFLAGS + %5B%22-I%22, INCLUDE_FOLDER%5D + objects %5C%0A        + %5B%22-o%22, BIN_FOLDER + %22/%22 + BINARY_NAME%5D%0A    print(%22Executing %7B%7D%22.format(args))%0A    subprocess.check_output(args)%0A

Add build script for environments with gcc