ScrapExplorer - run_makefiles.py
Home / lab / c / compiled_c / tools Lines: 2 | Size: 1414 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1# Compiled C 2# A collection of C programs that are compiled to assembly 3# code for understanding how C and assembly work. 4# GitHub: https://wwww.github.com/0x4248/Compiled_C 5# Licence: GNU General Public Licence v3.0 6# By: 0x4248 7 8import os 9 10SOURCES_FILE = "sources.conf" 11COLOUR_BLUE = "\033[94m" 12COLOUR_RESET = "\033[0m" 13 14def calculate_percentage_done(current_build, total_builds): 15 try: 16 current_build = total_builds.index(current_build) 17 except: 18 current_build = total_builds.index(current_build+"\n") 19 total_builds = len(total_builds) 20 return round((current_build / total_builds) * 100) 21 22if __name__ == "__main__": 23 f = open("sources.conf", "r") 24 sources = f.readlines() 25 f.close() 26 # The sources file contains where the makefiles are to run 27 for source in sources: 28 source = source.strip() 29 # Strip the new line character from the end of the line 30 if source == "" or source.startswith("#"): 31 # If the line is blank or starts with a hash, skip it 32 continue 33 # Print [BLUE+Percentage done+RESET] [source] 34 print("[" + COLOUR_BLUE + str(calculate_percentage_done(source, sources)) + "%\t" + COLOUR_RESET + "] " + source) 35 os.chdir(source) 36 os.system("make") 37 while True: 38 os.chdir("..") 39 files = os.listdir() 40 if "sources.conf" in files: 41 break[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.