Changeset 3b3e776 in mainline for tools/jobfile.py


Ignore:
Timestamp:
2010-02-05T10:57:50Z (15 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0358da0
Parents:
3f085132 (diff), b4cbef1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged with head

File:
1 moved

Legend:

Unmodified
Added
Removed
  • tools/jobfile.py

    • Property mode changed from 100644 to 100755
    r3f085132 r3b3e776  
     1#!/usr/bin/env python
    12#
    2 # Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2007 Jakub Jermar
     3# Copyright (c) 2009 Martin Decky
    44# All rights reserved.
    55#
     
    2727# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828#
     29"""
     30Add a source/object file pair to a checker jobfile
     31"""
    2932
    30 ## Setup toolchain
    31 #
     33import sys
     34import os
     35import fcntl
    3236
    33 include Makefile.common
    34 include $(LIBC_PREFIX)/Makefile.toolchain
     37def usage(prname):
     38        "Print usage syntax"
     39        print prname + " <JOBFILE> <SOURCE> <TARGET> <TOOL> <CATEGORY> [OPTIONS ...]"
    3540
    36 ## Sources
    37 #
     41def main():
     42        if (len(sys.argv) < 6):
     43                usage(sys.argv[0])
     44                return
     45       
     46        jobfname = sys.argv[1]
     47        srcfname = sys.argv[2]
     48        tgtfname = sys.argv[3]
     49        toolname = sys.argv[4]
     50        category = sys.argv[5]
     51        cwd = os.getcwd()
     52        options = " ".join(sys.argv[6:])
     53       
     54        jobfile = file(jobfname, "a")
     55        fcntl.lockf(jobfile, fcntl.LOCK_EX)
     56        jobfile.write("{%s},{%s},{%s},{%s},{%s},{%s}\n" % (srcfname, tgtfname, toolname, category, cwd, options))
     57        fcntl.lockf(jobfile, fcntl.LOCK_UN)
     58        jobfile.close()
    3859
    39 SOURCES = \
    40         edit.c \
    41         sheet.c
    42 
    43 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    44 
    45 .PHONY: all
    46 
    47 all: $(OUTPUT) $(OUTPUT).disasm
    48 
    49 -include $(DEPEND)
    50 
    51 $(OUTPUT).disasm: $(OUTPUT)
    52         $(OBJDUMP) -d $< > $@
    53 
    54 $(OUTPUT): $(OBJECTS) $(LIBS)
    55         $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    56 
    57 %.o: %.c $(DEPEND)
    58         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
    59 
    60 $(DEPEND):
    61         makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
    62         -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     60if __name__ == '__main__':
     61        main()
Note: See TracChangeset for help on using the changeset viewer.