# $Id: Makefile.am 30154 2026-06-25 13:32:45Z yeti-dn $

# 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 = roddeposit.c

synthdir = $(libdir)/gwyddion3/modules/synth

# 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 = \
	annealing.la \
	ballistic.la \
	chaining.la \
	columnar.la \
	cpde.la \
	deposit.la \
	diffusion.la \
	discs.la \
	domains.la \
	dunes.la \
	fbrownian.la \
	fibres.la \
	fourier.la \
	lattice.la \
	linenoise.la \
	mfm_current.la \
	mfm_parallel.la \
	noise.la \
	objects.la \
	pattern.la \
	phases.la \
	pileup.la \
	plateaus.la \
	residue.la \
	wetfront.la \
	waves.la

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

synth_LTLIBRARIES = \
	$(synth_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 synth_la_SOURCES below.
annealing_la_SOURCES    = annealing.c
ballistic_la_SOURCES    = ballistic.c
chaining_la_SOURCES     = chaining.c
columnar_la_SOURCES     = columnar.c
cpde_la_SOURCES         = cpde.c
deposit_la_SOURCES      = deposit.c
diffusion_la_SOURCES    = diffusion.c
discs_la_SOURCES        = discs.c
domains_la_SOURCES      = domains.c
dunes_la_SOURCES        = dunes.c
fbrownian_la_SOURCES    = fbrownian.c
fourier_la_SOURCES      = fourier.c
fibres_la_SOURCES       = fibres.c
lattice_la_SOURCES      = lattice.c
linenoise_la_SOURCES    = linenoise.c
mfm_current_la_SOURCES  = mfm_current.c
mfm_parallel_la_SOURCES = mfm_parallel.c
noise_la_SOURCES        = noise.c
objects_la_SOURCES      = objects.c
pattern_la_SOURCES      = pattern.c
phases_la_SOURCES       = phases.c
pileup_la_SOURCES       = pileup.c
plateaus_la_SOURCES     = plateaus.c
residue_la_SOURCES      = residue.c
waves_la_SOURCES        = waves.c
wetfront_la_SOURCES     = wetfront.c
#roddeposit_la_SOURCES  = roddeposit.c

synth_la_SOURCES = \
	$(annealing_la_SOURCES) \
	$(ballistic_la_SOURCES) \
	$(chaining_la_SOURCES) \
	$(columnar_la_SOURCES) \
	$(cpde_la_SOURCES) \
	$(deposit_la_SOURCES) \
	$(diffusion_la_SOURCES) \
	$(discs_la_SOURCES) \
	$(domains_la_SOURCES) \
	$(dunes_la_SOURCES) \
	$(fbrownian_la_SOURCES) \
	$(fibres_la_SOURCES) \
	$(fourier_la_SOURCES) \
	$(lattice_la_SOURCES) \
	$(linenoise_la_SOURCES) \
	$(mfm_current_la_SOURCES) \
	$(mfm_parallel_la_SOURCES) \
	$(noise_la_SOURCES) \
	$(objects_la_SOURCES) \
	$(pattern_la_SOURCES) \
	$(phases_la_SOURCES) \
	$(pileup_la_SOURCES) \
	$(plateaus_la_SOURCES) \
	$(residue_la_SOURCES) \
	$(waves_la_SOURCES) \
	$(wetfront_la_SOURCES) \
	synth.c

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

CLEAN_FILES = synth.c

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

