Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / Tools / padder / meshjob / idl / Makefile.am
1 # Copyright (C) 2011-2012  CEA/DEN, EDF R&D
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 BUILT_SOURCES = MESHJOBSK.cc
28 IDL_FILES = MESHJOB.idl
29
30 # For test purpose, we add a little component:
31 BUILT_SOURCES += SPADDERPluginTestSK.cc
32 IDL_FILES += SPADDERPluginTest.idl
33
34 IDL_FILES_PY=$(IDL_FILES:%.idl=%_idl.py)
35
36 salomeidl_DATA = $(IDL_FILES) 
37
38 lib_LTLIBRARIES = libSalomeIDLSPADDER.la
39 libSalomeIDLSPADDER_la_SOURCES      =
40 nodist_libSalomeIDLSPADDER_la_SOURCES = $(BUILT_SOURCES)
41 nodist_salomeinclude_HEADERS= $(IDL_FILES:%idl=%hh)
42
43 OMNIORB_CXXFLAGS=@OMNIORB_CXXFLAGS@ @OMNIORB_INCLUDES@
44 OMNIORB_LIBS=@OMNIORB_LIBS@
45
46 libSalomeIDLSPADDER_la_CXXFLAGS = \
47         $(KERNEL_CXXFLAGS) \
48         $(OMNIORB_CXXFLAGS) \
49         -I.
50
51 libSalomeIDLSPADDER_la_LIBADD     = \
52         $(KERNEL_LDFLAGS) -lSalomeIDLKernel \
53         $(OMNIORB_LIBS)
54
55
56 # These variables defines the building process of CORBA files
57 IDLCXXFLAGS = \
58         -bcxx -I. \
59         @OMNIORB_IDLCXXFLAGS@ \
60         -I$(KERNEL_ROOT_DIR)/idl/salome
61
62 IDLPYFLAGS  = \
63         -I. \
64         @OMNIORB_IDLPYFLAGS@ \
65         -I$(KERNEL_ROOT_DIR)/idl/salome
66
67 ##########################################################
68 SUFFIXES = .idl .hh SK.cc
69
70 %SK.cc %.hh : %.idl
71         $(OMNIORB_IDL) $(IDLCXXFLAGS) $<
72
73 %_idl.py : %.idl
74         $(OMNIORB_IDL) $(IDLPYFLAGS)  $<
75
76 CLEANFILES = *.hh *SK.cc *.py *.hxx *.cxx
77
78 EXTRA_DIST += $(IDL_FILES)
79
80 install-data-local: $(IDL_FILES)
81         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
82         ls $^ | while read file; do \
83         $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
84         done
85
86 # we want to remove only staff generated for IDL files and nothing more
87 uninstall-local:
88         @for modulen in MESHJOB SPADDERPluginTest  ; do \
89           test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
90           test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
91         done ; \
92         for filen in $(IDL_FILES_PY) ; do \
93           echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
94         done
95