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