summaryrefslogtreecommitdiffstats
path: root/mak/SDKMakefile
blob: 2e56baeeda2f7e4ccad276210845b7d5d21725d4 (plain)
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
include $(PEGASUS_ROOT)/mak/config.mak
include $(PEGASUS_ROOT)/mak/commands.mak

ifndef PEGASUS_STAGING_DIR
   PEGASUS_STAGING_DIR = $(PEGASUS_HOME)/stageSDK/
endif

ifndef PEGASUS_SAMPLES_DIR
   PEGASUS_SAMPLES_DIR = samples
endif

ifndef PEGASUS_INCLUDE_DIR
   PEGASUS_INCLUDE_DIR = include
endif

ifndef PEGASUS_HTML_DIR
   PEGASUS_HTML_DIR = html
endif
   

INCLUDE_SRCPATH = $(PEGASUS_ROOT)/src

HTML_SRCPATH = $(PEGASUS_HOME)/html

CLIENT_SRCPATH1 = $(PEGASUS_ROOT)/src/SDK/samples
CLIENT_SRCPATH2 = $(PEGASUS_ROOT)/InterfaceArchive/v002001/tests/Clients
CLIENT_SRCPATH3 = $(PEGASUS_ROOT)/src/Clients

PROVIDER_SRCPATH1 = $(PEGASUS_ROOT)/src/SDK/samples/Providers
PROVIDER_SRCPATH2 = $(PEGASUS_ROOT)/src/Providers/sample
PROVIDER_SRCPATH3 = $(PEGASUS_ROOT)/InterfaceArchive/v002001/tests/Providers
PROVIDER_SRCPATH4 = $(PEGASUS_ROOT)/src/Providers/IndicationConsumer

INCLUDEFILES = \
   Pegasus/Client/CIMClientException.h \
   Pegasus/Client/CIMClient.h \
   Pegasus/Client/Linkage.h \
   Pegasus/Common/Array.h \
   Pegasus/Common/ArrayInter.h \
   Pegasus/Common/Char16.h \
   Pegasus/Common/CIMClass.h \
   Pegasus/Common/CIMDateTime.h \
   Pegasus/Common/CIMFlavor.h \
   Pegasus/Common/CIMIndication.h \
   Pegasus/Common/CIMInstance.h \
   Pegasus/Common/CIMMethod.h \
   Pegasus/Common/CIMName.h \
   Pegasus/Common/CIMObject.h \
   Pegasus/Common/CIMObjectPath.h \
   Pegasus/Common/CIMParameter.h \
   Pegasus/Common/CIMParamValue.h \
   Pegasus/Common/CIMProperty.h \
   Pegasus/Common/CIMPropertyList.h \
   Pegasus/Common/CIMQualifierDecl.h \
   Pegasus/Common/CIMQualifier.h \
   Pegasus/Common/CIMScope.h \
   Pegasus/Common/CIMStatusCode.h \
   Pegasus/Common/CIMType.h \
   Pegasus/Common/CIMValue.h \
   Pegasus/Common/Config.h \
   Pegasus/Common/Exception.h \
   Pegasus/Common/Linkage.h \
   Pegasus/Common/OperationContext.h \
   Pegasus/Common/ResponseHandler.h \
   Pegasus/Common/SSLContext.h \
   Pegasus/Common/String.h \
   Pegasus/Common/Platform_$(PEGASUS_PLATFORM).h \
   Pegasus/Consumer/CIMIndicationConsumer.h \
   Pegasus/Consumer/Linkage.h \
   Pegasus/Provider/CIMAssociationProvider.h \
   Pegasus/Provider/CIMIndicationConsumerProvider.h \
   Pegasus/Provider/CIMIndicationProvider.h \
   Pegasus/Provider/CIMInstanceProvider.h \
   Pegasus/Provider/CIMMethodProvider.h \
   Pegasus/Provider/CIMOMHandle.h \
   Pegasus/Provider/CIMProvider.h \
   Pegasus/Provider/Linkage.h \
   Pegasus/Provider/ProviderException.h 

INCLUDEFILES += \
   Pegasus/Common/AcceptLanguages.h \
   Pegasus/Common/MessageLoader.h \
   Pegasus/Common/ContentLanguages.h \
   Pegasus/Common/LanguageElementContainer.h \
   Pegasus/Common/AcceptLanguageElement.h \
   Pegasus/Common/Formatter.h \
   Pegasus/Common/ContentLanguageElement.h \
   Pegasus/Common/LanguageElement.h  


