1 | |
---|
2 | //----------------------------------------------------------- |
---|
3 | // Copyright Christian Arnault LAL-Orsay CNRS |
---|
4 | // arnault@lal.in2p3.fr |
---|
5 | // See the complete license in cmt_license.txt "http://www.cecill.info". |
---|
6 | //----------------------------------------------------------- |
---|
7 | |
---|
8 | ========================================================================== |
---|
9 | Gestionnaire de messages de log dans CMT |
---|
10 | ---------------------------------------- |
---|
11 | |
---|
12 | cmt_log (...) |
---|
13 | |
---|
14 | will |
---|
15 | |
---|
16 | o display or not according to the level of output |
---|
17 | |
---|
18 | [default] quiet |
---|
19 | verbose = <n> |
---|
20 | debug |
---|
21 | |
---|
22 | o pour le mode debug on devrait rajouter la fonction?? |
---|
23 | |
---|
24 | A terme doit remplacer tous les outputs de CMT !!! |
---|
25 | |
---|
26 | |
---|
27 | ========================================================================== |
---|
28 | 1) actions in CMT [DONE] |
---|
29 | ----------------- |
---|
30 | Principle: |
---|
31 | define an "action" concept similar to constituents (or macro????) |
---|
32 | |
---|
33 | - it has a name |
---|
34 | |
---|
35 | - its name corresponds to a make target |
---|
36 | |
---|
37 | - it receives in its value a shell command (subject to macro |
---|
38 | expansion before activation) |
---|
39 | |
---|
40 | - can be run out of the make context through the "cmt do <action>" command. |
---|
41 | |
---|
42 | - in the context of gmake a temporary make fragment will be |
---|
43 | generated, holding the associated shell command. |
---|
44 | |
---|
45 | |
---|
46 | examples |
---|
47 | |
---|
48 | action A "xxx" WIN32 "yyy" |
---|
49 | |
---|
50 | => the syntax is like macros but the execution phase is close to constituents. |
---|
51 | |
---|
52 | One may either do |
---|
53 | |
---|
54 | > cmt do A |
---|
55 | |
---|
56 | or |
---|
57 | |
---|
58 | gmake A |
---|
59 | |
---|
60 | Question : do we need parameters |
---|
61 | |
---|
62 | action A "xxx<p>" WIN32 "yyy<p>" |
---|
63 | action A "xxx$(p)" WIN32 "yyy$(p)" |
---|
64 | |
---|
65 | so that |
---|
66 | |
---|
67 | > cmt do A p=z |
---|
68 | > gmake A p=z |
---|
69 | |
---|
70 | Question : can action replace setup_script ? |
---|
71 | |
---|
72 | Implementation : reuse the symbol code. |
---|
73 | |
---|
74 | Cmt::do_do (...) |
---|
75 | o at least first argument should be the action name |
---|
76 | o optional param-value pairs will assign value to macros |
---|
77 | |
---|
78 | cmt do A p=y |
---|
79 | |
---|
80 | equivalent to [macro p "y"] |
---|
81 | |
---|
82 | cmt show constituents should show actions as well |
---|
83 | |
---|
84 | when generating the constituent make files we also have to generate |
---|
85 | makefiles for actions. |
---|
86 | => name space for actions share the name space for constituents |
---|
87 | => there is a target_<action> tag [see next design] |
---|
88 | |
---|
89 | Actually, doing |
---|
90 | |
---|
91 | action A "cmd" |
---|
92 | |
---|
93 | is equivalent to doing: |
---|
94 | |
---|
95 | document cmt_action_runner A action_value='cmd' |
---|
96 | |
---|
97 | ========================================================================== |
---|
98 | 2) target tags |
---|
99 | -------------- |
---|
100 | Principle: |
---|
101 | |
---|
102 | - Each constituent (or action) is associated with a make target |
---|
103 | |
---|
104 | - let's also generate a "tag" associated with the make target. |
---|
105 | |
---|
106 | - the tag format is target_<name> |
---|
107 | |
---|
108 | - the group tags are also defined as tag associations |
---|
109 | |
---|
110 | tag target_all target_A target_B |
---|
111 | |
---|
112 | ========================================================================== |
---|
113 | 3) A pattern also defines a dynamic CMT keyword.[DONE] |
---|
114 | |
---|
115 | => at the end of the parser if the word did not match any standard |
---|
116 | CMT keyword, then we look into the pattern name space. |
---|
117 | |
---|
118 | ex. |
---|
119 | |
---|
120 | pattern A ... |
---|
121 | |
---|
122 | apply_pattern A p=x |
---|
123 | |
---|
124 | is equivalent to |
---|
125 | |
---|
126 | A p=x |
---|
127 | |
---|
128 | ========================================================================== |
---|
129 | 4) Revival of the concept of Project[DONE] |
---|
130 | |
---|
131 | o One project is associated with every CMTPATH |
---|
132 | |
---|
133 | o Strategies are stored into project objects |
---|
134 | |
---|
135 | o project objects are ordered like CMTPATHs |
---|
136 | |
---|
137 | o Each CMTPATH entry does generate one Project |
---|
138 | |
---|
139 | o unnamed projects receive a default name [TBD] |
---|
140 | |
---|
141 | o Projects can be named: |
---|
142 | |
---|
143 | project abcd |
---|
144 | |
---|
145 | Will name the project associated with the cmtpath of the package where this is defined. |
---|
146 | |
---|
147 | o By default Projects inherit properties of the previous project |
---|
148 | |
---|
149 | o Any package has a corresponding project which is the project |
---|
150 | associated with the CMTPATH entry of this package. |
---|
151 | |
---|
152 | o CMT itself defines the "base" project (named CMT) |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|