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