# # Please remove these lines (added to allow wiki upload) # #!/usr/bin/env python # # Copyright Andrew Bartlett # # GPLv3 or later # import sys, subprocess found_E = False found_o = False argv = sys.argv[1:] for v in argv: if v == "-E": found_E = True argv_E = ["ccache", "gcc", "-E"] + argv for i in range(0, len(argv_E)): if argv_E[i] == '-o': argv_E[i+1] = argv_E[i+1] + ".E" found_o = True if argv_E[i].startswith('-o'): argv_E[i] = argv_E[i] + ".E" found_o = True if (not found_E) and found_o: subprocess.call(argv_E) subprocess.call(["ccache", "gcc"] + argv)