source: rubycfg_asp/trunk/asp_dcre/arch/ccrx/pre_cfg.py@ 313

Last change on this file since 313 was 313, checked in by coas-nagasima, 7 years ago

ソースを追加

File size: 1.7 KB
Line 
1#!python
2import subprocess
3import os
4import sys
5
6#
7# variable definition
8#
9INCLUDES = []
10CFG1_DEF_TABLES = []
11
12# set relative path from top proj
13proj_rel_dir = "../"
14
15TCPIP_API_TABLE = ""
16CFG_TCPIP_KERNEL_TRB = ""
17
18# call definition file
19common.Source(proj_rel_dir + "def.py")
20
21# path
22src_abs_path = os.path.abspath(proj_rel_dir + SRCDIR)
23
24# call common file
25common.Source(src_abs_path + "/arch/ccrx/common.py")
26
27#
28# delete generated files
29#
30if os.path.exists("cfg1_out.db"):
31 os.remove("cfg1_out.db")
32if os.path.exists("cfg2_out.db"):
33 os.remove("cfg2_out.db")
34if os.path.exists("cfg3_out.db"):
35 os.remove("cfg3_out.db")
36if os.path.exists("cfg1_out.c"):
37 os.remove("cfg1_out.c")
38if os.path.exists("kernel_cfg.c"):
39 os.remove("kernel_cfg.c")
40if os.path.exists("kernel_cfg.h"):
41 os.remove("kernel_cfg.h")
42if os.path.exists("offset.h"):
43 os.remove("offset.h")
44if os.path.exists("tinet_cfg.c"):
45 os.remove("tinet_cfg.c")
46if os.path.exists("tinet_cfg.h"):
47 os.remove("tinet_cfg.h")
48
49if TCPIP_API_TABLE != "":
50 cfg_tcpip_api_table = srcdir + TCPIP_API_TABLE
51
52#
53# make command
54#
55cfg_command = cfg + " --pass 1 " + "--kernel " + CFG_KERNEL
56cfg_command += " " + cfg_includes
57if TCPIP_API_TABLE == "":
58 cfg_command += " --api-table " + cfg_api_table
59else:
60 cfg_command += " --api-table " + cfg_tcpip_api_table + ":tcpip"
61 cfg_command += " --api-table " + cfg_api_table + ":kernel"
62cfg_command += " " + cfg_cfg1_def_tables
63cfg_command += " -M cfg1_out_c.d"
64cfg_command += " " + proj_rel_dir + CFG_FILE
65
66print cfg_command
67
68#
69# Execute cfg path 1
70#
71try:
72 output = subprocess.check_output(cfg_command, stderr=subprocess.STDOUT,)
73except subprocess.CalledProcessError, e:
74 print "ERROR!! : ", e.output
75
76print output
Note: See TracBrowser for help on using the repository browser.