CLIENTSRCPATH1FILES = \
   Makefile \
   mak/$(PEGASUS_PLATFORM).mak \
   mak/config.mak \
   mak/program.mak \
   mak/recurse.mak \
   mak/library.mak \
   mak/common.mak \
   Clients/Makefile \
   Clients/DefaultC++/Makefile \
   Clients/DefaultC++/EnumInstances/Makefile \
   Clients/DefaultC++/InvokeMethod/Makefile \
   Clients/DefaultC++/SendTestIndications/Makefile 

CLIENTSRCPATH2FILES = \
   EnumInstances/EnumInstances.cpp \
   InvokeMethod/InvokeMethod.cpp 

CLIENTSRCPATH3FILES = \
   SendTestIndications/SendTestIndications.cpp

PROVIDERSRCPATH1FILES = \
   Makefile \
   Load/Makefile \
   Load/SampleProviderSchema.mof \
   Load/IndicationProviderR.mof \
   DefaultC++/Makefile \
   DefaultC++/InstanceProvider/Makefile \
   DefaultC++/MethodProvider/Makefile \
   DefaultC++/IndicationProvider/Makefile \
   DefaultC++/IndicationProvider/IndicationProvider.cpp \
   DefaultC++/IndicationProvider/IndicationProvider.h \
   DefaultC++/IndicationProvider/IndicationProviderMain.cpp \
   DefaultC++/SimpleDisplayConsumer/Makefile
   
PROVIDERSRCPATH2FILES = \
   Load/InstanceProviderR.mof \
   Load/MethodProviderR.mof \
   Load/SimpleDisplayConsumerR.mof 

PROVIDERSRCPATH3FILES = \
   InstanceProvider/InstanceProvider.cpp \
   InstanceProvider/InstanceProviderMain.cpp \
   InstanceProvider/InstanceProvider.h \
   InstanceProvider/EnumerateInstancesrspgood.xml \
   InstanceProvider/EnumerateInstances.xml \
   MethodProvider/MethodProvider.cpp \
   MethodProvider/MethodProviderMain.cpp \
   MethodProvider/MethodProvider.h \
   MethodProvider/InvokeMethod.xml \
   MethodProvider/InvokeMethodrspgood.xml

PROVIDERSRCPATH4FILES = \
   SimpleDisplayConsumer/SimpleDisplayConsumerMain.cpp \
   SimpleDisplayConsumer/SimpleDisplayConsumer.cpp \
   SimpleDisplayConsumer/SimpleDisplayConsumer.h

error:
	@echo "Please specify an action"

stageSDK:
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile stageINCLUDE
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile stageHTML
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile stageSAMPLES

stageINCLUDE:
	@$(RMDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)/Pegasus/Common
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)/Pegasus/Client
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)/Pegasus/Provider
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)/Pegasus/Handler
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)/Pegasus/Consumer
	@$(foreach i, $(INCLUDEFILES), $(COPY) $(INCLUDE_SRCPATH)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR)/$(i);)

createPlatformFile:
	@$(ECHO) "ifndef PEGASUS_PROVIDER_LIB_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "   PEGASUS_PROVIDER_LIB_DIR = $(PEGASUS_PROVIDER_LIB_DIR)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "ifndef PEGASUS_DEST_LIB_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "   PEGASUS_DEST_LIB_DIR = $(PEGASUS_DEST_LIB_DIR)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "ifndef PEGASUS_INCLUDE_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "   PEGASUS_INCLUDE_DIR = $(PEGASUS_INCLUDE_DIR)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "ifndef PEGASUS_MOF_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "   PEGASUS_MOF_DIR = $(PEGASUS_MOF_DIR)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "ifndef PEGASUS_SAMPLES_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "   PEGASUS_SAMPLES_DIR = $(PEGASUS_SAMPLES_DIR)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "ifndef PEGASUS_BIN_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "   PEGASUS_BIN_DIR = $(PEGASUS_BIN_DIR)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(ECHO) "" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak
	@$(CAT) $(CLIENT_SRCPATH1)/mak/$(PEGASUS_PLATFORM).mak  >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/$(PEGASUS_PLATFORM).mak

createConfigFile:
	@$(ECHO) "ifndef PEGASUS_PLATFORM" > $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(ECHO) "   PEGASUS_PLATFORM = $(PEGASUS_PLATFORM)" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(ECHO) "ifndef PEGASUS_INDICATION_CONSUMER_LOG_DIR" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(ECHO) "   PEGASUS_INDICATION_CONSUMER_LOG_DIR = $(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/SimpleDisplayConsumer" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(ECHO) "endif" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(ECHO) "" >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak
	@$(CAT)  $(PEGASUS_ROOT)/src/SDK/samples/mak/config.mak >> $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak/config.mak

