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