Changes in tools/jobfile.py [28f4adb:7f881cd8] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/jobfile.py

    r28f4adb r7f881cd8  
    3838def usage(prname):
    3939        "Print usage syntax"
    40         print(prname + " <JOBFILE> <SOURCE> <TARGET> <TOOL> <CATEGORY> [OPTIONS ...]")
     40        print(prname + " <JOBFILE> <CC> <INPUT> -o <OUTPUT> [CC_ARGUMENTS ...]")
    4141
    4242def main():
     
    4646       
    4747        jobfname = sys.argv[1]
    48         srcfname = sys.argv[2]
    49         tgtfname = sys.argv[3]
    50         toolname = sys.argv[4]
    51         category = sys.argv[5]
     48        ccname = sys.argv[2]
     49        srcfname = sys.argv[3]
     50        assert(not srcfname.startswith("-"))
     51        assert(sys.argv[4] == "-o")
     52        tgtfname = sys.argv[5]
     53        options = " ".join(sys.argv[6:])
    5254        cwd = os.getcwd()
    53         options = " ".join(sys.argv[6:])
     55       
     56        if srcfname.endswith(".c"):
     57                toolname = "cc"
     58                category = "core"
     59       
     60        if srcfname.endswith(".s"):
     61                toolname = "as"
     62                category = "asm"
     63       
     64        if srcfname.endswith(".S"):
     65                toolname = "as"
     66                category = "asm/preproc"
    5467       
    5568        jobfile = open(jobfname, "a")
     
    5871        fcntl.lockf(jobfile, fcntl.LOCK_UN)
    5972        jobfile.close()
     73       
     74        # Run the compiler proper.
     75        os.execvp(ccname, sys.argv[2:])
    6076
    6177if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.