summaryrefslogtreecommitdiff
path: root/src/Makefile.am.in
blob: 4681fa79663042116b185052add2a57b803169a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# The Makefile.am is generated from Makefile.am.in by autogen.sh
# because the list of files to compile has to be determined
# dynamically.
#
# When adding new files or changing options rerun autogen.sh.
# Beware that changes made to Makefile.am will get lost, always
# edit Makefile.am.in! The following rule ensures that make
# itself will rebuild its makefiles when Makefile.am.in is edited.
$(srcdir)/Makefile.am: $(srcdir)/Makefile.am.in $(srcdir)/gen-makefile-am.sh
	cd $(srcdir) && sh ./gen-makefile-am.sh

# versioning for *all* libs
#
# CURRENT - most recent interface version
# REVISION - minor version number of that interface implementation
# AGE - number of previous interface versions supported in addition
#       to the current one
#
# When adding to the interface, increment CURRENT and AGE and reset
# REVISION to zero. When breaking the interface in a backwards
# incompatible way, increment CURRENT and reset AGE and REVISION to
# zero. When fixing something without interface change, increment
# REVISION.
ENGINE_CURRENT = 2
ENGINE_REVISION = 0
ENGINE_AGE = 2

CLEANFILES =
EXTRA_DIST =

lib_LTLIBRARIES = libsmltk.la libsynthesis.la libsynthesisserver.la libsynthesissdk.la
nobase_include_HEADERS = @LIBSYNTHESISSDK_HEADERS@ synthesis/target_options.h

# Configuration header files are searched in this order:
# - Targets/ReleasedProducts/autotools: files only used when compiling with autotools
# - Targets/ReleasedProducts/[clientEngine_opensource_linux|serverEngine_opensource_linux|SDK]: files also used with Synthesis Linux makefile
#
# Always included first via -include:
# - config.h: configure result (top directory)
# - Targets/ReleasedProducts/clientEngine_opensource_linux/clientengine_demo_x86_linux_prefix.h resp. Targets/ReleasedProducts/serverEngine_opensource_linux/serverengine_opensource_linux_prefix.h
#
# Included as needed:
# - define.h: hard-coded SyncML Toolkit config (from search path above)

libsynthesis_la_SOURCES = @LIBSYNTHESIS_SOURCES@ \
	$(XMLPARSE_SOURCES)
libsynthesis_la_CPPFLAGS = -I$(srcdir)/sysync_SDK/Sources
libsynthesis_la_CFLAGS = \
	-include $(top_builddir)/config.h \
	-include $(srcdir)/Targets/ReleasedProducts/clientEngine_opensource_linux/clientengine_demo_x86_linux_prefix.h \
	-I$(srcdir)/Targets/ReleasedProducts/clientEngine_autotools/ \
	-I$(srcdir)/Targets/ReleasedProducts/clientEngine_opensource_linux/ \
	-I$(srcdir)/platform_adapters/linux/ \
	-I$(srcdir)/platform_adapters/unix_common/ \
	-I$(srcdir)/platform_adapters/ \
	-I$(srcdir)/syncapps/clientEngine_custom/ \
	-I$(srcdir)/sysync/ \
	-I$(srcdir)/Transport_interfaces/engine/ \
	-I$(srcdir)/ \
	-I$(srcdir)/syncml_tk/src/sml/inc/ \
	-I$(srcdir)/syncml_tk/src/sml/lib/inc/ \
	-I$(srcdir)/syncml_tk/src/sml/lib/ \
	-I$(srcdir)/syncml_tk/src/sml/mgr/inc/ \
	-I$(srcdir)/syncml_tk/src/sml/mgr/ \
	-I$(srcdir)/syncml_tk/src/sml/wsm/inc/ \
	-I$(srcdir)/syncml_tk/src/sml/xlt/inc \
	-I$(srcdir)/syncml_tk/src/sml/xlt/all \
	-I$(srcdir)/DB_interfaces/odbc_db/ \
	-I$(srcdir)/DB_interfaces/api_db/ \
	-I$(srcdir)/sysync_SDK/Sources/ \
	$(PCRE_CFLAGS) \
	$(SQLITE3_CFLAGS) \
	$(ZLIB_CFLAGS) \
	$(XMLPARSE_CFLAGS) \
	$(XMLPARSE_CFLAGS_BUILTIN) \
	$(LIBICAL_CFLAGS) \
	$(LIBECAL_CFLAGS)
libsynthesis_la_CXXFLAGS = $(libsynthesis_la_CFLAGS)
libsynthesis_la_LIBADD = $(PCRE_LIBS) $(SQLITE3_LIBS) $(XMLPARSE_LIBS) $(LIBICAL_LIBS) $(LIBECAL_LIBS) libsmltk.la
libsynthesis_la_LDFLAGS = -version-info $(ENGINE_CURRENT):$(ENGINE_REVISION):$(ENGINE_AGE) \
	-Wl,--version-script=$(srcdir)/synthesis-linker.map
libsynthesis_la_DEPENDENCIES = $(srcdir)/synthesis-linker.map libsmltk.la


