b41ca0989f8431cc51b4b772ac0970468986c7da
[grits] / src / Makefile.am
1 SUBDIRS = data objects . plugins
2
3 AM_CFLAGS   = -Wall --std=gnu99 -I$(top_srcdir)/src
4 AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(SOUP_CFLAGS)
5 AM_LDADD    = $(GLIB_LIBS) $(GTK_LIBS) $(SOUP_LIBS)
6 AM_LDFLAGS  = --as-needed -no-undefined
7
8 BUILT_SOURCES = gis-marshal.c gis-marshal.h
9
10
11 # Headers
12 gis_includedir = $(includedir)/gis
13 gis_include_HEADERS = \
14         gis.h         \
15         gis-viewer.h  \
16         gis-prefs.h   \
17         gis-opengl.h  \
18         gis-plugin.h  \
19         gis-util.h    \
20         gpqueue.h     \
21         roam.h
22
23 # Pkg-config
24 pkgconfigdir = $(libdir)/pkgconfig
25 pkgconfig_DATA = libgis.pc
26
27 # Library
28 lib_LTLIBRARIES = libgis.la
29
30 libgis_la_SOURCES = gis.h \
31         gis-viewer.c  gis-viewer.h  \
32         gis-prefs.c   gis-prefs.h   \
33         gis-opengl.c  gis-opengl.h  \
34         gis-plugin.c  gis-plugin.h  \
35         gis-marshal.c gis-marshal.h \
36         gis-util.c    gis-util.h    \
37         roam.c        roam.h        \
38         gpqueue.c     gpqueue.h
39 libgis_la_CPPFLAGS = $(AM_CPPFLAGS) \
40         -DPKGDATADIR="\"$(dots)$(datadir)/gis\"" \
41         -DPLUGINSDIR="\"$(dots)$(libdir)/gis\""
42 libgis_la_LIBADD  = $(AM_LDADD) \
43         objects/libgis-objects.la \
44         data/libgis-data.la
45
46 # Demo program
47 if WIN32
48 AM_LDFLAGS += -mwindows
49 dots        = ..
50 else
51 BINLDFLAGS  = -static
52 endif
53
54 bin_PROGRAMS = gis-demo
55
56 gis_demo_SOURCES  = gis-demo.c
57 gis_demo_LDADD    = $(AM_LDADD) libgis.la
58 gis_demo_LDFLAGS  = $(BINLDFLAGS)
59
60 # Test programs
61 noinst_PROGRAMS = gis-test tile-test
62
63 gis_test_SOURCES = gis-test.c
64 gis_test_LDADD   = $(AM_LDADD) libgis.la
65 gis_test_LDFLAGS  = $(BINLDFLAGS)
66
67 tile_test_SOURCES = tile-test.c
68 tile_test_LDADD   = $(AM_LDADD) libgis.la
69 tile_test_LDFLAGS = $(BINLDFLAGS)
70
71
72 MAINTAINERCLEANFILES = Makefile.in
73
74 .list.c:
75         glib-genmarshal --prefix=gis_cclosure_marshal --body   $< > $@
76 .list.h:
77         glib-genmarshal --prefix=gis_cclosure_marshal --header $< > $@
78
79 test: all .libs/gis
80         ./gis-test
81
82 gdb: all .libs/gis
83         gdb ./gis-test
84
85 ddd: all .libs/gis
86         ddd ./gis-test
87
88 .libs/gis: plugins/.libs
89         ln -sf ../plugins/.libs .libs/gis
90
91 memcheck: all
92         G_SLICE=always-malloc                   \
93         G_DEBUG=gc-friendly,resident-modules    \
94         valgrind --track-origins=yes            \
95                  --leak-check=full              \
96                  --leak-resolution=high         \
97                  --num-callers=50               \
98                  --suppressions=gtk.suppression \
99                  ./gis-test                     \
100         2> valgrind.out