AUTOMAKE_OPTIONS = foreign
+CLEANFILES = pch.h.gch
+
DISTCLEANFILES= *.orig *.rej *~ *.bak core
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-ETAGS_ARGS = --lang=c++
+AM_INSTALL_DATA_FLAGS = $(INSTALL) -m 644 -D
+
+AM_ETAGSFLAGS = --lang=c++
+
+if LYX_BUILD_PCH
+PCH_FLAGS = -Winvalid-pch --include=./pch.h
+PCH_FILE = ./pch.h.gch
+PCH_SOURCE = ./pch.h
+sinclude ./pch.h.gch.dep
+
+*.C *.cpp: $(PCH_FILE)
+
+pch.h.gch: $(PCH_SOURCE)
+ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) \
+ -x c++-header $(PCH_SOURCE) -MT $@ -MD -MP -MF "./$@.Tdep" \
+ && mv "./$@.Tdep" "./$@.dep" || rm "./$@.Tdep"
+
+endif
+
+SUFFIXES = .gch
+if USE_INCLUDED_BOOST
BOOST_INCLUDES = -I$(top_srcdir)/boost
-SIGC_INCLUDES = -I$(top_srcdir) -I$(top_builddir)
+endif
LIBS =