Salome HOME
Issue 0020924: [CEA] 6.1.0rc1 - script fails
[modules/kernel.git] / idl / Makefile.am
1 #  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 # This Makefile is responsible of generating the client and server
24 # implementation of IDL interfaces for both C++ and python usage.
25 # The building process of the C++ files is in charge of each source
26 # package and then is not manage here.
27 #
28 include $(top_srcdir)/salome_adm/unix/make_common_starter.am
29
30 AM_CXXFLAGS += -fPIC
31
32 BASEIDL_FILES = \
33   SALOME_Exception.idl \
34   SALOME_Comm.idl \
35   SALOME_ModuleCatalog.idl \
36   SALOME_RessourcesCatalog.idl \
37   SALOMEDS.idl \
38   SALOMEDS_Attributes.idl \
39   SALOME_Component.idl \
40   SALOME_ContainerManager.idl \
41   SALOME_TestComponent.idl \
42   SALOME_Registry.idl \
43   Logger.idl \
44   SALOME_GenericObj.idl \
45   SALOME_Types.idl \
46   SALOME_Session.idl \
47   SALOME_TestModuleCatalog.idl \
48   nstest.idl \
49   DSC_Engines.idl \
50   SALOME_Ports.idl \
51   SALOME_PyNode.idl \
52   Palm_Ports.idl \
53   SALOME_PACOExtension.idl \
54   SALOME_ParamPorts.idl
55
56 MPIIDL_FILES = \
57   SALOME_MPIObject.idl \
58   SALOME_MPIContainer.idl \
59   SALOME_TestMPIComponent.idl  
60
61 IDL_FILES = $(BASEIDL_FILES)
62 if MPI_IS_OK
63   IDL_FILES += $(MPIIDL_FILES)
64 endif
65
66 OTHER_IDL_FILES = \
67   TestNotif.idl \
68   TypeData.idl
69
70 # all the idl files are needed for make dist
71 EXTRA_DIST= $(BASEIDL_FILES) $(MPIIDL_FILES) $(OTHER_IDL_FILES) \
72             SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml \
73             SALOME_PACOExtension.xml SALOME_ParamPorts.xml
74
75 # This variable defines the files to be installed
76 salomeidl_DATA        = $(IDL_FILES)
77 nodist_salomeidl_DATA = Calcium_Ports.idl
78
79 # Sources built from idl files
80 # BUILT_SOURCE = first thing done on make all
81 # idl dependencies are checked and rebuilt first
82
83 BASEIDL_SOURCES =\
84   SALOME_ExceptionSK.cc \
85   SALOME_CommSK.cc \
86   SALOME_ModuleCatalogSK.cc \
87   SALOME_RessourcesCatalogSK.cc \
88   SALOMEDSSK.cc \
89   SALOMEDS_AttributesSK.cc \
90   SALOME_ComponentSK.cc \
91   SALOME_ContainerManagerSK.cc \
92   SALOME_TestComponentSK.cc \
93   SALOME_RegistrySK.cc \
94   LoggerSK.cc \
95   SALOME_GenericObjSK.cc \
96   SALOME_TypesSK.cc \
97   SALOME_SessionSK.cc \
98   SALOME_TestModuleCatalogSK.cc \
99   nstestSK.cc \
100   DSC_EnginesSK.cc \
101   SALOME_PortsSK.cc \
102   SALOME_PyNodeSK.cc \
103   Calcium_PortsSK.cc \
104   Palm_PortsSK.cc \
105   SALOME_PACOExtensionSK.cc \
106   SALOME_ParamPortsSK.cc
107
108 DYNIDL_SRCS = \
109   SALOME_PortsDynSK.cc  Calcium_PortsDynSK.cc     SALOME_ContainerManagerDynSK.cc \
110   SALOME_CommDynSK.cc   SALOME_RegistryDynSK.cc   SALOME_ModuleCatalogDynSK.cc \
111   SALOMEDSDynSK.cc      SALOME_SessionDynSK.cc    SALOME_RessourcesCatalogDynSK.cc \
112   DSC_EnginesDynSK.cc   SALOME_ComponentDynSK.cc  SALOME_GenericObjDynSK.cc SALOME_TypesDynSK.cc \
113   Palm_PortsDynSK.cc    SALOME_ExceptionDynSK.cc  SALOMEDS_AttributesDynSK.cc \
114   LoggerDynSK.cc        SALOME_PACOExtensionDynSK.cc SALOME_ParamPortsDynSK.cc SALOME_PyNodeDynSK.cc
115
116 MPIIDL_SOURCES = \
117   SALOME_MPIObjectSK.cc \
118   SALOME_MPIContainerSK.cc \
119   SALOME_TestMPIComponentSK.cc  
120
121 IDL_SOURCES = $(BASEIDL_SOURCES)
122 if MPI_IS_OK
123   IDL_SOURCES += $(MPIIDL_SOURCES)
124 endif
125
126
127 STATIDL_SOURCES=$(BASEIDL_SOURCES)
128 if MPI_IS_OK
129   STATIDL_SOURCES += $(MPIIDL_SOURCES)
130 endif
131
132 if MPI_IS_OK
133   DYNIDL_SRCS += SALOME_MPIObjectDynSK.cc SALOME_MPIContainerDynSK.cc SALOME_TestMPIComponentDynSK.cc
134 endif
135
136 $(DYNIDL_SRCS) : $(IDL_SOURCES)
137
138 # also install all generated headers to use result library from another modules
139 salomeinclude_DATA= $(STATIDL_SOURCES:%SK.cc=%.hh)
140
141 if WITH_PACO_PARALLEL
142 PAR = SALOME_ComponentPaCO.hxx SALOME_ComponentPaCO.cxx \
143       SALOME_PortsPaCO.hxx SALOME_PortsPaCO.cxx \
144       DSC_EnginesPaCO.hxx DSC_EnginesPaCO.cxx \
145       SALOME_PACOExtensionPaCO.hxx SALOME_PACOExtensionPaCO.cxx \
146       SALOME_ParamPortsPaCO.hxx SALOME_ParamPortsPaCO.cxx
147
148 PAR_INCLUDES = SALOME_Exception.hxx SALOME_GenericObj.hxx SALOMEDS.hxx SALOME_PyNode.hxx
149
150 PAR_LIB = libSalomeParallelIDLKernel.la
151
152 IDL_PACO = SALOME_ComponentPaCO.idl SALOME_PortsPaCO.idl DSC_EnginesPaCO.idl \
153            SALOME_ParamPortsPaCO.idl SALOME_PACOExtensionPaCO.idl
154
155 GEN_PACO = SALOME_ComponentPaCO_Engines_Container_server.cxx \
156            SALOME_ComponentPaCO_Engines_Container_client.cxx \
157            SALOME_ComponentPaCO_Engines_Component_server.cxx \
158            SALOME_ComponentPaCO_Engines_Component_client.cxx \
159            SALOME_ComponentPaCO_Engines_fileTransfer_server.cxx \
160            SALOME_ComponentPaCO_Engines_fileTransfer_client.cxx \
161            SALOME_ComponentPaCO_Engines_Salome_file_server.cxx \
162            SALOME_ComponentPaCO_Engines_Salome_file_client.cxx \
163            SALOME_PortsPaCO_Ports_Port_server.cxx \
164            SALOME_PortsPaCO_Ports_Port_client.cxx \
165            SALOME_PortsPaCO_Ports_Data_Port_server.cxx \
166            SALOME_PortsPaCO_Ports_Data_Port_client.cxx \
167            DSC_EnginesPaCO_Engines_DSC_server.cxx \
168            DSC_EnginesPaCO_Engines_DSC_client.cxx \
169            DSC_EnginesPaCO_Engines_Superv_Component_server.cxx \
170            DSC_EnginesPaCO_Engines_Superv_Component_client.cxx \
171            SALOME_PACOExtensionPaCO_Engines_Parallel_Component_server.cxx \
172            SALOME_PACOExtensionPaCO_Engines_Parallel_Component_client.cxx \
173            SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.cxx \
174            SALOME_PACOExtensionPaCO_Engines_PACO_Container_client.cxx \
175            SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_server.cxx \
176            SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_client.cxx \
177            SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.cxx \
178            SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_client.cxx \
179            SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.cxx \
180            SALOME_ParamPortsPaCO_Ports_Param_Double_Port_client.cxx
181
182 INCLUDES_PACO = SALOME_ComponentPaCO_Engines_Container_server.hxx \
183                 SALOME_ComponentPaCO_Engines_Container_client.hxx \
184                 SALOME_ComponentPaCO_Engines_Component_server.hxx \
185                 SALOME_ComponentPaCO_Engines_Component_client.hxx \
186                 SALOME_ComponentPaCO_Engines_fileTransfer_server.hxx \
187                 SALOME_ComponentPaCO_Engines_fileTransfer_client.hxx \
188                 SALOME_ComponentPaCO_Engines_Salome_file_server.hxx \
189                 SALOME_ComponentPaCO_Engines_Salome_file_client.hxx \
190                 SALOME_ComponentPaCO.hxx \
191                 SALOME_Component.hxx \
192                 SALOME_PortsPaCO_Ports_Port_server.hxx \
193                 SALOME_PortsPaCO_Ports_Port_client.hxx \
194                 SALOME_PortsPaCO_Ports_Data_Port_server.hxx \
195                 SALOME_PortsPaCO_Ports_Data_Port_client.hxx \
196                 SALOME_PortsPaCO.hxx \
197                 SALOME_Ports.hxx \
198                 DSC_EnginesPaCO_Engines_DSC_server.hxx \
199                 DSC_EnginesPaCO_Engines_DSC_client.hxx \
200                 DSC_EnginesPaCO_Engines_Superv_Component_server.hxx \
201                 DSC_EnginesPaCO_Engines_Superv_Component_client.hxx \
202                 DSC_EnginesPaCO.hxx \
203                 DSC_Engines.hxx \
204                 SALOME_PACOExtensionPaCO_Engines_Parallel_Component_server.hxx \
205                 SALOME_PACOExtensionPaCO_Engines_Parallel_Component_client.hxx \
206                 SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.hxx \
207                 SALOME_PACOExtensionPaCO_Engines_PACO_Container_client.hxx \
208                 SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_server.hxx \
209                 SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_client.hxx \
210                 SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.hxx \
211                 SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_client.hxx \
212                 SALOME_PACOExtensionPaCO.hxx \
213                 SALOME_PACOExtension.hxx \
214                 SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.hxx \
215                 SALOME_ParamPortsPaCO_Ports_Param_Double_Port_client.hxx \
216                 SALOME_ParamPortsPaCO.hxx \
217                 SALOME_ParamPorts.hxx
218
219 XML           = SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml \
220                 SALOME_PACOExtension.xml SALOME_ParamPorts.xml
221 endif
222
223 idldir = $(prefix)/idl/salome
224 nodist_idl_DATA = ${XML} ${IDL_PACO} Calcium_Ports.idl
225 nodist_salomeinclude_HEADERS = ${INCLUDES_PACO} 
226
227 BUILT_SOURCES = $(IDL_SOURCES) $(PAR_INCLUDES) $(PAR)
228
229 SALOME_ComponentPaCO.idl SALOME_ComponentPaCO.hxx SALOME_ComponentPaCO.cxx : SALOME_Component.idl SALOME_Component.xml
230 SALOME_PortsPaCO.idl SALOME_PortsPaCO.hxx SALOME_PortsPaCO.cxx : SALOME_Ports.idl SALOME_Ports.xml
231 DSC_EnginesPaCO.idl DSC_EnginesPaCO.hxx DSC_EnginesPaCO.cxx : DSC_Engines.idl DSC_Engines.xml
232 SALOME_PACOExtensionPaCO.idl SALOME_PACOExtensionPaCO.hxx SALOME_PACOExtensionPaCO.cxx : SALOME_PACOExtension.idl SALOME_PACOExtension.xml
233 SALOME_ParamPortsPaCO.idl SALOME_ParamPortsPaCO.hxx SALOME_ParamPortsPaCO.cxx : SALOME_ParamPorts.idl SALOME_ParamPorts.xml
234
235 lib_LTLIBRARIES = libSalomeIDLKernel.la $(PAR_LIB)
236
237 nodist_libSalomeIDLKernel_la_SOURCES = $(IDL_SOURCES) $(DYNIDL_SRCS)
238 libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/idl \
239                                 @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
240 libSalomeIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
241 libSalomeIDLKernel_la_LIBADD  = @CORBA_LIBS@
242
243 nodist_libSalomeParallelIDLKernel_la_SOURCES = $(PAR) $(GEN_PACO)
244 libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/idl \
245                                         @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
246                                         @PACO_INCLUDES@
247 libSalomeParallelIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
248 libSalomeParallelIDLKernel_la_LIBADD  = libSalomeIDLKernel.la @PACO_LIBS@
249
250 # These variables defines the building process of CORBA files
251 IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(srcdir) -I$(top_builddir)/salome/idl
252 IDLPYFLAGS  = @IDLPYFLAGS@ -I$(srcdir)
253
254 # potential problem on parallel make on the following - multiple outputs
255 SUFFIXES = .idl .hh SK.cc
256 .idlSK.cc:
257         $(IDL) $(IDLCXXFLAGS) $<
258 SK.cc.hh:
259
260 #Dummy rule to replace the following one (for parallel make)
261 #.idl.hh:
262 #       $(IDL) $(IDLCXXFLAGS) $<
263
264 if WITH_PACO_PARALLEL
265
266 %PaCO.idl %PaCO.hxx %PaCO.cxx : %.idl %.xml
267         $(IDL) -p@PACOPATH@/lib/python -bpaco -Wb$(top_srcdir)/idl/$*.xml,$(srcdir):@PACOPATH@/idl $(top_srcdir)/idl/$*.idl
268
269 .idl.hxx:
270         $(IDL) $(IDLCXXFLAGS) -Wbh=.hxx -Wbs=.cxx $<
271 endif
272
273 install-exec-local: $(IDL_FILES:%=$(top_srcdir)/idl/%) Calcium_Ports.idl
274         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
275         ls $^ | while read file; do \
276           $(IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
277         done
278 if WITH_PACO_PARALLEL
279         ls $(top_builddir)/idl/*.idl | while read file; do \
280           $(IDL) $(IDLPYFLAGS) -I$(top_srcdir)/idl -I@PACOPATH@/idl -C$(DESTDIR)$(salomepythondir) $$file ; \
281         done
282 endif
283
284 # uninstall-local removes too much, but it works in distcheck
285 uninstall-local:
286         rm -rf $(DESTDIR)$(salomepythondir)/*
287
288 mostlyclean-local:
289         -rm -f *.hh *.cc .depidl Calcium_Ports.idl
290
291 # we use cpp to generate dependencies between idl files.
292 # option x c tells the preprocessor to consider idl as a c file.
293 # if an idl is modified, all idl dependencies are rebuilt
294
295 .depidl: $(IDL_FILES) Calcium_Ports.idl
296         @echo "" > $@
297         @for dep in $^ dummy; do \
298           if [ $$dep != "dummy" ]; then \
299             echo Building dependencies for $$dep; \
300             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) $$dep 2>/dev/null | \
301             sed 's/\.o/\SK.cc/' >>$@; \
302           fi; \
303         done ;
304
305 -include .depidl
306
307 CLEANFILES = *PaCO* *.hxx *.cxx Calcium_Ports.idl
308
309