libsynthesisserver_la_SOURCES = @LIBSYNTHESISSERVER_SOURCES@ \
	$(XMLPARSE_SOURCES)
libsynthesisserver_la_CPPFLAGS = $(libsynthesis_la_CPPFLAGS)
libsynthesisserver_la_CFLAGS = $(subst clientEngine,serverEngine, \
	$(subst clientengine_demo_x86_linux_prefix.h,serverengine_opensource_linux_prefix.h, $(libsynthesis_la_CFLAGS)))
libsynthesisserver_la_CXXFLAGS = $(libsynthesisserver_la_CFLAGS)
libsynthesisserver_la_LIBADD = $(libsynthesis_la_LIBADD)
libsynthesisserver_la_LDFLAGS = $(libsynthesis_la_LDFLAGS)
libsynthesisserver_la_DEPENDENCIES = $(libsynthesis_la_DEPENDENCIES)

if COND_XMLPARSE
XMLPARSE_CFLAGS_BUILTIN = -I$(srcdir)/expat -I$(srcdir)/expat/xmltok -I$(srcdir)/expat/xmlparse
XMLPARSE_SOURCES = \
	expat/xmlparse/xmlparse.c \
	expat/xmlparse/xmlparse.h \
	expat/xmltok/ascii.h \
	expat/xmltok/asciitab.h \
	expat/xmltok/iasciitab.h \
	expat/xmltok/latin1tab.h \
	expat/xmltok/nametab.h \
	expat/xmltok/utf8tab.h \
	expat/xmltok/xmldef.h \
	expat/xmltok/xmlrole.c \
	expat/xmltok/xmlrole.h \
	expat/xmltok/xmltok.c \
	expat/xmltok/xmltok.h \
	expat/xmltok/xmltok_impl.h
EXTRA_DIST += \
	expat/xmltok/xmltok_impl.c \
	expat/xmltok/xmltok_ns.c
else
# add path to xmlparse.h which includes the system's xmltok/xmlparse.h
XMLPARSE_CFLAGS_BUILTIN = -I$(srcdir)/Targets/ReleasedProducts/clientEngine_autotools/systemxml
endif

libsynthesissdk_la_LDFLAGS = -static
libsynthesissdk_la_SOURCES = @LIBSYNTHESISSDK_HEADERS@
if COND_STATIC
libsynthesissdk_la_SOURCES += @LIBSYNTHESISSDK_SOURCES_SDK_ONLY@
else
libsynthesissdk_la_SOURCES += @LIBSYNTHESISSDK_SOURCES_BOTH@
endif
libsynthesissdk_la_CPPFLAGS = \
	-D_GNU_SOURCE=1 \
	-I$(srcdir)/sysync_SDK/Sources \
	-I$(srcdir)/Targets/ReleasedProducts/SDK

# All files needed by libsynthesissdk.a come from either
# sysync_SDK/Sources (shared between engine and SDK) or
# sysync_SDK/SDK (only in SDK). We patch the files so that
# they include their own files via #include "synthesis/..."
vpath %.cpp $(srcdir)/sysync_SDK/Sources $(srcdir)/sysync_SDK/SDK # $(srcdir)/Targets/ReleasedProducts/clientEngine_opensource_linux $(srcdir)/syncapps/clientEngine_custom $(srcdir)/sysync $(srcdir)/platform_adapters $(srcdir)
vpath %.c $(srcdir)/sysync_SDK/Sources $(srcdir)/sysync_SDK/SDK # $(srcdir)/Targets/ReleasedProducts/clientEngine_opensource_linux $(srcdir)/syncapps/clientEngine_custom $(srcdir)/sysync $(srcdir)/platform_adapters $(srcdir)
vpath %.h $(srcdir)/sysync_SDK/Sources $(srcdir)/sysync_SDK/SDK # $(srcdir)/Targets/ReleasedProducts/clientEngine_opensource_linux $(srcdir)/syncapps/clientEngine_custom $(srcdir)/sysync $(srcdir)/platform_adapters $(srcdir)
@LIBSYNTHESISSDK_HEADERS@: synthesis/%: %
	mkdir -p synthesis
	sed -e 's;# *include  *";#include "synthesis/;' -e 's/defined(HAVE_STDINT_H)/1/' $< >$@

synthesis/target_options.h: $(srcdir)/Targets/ReleasedProducts/SDK/target_options.h
	mkdir -p synthesis
	cp $< $@

# ensure that the header file is in place before compiling the SDK
@LIBSYNTHESISSDK_SOURCES@: synthesis/target_options.h

# libsmltk: compiled just like libsynthesis
libsmltk_la_SOURCES = @LIBSMLTK_SOURCES@
libsmltk_la_CFLAGS = $(libsynthesis_la_CFLAGS)
libsmltk_la_CXXFLAGS = $(libsmltk_la_CFLAGS)

# versioning: same as of engine! changes in libsmltk are not tracked separately.
libsmltk_la_LDFLAGS = -version-info $(ENGINE_CURRENT):$(ENGINE_REVISION):$(ENGINE_AGE) \
	-Wl,--version-script=$(srcdir)/smltk-linker.map
libsmltk_la_DEPENDENCIES = $(srcdir)/smltk-linker.map