SFI: compile sfimemory.c as C++ source
[stwbeast.git] / sfi / Makefile.am
1 # SFI - Synthesis Fusion Kit Interface
2 # Copyright (C) 2002 Tim Janik
3 #
4 ## GNU Lesser General Public License version 2 or any later version.
5 include $(top_srcdir)/Makefile.decl
6
7 SUBDIRS   = . tests
8 INCLUDES += -I$(top_srcdir) -I$(top_builddir) $(SFI_CFLAGS)
9 DEFS     += -DG_LOG_DOMAIN=\"SFI\" -DG_DISABLE_CONST_RETURNS
10
11 sfi_public_headers = $(strip \
12         sfistore.h      sficomwire.h    sfifilecrawler.h \
13         glib-extra.h                    sfiwrapper.h     \
14         sfivmarshal.h   sfiglue.h       sfigluecodec.h  sfiglueproxy.h  \
15         sfinote.h       sfiparams.h     sfiprimitives.h sfiserial.h     \
16         sfitime.h       sfitypes.h      sfivalues.h     sfiustore.h     \
17         sficxx.hh       sfiring.h       sfimemory.h     sficomport.h    \
18         sfitests.h      sfi.h                                           \
19 )
20 sfi_all_sources = $(strip \
21         sfistore.c      sficomwire.c    sfifilecrawler.c \
22         glib-extra.c                    sfiwrapper.cc    \
23         sfivmarshal.c   sfiglue.c       sfigluecodec.c  sfiglueproxy.c  \
24         sfinote.c       sfiparams.c     sfiprimitives.c sfiserial.c     \
25         sfitime.c       sfitypes.c      sfivalues.c     sfiustore.c     \
26         sficxx.cc       sfiring.c       sfimemory.cc    sficomport.cc   \
27         $(conditional_toyprof_sources)  \
28 )
29 sfi_extra_sources = $(strip \
30         gbsearcharray.h \
31 )
32 sfi_built_sources = $(strip \
33 )
34
35 $(sfi_all_sources): $(sfi_built_sources)
36
37 # SFI library
38 # we want a partial shared library here. libtool creates that if the library
39 # name ends in .lo or .o. however automake doesn't know .lo or .o libraries,
40 # so we simply build an ordinary non-installed .la library and then use our
41 # own rule to build the .o from the .la pieces.
42 noinst_LTLIBRARIES    = libsfi.la
43 libsfiincludedir      = $(includedir)/sfi
44 libsfiinclude_HEADERS = $(sfi_public_headers)
45 libsfi_la_SOURCES     = $(sfi_all_sources)
46 libsfi_la_LDFLAGS     = -no-undefined # -Wl,-Bsymbolic
47 libsfi_la_LIBADD      = $(SFI_LIBS) -lm
48 # keep this .o rule in sync with the corresponding .la rule from Makefile.in
49 libsfi.o: $(libsfi_la_OBJECTS) $(libsfi_la_DEPENDENCIES)
50         $(CXXLINK)  $(libsfi_la_LDFLAGS) $(libsfi_la_OBJECTS) # $(libsfi_la_LIBADD) $(LIBS)
51 all-am: libsfi.o
52 CLEANFILES += libsfi.o libsfi.lo
53
54 #
55 # programs to build
56 #
57 # source files
58 common_idl_sources = sfidl-generator.cc sfidl-namespace.cc sfidl-options.cc sfidl-parser.cc \
59   sfidl-factory.cc sfidl-typelist.cc sfidl-cbase.cc sfidl-clientc.cc sfidl-clientcxx.cc sfidl-corec.cc \
60   sfidl-corecxx.cc sfidl-cxxbase.cc sfidl-hostc.cc glib-extra.c
61
62 bin_PROGRAMS = sfidl
63 sfidl_SOURCES = sfidl.cc $(common_idl_sources)
64 sfidl_LDADD = $(SFI_LIBS) -lm $(top_builddir)/birnet/libbirnet.o # libsfi.la
65 sfidl_CFLAGS = $(AM_CFLAGS) # hack to cause glib-extra.c to be compiled twice (work around automake)
66 EXTRA_DIST += sfidl-generator.hh sfidl-namespace.hh sfidl-options.hh sfidl-parser.hh sfidl-factory.hh
67 EXTRA_DIST += sfidl-cbase.hh sfidl-clientc.hh sfidl-clientcxx.hh sfidl-cxxbase.hh sfidl-hostc.hh sfidl-utils.hh
68
69 #
70 # TOYPROF: poor man's profiling toy
71 #
72 TOYPROF_H_SOURCES = toyprof.h toyprof-mem.h
73 TOYPROF_C_SOURCES = toyprof.c toyprof-mem.c
74 EXTRA_DIST += toyprof.pl toyprof.README $(TOYPROF_H_SOURCES)
75 if IF_TOYPROF
76 conditional_toyprof_sources = $(TOYPROF_C_SOURCES)
77 endif
78
79
80 EXTRA_DIST += $(sfi_public_headers) $(sfi_extra_sources) $(sfi_built_sources)
81 MAINTAINERCLEANFILES += $(sfi_built_sources)