X-Git-Url: https://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/c988ed346e0af1707a9b7b3577e14f12c69a6f07..HEAD:/Makefile.am diff --git a/Makefile.am b/Makefile.am index 6830ab5..e5c0d8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,16 +1,98 @@ -# Copyright (C) 2009 Nick Bowler -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without any warranty. - -ACLOCAL_AMFLAGS = -I m4 - -dist_man_MANS = -dist_doc_DATA = -noinst_HEADERS = -lib_LTLIBRARIES = -bin_PROGRAMS = - -include doc/Makefile.inc -include src/Makefile.inc +# Copyright © 2009-2010,2013-2014,2021 Nick Bowler +# +# License WTFPL2: Do What The Fuck You Want To Public License, version 2. +# This is free software: you are free to do what the fuck you want to. +# There is NO WARRANTY, to the extent permitted by law. + +ACLOCAL_AMFLAGS = -I m4 -I common/m4 + +# For Gnulib +MOSTLYCLEANFILES = +EXTRA_LTLIBRARIES = + +EXTRA_DIST = bootstrap $(DX_BASEDIR)/scripts/fix-gnulib.pl m4/gnulib-cache.m4 +CLEANFILES = $(EXTRA_LTLIBRARIES) +DISTCLEANFILES = + +AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_srcdir)/common/src +AM_CFLAGS = $(LIBPNG_CFLAGS) $(GTK_CFLAGS) + +dist_man_MANS = doc/man/lbxtool.1 doc/man/lbximg.1 +dist_doc_DATA = doc/txt/moo2-data.txt + +lbxdir = $(includedir)/lbx +lbx_HEADERS = src/lbx.h src/image.h src/error.h +noinst_HEADERS = src/misc.h src/tools.h src/imgoutput.h common/src/help.h + +lib_LTLIBRARIES = liblbx.la +liblbx_la_SOURCES = src/lbx.c src/fops.c src/image.c src/error.c \ + common/src/pack.c common/src/pack.h +liblbx_la_LDFLAGS = -export-symbols-regex '^lbx_' + +bin_PROGRAMS = lbxtool lbximg +if BUILD_LBXGUI +bin_PROGRAMS += lbxgui +endif + +lbxtool_SOURCES = src/lbxtool.c src/tools.c common/src/help.c +lbxtool_LDADD = liblbx.la libgnu.la +$(lbxtool_OBJECTS): $(gnulib_headers) +$(lbxtool_OBJECTS): src/toolopts.h + +lbximg_SOURCES = src/lbximg.c src/tools.c src/pnm.c common/src/help.c +lbximg_LDADD = liblbx.la libgnu.la $(LIBPNG_LIBS) +$(lbximg_OBJECTS): $(gnulib_headers) +$(lbximg_OBJECTS): src/imgopts.h + +if HAVE_LIBPNG +lbximg_SOURCES += src/png.c +endif + +nodist_lbxgui_SOURCES = src/gui/lbxgui.glade.c +lbxgui_SOURCES = src/gui/lbxgui.c src/gui/lbxgui.h src/gui/image.c \ + src/gui/bg.xbm +lbxgui_LDFLAGS = $(AM_LDFLAGS) -export-dynamic +lbxgui_LDADD = liblbx.la $(GTK_LIBS) + +OPTFILES = src/toolopts.opt src/imgopts.opt +.opt.h: + $(AM_V_GEN) $(AWK) -f $(DX_BASEDIR)/scripts/gen-options.awk $< >$@.tmp + $(AM_V_at) mv -f $@.tmp $@ +$(OPTFILES:.opt=.h): $(DX_BASEDIR)/scripts/gen-options.awk +CLEANFILES += $(OPTFILES:.opt=.h) +EXTRA_DIST += $(DX_BASEDIR)/scripts/gen-options.awk $(OPTFILES) + +.xml.c: + $(AM_V_GEN) printf '%s\n' $(*F) | sed -e 's/[^[:alnum:]]/_/g' \ + -e 's/.*/const char &[] =/' > $@.tmp + $(AM_V_at) sed -e 's/\\/\\\\/g' \ + -e 's/"/\\"/g' \ + -e 's/.*/"&\\n"/' \ + -e '$$ s/$$/;/' $< >> $@.tmp + $(AM_V_at) mv -f $@.tmp $@ + +EXTRA_DIST += src/gui/lbxgui.glade.xml +CLEANFILES += src/gui/lbxgui.glade.c + +atlocal: config.status + $(AM_V_GEN) :; { \ + printf ': "$${%s=%s}"\n' \ + datadir '$(datadir)' \ + LN_S '$(LN_S)' \ + MD5 '$(MD5)' \ + PAMARITH '$(PAMARITH)' \ + PAMCHANNEL '$(PAMCHANNEL)' \ + ; } >$@.tmp + $(AM_V_at) mv -f $@.tmp $@ +check_DATA = atlocal +CLEANFILES += atlocal + +# Data files used in test cases +dist_check_DATA = tests/testdata/image-0x0 tests/testdata/image-1x1 \ + tests/testdata/image-1x1-mt tests/testdata/palette-ramp \ + tests/testdata/arch-trunc.lbx + +include $(top_srcdir)/common/snippet/autotest.mk +include $(top_srcdir)/lib/gnulib.mk