1 # Copyright © 2009-2010,2013-2014,2021 Nick Bowler
3 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 # This is free software: you are free to do what the fuck you want to.
5 # There is NO WARRANTY, to the extent permitted by law.
7 AUTOMAKE_OPTIONS = parallel-tests color-tests
8 ACLOCAL_AMFLAGS = -I m4 -I common/m4
14 EXTRA_DIST = bootstrap $(DX_BASEDIR)/scripts/fix-gnulib.pl m4/gnulib-cache.m4
15 CLEANFILES = $(EXTRA_LTLIBRARIES)
17 AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib \
18 -I$(top_builddir)/src -I$(top_srcdir)/src \
19 -I$(top_srcdir)/common/src
20 AM_CFLAGS = $(LIBPNG_CFLAGS) $(GTK_CFLAGS)
22 dist_man_MANS = doc/man/lbxtool.1 doc/man/lbximg.1
23 dist_doc_DATA = doc/txt/moo2-data.txt
25 lbxdir = $(includedir)/lbx
26 lbx_HEADERS = src/lbx.h src/image.h src/error.h
27 noinst_HEADERS = src/misc.h src/tools.h src/imgoutput.h common/src/help.h
29 lib_LTLIBRARIES = liblbx.la
30 liblbx_la_SOURCES = src/lbx.c src/fops.c src/image.c src/error.c \
31 common/src/pack.c common/src/pack.h
32 liblbx_la_LDFLAGS = -export-symbols-regex '^lbx_'
34 bin_PROGRAMS = lbxtool lbximg
36 bin_PROGRAMS += lbxgui
39 lbxtool_SOURCES = src/lbxtool.c src/tools.c common/src/help.c
40 lbxtool_LDADD = liblbx.la libgnu.la
41 $(lbxtool_OBJECTS): $(gnulib_headers)
42 $(lbxtool_OBJECTS): src/toolopts.h
44 lbximg_SOURCES = src/lbximg.c src/tools.c src/pnm.c common/src/help.c
45 lbximg_LDADD = liblbx.la libgnu.la $(LIBPNG_LIBS)
46 $(lbximg_OBJECTS): $(gnulib_headers)
47 $(lbximg_OBJECTS): src/imgopts.h
50 lbximg_SOURCES += src/png.c
53 nodist_lbxgui_SOURCES = src/gui/lbxgui.glade.c
54 lbxgui_SOURCES = src/gui/lbxgui.c src/gui/lbxgui.h src/gui/image.c \
56 lbxgui_LDFLAGS = $(AM_LDFLAGS) -export-dynamic
57 lbxgui_LDADD = liblbx.la $(GTK_LIBS)
59 TEST_EXTENSIONS = .tap
61 TAP_LOG_COMPILER = $(SHELL)
62 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' \
63 $(SHELL) $(srcdir)/tests/util/tap-driver.sh
65 TESTS = tests/broken-archives.tap tests/empty-image.tap tests/pam-formats.tap \
66 tests/moo2-mainmenu.tap tests/moo2-logo.tap tests/moo2-starbg.tap \
67 tests/moo2-ships.tap tests/moo2-monster.tap
69 mostlyclean-local: clean-testdirs
71 for dir in $(TESTS:.tap=.dir); do \
73 *.dir) rm -rf "$$dir" ;; \
76 .PHONY: clean-testdirs
78 OPTFILES = src/toolopts.opt src/imgopts.opt
80 $(AM_V_GEN) $(AWK) -f $(DX_BASEDIR)/scripts/gen-options.awk $< >$@.tmp
81 $(AM_V_at) mv -f $@.tmp $@
82 $(OPTFILES:.opt=.h): $(DX_BASEDIR)/scripts/gen-options.awk
83 CLEANFILES += $(OPTFILES:.opt=.h)
84 EXTRA_DIST += $(DX_BASEDIR)/scripts/gen-options.awk $(OPTFILES)
87 $(AM_V_GEN) printf '%s\n' $(*F) | sed -e 's/[^[:alnum:]]/_/g' \
88 -e 's/.*/const char &[] =/' > $@.tmp
89 $(AM_V_at) sed -e 's/\\/\\\\/g' \
92 -e '$$ s/$$/;/' $< >> $@.tmp
93 $(AM_V_at) mv -f $@.tmp $@
95 EXTRA_DIST += src/gui/lbxgui.glade.xml
96 CLEANFILES += src/gui/lbxgui.glade.c