[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Corba IDL and automake

From: Thomas Richter
Subject: Corba IDL and automake
Date: Tue, 25 Feb 2003 11:33:08 +0100 (CET)

Hi folks,

are CORBA and its IDL covered by automake? I'm currently working on a C++
based project with a CORBA interface I put under automake, but I seem to
have some problems setting it up correctly. To be a bit more specific, I
have a subdirectory named "idl" that contains all the corba IDL interface
specifications that need to be converted into stub and skeleton code by
means of an IDL compiler. I'm currently using the following
in the idl subdirectory, but it could perform better: (Comments added
in this mail for clarity)

noinst_LIBRARIES = libidl.a

# The skeleton code gets compiled into a static library that gets
# linked with the libraries from other source directories to form
# the final code.

CXXFLAGS        = $(TARGET_CXXFLAGS) -I$(top_srcdir)/global -I$(top_srcdir)
CLEANFILES      = *.o *.s *.cpp *.hpp *.cc *.hh
SUFFIXES        = .idl .o .cpp .hpp .hh .cc
IDL_SOURCES     = drawinginterface videointerface videopluginterface \
                  sessioninterface \
                  globals sessionmanagerinterface veexception
# the line above keeps the name of all idl sources that require
# compilation.

DERIVED_HPPS    =       $(foreach file,$(IDL_SOURCES),$(file).hpp)
DERIVED_CPPS    =       $(foreach file,$(IDL_SOURCES),$(file).cpp)
DERIVED_IDLS    =       $(foreach file,$(IDL_SOURCES),$(file).idl)
DERIVED_HHS     =       $(foreach file,$(IDL_SOURCES),$(file).hh)
DERIVED_SKELS   =       $(foreach file,$(IDL_SOURCES),$(file)
DERIVED_OBJECTS =       $(foreach file,$(IDL_SOURCES),$(file).o)

# derived objects from the idl.

EXTRA_DIST      =       ReadMe $(DERIVED_IDLS)

# I put the IDLs into the EXTRA_DIST as I wouldn't see them as "source code"
# in the sense of automake. Is this correct?

IDLCC           =       @IDL_COMPILER@
IDLFLAGS        =       @IDL_FLAGS@

# The above gets some information by autoconf concering the idl
# compiler and its command line options.

noinst_libidl_a_HEADERS = $(DERIVED_HPPS)
nodist_libidl_a_SOURCES = $(DERIVED_CPPS)
libidl_a_LIBADD         = $(DERIVED_OBJECTS)

%.hpp:  %.idl
        $(IDLCC) $(IDLFLAGS) $*.idl
        @ echo '#include "'$*.hh'"' >$*.hpp

%.cpp:  %.idl
        $(IDLCC) $(IDLFLAGS) $*.idl
        @ echo '#include "'$*'"' >$*.cpp

# The above junk builds some pseudo-source files under the "canonical" names
# that include the idl-generated headers and sources.

%.o:    %.cpp
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPTIMIZER_CXXFLAGS) -c $*.cpp -o $*.o
# This line is wierd.

Ok, now for the problems:

1) If I run "automake --foreign", I get the following warnings:

idl/ invalid variable `noinst_libidl_a_HEADERS'
idl/ invalid unused variable name: `IDL_SOURCES'

Why is "noinst_libidl_a_HEADERS" invalid? These are header files for
the idl static library that are not to be included in the distribution.

Why is IDL_SOURCES unused? It is very well used in all the lines below.

2) I need to specify an explicit make rule how to form an object from
a .cpp file. If I don't, then the automake generated makefile does not
include any such rule, and it won't compile any object code and would
rather fail to build the final library. Why is this so, and what would be
a more apropriate solution instead of giving the rule manually (which is,
as far as I understand it, against the automake paradigm).

Thanks in advance,

        Thomas Richter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]