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