stageSAMPLES:
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f commands.mak cimstop_IgnoreError
	@$(RMDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/mak
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Clients/DefaultC++/EnumInstances
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Clients/DefaultC++/InvokeMethod
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Clients/DefaultC++/SendTestIndications
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/Load
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/InstanceProvider
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/MethodProvider
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/IndicationProvider
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/SimpleDisplayConsumer
	@$(foreach i, $(CLIENTSRCPATH1FILES), $(COPY) $(CLIENT_SRCPATH1)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/$(i);)
	@$(foreach i, $(CLIENTSRCPATH2FILES), $(COPY) $(CLIENT_SRCPATH2)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Clients/DefaultC++/$(i);)
	@$(foreach i, $(CLIENTSRCPATH3FILES), $(COPY) $(CLIENT_SRCPATH3)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Clients/DefaultC++/$(i);)
	@$(foreach i, $(PROVIDERSRCPATH1FILES), $(COPY) $(PROVIDER_SRCPATH1)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/$(i);)
	@$(foreach i, $(PROVIDERSRCPATH2FILES), $(COPY) $(PROVIDER_SRCPATH2)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/$(i);)
	@$(foreach i, $(PROVIDERSRCPATH3FILES), $(COPY) $(PROVIDER_SRCPATH3)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/$(i);)
	@$(foreach i, $(PROVIDERSRCPATH4FILES), $(COPY) $(PROVIDER_SRCPATH4)/$(i) $(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/$(i);)
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile createConfigFile
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile createPlatformFile

stageHTML:
	@$(RMDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_HTML_DIR)
	@$(MKDIRHIER) $(PEGASUS_STAGING_DIR)$(PEGASUS_HTML_DIR)
	@$(MAKE) --directory=$(PEGASUS_ROOT)/doc/SDK -f Makefile PEGASUS_HTML_DIR=$(PEGASUS_STAGING_DIR)$(PEGASUS_HTML_DIR) buildDoc_ContinueOnError

removeSampleProviderNamespace:
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f commands.mak cimstop_IgnoreError
	@$(ECHO) +++++ Removing existing repository named root#SampleProvider 
	@$(RMREPOSITORY) $(REPOSITORY_ROOT)/root\#SampleProvider
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f commands.mak cimstart

buildSDK:
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile -i removeSampleProviderNamespace
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile -i deregisterproviders
	@$(MAKE) --directory=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR) -f Makefile clean \
             PEGASUS_SAMPLES_DIR=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR) \
             PEGASUS_PROVIDER_LIB_DIR=$(PEGASUS_HOME)/lib
	@$(MAKE) --directory=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR) -f Makefile all \
             PEGASUS_PROVIDER_LIB_DIR=$(PEGASUS_HOME)/lib PEGASUS_INCLUDE_DIR=$(PEGASUS_STAGING_DIR)$(PEGASUS_INCLUDE_DIR) \
             PEGASUS_DEST_LIB_DIR=$(PEGASUS_HOME)/lib PEGASUS_SAMPLES_DIR=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR) \
             PEGASUS_INDICATION_CONSUMER_LOG_DIR=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/DefaultC++/SimpleDisplayConsumer
	@$(MAKE) --directory=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/Load -f Makefile createrepository \
             PEGASUS_MOF_DIR=$(PEGASUS_ROOT)/Schemas PEGASUS_BIN_DIR=$(PEGASUS_HOME)/bin
	@$(MAKE) --directory=$(PEGASUS_ROOT)/mak -f SDKMakefile -i registerproviders PEGASUS_BIN_DIR=$(PEGASUS_HOME)/bin

deregisterproviders:
	@$(MAKE) --directory=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/Load -f Makefile deregisterproviders \
             PEGASUS_BIN_DIR=$(PEGASUS_HOME)/bin

registerproviders:
	@$(MAKE) --directory=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)/Providers/Load -f Makefile registerproviders \
             PEGASUS_BIN_DIR=$(PEGASUS_HOME)/bin

testSDK:
	@$(MAKE) --directory=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR) -f Makefile  tests \
             PEGASUS_SAMPLES_DIR=$(PEGASUS_STAGING_DIR)$(PEGASUS_SAMPLES_DIR)