BUG#: 8679
[tpot/pegasus/.git] / Makefile
1 #//%LICENSE////////////////////////////////////////////////////////////////
2 #//
3 #// Licensed to The Open Group (TOG) under one or more contributor license
4 #// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
5 #// this work for additional information regarding copyright ownership.
6 #// Each contributor licenses this file to you under the OpenPegasus Open
7 #// Source License; you may not use this file except in compliance with the
8 #// License.
9 #//
10 #// Permission is hereby granted, free of charge, to any person obtaining a
11 #// copy of this software and associated documentation files (the "Software"),
12 #// to deal in the Software without restriction, including without limitation
13 #// the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 #// and/or sell copies of the Software, and to permit persons to whom the
15 #// Software is furnished to do so, subject to the following conditions:
16 #//
17 #// The above copyright notice and this permission notice shall be included
18 #// in all copies or substantial portions of the Software.
19 #//
20 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 #// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 #// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 #// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #//
28 #//////////////////////////////////////////////////////////////////////////
29 # Pegasus top level make file
30 # see the usage rule for options
31
32 ROOT = .
33
34 include $(ROOT)/env_var.status
35 include $(ROOT)/mak/config.mak
36
37 ## Include mu in the clean structure
38 ## This required because mu is not part of the hiearchial build
39 ##structure.  It is built with the buildmu target.  Adding this
40 ## variable allows it to be cleaned with the normal clean target.
41 RECURSE_EXTRA_CLEAN_DIRS += src/utils/mu
42
43 # This is a recurse make file
44 # Defines subdirectories to go to recursively
45
46 DIRS = src
47
48 TEST_DIRS = test
49
50 # Define the inclusion of the recurse.mak file to execute the next
51 # level of makefiles defined by the DIRS variable
52
53 defaultrule: all setupdevserver
54
55 include $(ROOT)/mak/recurse.mak
56
57 .PHONY: FORCE
58
59 FORCE:
60
61 usage: FORCE
62         $(USAGE)
63         $(USAGE)"Makefile targets:"
64         $(USAGE)
65         $(USAGE)"Recursive rules - These are the primatives that traverse the tree"
66         $(USAGE)"invoking the specified command in each subdirectory directory."
67         $(USAGE)"NOTE: all is special, it specifies no target and therefore invokes"
68         $(USAGE)"the default rule for that directory."
69         $(USAGE)"all                 - recursive DEFAULT rule"
70         $(USAGE)"clean               - recursive clean"
71         $(USAGE)"depend              - buildmu recursive depend"
72         $(USAGE)"messages            - rootbundle recursive messages"
73         $(USAGE)"tests               - recursive tests"
74         $(USAGE)"poststarttests      - recursive poststarttests"
75         $(USAGE)
76         $(USAGE)"Combinational rules - Combine other rules to achieve results"
77         $(USAGE)"DEFAULT RULE        - all, setupdevserver"
78         $(USAGE)"new                 - clean repositoryclean"
79         $(USAGE)"build               - depend all, setupdevserver"
80         $(USAGE)"world               - build unittests servertests"
81         $(USAGE)
82         $(USAGE)"Functional rules - Other rules to achieve specified results"
83         $(USAGE)"clobber             -removes objects built during compile"
84         $(USAGE)"                     specifically the following directories are removed:"
85         $(USAGE)"                      $(PEGASUS_HOME)/bin"
86         $(USAGE)"                      $(PEGASUS_HOME)/lib"
87         $(USAGE)"                      $(PEGASUS_HOME)/obj"
88         $(USAGE)"buildmu             - builds the mu utility"
89         $(USAGE)"setupdevserver      - setup the development server env"
90         $(USAGE)"cleandevserver      - cleans the development server env"
91         $(USAGE)"repository          - builds the base repository. Does not remove other"
92         $(USAGE)"                      namespaces than the base namespaces."
93         $(USAGE)"testrepository      - builds items for the test suites into the repository"
94         $(USAGE)"repositoryclean     - removes the complete repository"
95         $(USAGE)"listplatforms       - List all valid platforms"
96         $(USAGE)
97         $(USAGE)"Test rules (accessable here but implemented in TestMakefile)"
98         $(USAGE)"alltests            - unittests and servertests"
99         $(USAGE)"unittests           - runs the unit functional test"
100         $(USAGE)"servertests         - runs basic server tests"
101         $(USAGE)"perftests           - runs basic server performance tests"
102         $(USAGE)"standardtests       - runs server extended tests"
103         $(USAGE)"testusage           - TestMakefile usage"
104         $(USAGE)"testusage2          - TestMakefile usage2"
105         $(USAGE)"stresstests         - Runs the default stresstests"
106         $(USAGE)
107         $(USAGE)"--------------------"
108         $(USAGE)"Quick start:"
109         $(USAGE)"  After checkout of new tree:"
110         $(USAGE)"  use \"make listplatforms\" to view a list of platforms"
111         $(USAGE)"  set PEGASUS_PLATFORM=<your platofrm>"
112         $(USAGE)"  set PEGASUS_ROOT=<location of your pegasus source>"
113         $(USAGE)"  set PEGASUS_HOME=<build output location"
114         $(USAGE)"  make world"
115         $(USAGE)
116         $(USAGE)"  This will build everthing with a default configuration"
117         $(USAGE)"  and run the automated tests."
118         $(USAGE)
119         $(USAGE)"--------------------"
120         $(USAGE)"Examples:"
121         $(USAGE)"  After \"cvs checkout\" of new tree:    make world"
122         $(USAGE)
123         $(USAGE)"  After changes to include files:      make"
124         $(USAGE)
125         $(USAGE)"  After changes to the files included: make build"
126         $(USAGE)
127         $(USAGE)"  After \"cvs update\" or to start over: make new world"
128         $(USAGE)
129
130 listplatforms: FORCE
131         $(USAGE)
132         $(USAGE)"The $(words $(VALID_PLATFORMS)) valid platforms are:"
133         $(USAGE)" $(foreach w, $(VALID_PLATFORMS), " $w ")"
134         $(USAGE)
135         $(USAGE)
136
137 #########################################################################
138 # This section defines any prerequisites that are required by the
139 # recursive rules.
140 #
141 # NOTE: You can add prerequisties for the recursive rules but you cannot
142 #       add any commands to run as part of the rule. You can define them
143 #       and make will quietly ignore them and they will not be run either
144 #       before or after the recursive rule.
145 #
146 #
147 messages: rootbundle
148
149 depend: buildmu
150
151 #########################################################################
152 # This section defines combinational rules
153 #
154 #-----------------------
155 # build target: builds all source
156 #
157 build: depend all setupdevserver
158
159 #------------------------
160 # rebuild target is being deprecated instead use "make new build"
161 #
162 rebuild_msg: FORCE
163         @$(ECHO) "==============================================================================="
164         @$(ECHO) "Makefile: The rebuild target is being deprecated."
165         @$(ECHO) "          Use \"make usage\" for a description of the usage model."
166         @$(ECHO) "          Consider using \"make new world\" ."
167         @$(ECHO) "          Invoking the old rebuild rule now."
168         @$(ECHO) "==============================================================================="
169
170 rebuild: rebuild_msg shortsleep new build s_unittests repository
171
172 #-----------------------
173 # new target: cleans everthing
174 #
175 # This can be combined on the command line with other rules like:
176 #
177 # make new build
178 # make new world
179
180 new: clean repositoryclean
181
182 #-----------------------
183 # world targets: builds everything and dependent on which target may do testing
184 #
185 #       Typically used after a fresh checkout from CVS
186
187 world: build s_unittests servertests
188
189
190 ############################
191 #
192 # rules defined in TestMakefile that are repeated here for convenience
193 #
194 shortsleep: FORCE
195         @$(MAKE)  -f TestMakefile shortsleep
196
197 servertests: FORCE
198         @ $(MAKE) -f TestMakefile servertests
199
200 perftests: FORCE
201         @ $(MAKE) -f TestMakefile perftests
202
203 s_unittests: FORCE
204         @ $(MAKE) -f TestMakefile -s unittests
205
206 unittests: FORCE
207         @ $(MAKE) -f TestMakefile unittests
208
209 standardtests: FORCE
210         @ $(MAKE) -f TestMakefile standardtests
211
212 alltests: FORCE
213         @ $(MAKE) -f TestMakefile alltests
214
215 testusage: FORCE
216         @ $(MAKE) -f TestMakefile usage
217
218 testusage2: FORCE
219         @ $(MAKE) -f TestMakefile usage2
220
221 stresstests:
222         @$(ECHO) "Running OpenPegasus StressTests"
223         @$(MAKE)  -f TestMakefile stresstests
224         @$(ECHO) "+++++ OpenPegasus StressTests complete"
225
226 ##########################################################################
227 #
228 # This section defines functional rules
229 #
230 #---------------------
231 # buildmu target: build mu the make utility that among other things
232 # includes a depend implementation. This is a separate target because
233 # it must be build before anything else and before the depend target is used
234 # on some platforms. Note that mu is not used on all platforms.
235 #
236 buildmu: FORCE
237         $(MAKE) --directory=$(PEGASUS_ROOT)/src/utils/mu -f Makefile
238
239 #----------------------
240 # setupdevserver and cleandevserver are used to setup and clear the
241 # server configuration files needed to run the server in a development
242 # environment.
243 #
244 setupdevserver: FORCE
245         $(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile install_run
246         @$(ECHO) "PEGASUS Development Server Runtime Environment configured "
247
248 cleandevserver: FORCE
249         $(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile install_run_clean
250
251 clobber: FORCE
252         - $(RMDIRHIER) $(PEGASUS_HOME)/bin
253         - $(RMDIRHIER) $(PEGASUS_HOME)/lib
254         - $(RMDIRHIER) $(PEGASUS_HOME)/obj
255
256
257 #---------------------
258 # The repository target removes the entire repository and rebuilds the Pegasus
259 # namespaces.  The repositoryServer target does not remove the repository
260 # before building the Pegasus namespaces.  (The repositoryServer target in
261 # TestMakefile *does* remove the repository first.)
262
263 # Note: Arguments must be quoted to preserve upper case characters in VMS.
264 repository: repositoryclean
265         @ $(MAKE) "-SC" Schemas/Pegasus repository
266
267 repositoryclean: FORCE
268         @ $(RMREPOSITORY) $(REPOSITORY_ROOT)
269
270 repositoryServer: FORCE
271         @ $(MAKE) "-SC" Schemas/Pegasus repositoryServer
272
273 #---------------------
274 # The testrepository and testrepositoryServer targets build the Pegasus test
275 # namespaces.  A pre-existing repository is not removed.
276
277 testrepository: FORCE
278         @ $(MAKE) "-SC" src/Providers/sample/Load repository
279         @ $(MAKE) "-SC" test/wetest repository
280         @ $(MAKE) "-SC" src/Clients/benchmarkTest/Load repository
281         @ $(MAKE) "-SC" src/Pegasus/CQL/CQLCLI repository
282         @ $(MAKE) "-SC" src/Pegasus/Query/QueryExpression/tests repository
283         @ $(MAKE) "-SC" src/Providers/TestProviders/Load repository
284 ifeq ($(PEGASUS_ENABLE_CQL),true)
285         @ $(MAKE) "-SC" src/Pegasus/ControlProviders/QueryCapabilitiesProvider/tests repository
286 endif
287 ifeq ($(PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER), true)
288         @ $(MAKE) "-SC" src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests repository
289 endif
290         @ $(MAKE) --directory=$(PEGASUS_ROOT)/src/Clients/cimsub/tests/testscript \
291             -f Makefile repository
292
293 testrepositoryServer: FORCE
294         @ $(MAKE) "-SC" src/Providers/sample/Load repositoryServer
295         @ $(MAKE) "-SC" test/wetest repositoryServer
296         @ $(MAKE) "-SC" src/Clients/benchmarkTest/Load repositoryServer
297         @ $(MAKE) "-SC" src/Pegasus/CQL/CQLCLI repositoryServer
298         @ $(MAKE) "-SC" src/Pegasus/Query/QueryExpression/tests repositoryServer
299         @ $(MAKE) "-SC" src/Providers/TestProviders/Load repositoryServer
300 ifeq ($(PEGASUS_ENABLE_CQL),true)
301         @ $(MAKE) "-SC" src/Pegasus/ControlProviders/QueryCapabilitiesProvider/tests repositoryServer
302 endif
303 ifeq ($(PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER), true)
304         @ $(MAKE) "-SC" src/Pegasus/ProviderManager2/JMPI/org/pegasus/jmpi/tests repositoryServer
305 endif
306         @ $(MAKE) --directory=$(PEGASUS_ROOT)/src/Clients/cimsub/tests/testscript \
307             -f Makefile repositoryServer
308
309 config:
310         @ $(ROOT)/SetConfig_EnvVar
311
312 rootbundle:
313         $(MAKE) --directory=$(PEGASUS_ROOT)/src/utils/cnv2rootbundle -f Makefile