1 | #----------------------------------------------------------- |
---|
2 | # Copyright Christian Arnault LAL-Orsay CNRS |
---|
3 | # arnault@lal.in2p3.fr |
---|
4 | # See the complete license in cmt_license.txt "http://www.cecill.info". |
---|
5 | #----------------------------------------------------------- |
---|
6 | |
---|
7 | !include $(CMTROOT)/src/NMakefile.core |
---|
8 | |
---|
9 | # |
---|
10 | # Basic tag management |
---|
11 | # |
---|
12 | !if defined (tag) |
---|
13 | CMTEXTRATAGS = $(tag) |
---|
14 | !else |
---|
15 | !if defined (CMTCONFIG) |
---|
16 | tag = $(CMTCONFIG) |
---|
17 | !else |
---|
18 | tag = VisualC |
---|
19 | !endif |
---|
20 | !endif |
---|
21 | |
---|
22 | tags = $(tag),$(CMTEXTRATAGS) |
---|
23 | |
---|
24 | # |
---|
25 | # Generic entry points for all targets |
---|
26 | # |
---|
27 | #build_strategy = rebuild_makefiles |
---|
28 | #build_dependencies = echo |
---|
29 | |
---|
30 | all :: ; |
---|
31 | |
---|
32 | #check_config :: |
---|
33 | # @$(cmtexe) check configuration |
---|
34 | |
---|
35 | #configclean :: |
---|
36 | # del *nmake* setup.* cleanup.* |
---|
37 | |
---|
38 | !if "$(CMTBCAST)" == "" |
---|
39 | binclean :: |
---|
40 | $(echo) (NMakefile.header) Removing binary directory $(bin) |
---|
41 | $(cleanup_silent)if not "$(bin)"==".\" (if exist $(bin) rmdir /S /Q $(bin)) |
---|
42 | # @del /Q $(bin)\* |
---|
43 | !endif |
---|
44 | |
---|
45 | #help :: dirs |
---|
46 | help :: |
---|
47 | !if "$(CMTBCAST)" == "" |
---|
48 | @echo -------------------------------------------------------------------------- |
---|
49 | @echo You may select one of the following make targets : |
---|
50 | @echo. |
---|
51 | @echo help : this help |
---|
52 | @echo all : rebuild everything according to the $$(constituents) macro |
---|
53 | @echo (this is the default target) |
---|
54 | @echo clean : remove everything that can be rebuilt |
---|
55 | # @echo configclean : remove configuration files (*.nmake) |
---|
56 | @echo binclean : fast erase of the binary directory |
---|
57 | @echo uninstall : remove everything installed in the installation area |
---|
58 | @echo. |
---|
59 | @for /F "usebackq" %%i in (`$(cmtexe) show groups -tag^=$(tags)`) do \ |
---|
60 | @echo %%i : rebuild all constituents of group %%i |
---|
61 | @echo Constituents: & \ |
---|
62 | for /F "usebackq" %%i in (`$(cmtexe) show constituent_names -tag^=$(tags)`) do \ |
---|
63 | @echo %%i %%iclean %%iuninstall |
---|
64 | @echo. |
---|
65 | @echo check : |
---|
66 | @echo run all applications defined with the -check option |
---|
67 | @echo. |
---|
68 | # @echo everywhere [target=...] : |
---|
69 | # @echo o Rebuild on all plateforms specified in the $$(everywhere) macro |
---|
70 | # @echo o Use "cmt show macro everywhere -tag=<site>" to check it |
---|
71 | # @echo o The "target" option permits to transmit a target to the remote site |
---|
72 | @echo To switch to BCAST mode, set CMTBCAST to non-empty string. |
---|
73 | !else |
---|
74 | @echo Targets for BCAST mode: |
---|
75 | @echo. |
---|
76 | @echo help : this help |
---|
77 | !if "$(BCAST_ONLY)" == "" |
---|
78 | !if "$(BCAST_GLOBAL)" == "" |
---|
79 | @echo all : (re)build all used packages in current project (this is default target) |
---|
80 | !else |
---|
81 | @echo all : (re)build all used packages in all projects (this is default target) |
---|
82 | !endif |
---|
83 | !else |
---|
84 | @echo all : (re)build current package (this is default target) |
---|
85 | !endif |
---|
86 | @echo clean : remove everything that can be rebuilt |
---|
87 | @echo binclean : fast erase of binary directories (and installation area) |
---|
88 | @echo uninstall : remove everything installed in the installation area |
---|
89 | @echo check : run all applications defined with the -check option |
---|
90 | @echo. |
---|
91 | !if "$(BCAST_ONLY)" == "" |
---|
92 | @echo ... with dependencies packages (may be ignored by setting BCAST_ONLY). |
---|
93 | !else |
---|
94 | @echo ... without dependencies packages (may be included by unsetting BCAST_ONLY). |
---|
95 | !endif |
---|
96 | @echo. |
---|
97 | !if "$(BCAST_GLOBAL)" == "" |
---|
98 | @echo To (re)build packages in all projects, set BCAST_GLOBAL. |
---|
99 | !else |
---|
100 | @echo To (re)build packages in current project, unset BCAST_GLOBAL. |
---|
101 | !endif |
---|
102 | !if "$(NO_ALL_GROUPS)" == "" |
---|
103 | @echo To (re)build default group only, set NO_ALL_GROUPS. |
---|
104 | !if "$(CMTACTIONS)" == "" |
---|
105 | @echo To also (re)build cmt_actions group, set CMTACTIONS. |
---|
106 | !endif |
---|
107 | !else |
---|
108 | @echo To (re)build all groups, unset NO_ALL_GROUPS. |
---|
109 | !endif |
---|
110 | @echo. |
---|
111 | @echo To switch to PACKAGE mode, unset CMTBCAST. |
---|
112 | !endif |
---|
113 | |
---|
114 | !if "$(NO_ALL_GROUPS)" == "" |
---|
115 | !if "$(CMTACTIONS)" == "" |
---|
116 | _groups = all groups except cmt_actions |
---|
117 | !else |
---|
118 | _groups = all groups |
---|
119 | !endif |
---|
120 | !else |
---|
121 | _groups = default group |
---|
122 | !endif |
---|
123 | |
---|
124 | cmt_local_tagfile = $(bin)$(tag).nmake |
---|
125 | cmt_broadcast_tagfile = $(bin)$(tag)_broadcast.nmake |
---|
126 | |
---|
127 | cmt_constituents_makefile = $(bin)constituents.nmake |
---|
128 | cmt_broadcast_makefile = $(bin)broadcast.nmake |
---|
129 | |
---|
130 | #!if "$(CMTBCAST)" != "" |
---|
131 | #QUICK = 1 |
---|
132 | #!endif |
---|
133 | |
---|
134 | !if "$(QUICK)" != "" |
---|
135 | !if "$(CMTBCAST)" == "" |
---|
136 | |
---|
137 | !if exist ($(cmt_local_tagfile)) |
---|
138 | cmt_included = 1 |
---|
139 | !include $(cmt_local_tagfile) |
---|
140 | !endif |
---|
141 | |
---|
142 | !else |
---|
143 | |
---|
144 | !if exist ($(cmt_broadcast_tagfile)) |
---|
145 | cmt_included = 1 |
---|
146 | !include $(cmt_broadcast_tagfile) |
---|
147 | !endif |
---|
148 | |
---|
149 | !endif |
---|
150 | !endif |
---|
151 | |
---|
152 | !if "$(QUICK)" == "" |
---|
153 | $(cmt_constituents_makefile) :: |
---|
154 | !else |
---|
155 | $(cmt_local_tagfile) $(cmt_constituents_makefile) : $(use_requirements) |
---|
156 | !endif |
---|
157 | $(echo) (NMakefile.header) Rebuilding $@ |
---|
158 | @if not exist "$(@D)" mkdir "$(@D)" |
---|
159 | @$(cmtexe) -tag=$(tags) build constituents_config -out=$(cmt_constituents_makefile) |
---|
160 | |
---|
161 | !if "$(QUICK)" == "" |
---|
162 | $(cmt_broadcast_makefile) :: |
---|
163 | !else |
---|
164 | $(cmt_broadcast_tagfile) $(cmt_broadcast_makefile) : $(use_requirements) |
---|
165 | !endif |
---|
166 | $(echo) (NMakefile.header) Rebuilding $@ |
---|
167 | @if not exist "$(@D)" mkdir "$(@D)" |
---|
168 | @$(cmtexe) -tag=$(tags) build broadcast_config -out=$(cmt_broadcast_makefile) |
---|
169 | |
---|
170 | !if "$(cmt_config)" == "" |
---|
171 | !if "$(CMTBCAST)" == "" |
---|
172 | |
---|
173 | #!if "$(cmt_config)" == "" |
---|
174 | !if [$(MAKE) /nologo /f NMake /$(MAKEFLAGS) cmt_config=1 $(cmt_constituents_makefile)] != 0 |
---|
175 | !error (NMakefile.header) Cannot rebuild $(cmt_constituents_makefile) |
---|
176 | !endif |
---|
177 | #!endif |
---|
178 | |
---|
179 | !else |
---|
180 | |
---|
181 | #!if "$(cmt_config)" == "" |
---|
182 | !if [$(MAKE) /nologo /f NMake /$(MAKEFLAGS) cmt_config=1 $(cmt_broadcast_makefile)] != 0 |
---|
183 | !error (NMakefile.header) Cannot rebuild $(cmt_broadcast_makefile) |
---|
184 | !endif |
---|
185 | #!endif |
---|
186 | |
---|
187 | !endif |
---|
188 | !endif |
---|
189 | |
---|
190 | !if "$(cmt_config)" == "" |
---|
191 | !if "$(CMTBCAST)" == "" |
---|
192 | |
---|
193 | #!if exist ($(cmt_constituents_makefile)) |
---|
194 | !include $(cmt_constituents_makefile) |
---|
195 | #!endif |
---|
196 | |
---|
197 | !else |
---|
198 | |
---|
199 | #!if "$(cmt_config)" == "" |
---|
200 | #!undef CMTBCAST |
---|
201 | CMTBCAST = |
---|
202 | !include $(cmt_broadcast_makefile) |
---|
203 | #!endif |
---|
204 | |
---|
205 | !endif |
---|
206 | !endif |
---|