OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [tools/] [tagsgen/] [tagsgen_kernel.py] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#! /usr/bin/env python2.6
2
# -*- mode: python; coding: utf-8; -*-
3
 
4
import os, sys
5
 
6
PROJRELROOT = '../../'
7
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), PROJRELROOT)))
8
 
9
from config.configuration import *
10
config = configuration_retrieve()
11
 
12
platform = config.platform
13
subarch = config.subarch
14
arch = config.arch
15
 
16
def main():
17
    os.system("rm -f cscope.*")
18
    os.system("rm -f tags")
19
 
20
    # Type of files to be included
21
    file_extn = ['*.cc', '*.c', '*.h', '*.s', '*.S', '*.lds']
22
 
23
    # Kernel directories
24
    src_dir_path = 'src'
25
    include_dir_path = 'include/l4'
26
 
27
    search_folder = \
28
        ['api', 'arch/'+ arch, 'arch/'+ arch + '/' + subarch, 'drivers', \
29
         'generic', 'glue/' + arch, 'lib', 'platform/' + platform]
30
 
31
    # Check if we need realview directory based on platform selected
32
    if platform == "eb" or \
33
       platform == "pba8" or \
34
       platform == "pba9" or \
35
       platform == "pb11mpcore":
36
        search_folder += ['platform/realview']
37
 
38
    # Put all sources into a file list.
39
    for extn in file_extn:
40
        for dir in search_folder:
41
            # Directory depth to be searched
42
            if dir == 'drivers':
43
                depth = 5
44
            else:
45
                depth = 1
46
 
47
            os.system("find " + join(src_dir_path, dir) + \
48
                " -maxdepth " + str(depth) + " -name '" + extn + "' >> tagfilelist")
49
            os.system("find " + join(include_dir_path, dir) + \
50
                " -maxdepth " + str(depth) + " -name '" + extn + "' >> tagfilelist")
51
 
52
    # Use file list to include in tags.
53
    os.system("ctags --languages=C,Asm --recurse -Ltagfilelist")
54
    os.system("cscope -q -k -R -i tagfilelist")
55
 
56
    # Remove file list.
57
    os.system("rm -f tagfilelist")
58
 
59
if __name__ == "__main__":
60
    main()
61
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.