Salome HOME
Integration of 0019971: A patch for cmake compilation.
[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 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_Exception.xml SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml
73
74 # This variable defines the files to be installed
75 salomeidl_DATA = $(IDL_FILES)
76
77 # Sources built from idl files
78 # BUILT_SOURCE = first thing done on make all
79 # idl dependencies are checked and rebuilt first
80
81 BASEIDL_SOURCES =\
82   SALOME_ExceptionSK.cc \
83   SALOME_CommSK.cc \
84   SALOME_ModuleCatalogSK.cc \
85   SALOME_RessourcesCatalogSK.cc \
86   SALOMEDSSK.cc \
87   SALOMEDS_AttributesSK.cc \
88   SALOME_ComponentSK.cc \
89   SALOME_ContainerManagerSK.cc \
90   SALOME_TestComponentSK.cc \
91   SALOME_RegistrySK.cc \
92   LoggerSK.cc \
93   SALOME_GenericObjSK.cc \
94   SALOME_SessionSK.cc \
95   SALOME_TestModuleCatalogSK.cc \
96   nstestSK.cc \
97   DSC_EnginesSK.cc \
98   SALOME_PortsSK.cc \
99   Calcium_PortsSK.cc \
100   Palm_PortsSK.cc
101
102 DYNIDL_SRCS = \
103   SALOME_PortsDynSK.cc  Calcium_PortsDynSK.cc     SALOME_ContainerManagerDynSK.cc \
104   SALOME_CommDynSK.cc   SALOME_RegistryDynSK.cc   SALOME_ModuleCatalogDynSK.cc \
105   SALOMEDSDynSK.cc      SALOME_SessionDynSK.cc    SALOME_RessourcesCatalogDynSK.cc \
106   DSC_EnginesDynSK.cc   SALOME_ComponentDynSK.cc  SALOME_GenericObjDynSK.cc \
107   Palm_PortsDynSK.cc    SALOME_ExceptionDynSK.cc  SALOMEDS_AttributesDynSK.cc \
108   LoggerDynSK.cc
109
110 MPIIDL_SOURCES = \
111   SALOME_MPIObjectSK.cc \
112   SALOME_MPIContainerSK.cc \
113   SALOME_TestMPIComponentSK.cc  
114
115 IDL_SOURCES = $(BASEIDL_SOURCES)
116 if MPI_IS_OK
117   IDL_SOURCES += $(MPIIDL_SOURCES)
118 endif
119
120
121 STATIDL_SOURCES=$(BASEIDL_SOURCES)
122 if MPI_IS_OK
123   STATIDL_SOURCES += $(MPIIDL_SOURCES)
124 endif
125
126 $(DYNIDL_SRCS) : $(IDL_SOURCES)
127
128 # also install all generated headers to use result library from another modules
129 salomeinclude_DATA= $(STATIDL_SOURCES:%SK.cc=%.hh)
130
131 if WITH_PACO_PARALLEL
132 PAR = SALOME_ExceptionPaCO.h SALOME_ExceptionPaCO.cc \
133       SALOME_ComponentPaCO.h SALOME_ComponentPaCO.cc \
134       SALOME_PortsPaCO.h SALOME_PortsPaCO.cc \
135       DSC_EnginesPaCO.h DSC_EnginesPaCO.cc 
136
137 PAR_LIB = libSalomeParallelIDLKernel.la
138
139 IDL_PACO      = SALOME_ExceptionPaCO.idl SALOME_ComponentPaCO.idl SALOME_PortsPaCO.idl DSC_EnginesPaCO.idl
140
141 GEN_PACO = SALOME_ComponentPaCO_Engines_Container_server.cc \
142            SALOME_ComponentPaCO_Engines_Container_client.cc \
143            SALOME_ComponentPaCO_Engines_Component_server.cc \
144            SALOME_ComponentPaCO_Engines_Component_client.cc \
145            SALOME_ComponentPaCO_Engines_Parallel_Component_server.cc \
146            SALOME_ComponentPaCO_Engines_Parallel_Component_client.cc \
147            SALOME_ComponentPaCO_Engines_fileTransfer_server.cc \
148            SALOME_ComponentPaCO_Engines_fileTransfer_client.cc \
149            SALOME_ComponentPaCO_Engines_Salome_file_server.cc \
150            SALOME_ComponentPaCO_Engines_Salome_file_client.cc \
151            SALOME_ComponentPaCO_Engines_Parallel_Salome_file_server.cc \
152            SALOME_ComponentPaCO_Engines_Parallel_Salome_file_client.cc \
153            SALOME_PortsPaCO_Ports_Port_server.cc \
154            SALOME_PortsPaCO_Ports_Port_client.cc \
155            DSC_EnginesPaCO_Engines_DSC_server.cc \
156            DSC_EnginesPaCO_Engines_DSC_client.cc \
157            DSC_EnginesPaCO_Engines_Superv_Component_server.cc \
158            DSC_EnginesPaCO_Engines_Superv_Component_client.cc \
159            DSC_EnginesPaCO_Engines_Parallel_DSC_server.cc \
160            DSC_EnginesPaCO_Engines_Parallel_DSC_client.cc
161
162 INCLUDES_PACO = SALOME_ComponentPaCO_Engines_Container_server.h \
163                 SALOME_ComponentPaCO_Engines_Container_client.h \
164                 SALOME_ComponentPaCO_Engines_Component_server.h \
165                 SALOME_ComponentPaCO_Engines_Component_client.h \
166                 SALOME_ComponentPaCO_Engines_Parallel_Component_server.h \
167                 SALOME_ComponentPaCO_Engines_Parallel_Component_client.h \
168                 SALOME_ComponentPaCO_Engines_fileTransfer_server.h \
169                 SALOME_ComponentPaCO_Engines_fileTransfer_client.h \
170                 SALOME_ComponentPaCO_Engines_Salome_file_server.h \
171                 SALOME_ComponentPaCO_Engines_Salome_file_client.h \
172                 SALOME_ComponentPaCO_Engines_Parallel_Salome_file_server.h \
173                 SALOME_ComponentPaCO_Engines_Parallel_Salome_file_client.h \
174                 SALOME_ExceptionPaCO.h \
175                 SALOME_ComponentPaCO.h \
176                 SALOME_Exception.h \
177                 SALOME_Component.h \
178                 SALOME_PortsPaCO_Ports_Port_server.h \
179                 SALOME_PortsPaCO_Ports_Port_client.h \
180                 SALOME_PortsPaCO.h \
181                 SALOME_Ports.h \
182                 DSC_EnginesPaCO_Engines_DSC_server.h \
183                 DSC_EnginesPaCO_Engines_DSC_client.h \
184                 DSC_EnginesPaCO_Engines_Superv_Component_server.h \
185                 DSC_EnginesPaCO_Engines_Superv_Component_client.h \
186                 DSC_EnginesPaCO_Engines_Parallel_DSC_server.h \
187                 DSC_EnginesPaCO_Engines_Parallel_DSC_client.h \
188                 DSC_EnginesPaCO.h \
189                 DSC_Engines.h
190
191 XML           = SALOME_Exception.xml SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml
192 endif
193
194 idldir = $(prefix)/idl/salome
195 nodist_idl_DATA = ${XML} ${IDL_PACO} 
196 nodist_salomeinclude_HEADERS = ${INCLUDES_PACO} 
197
198 BUILT_SOURCES = $(IDL_SOURCES) $(PAR)
199
200 SALOME_ExceptionPaCO.h SALOME_ExceptionPaCO.cc : SALOME_Exception.idl SALOME_Exception.xml
201 SALOME_ComponentPaCO.h SALOME_ComponentPaCO.cc : SALOME_Component.idl SALOME_Component.xml
202 SALOME_PortsPaCO.h SALOME_PortsPaCO.cc : SALOME_Ports.idl SALOME_Ports.xml
203 DSC_EnginesPaCO.h DSC_EnginesPaCO.cc : DSC_Engines.idl DSC_Engines.xml
204
205 lib_LTLIBRARIES = libSalomeIDLKernel.la $(PAR_LIB)
206
207 nodist_libSalomeIDLKernel_la_SOURCES = $(IDL_SOURCES) $(DYNIDL_SRCS)
208 libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \
209                                 -I$(top_builddir)/idl \
210                                 @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
211 libSalomeIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
212 libSalomeIDLKernel_la_LIBADD  = @CORBA_LIBS@
213
214 nodist_libSalomeParallelIDLKernel_la_SOURCES = $(PAR) $(GEN_PACO)
215 libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \
216                                         -I$(top_builddir)/idl \
217                                         @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
218                                         @PACO_INCLUDES@
219 libSalomeParallelIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
220 libSalomeParallelIDLKernel_la_LIBADD  = libSalomeIDLKernel.la @PACO_LIBS@
221
222 # These variables defines the building process of CORBA files
223 OMNIORB_IDL         = @OMNIORB_IDL@
224 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
225 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/salome/idl
226 IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -Wba -I$(top_builddir)/salome/idl
227 IDLPYFLAGS  = @IDLPYFLAGS@
228
229 # potential problem on parallel make on the following - multiple outputs
230 SUFFIXES = .idl .hh SK.cc
231 .idlSK.cc:
232         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
233 SK.cc.hh:
234
235 #Dummy rule to replace the following one (for parallel make)
236 #.idl.hh:
237 #       $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
238
239 %PaCO.h %PaCO.cc : %.idl %.xml
240         @PACO_IDL@ -I $(srcdir):@PACOPATH@/idl $^ omniORB4 0
241
242 install-exec-local: $(IDL_FILES:%=$(top_srcdir)/idl/%)
243         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
244         ls $^ | while read file; do \
245           $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
246         done
247
248 # uninstall-local removes too much, but it works in distcheck
249 uninstall-local:
250         rm -rf $(DESTDIR)$(salomepythondir)/*
251
252 mostlyclean-local:
253         -rm -f *.hh *.cc .depidl
254
255 # we use cpp to generate dependencies between idl files.
256 # option x c tells the preprocessor to consider idl as a c file.
257 # if an idl is modified, all idl dependencies are rebuilt
258
259 .depidl: $(IDL_FILES)
260         @echo "" > $@
261         @for dep in $^ dummy; do \
262           if [ $$dep != "dummy" ]; then \
263             echo Building dependencies for $$dep; \
264             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) $$dep 2>/dev/null | \
265             sed 's/\.o/\SK.cc/' >>$@; \
266           fi; \
267         done ;
268
269 -include .depidl
270
271 CLEANFILES = *PaCO* *.h
272