Salome HOME
0020501: EDF 1098 SMESH: Display only groups, edit a group: can't select face from...
[modules/smesh.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)/adm_local/unix/make_common_starter.am
28
29 BASEIDL_FILES = \
30         SMESH_Gen.idl \
31         SMESH_Mesh.idl \
32         SMESH_Hypothesis.idl \
33         SMESH_BasicHypothesis.idl \
34         SMESH_Filter.idl \
35         SMESH_Group.idl \
36         SMESH_Pattern.idl \
37         SMESH_MeshEditor.idl
38
39 # This variable defines the files to be installed
40 dist_salomeidl_DATA = $(BASEIDL_FILES)
41
42 # GUI idl common library
43 lib_LTLIBRARIES = libSalomeIDLSMESH.la
44
45 # Sources built from idl files
46 nodist_libSalomeIDLSMESH_la_SOURCES = \
47         SMESH_MeshSK.cc \
48         SMESH_HypothesisSK.cc \
49         SMESH_GenSK.cc \
50         SMESH_BasicHypothesisSK.cc \
51         SMESH_FilterSK.cc \
52         SMESH_GroupSK.cc \
53         SMESH_PatternSK.cc \
54         SMESH_MeshEditorSK.cc
55
56 # header files must be exported: other modules have to use this library
57 nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
58
59 libSalomeIDLSMESH_la_CPPFLAGS =                 \
60         -I$(top_builddir)/idl                   \
61         $(CORBA_CXXFLAGS) $(CORBA_INCLUDES)     \
62         $(KERNEL_CXXFLAGS) $(MED_CXXFLAGS)      \
63         $(GEOM_CXXFLAGS)
64 libSalomeIDLSMESH_la_LDFLAGS = -no-undefined -version-info=0:0:0
65 libSalomeIDLSMESH_la_LIBADD  =          \
66         @CORBA_LIBS@                    \
67         $(MED_LDFLAGS) -lSalomeIDLMED   \
68         $(GEOM_LDFLAGS) -lSalomeIDLGEOM \
69         $(KERNEL_LDFLAGS) -lSalomeIDLKernel
70
71 # These variables defines the building process of CORBA files
72 OMNIORB_IDL         = @OMNIORB_IDL@
73 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
74 OMNIORB_IDLPYFLAGS  = \
75         @OMNIORB_IDLPYFLAGS@ \
76         -I$(top_builddir)/idl/salome \
77         -I$(KERNEL_ROOT_DIR)/idl/salome \
78         -I$(MED_ROOT_DIR)/idl/salome \
79         -I$(GEOM_ROOT_DIR)/idl/salome
80
81 IDLCXXFLAGS = \
82         -bcxx \
83         @IDLCXXFLAGS@ \
84         -I$(top_builddir)/idl/salome \
85         -I$(KERNEL_ROOT_DIR)/idl/salome \
86         -I$(MED_ROOT_DIR)/idl/salome \
87         -I$(GEOM_ROOT_DIR)/idl/salome
88
89 IDLPYFLAGS  = \
90         @IDLPYFLAGS@ \
91         -I$(KERNEL_ROOT_DIR)/idl/salome \
92         -I$(MED_ROOT_DIR)/idl/salome \
93         -I$(GEOM_ROOT_DIR)/idl/salome
94
95 # potential problem on parallel make on the following - multiple outputs
96 SUFFIXES = .idl .hh SK.cc
97 .idlSK.cc:
98         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
99 .idl.hh:
100         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
101
102 install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
103         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
104         ls $^ | while read file; do \
105           $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
106         done
107
108 # uninstall-local removes too much, but it works in distcheck
109 uninstall-local:
110         rm -rf $(DESTDIR)$(salomepythondir)/*
111
112 mostlyclean-local:
113         -rm -f *.hh *.cc .depidl
114
115 # we use cpp to generate dependencies between idl files.
116 # option x c tells the preprocessor to consider idl as a c file.
117 # if an idl is modified, all idl dependencies are rebuilt
118
119 .depidl: $(BASEIDL_FILES)
120         @echo "" > $@
121         @for dep in $^ dummy; do \
122           if [ $$dep != "dummy" ]; then \
123             echo Building dependencies for $$dep; \
124             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
125             sed 's/\.o/\SK.cc/' >>$@; \
126           fi; \
127         done ;
128
129 -include .depidl