# $Id: Makefile.am 30095 2026-06-21 11:27:16Z yeti-dn $

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

uidatadir = $(datadir)/gwyddion3/ui

noinst_HEADERS = \
	mac_integration.h \
	authors.h \
	gwyddion.h \
	release.h \
	toolbox.h

uidata_DATA = toolbox.xml

bin_PROGRAMS = gwyddion3

BUILT_SOURCES = \
	authors.h \
	release.h

EXTRA_DIST = toolbox.xml

if OS_DARWIN
darwin_cflags = -ObjC -g
darwin_ldflags = -framework AppKit -framework ApplicationServices
if HAVE_GTK_MAC_INTEGRATION
mac_integration = mac_integration.c
else
EXTRA_DIST += mac_integration.c
endif
endif

AM_CFLAGS = $(darwin_cflags) @GTK_MAC_CFLAGS@ @FFTW3_CFLAGS@ @GTK_CFLAGS@ @COMMON_CFLAGS@ @OPENMP_CFLAGS@
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gwyddion\" -I$(top_srcdir) @OPENMP_CFLAGS@
AM_LDFLAGS = $(darwin_ldflags) @OPENMP_CFLAGS@

gwyddion3_SOURCES = \
	$(mac_integration) \
	about.c \
	file-handling.c \
	gwyddion.c \
	splash.c \
	shortcut-editor.c \
	toolbox.c \
	toolbox-editor.c \
	toolbox-spec.c

gwyddion3_LDADD = @COMMON_LDFLAGS@ @GTK_MAC_LIBS@ @GTK_LIBS@ @FFTW3_LIBS@ @BASIC_LIBS@ \
	$(libgwyapp) $(libgwyui) $(libgwyddion)

if MAINTAINER_MODE
authors.h: ${top_srcdir}/AUTHORS $(top_srcdir)/build-aux/gen-authors.py
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/build-aux/gen-authors.py $(top_srcdir)/AUTHORS header >authors.h

release.h: ${top_srcdir}/NEWS Makefile $(top_builddir)/config.h
	$(AM_V_GEN)echo '/* This is a 'GENERATED' file. */' >release.h
	$(AM_V_at)$(SED) -n 1p ${top_srcdir}/NEWS \
		| $(SED) -e 's/^.*(/#define RELEASEDATE /' -e 's/)/u/' -e 's/-//g' >>release.h
endif

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