Salome HOME
merge from BR_KERNEL_REFACTORING
[modules/kernel.git] / idl / Makefile.am
1 # Copyright (C) 2007-2012  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   SALOME_Parametric.idl \
56   SALOME_MPIObject.idl
57
58 MPIIDL_FILES = \
59   SALOME_MPIContainer.idl \
60   SALOME_TestMPIComponent.idl  
61
62 IDL_FILES = $(BASEIDL_FILES)
63 if MPI_IS_OK
64   IDL_FILES += $(MPIIDL_FILES)
65 endif
66
67 OTHER_IDL_FILES = \
68   TestNotif.idl \
69   TypeData.idl
70
71 # all the idl files are needed for make dist
72 EXTRA_DIST += $(BASEIDL_FILES) $(MPIIDL_FILES) $(OTHER_IDL_FILES) \
73             SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml \
74             SALOME_PACOExtension.xml SALOME_ParamPorts.xml \
75             SALOME_GenericObj.xml SALOME_Exception.xml
76
77 # This variable defines the files to be installed
78 salomeidl_DATA        = $(IDL_FILES)
79 nodist_salomeidl_DATA = Calcium_Ports.idl
80
81 # Sources built from idl files
82 # BUILT_SOURCE = first thing done on make all
83 # idl dependencies are checked and rebuilt first
84
85 BASEIDL_SOURCES =\
86   SALOME_ExceptionSK.cc \
87   SALOME_CommSK.cc \
88   SALOME_ModuleCatalogSK.cc \
89   SALOME_RessourcesCatalogSK.cc \
90   SALOMEDSSK.cc \
91   SALOMEDS_AttributesSK.cc \
92   SALOME_ComponentSK.cc \
93   SALOME_ContainerManagerSK.cc \
94   SALOME_TestComponentSK.cc \
95   SALOME_RegistrySK.cc \
96   LoggerSK.cc \
97   SALOME_GenericObjSK.cc \
98   SALOME_TypesSK.cc \
99   SALOME_SessionSK.cc \
100   SALOME_TestModuleCatalogSK.cc \
101   nstestSK.cc \
102   DSC_EnginesSK.cc \
103   SALOME_PortsSK.cc \
104   SALOME_PyNodeSK.cc \
105   Calcium_PortsSK.cc \
106   Palm_PortsSK.cc \
107   SALOME_PACOExtensionSK.cc \
108   SALOME_ParamPortsSK.cc \
109   SALOME_ParametricSK.cc \
110   SALOME_MPIObjectSK.cc
111
112 DYNIDL_SRCS = \
113   SALOME_PortsDynSK.cc  Calcium_PortsDynSK.cc     SALOME_ContainerManagerDynSK.cc \
114   SALOME_CommDynSK.cc   SALOME_RegistryDynSK.cc   SALOME_ModuleCatalogDynSK.cc \
115   SALOMEDSDynSK.cc      SALOME_SessionDynSK.cc    SALOME_RessourcesCatalogDynSK.cc \
116   DSC_EnginesDynSK.cc   SALOME_ComponentDynSK.cc  SALOME_GenericObjDynSK.cc SALOME_TypesDynSK.cc \
117   Palm_PortsDynSK.cc    SALOME_ExceptionDynSK.cc  SALOMEDS_AttributesDynSK.cc \
118   LoggerDynSK.cc        SALOME_PACOExtensionDynSK.cc SALOME_ParamPortsDynSK.cc SALOME_PyNodeDynSK.cc \
119   SALOME_ParametricDynSK.cc SALOME_MPIObjectDynSK.cc
120
121 MPIIDL_SOURCES = \
122   SALOME_MPIContainerSK.cc \
123   SALOME_TestMPIComponentSK.cc  
124
125 IDL_SOURCES = $(BASEIDL_SOURCES)
126 if MPI_IS_OK
127   IDL_SOURCES += $(MPIIDL_SOURCES)
128 endif
129
130
131 STATIDL_SOURCES=$(BASEIDL_SOURCES)
132 if MPI_IS_OK
133   STATIDL_SOURCES += $(MPIIDL_SOURCES)
134 endif
135
136 if MPI_IS_OK
137   DYNIDL_SRCS += SALOME_MPIContainerDynSK.cc SALOME_TestMPIComponentDynSK.cc
138 endif
139
140 $(DYNIDL_SRCS) : $(IDL_SOURCES)
141
142 # also install all generated headers to use result library from another modules
143 salomeinclude_DATA= $(STATIDL_SOURCES:%SK.cc=%.hh)
144
145 if WITH_PACO_PARALLEL
146 PAR = SALOME_ComponentPaCO.hxx SALOME_ComponentPaCO.cxx \
147       SALOME_PortsPaCO.hxx SALOME_PortsPaCO.cxx \
148       DSC_EnginesPaCO.hxx DSC_EnginesPaCO.cxx \
149       SALOME_PACOExtensionPaCO.hxx SALOME_PACOExtensionPaCO.cxx \
150       SALOME_ParamPortsPaCO.hxx SALOME_ParamPortsPaCO.cxx \
151       SALOME_GenericObjPaCO.hxx SALOME_GenericObjPaCO.cxx
152
153 PAR_INCLUDES = SALOME_Exception.hxx SALOME_GenericObj.hxx SALOMEDS.hxx SALOME_PyNode.hxx
154
155 PAR_LIB = libSalomeParallelIDLKernel.la
156
157 IDL_PACO = SALOME_ComponentPaCO.idl SALOME_PortsPaCO.idl DSC_EnginesPaCO.idl \
158            SALOME_ParamPortsPaCO.idl SALOME_PACOExtensionPaCO.idl \
159            SALOME_GenericObjPaCO.idl
160
161 GEN_PACO = SALOME_ComponentPaCO_Engines_Container_server.cxx \
162            SALOME_ComponentPaCO_Engines_Container_client.cxx \
163            SALOME_ComponentPaCO_Engines_EngineComponent_server.cxx \
164            SALOME_ComponentPaCO_Engines_EngineComponent_client.cxx \
165            SALOME_ComponentPaCO_Engines_fileTransfer_server.cxx \
166            SALOME_ComponentPaCO_Engines_fileTransfer_client.cxx \
167            SALOME_ComponentPaCO_Engines_Salome_file_server.cxx \
168            SALOME_ComponentPaCO_Engines_Salome_file_client.cxx \
169            SALOME_PortsPaCO_Ports_Port_server.cxx \
170            SALOME_PortsPaCO_Ports_Port_client.cxx \
171            SALOME_PortsPaCO_Ports_Data_Port_server.cxx \
172            SALOME_PortsPaCO_Ports_Data_Port_client.cxx \
173            DSC_EnginesPaCO_Engines_DSC_server.cxx \
174            DSC_EnginesPaCO_Engines_DSC_client.cxx \
175            DSC_EnginesPaCO_Engines_Superv_Component_server.cxx \
176            DSC_EnginesPaCO_Engines_Superv_Component_client.cxx \
177            SALOME_PACOExtensionPaCO_Engines_Parallel_Component_server.cxx \
178            SALOME_PACOExtensionPaCO_Engines_Parallel_Component_client.cxx \
179            SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.cxx \
180            SALOME_PACOExtensionPaCO_Engines_PACO_Container_client.cxx \
181            SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_server.cxx \
182            SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_client.cxx \
183            SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.cxx \
184            SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_client.cxx \
185            SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.cxx \
186            SALOME_ParamPortsPaCO_Ports_Param_Double_Port_client.cxx \
187            SALOME_GenericObjPaCO_SALOME_GenericObj_server.cxx \
188            SALOME_GenericObjPaCO_SALOME_GenericObj_client.cxx
189
190 INCLUDES_PACO = SALOME_ComponentPaCO_Engines_Container_server.hxx \
191                 SALOME_ComponentPaCO_Engines_Container_client.hxx \
192                 SALOME_ComponentPaCO_Engines_EngineComponent_server.hxx \
193                 SALOME_ComponentPaCO_Engines_EngineComponent_client.hxx \
194                 SALOME_ComponentPaCO_Engines_fileTransfer_server.hxx \
195                 SALOME_ComponentPaCO_Engines_fileTransfer_client.hxx \
196                 SALOME_ComponentPaCO_Engines_Salome_file_server.hxx \
197                 SALOME_ComponentPaCO_Engines_Salome_file_client.hxx \
198                 SALOME_ComponentPaCO.hxx \
199                 SALOME_Component.hxx \
200                 SALOME_PortsPaCO_Ports_Port_server.hxx \
201                 SALOME_PortsPaCO_Ports_Port_client.hxx \
202                 SALOME_PortsPaCO_Ports_Data_Port_server.hxx \
203                 SALOME_PortsPaCO_Ports_Data_Port_client.hxx \
204                 SALOME_PortsPaCO.hxx \
205                 SALOME_Ports.hxx \
206                 DSC_EnginesPaCO_Engines_DSC_server.hxx \
207                 DSC_EnginesPaCO_Engines_DSC_client.hxx \
208                 DSC_EnginesPaCO_Engines_Superv_Component_server.hxx \
209                 DSC_EnginesPaCO_Engines_Superv_Component_client.hxx \
210                 DSC_EnginesPaCO.hxx \
211                 DSC_Engines.hxx \
212                 SALOME_PACOExtensionPaCO_Engines_Parallel_Component_server.hxx \
213                 SALOME_PACOExtensionPaCO_Engines_Parallel_Component_client.hxx \
214                 SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.hxx \
215                 SALOME_PACOExtensionPaCO_Engines_PACO_Container_client.hxx \
216                 SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_server.hxx \
217                 SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_client.hxx \
218                 SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.hxx \
219                 SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_client.hxx \
220                 SALOME_PACOExtensionPaCO.hxx \
221                 SALOME_PACOExtension.hxx \
222                 SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.hxx \
223                 SALOME_ParamPortsPaCO_Ports_Param_Double_Port_client.hxx \
224                 SALOME_ParamPortsPaCO.hxx \
225                 SALOME_ParamPorts.hxx \
226                 SALOME_GenericObjPaCO_SALOME_GenericObj_server.hxx \
227                 SALOME_GenericObjPaCO_SALOME_GenericObj_client.hxx \
228                 SALOME_GenericObjPaCO.hxx \
229                 SALOME_GenericObj.hxx
230
231 XML           = SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml \
232                 SALOME_PACOExtension.xml SALOME_ParamPorts.xml \
233                 SALOME_GenericObj.xml
234 endif
235
236 idldir = $(prefix)/idl/salome
237 nodist_idl_DATA = ${XML} ${IDL_PACO} Calcium_Ports.idl
238 nodist_salomeinclude_HEADERS = ${INCLUDES_PACO} 
239
240 BUILT_SOURCES = $(IDL_SOURCES) $(PAR_INCLUDES) $(PAR)
241
242 SALOME_GenericObjPaCO.idl SALOME_GenericObjPaCO.hxx SALOME_GenericObjPaCO.cxx : SALOME_GenericObj.idl SALOME_GenericObj.xml
243 SALOME_ComponentPaCO.idl SALOME_ComponentPaCO.hxx SALOME_ComponentPaCO.cxx : SALOME_Component.idl SALOME_Component.xml SALOME_GenericObjPaCO.idl
244 SALOME_PortsPaCO.idl SALOME_PortsPaCO.hxx SALOME_PortsPaCO.cxx : SALOME_Ports.idl SALOME_Ports.xml
245 DSC_EnginesPaCO.idl DSC_EnginesPaCO.hxx DSC_EnginesPaCO.cxx : DSC_Engines.idl DSC_Engines.xml
246 SALOME_PACOExtensionPaCO.idl SALOME_PACOExtensionPaCO.hxx SALOME_PACOExtensionPaCO.cxx : SALOME_PACOExtension.idl SALOME_PACOExtension.xml
247 SALOME_ParamPortsPaCO.idl SALOME_ParamPortsPaCO.hxx SALOME_ParamPortsPaCO.cxx : SALOME_ParamPorts.idl SALOME_ParamPorts.xml
248
249 lib_LTLIBRARIES = libSalomeIDLKernel.la $(PAR_LIB)
250
251 nodist_libSalomeIDLKernel_la_SOURCES = $(IDL_SOURCES) $(DYNIDL_SRCS)
252 libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/idl \
253                                 @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
254 libSalomeIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
255 libSalomeIDLKernel_la_LIBADD  = @CORBA_LIBS@
256
257 nodist_libSalomeParallelIDLKernel_la_SOURCES = $(PAR) $(GEN_PACO)
258 libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/idl \
259                                         @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
260                                         @PACO_INCLUDES@
261 libSalomeParallelIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
262 libSalomeParallelIDLKernel_la_LIBADD  = libSalomeIDLKernel.la @PACO_LIBS@
263
264 # These variables defines the building process of CORBA files
265 IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(srcdir) -I$(top_builddir)/salome/idl
266 IDLPYFLAGS  = @IDLPYFLAGS@ -I$(srcdir)
267
268 # potential problem on parallel make on the following - multiple outputs
269 SUFFIXES = .idl .hh SK.cc
270 .idlSK.cc:
271         $(IDL) $(IDLCXXFLAGS) $<
272 SK.cc.hh:
273
274 #Dummy rule to replace the following one (for parallel make)
275 #.idl.hh:
276 #       $(IDL) $(IDLCXXFLAGS) $<
277
278 if WITH_PACO_PARALLEL
279
280 %PaCO.idl %PaCO.hxx %PaCO.cxx : %.idl %.xml
281         $(IDL) -p@PACOPATH@/lib/python -bpaco -Wb$(top_srcdir)/idl/$*.xml,$(srcdir):@PACOPATH@/idl $(top_srcdir)/idl/$*.idl
282
283 .idl.hxx:
284         $(IDL) $(PACOIDLCXXFLAGS) -bcxx -Wbh=.hxx -Wbs=.cxx $<
285 endif
286
287 install-exec-local: $(IDL_FILES:%=$(top_srcdir)/idl/%) Calcium_Ports.idl
288         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
289         ls $^ | while read file; do \
290           $(IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
291         done
292 if WITH_PACO_PARALLEL
293         ls $(top_builddir)/idl/*.idl | while read file; do \
294           $(IDL) $(IDLPYFLAGS) -I$(top_srcdir)/idl -I@PACOPATH@/idl -C$(DESTDIR)$(salomepythondir) $$file ; \
295         done
296 endif
297
298 # uninstall-local removes too much, but it works in distcheck
299 uninstall-local:
300         for filen in `find $(DESTDIR)$(salomepythondir) -maxdepth 1` ; do \
301           case $${filen} in                                               \
302           $(DESTDIR)$(salomepythondir) )    ;;                            \
303           $(DESTDIR)$(salomepypkgdir) )     ;;                            \
304           $(DESTDIR)$(sharedpkgpythondir) ) ;;                            \
305           * ) rm -rf $${filen} ;;                                         \
306           esac ;                                                          \
307         done ;
308
309 mostlyclean-local:
310         -rm -f *.hh *.cc .depidl Calcium_Ports.idl
311
312 # we use cpp to generate dependencies between idl files.
313 # option x c tells the preprocessor to consider idl as a c file.
314 # if an idl is modified, all idl dependencies are rebuilt
315
316 .depidl: $(IDL_FILES) Calcium_Ports.idl
317         @echo "" > $@
318         @for dep in $^ dummy; do \
319           if [ $$dep != "dummy" ]; then \
320             echo Building dependencies for $$dep; \
321             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) $$dep 2>/dev/null | \
322             sed 's/\.o/\SK.cc/' >>$@; \
323           fi; \
324         done ;
325
326 -include .depidl
327
328 CLEANFILES = *PaCO* *.hxx *.cxx Calcium_Ports.idl
329
330