Salome HOME
PR: add resources/Plugin in Install
[modules/yacs.git] / idl / Makefile.am
1
2 #
3 # This Makefile is responsible of generating the client and server
4 # implementation of IDL interfaces for both C++ and python usage.
5 # The building process of the C++ files is in charge of each source
6 # package and then is not manage here.
7 #
8
9 include $(top_srcdir)/salome_adm/unix/make_common_starter.am
10
11 BASEIDL_FILES = \
12   SALOME_Exception.idl \
13   SALOME_Comm.idl \
14   SALOME_ModuleCatalog.idl \
15   SALOME_DataTypeCatalog.idl \
16   SALOME_RessourcesCatalog.idl \
17   SALOMEDS.idl \
18   SALOMEDS_Attributes.idl \
19   SALOME_Component.idl \
20   SALOME_ContainerManager.idl \
21   SALOME_TestComponent.idl \
22   SALOME_Registry.idl \
23   Logger.idl \
24   SALOME_GenericObj.idl \
25   SALOME_TestModuleCatalog.idl \
26   nstest.idl
27
28 MPIIDL_FILES = \
29   SALOME_MPIObject.idl \
30   SALOME_MPIContainer.idl \
31   SALOME_TestMPIComponent.idl  
32
33 IDL_FILES = $(BASEIDL_FILES)
34 if MPI_IS_OK
35   IDL_FILES += $(MPIIDL_FILES)
36 endif
37
38 # all the idl files are needed for make dist
39 EXTRA_DIST= $(BASEIDL_FILES) $(MPIIDL_FILES)
40
41 # This variable defines the files to be installed
42 salomeidl_DATA = $(IDL_FILES)
43
44 # Sources built from idl files
45 # BUILT_SOURCE = first thing done on make all
46 # idl dependencies are checked and rebuilt first
47
48 BASEIDL_SOURCES =\
49   SALOME_ExceptionSK.cc \
50   SALOME_CommSK.cc \
51   SALOME_ModuleCatalogSK.cc \
52   SALOME_DataTypeCatalogSK.cc \
53   SALOME_RessourcesCatalogSK.cc \
54   SALOMEDSSK.cc \
55   SALOMEDS_AttributesSK.cc \
56   SALOME_ComponentSK.cc \
57   SALOME_ContainerManagerSK.cc \
58   SALOME_TestComponentSK.cc \
59   SALOME_RegistrySK.cc \
60   LoggerSK.cc \
61   SALOME_GenericObjSK.cc \
62   SALOME_TestModuleCatalogSK.cc \
63   nstestSK.cc
64
65 MPIIDL_SOURCES = \
66   SALOME_MPIObjectSK.cc \
67   SALOME_MPIContainerSK.cc \
68   SALOME_TestMPIComponentSK.cc  
69
70 IDL_SOURCES = $(BASEIDL_SOURCES)
71 if MPI_IS_OK
72   IDL_SOURCES += $(MPIIDL_SOURCES)
73 endif
74
75 BUILT_SOURCES = $(IDL_SOURCES)
76
77 lib_LTLIBRARIES = libSalomeIDLKernel.la
78 nodist_libSalomeIDLKernel_la_SOURCES = $(BUILT_SOURCES)
79 libSalomeIDLKernel_la_CPPFLAGS =\
80         -I$(top_builddir)/salome_adm/unix \
81         -I$(top_builddir)/idl \
82         @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
83 libSalomeIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0
84 libSalomeIDLKernel_la_LIBADD  = @CORBA_LIBS@
85
86 # These variables defines the building process of CORBA files
87 OMNIORB_IDL         = @OMNIORB_IDL@
88 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
89 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/salome/idl
90 IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/salome/idl
91 IDLPYFLAGS  = @IDLPYFLAGS@
92
93 # potential problem on parallel make on the following - multiple outputs
94 SUFFIXES = .idl .hh SK.cc
95 .idlSK.cc:
96         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
97 .idl.hh:
98         $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
99
100
101 install-exec-local: $(IDL_FILES:%=$(top_srcdir)/idl/%)
102         $(INSTALL) -d  $(pkgpythondir)
103         ls $^ | while read file; do \
104           $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(pkgpythondir) $$file ; \
105         done
106
107 # uninstall-local removes too much, but it works in distcheck
108 uninstall-local:
109         rm -rf $(pkgpythondir)/*
110
111 mostlyclean-local:
112         -rm -f *.hh *.cc .depidl
113
114 # we use cpp to generate dependencies between idl files.
115 # option x c tells the preprocessor to consider idl as a c file.
116 # if an idl is modified, all idl dependencies are rebuilt
117
118 .depidl: $(IDL_FILES)
119         @echo "" > $@
120         @for dep in $^ dummy; do \
121           if [ $$dep != "dummy" ]; then \
122             echo Building dependencies for $$dep; \
123             $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) $$dep 2>/dev/null | \
124             sed 's/\.o/\SK.cc/' >>$@; \
125           fi; \
126         done ;
127
128 -include .depidl
129