]> git.draconx.ca Git - upkg.git/blob - Makefile.am
Use dxcommon version of the packing library.
[upkg.git] / Makefile.am
1 # Copyright © 2009-2012, 2015 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 MAINTAINERCLEANFILES =
10 MOSTLYCLEANFILES =
11 CLEANFILES =
12
13 EXTRA_DIST = $(MAINTAINERCLEANFILES) m4/gnulib-cache.m4
14
15 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
16         -I$(top_srcdir)/$(DX_BASEDIR)/src \
17         -I$(top_builddir)/lib -I$(top_srcdir)/lib \
18         -DPKGLIBDIR=\"$(pkglibdir)\" -DPKGDATADIR=\"$(pkgdatadir)\"
19
20 AM_CFLAGS = $(LTDLINCL) $(GLIB_CFLAGS) $(LIBMODPLUG_CFLAGS)
21
22 bin_PROGRAMS = upkg
23 lib_LTLIBRARIES = libupkg.la libuobject.la
24 pkglib_LTLIBRARIES = engine.la
25 noinst_LTLIBRARIES =
26 EXTRA_LTLIBRARIES =
27 include_HEADERS =
28
29 dist_man_MANS = doc/man/upkg.1
30
31 # This trick should define orderonly to | iff we're using GNU make.
32 have_orderonly = $(findstring order-only,$(.FEATURES))
33 orderonly = $(have_orderonly:order-only=|)
34
35 upkg_SOURCES  = src/upkg.c
36 upkg_LDFLAGS  = $(AM_LDFLAGS) -export-dynamic
37 upkg_LDADD    = libuobject.la libupkg.la libgnu.la $(GLIB_LIBS)
38 $(upkg_OBJECTS): $(gnulib_headers)
39
40 libupkg_la_SOURCES = src/libupkg.c common/src/pack.c common/src/pack.h
41
42 uobjectdir = $(includedir)/uobject
43 uobject_HEADERS = src/uobject/uobject.h src/uobject/exportable.h \
44         src/uobject/loadable.h src/uobject/module.h src/uobject/package.h \
45         src/uobject/vfs.h
46
47 libuobject_la_SOURCES = src/uobject/uobject.c src/uobject/module.c \
48         src/uobject/avl.c src/uobject/avl.h src/uobject/package.c \
49         src/uobject/exportable.c src/uobject/loadable.c src/uobject/vfs.c
50 libuobject_la_LDFLAGS  = $(AM_LDFLAGS) -export-symbols-regex '^u_'
51 libuobject_la_LIBADD   = libgnu.la $(LIBLTDL) $(GLIB_LIBS)
52 $(libuobject_la_OBJECTS): $(gnulib_headers)
53
54 libuobject_la = libuobject.la
55 $(libuobject_la): $(LTDLDEPS)
56
57 moduleflags = -module -avoid-version -export-symbols-regex _LTX_
58
59 engine_GOBS = src/engine/palette.gob src/engine/texture.gob \
60         src/engine/music.gob src/engine/sound.gob
61
62 MAINTAINERCLEANFILES += $(engine_GOBS:.gob=.gobstamp) \
63         $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h)
64
65 engine_la_SOURCES = $(engine_GOBS:.gob=.c) $(engine_GOBS:.gob=.h) \
66         src/engine/engine.c src/engine/pcx.c
67 engine_la_LDFLAGS  = $(AM_LDFLAGS) $(moduleflags)
68 engine_la_LIBADD   = $(GLIB_LIBS)
69 $(engine_la_OBJECTS): $(orderonly) $(engine_GOBS:.gob=.gobstamp)
70
71 if USE_DUMMYMOD
72 engine_la_SOURCES += src/engine/music-dummymod.c
73 endif
74
75 if USE_LIBMODPLUG
76 engine_la_SOURCES  += src/engine/music-modplug.c src/engine/modplug-types.h
77 engine_la_LIBADD   += $(LIBMODPLUG_LIBS)
78 endif
79
80 check_LTLIBRARIES = libtest.la
81 check_PROGRAMS = test/decodeindex test/pcxrle
82
83 libtest_la_SOURCES = test/common.c
84
85 test_decodeindex_LDADD = libupkg.la libgnu.la libtest.la
86 $(test_decodeindex_OBJECTS): $(gnulib_headers)
87 test_pcxrle_LDADD = src/engine/pcx.lo libupkg.la libgnu.la libtest.la
88 $(test_pcxrle_OBJECTS): $(gnulib_headers)
89
90 TESTS_ENVIRONMENT = SHELL='$(SHELL)' EXEEXT='$(EXEEXT)'
91 TEST_EXTENSIONS = .sh
92 SH_LOG_COMPILER = $(SHELL)
93
94 TESTS = tests/libupkg-index-decode.sh tests/engine-pcx-rlencode.sh
95 EXTRA_DIST += $(TESTS)
96
97 # Supporting rules for GObject Builder
98 GOB_V   = $(GOB_V_@AM_V@)
99 GOB_V_  = $(GOB_V_@AM_DEFAULT_V@)
100 GOB_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'GOB     ' $<;
101
102 # Unfortunately, GOB's output filenames depend on the contents of the gob file,
103 # rather than its filename.  This isn't really suitable for use with make, so
104 # this rule has to make some assumptions about the source tree layout.
105 .gob.gobstamp:
106         $(GOB_V) $(GOB2) -o src --file-sep=/ --no-private-header $<
107         $(AM_V_at) touch $@
108
109 STAMP_RECOVER = \
110         @if test -f $@; then :; else rm -f $<; $(MAKE) $(AM_MAKEFLAGS) $<; fi
111 .gobstamp.c: ; $(STAMP_RECOVER)
112 .gobstamp.h: ; $(STAMP_RECOVER)
113
114 include $(top_srcdir)/lib/gnulib.mk
115 include $(top_srcdir)/libltdl/ltdl.mk