bin_PROGRAMS = ghkl

dist_man_MANS = ghkl.1

AM_CFLAGS = \
	-DPKGDATA=\""$(pkgdatadir)"\" \
	-DGTK_DISABLE_SINGLE_INCLUDES \
	-DGDK_DISABLE_DEPRECATED \
	-DGTK_DISABLE_DEPRECATED \
	-DGSEAL_ENABLE \
	-I$(top_srcdir) \
	-I$(top_srcdir)/hkl \
	-Wno-misleading-indentation \
	$(DATATYPE99_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GSL_CFLAGS) \
	$(GTK_CFLAGS)

AM_LDFLAGS = \
	-Wl,--export-dynamic \
	$(GLIB_LIBS) \
	$(GSL_LIBS) \
	$(GTK_LIBS)

ghkl_LDADD = \
	$(top_builddir)/hkl/libhkl.la

ghkl_SOURCES = \
	hkl-gui-diffractometer.c \
	hkl-gui-diffractometer-private.h \
	hkl-gui-engine.c \
	hkl-gui-factory.c \
	hkl-gui-geometry.c \
	hkl-gui-item-factories.c \
	hkl-gui-macros.h \
	hkl-gui-parameter.c \
	hkl-gui-sample.c \
	hkl-gui-sample-reflection.c \
	hkl-gui.c \
	hkl-gui.h

appldir = ${datadir}/applications
dist_appl_DATA = ghkl.desktop

if HKL3D

AM_CFLAGS += \
	-I$(top_srcdir)/hkl3d \
	-I$(top_srcdir)/hkl3d/bullet/src \
	-DHKL3D \
	$(EPOXY_CFLAGS) \
	$(G3D_CFLAGS) \
	$(BULLET_CFLAGS)

AM_LDFLAGS += -lstdc++\
	$(EPOXY_LIBS) \
	$(G3D_LIBS) \
	$(BULLET_LIBS)

# force linkage using g++ for libhkl3d.la
nodist_EXTRA_ghkl_SOURCES = dummy.cxx

ghkl_LDADD += \
	$(top_builddir)/hkl3d/libhkl3d.la

ghkl_SOURCES += \
	hkl-gui-3d.c \
	hkl-gui-3d.h

endif

# Support for GNU Flymake, in Emacs.
check-syntax: AM_CFLAGS += -fsyntax-only -pipe
check-syntax:
	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)

.PHONY: check-syntax
