]> git.draconx.ca Git - liblbx.git/blob - Makefile.am
Use shared code from dxcommon.
[liblbx.git] / Makefile.am
1 # Copyright © 2009-2010,2013-2014,2021 Nick Bowler
2 #
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.
6
7 AUTOMAKE_OPTIONS = parallel-tests color-tests
8 ACLOCAL_AMFLAGS = -I m4 -I common/m4
9
10 # For Gnulib
11 MOSTLYCLEANFILES =
12 EXTRA_LTLIBRARIES =
13
14 EXTRA_DIST = bootstrap $(DX_BASEDIR)/scripts/fix-gnulib.pl m4/gnulib-cache.m4
15 CLEANFILES = $(EXTRA_LTLIBRARIES)
16
17 AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/src \
18               -I$(top_srcdir)/common/src
19 AM_CFLAGS = $(LIBPNG_CFLAGS) $(GTK_CFLAGS)
20
21 dist_man_MANS = doc/man/lbxtool.1 doc/man/lbximg.1
22 dist_doc_DATA = doc/txt/moo2-data.txt
23
24 lbxdir = $(includedir)/lbx
25 lbx_HEADERS = src/lbx.h src/image.h src/error.h
26 noinst_HEADERS = src/misc.h src/tools.h
27
28 lib_LTLIBRARIES = liblbx.la
29 liblbx_la_SOURCES = src/lbx.c src/fops.c src/image.c src/error.c \
30                     common/src/pack.c common/src/pack.h
31 liblbx_la_LDFLAGS = -export-symbols-regex '^lbx_'
32
33 bin_PROGRAMS = lbxtool lbximg
34 if BUILD_LBXGUI
35 bin_PROGRAMS += lbxgui
36 endif
37
38 lbxtool_SOURCES = src/lbxtool.c src/tools.c
39 lbxtool_LDADD = liblbx.la libgnu.la
40 $(lbxtool_OBJECTS): $(gnulib_headers)
41
42 lbximg_SOURCES = src/lbximg.c src/tools.c src/pnm.c src/imgoutput.h
43 lbximg_LDADD = liblbx.la libgnu.la $(LIBPNG_LIBS)
44 $(lbximg_OBJECTS): $(gnulib_headers)
45
46 if HAVE_LIBPNG
47 lbximg_SOURCES += src/png.c
48 endif
49
50 nodist_lbxgui_SOURCES = src/gui/lbxgui.glade.c
51 lbxgui_SOURCES = src/gui/lbxgui.c src/gui/lbxgui.h src/gui/image.c \
52         src/gui/bg.xbm
53 lbxgui_LDFLAGS = $(AM_LDFLAGS) -export-dynamic
54 lbxgui_LDADD = liblbx.la $(GTK_LIBS)
55
56 TEST_EXTENSIONS = .tap
57
58 TAP_LOG_COMPILER = $(SHELL)
59 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' \
60         $(SHELL) $(srcdir)/tests/util/tap-driver.sh
61
62 TESTS = tests/broken-archives.tap tests/empty-image.tap tests/pam-formats.tap \
63         tests/moo2-mainmenu.tap tests/moo2-logo.tap tests/moo2-starbg.tap \
64         tests/moo2-ships.tap tests/moo2-monster.tap
65
66 mostlyclean-local: clean-testdirs
67 clean-testdirs:
68         for dir in $(TESTS:.tap=.dir); do \
69                 case $$dir in \
70                 *.dir) rm -rf "$$dir" ;; \
71                 esac; \
72         done
73 .PHONY: clean-testdirs
74
75 .xml.c:
76         $(AM_V_GEN) printf '%s\n' $(*F) | sed -e 's/[^[:alnum:]]/_/g' \
77                 -e 's/.*/const char &[] =/' > $@.tmp
78         $(AM_V_at) sed -e 's/\\/\\\\/g' \
79                 -e 's/"/\\"/g' \
80                 -e 's/.*/"&\\n"/' \
81                 -e '$$ s/$$/;/' $< >> $@.tmp
82         $(AM_V_at) mv -f $@.tmp $@
83
84 EXTRA_DIST += src/gui/lbxgui.glade.xml
85 CLEANFILES += src/gui/lbxgui.glade.c
86
87 include lib/gnulib.mk