include $(top_srcdir)/config/common.am
-EXTRA_DIST = lyxclient.man
+CLEANFILES += $(man_MANS)
man_MANS = lyxclient.1
bin_PROGRAMS = lyxclient
-AM_CPPFLAGS = -I$(srcdir)/../ $(BOOST_INCLUDES)
+EXTRA_DIST = lyxclient.man
-AM_CXXFLAGS = $(PCH_FLAGS)
+AM_CPPFLAGS += -I$(srcdir)/.. $(BOOST_INCLUDES)
-if USE_INCLUDED_BOOST
-BOOST_LIBS = $(top_builddir)/boost/libs/filesystem/src/libboostfilesystem.la \
- $(top_builddir)/boost/libs/regex/src/libboostregex.la
-else
-BOOST_LIBS = -lboost_regex -lboost_filesystem
-endif
+lyxclient.1:
+ cp -p $(srcdir)/lyxclient.man lyxclient.1
lyxclient_LDADD = \
- $(top_builddir)/src/support/libsupport.la \
- $(BOOST_LIBS) $(INTLLIBS)
-
-lyxclient_SOURCES = \
- boost.C \
- client.C \
- debug.C \
- debug.h \
- gettext.C \
- gettext.h \
- messages.C \
- messages.h
+ $(top_builddir)/src/support/liblyxsupport.la \
+ $(BOOST_LIBS) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS)
-lyxclient.1:
- cp -p $(srcdir)/lyxclient.man lyxclient.1
+# everything below the line containing the single backslashs
+# an ugly hack and needed because of the
+# linking problems described in ../Makefile.am
+# These four objects are linked as object files as they are not
+# referenced within the core and therefore are not picked up
+# by the linker without looping over libs. We do not want that,
+# and in fact libtools seems not able to do that.
+
+SOURCEFILES = \
+ boost.cpp \
+ client.cpp \
+ debug.cpp \
+ gettext.cpp \
+ Messages.cpp
+
+HEADERFILES = \
+ debug.h \
+ Messages.h
+
+
+if MONOLITHIC_CLIENT
+
+client.cpp:
+ @echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@
+
+AM_CPPFLAGS += -I$(srcdir)/.. $(BOOST_INCLUDES)
+BUILT_SOURCES = client.cpp
+
+lyxclient_SOURCES = client.cpp $(HEADERFILES)
+
+else
+
+EXTRA_DIST += pch.h
+AM_CPPFLAGS += $(PCH_FLAGS)
+BUILT_SOURCES = $(PCH_FILE)
+
+lyxclient_SOURCES = $(SOURCEFILES) $(HEADERFILES)
+
+endif