# $Id: Makefile.am 30092 2026-06-20 21:38:03Z yeti-dn $

libgwyddion = $(top_builddir)/libgwyddion/libgwyddion3.la
libgwyui = $(top_builddir)/libgwyui/libgwyui3.la

libgwyapp3includedir = $(includedir)/gwyddion3/libgwyapp
pkgconfigdatadir = $(libdir)/pkgconfig

normal_public_headers = \
	$(srcdir)/app.h \
	$(srcdir)/app-data-window.h \
	$(srcdir)/app-graph-window.h \
	$(srcdir)/app-image-window.h \
	$(srcdir)/data-browser.h \
	$(srcdir)/data-chooser.h \
	$(srcdir)/dialog.h \
	$(srcdir)/file.h \
	$(srcdir)/file-ops.h \
	$(srcdir)/filelist.h \
	$(srcdir)/function-list.h \
	$(srcdir)/glmaterial-editor.h \
	$(srcdir)/gradient-editor.h \
	$(srcdir)/gwyapp.h \
	$(srcdir)/module-utils.h \
	$(srcdir)/module-utils-file.h \
	$(srcdir)/module-utils-synth.h \
	$(srcdir)/gwyplaintool.h \
	$(srcdir)/gwytool.h \
	$(srcdir)/help.h \
	$(srcdir)/log.h \
	$(srcdir)/log-browser.h \
	$(srcdir)/logging.h \
	$(srcdir)/menu.h \
	$(srcdir)/menu-recent-files.h \
	$(srcdir)/meta-browser.h \
	$(srcdir)/module-browser.h \
	$(srcdir)/module-cmap.h \
	$(srcdir)/module-file.h \
	$(srcdir)/module-graph.h \
	$(srcdir)/module-loader.h \
	$(srcdir)/module-image.h \
	$(srcdir)/module-synth.h \
	$(srcdir)/module-tool.h \
	$(srcdir)/module-volume.h \
	$(srcdir)/module-xyz.h \
	$(srcdir)/param-def.h \
	$(srcdir)/params.h \
	$(srcdir)/param-resource.h \
	$(srcdir)/param-table.h \
	$(srcdir)/recent-funcs.h \
	$(srcdir)/resource-editor.h \
	$(srcdir)/results-export.h \
	$(srcdir)/settings.h \
	$(srcdir)/thumbnail.h \
	$(srcdir)/undo.h \
	$(srcdir)/wait.h

libgwyapp3include_HEADERS = \
	$(normal_public_headers) \
	types.h

noinst_HEADERS = \
	data-browser-internal.h \
	file-chooser.h \
	internal.h \
	module-internal.h \
	param-internal.h \
	sanity.h

lib_LTLIBRARIES = libgwyapp3.la

pkgconfigdata_DATA = libgwyapp3.pc

if OS_MSWIN
no_undefined = -no-undefined
export_symbols = -export-symbols libgwyapp3.def
win32_libs = -lole32
libgwyapp3_la_DEPENDENCIES = libgwyapp3.def
endif

# Must init
EXTRA_DIST = libgwyapp3.pc.in
CLEANFILES = libgwyapp3.def $(dist_gir_DATA) $(typelib_DATA)
MAINTAINERCLEANFILES =
BUILT_SOURCES =

MKENUM_NAME = types
MKENUM_ID = GWYAPP_TYPES
MKENUM_HFILES = $(normal_public_headers)
include $(top_srcdir)/build-aux/mkenum.mk

libgwyapp3.def: $(libgwyapp3_la_OBJECTS)
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/build-aux/gen-library-def.py "$(EU_NM)" $(libgwyapp3_la_OBJECTS) >libgwyapp3.def

AM_CFLAGS = @GTK_CFLAGS@ @COMMON_CFLAGS@ @OPENMP_CFLAGS@
AM_CPPFLAGS = -I$(top_srcdir) -DG_LOG_DOMAIN=\"LibGwyApp\" @OPENMP_CFLAGS@

