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