Salome HOME
MEDMEM suppression
[modules/med.git] / idl / Makefile.am
1 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
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 # This Makefile is responsible of generating the client and server
21 # implementation of IDL interfaces for both C++ and python usage.
22 # The building process of the C++ files is in charge of each source
23 # package and then is not manage here.
24 #
25 include $(top_srcdir)/adm_local/unix/make_common_starter.am
26
27 BASEIDL_FILES = \
28         MED.idl                          \
29         MEDCouplingCorbaServant.idl      \
30         MEDCouplingCorbaServantTest.idl  \
31         ParaMEDCouplingCorbaServant.idl
32
33 MEDOPIDL_FILES =             \
34         MEDDataManager.idl   \
35         MEDCalculator.idl    \
36         MEDEventListener.idl \
37         MEDOPFactory.idl
38
39 MPIIDL_FILES = ParaMEDMEMComponent.idl
40
41 IDL_FILES = $(BASEIDL_FILES)
42 if MPI_IS_OK
43 IDL_FILES += $(MPIIDL_FILES)
44 endif
45 IDL_FILES += $(MEDOPIDL_FILES)
46
47 IDL_FILES_PY=$(IDL_FILES:%.idl=%_idl.py)
48
49 # This variable defines the files to be installed
50 dist_salomeidl_DATA = $(IDL_FILES)
51
52 # GUI idl common library
53 lib_LTLIBRARIES = libSalomeIDLMED.la libSalomeIDLMEDTests.la
54
55 # Sources built from idl files
56 BASEIDL_SOURCES = \
57         MEDSK.cc MED_GenSK.cc Compo1PySK.cc \
58         MEDCouplingCorbaServantSK.cc        \
59         ParaMEDCouplingCorbaServantSK.cc
60
61 MEDOPIDL_SOURCES =            \
62         MEDDataManagerSK.cc   \
63         MEDCalculatorSK.cc    \
64         MEDEventListenerSK.cc \
65         MEDOPFactorySK.cc
66
67 MPIIDL_SOURCES = ParaMEDMEMComponentSK.cc
68
69 IDL_SOURCES = $(BASEIDL_SOURCES)
70 if MPI_IS_OK
71   IDL_SOURCES += $(MPIIDL_SOURCES)
72 endif
73 IDL_SOURCES += $(MEDOPIDL_SOURCES)
74
75 nodist_libSalomeIDLMED_la_SOURCES = $(IDL_SOURCES)
76
77 # header files must be exported: other modules have to use this library
78 nodist_salomeinclude_HEADERS =         \
79         MED.hh MED_Gen.hh Compo1Py.hh  \
80         MEDCouplingCorbaServant.hh     \
81         MEDCouplingCorbaServantTest.hh \
82         ParaMEDCouplingCorbaServant.hh
83
84 if MPI_IS_OK
85   nodist_salomeinclude_HEADERS += ParaMEDMEMComponent.hh
86 endif
87
88 nodist_salomeinclude_HEADERS += \
89         MEDDataManager.hh       \
90         MEDCalculator.hh        \
91         MEDEventListener.hh     \
92         MEDOPFactory.hh
93
94 libSalomeIDLMED_la_CPPFLAGS =                   \
95         -I$(top_builddir)/idl                   \
96         @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@
97 libSalomeIDLMED_la_LDFLAGS = -no-undefined -version-info=0:0:0
98 libSalomeIDLMED_la_LIBADD  = @CORBA_LIBS@ $(KERNEL_LDFLAGS) -lSalomeIDLKernel
99
100 nodist_libSalomeIDLMEDTests_la_SOURCES = MEDCouplingCorbaServantTestSK.cc
101 libSalomeIDLMEDTests_la_CPPFLAGS = $(libSalomeIDLMED_la_CPPFLAGS)
102 libSalomeIDLMEDTests_la_LIBADD = libSalomeIDLMED.la
103
104 # These variables defines the building process of CORBA files
105 OMNIORB_IDL         = @OMNIORB_IDL@
106 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
107 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome 
108 IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
109 IDLPYFLAGS  = @IDLPYFLAGS@ -I$(KERNEL_ROOT_DIR)/idl/salome
110
111 SUFFIXES = .idl .hh SK.cc
112
113 %SK.cc %.hh : %.idl
114         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
115
116 # MEDSK.cc : MED.idl
117 #       $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
118 # MED.hh : MEDSK.cc
119
120 install-exec-local: $(IDL_FILES:%=$(top_srcdir)/idl/%)
121         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
122         ls $^ | while read file; do \
123           $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
124         done
125
126 # we want to remove only staff generated for IDL files and nothing more
127 uninstall-local:
128         @for modulen in SALOME_MED SALOME_TEST Compo1Py_ORB MEDOP ; do \
129           test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
130           test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
131         done ; \
132         for filen in $(IDL_FILES_PY) ; do \
133           echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
134         done
135
136 mostlyclean-local: clean-idls
137
138 clean-idls:
139         -rm -f *.hh *.cc .depidl
140
141 # we use cpp to generate dependencies between idl files.
142 # option x c tells the preprocessor to consider idl as a c file.
143 # if an idl is modified, all idl dependencies are rebuilt
144
145 .depidl: $(BASEIDL_FILES)
146         @echo "" > $@
147         @for dep in $^ dummy; do \
148           if [ $$dep != "dummy" ]; then \
149             echo Building dependencies for $$dep; \
150             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
151             sed 's/\.o/\SK.cc/' >>$@; \
152           fi; \
153         done ;
154
155 -include .depidl