# $Id: Makefile.am 30127 2026-06-24 08:43:50Z klapetek $

# Put sources that are for some reason disabled yet present in svn checkouts
# here.  This makes them distributed and translations of their messages are
# kept.  If we remove them completely, various bits can get lost.
disabled_sources = xyz_volumize.c xyz_zdrift.c

xyzdir = $(libdir)/gwyddion3/modules/xyz

# Only bundle modules without own dependencies.  If something goes wrong with
# any required libraries at run-time, it will at most break these individual
# unbundled modules, not the bundle.
bundlable_modules = \
	xyz_autocrop.la \
	xyz_average.la \
	xyz_crop.la \
	xyz_fft.la \
	xyz_level.la \
	xyz_merge.la \
	xyz_raster.la \
	xyz_reduce.la \
	xyz_relate.la \
	xyz_split.la \
	xyz_tcrop.la \
	xyz_tcut.la \
	xyz_valueops.la \
	xyz_volumize.la

# xyz_modules is either the bundle or all the individual modules.
if MODULE_BUNDLING
xyz_modules = xyz.la
BUILT_SOURCES = xyz.c
xyz_la_CFLAGS = $(AM_CFLAGS) -DGWY_MODULE_BUNDLING
else
xyz_modules = $(bundlable_modules)
endif

xyz_LTLIBRARIES = \
	$(xyz_modules)

EXTRA_DIST = \
	$(disabled_sources)

if OS_MSWIN
no_undefined = -no-undefined
endif

if MODULE_DEPENDENCIES
module_libadd = \
	$(top_builddir)/libgwyapp/libgwyapp3.la \
	$(top_builddir)/libgwyddion/libgwyddion3.la \
	$(top_builddir)/libgwyui/libgwyui3.la \
	@GTK_LIBS@ @LIBM@
else
module_libadd = @LIBM@
endif

AM_CPPFLAGS = -I$(top_srcdir) -DG_LOG_DOMAIN=\"Gwy-Module\"
AM_CFLAGS = @GTK_CFLAGS@ @COMMON_CFLAGS@ @OPENMP_CFLAGS@
AM_LDFLAGS = -avoid-version -module $(no_undefined) $(module_libadd) @OPENMP_CFLAGS@

# Bundlable modules, must be listed in xyz_la_SOURCES below.
xyz_autocrop_la_SOURCES  = xyz_autocrop.c
xyz_average_la_SOURCES   = xyz_average.c
xyz_crop_la_SOURCES      = xyz_crop.c
xyz_fft_la_SOURCES       = xyz_fft.c
xyz_level_la_SOURCES     = xyz_level.c
xyz_merge_la_SOURCES     = xyz_merge.c
xyz_raster_la_SOURCES    = xyz_raster.c
xyz_reduce_la_SOURCES    = xyz_reduce.c
xyz_relate_la_SOURCES    = xyz_relate.c
xyz_split_la_SOURCES     = xyz_split.c
xyz_tcrop_la_SOURCES     = xyz_tcrop.c
xyz_tcut_la_SOURCES      = xyz_tcut.c
xyz_valueops_la_SOURCES  = xyz_valueops.c
xyz_volumize_la_SOURCES  = xyz_volumize.c
#xyz_zdrift_la_SOURCES    = xyz_zdrift.c

xyz_la_SOURCES = \
	$(xyz_autocrop_la_SOURCES) \
	$(xyz_average_la_SOURCES) \
	$(xyz_crop_la_SOURCES) \
	$(xyz_fft_la_SOURCES) \
	$(xyz_level_la_SOURCES) \
	$(xyz_merge_la_SOURCES) \
	$(xyz_raster_la_SOURCES) \
	$(xyz_reduce_la_SOURCES) \
	$(xyz_relate_la_SOURCES) \
	$(xyz_split_la_SOURCES) \
	$(xyz_tcrop_la_SOURCES) \
	$(xyz_tcut_la_SOURCES) \
	$(xyz_valueops_la_SOURCES) \
	$(xyz_volumize_la_SOURCES) \
	$(xyz_zdrift_la_SOURCES) \
	xyz.c

xyz.c: $(srcdir)/Makefile.am $(top_srcdir)/build-aux/gen-module-bundle.sh
	$(SHELL) $(top_srcdir)/build-aux/gen-module-bundle.sh xyz.c $(bundlable_modules)

CLEAN_FILES = xyz.c

clean-local:
	rm -f core.* *~