# In following order do:
# Any code change     C:   R++: A
# Any iface change    C++: 0:   A
# Adding ifaces       C:   R:   A++
# Changing ifaces     C:   R:   0
#libversion = -version-info 30:2:30
libversion = -release @LIBRARY_RELEASE@
AM_LDFLAGS = @GTK_LIBS@ @BASIC_LIBS@ $(win32_libs) -export-dynamic $(no_undefined) $(export_symbols) $(libversion) $(libgwyui) $(libgwyddion)

libname = GwyApp
girlibname = $(libname)-$(GWY_VERSION_MAJOR).$(GWY_VERSION_MINOR)
INTROSPECTION_GIRS = $(girlibname).gir
INTROSPECTION_SCANNER_ARGS = \
	--identifier-prefix=Gwy \
	--symbol-prefix=gwy_ \
	-I$(top_srcdir) -I$(top_builddir) \
	$(GOBJECT_INTROSPECTION_SCANNER_FLAGS)
GwyApp_@GWY_GIR_VERSION@_gir_LIBS = $(lib_LTLIBRARIES)
GwyApp_@GWY_GIR_VERSION@_gir_FILES = $(libgwyapp3_la_SOURCES) $(libgwyapp3include_HEADERS) $(lib_LTLIBRARIES)
GwyApp_@GWY_GIR_VERSION@_gir_INCLUDES = Gtk-3.0
GwyApp_@GWY_GIR_VERSION@_gir_PACKAGES = gtk+-3.0
# NB: Do not swap the order of Gwyddion and GwyUI. Bad things will happen. It does not work like libraries
# where later libraries provide symbols for earlier. The scanner needs to know about Gwyddion by the time it
# sees GwyUI because that is when it gets confused if it does not know the lower-level library yet.
GwyApp_@GWY_GIR_VERSION@_gir_SCANNERFLAGS = \
	--include-uninstalled=$(top_builddir)/libgwyddion/Gwyddion-$(GWY_VERSION_MAJOR).$(GWY_VERSION_MINOR).gir \
	--include-uninstalled=$(top_builddir)/libgwyui/GwyUI-$(GWY_VERSION_MAJOR).$(GWY_VERSION_MINOR).gir \
	--library=$(top_builddir)/libgwyui/libgwyui3.la \
	--library=$(top_builddir)/libgwyddion/libgwyddion3.la
INTROSPECTION_COMPILER_ARGS = \
	--includedir=$(top_builddir)/libgwyui \
	--includedir=$(top_builddir)/libgwyddion
girdir = $(datadir)/gir-1.0
typelibdir = $(libdir)/girepository-1.0
if HAVE_INTROSPECTION
dist_gir_DATA = $(INTROSPECTION_GIRS)
typelib_DATA = $(girlibname).typelib
endif

-include $(INTROSPECTION_MAKEFILE)

libgwyapp3_la_SOURCES = \
	app.c \
	app-data-window.c \
	app-graph-window.c \
	app-image-window.c \
	data-browser.c \
	data-browser--gui.c \
	data-chooser.c \
	change-preview-cmap.c \
	change-preview-volume.c \
	change-preview-xyz.c \
	dialog.c \
	file.c \
	file--make-key.c \
	file-chooser.c \
	file-ops.c \
	filelist.c \
	function-list.c \
	gradient-editor.c \
	gwyapp.c \
	types.c \
	module-utils.c \
	module-utils-file.c \
	module-utils-file--inline.c \
	module-utils-synth.c \
	gwyplaintool.c \
	gwytool.c \
	help.c \
	log.c \
	log-browser.c \
	logging.c \
	menu.c \
	menu-recent-files.c \
	meta-browser.c \
	module-browser.c \
	module-cmap.c \
	module-file.c \
	module-graph.c \
	module-loader.c \
	module-image.c \
	module-synth.c \
	module-tool.c \
	module-volume.c \
	module-xyz.c \
	param-def.c \
	params.c \
	param-resource.c \
	param-table.c \
	recent-funcs.c \
	resource-editor.c \
	results-export.c \
	settings.c \
	thumbnail.c \
	undo.c \
	wait.c

# ======[ Triage ]=================================================
#
# We can easily live without for a while:
#	glmaterial-editor.c

EXTRA_DIST += \
	glmaterial-editor.c

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