Salome HOME
Update copyright
[modules/geom.git] / idl / Makefile.am
1 # Copyright (C) 2007-2011  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 = GEOM_Gen.idl GEOM_Superv.idl
28
29 # This variable defines the files to be installed
30 dist_salomeidl_DATA = $(BASEIDL_FILES)
31
32 # GUI idl common library
33 lib_LTLIBRARIES = libSalomeIDLGEOM.la
34
35 # Sources built from idl files
36 nodist_libSalomeIDLGEOM_la_SOURCES = GEOM_GenSK.cc GEOM_SupervSK.cc
37
38 # header files must be exported: other modules have to use this library
39 nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
40
41 libSalomeIDLGEOM_la_CPPFLAGS =                  \
42         -I$(top_builddir)/idl                   \
43         @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@
44 libSalomeIDLGEOM_la_LDFLAGS = -no-undefined -version-info=0:0:0
45 libSalomeIDLGEOM_la_LIBADD  = $(STDLIB) @CORBA_LIBS@ $(KERNEL_LDFLAGS) -lSalomeIDLKernel
46
47 # These variables defines the building process of CORBA files
48 OMNIORB_IDL         = @OMNIORB_IDL@
49 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
50 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome 
51 IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
52 IDLPYFLAGS  = @IDLPYFLAGS@ -I$(KERNEL_ROOT_DIR)/idl/salome
53
54 # potential problem on parallel make on the following - multiple outputs
55 SUFFIXES = .idl .hh SK.cc
56 .idlSK.cc:
57         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
58 .idl.hh:
59         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
60
61 install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
62         $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
63         ls $^ | while read file; do \
64           $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
65         done
66
67 # uninstall-local removes too much, but it works in distcheck
68 uninstall-local:
69         rm -rf $(DESTDIR)$(salomepythondir)/*
70
71 mostlyclean-local:
72         -rm -f *.hh *.cc .depidl
73
74 # we use cpp to generate dependencies between idl files.
75 # option x c tells the preprocessor to consider idl as a c file.
76 # if an idl is modified, all idl dependencies are rebuilt
77
78 .depidl: $(BASEIDL_FILES)
79         @echo "" > $@
80         @for dep in $^ dummy; do \
81           if [ $$dep != "dummy" ]; then \
82             echo Building dependencies for $$dep; \
83             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
84             sed 's/\.o/\SK.cc/' >>$@; \
85           fi; \
86         done ;
87
88 -include .depidl