Add version info for Debian
[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_SUBDIR)\"" \
41         -DPLUGINSDIR="\"$(dots)$(libdir)/$(GIS_SUBDIR)\""
42 libgis_la_LIBADD  = $(AM_LDADD) \
43         objects/libgis-objects.la \
44         data/libgis-data.la
45 libgis_la_LDFLAGS = $(AM_LDFLAGS) \
46         -version-info $(LIB_VERSION)
47
48 # Demo program
49 if WIN32
50 AM_LDFLAGS += -mwindows
51 dots        = ..
52 else
53 BINLDFLAGS  = -static
54 endif
55
56 bin_PROGRAMS = gis-demo
57
58 gis_demo_SOURCES  = gis-demo.c
59 gis_demo_LDADD    = $(AM_LDADD) libgis.la
60 gis_demo_LDFLAGS  = $(BINLDFLAGS)
61
62 # Test programs
63 noinst_PROGRAMS = gis-test tile-test
64
65 gis_test_SOURCES = gis-test.c
66 gis_test_LDADD   = $(AM_LDADD) libgis.la
67 gis_test_LDFLAGS  = $(BINLDFLAGS)
68
69 tile_test_SOURCES = tile-test.c
70 tile_test_LDADD   = $(AM_LDADD) libgis.la
71 tile_test_LDFLAGS = $(BINLDFLAGS)
72
73
74 MAINTAINERCLEANFILES = Makefile.in
75
76 .list.c:
77         glib-genmarshal --prefix=gis_cclosure_marshal --body   $< > $@
78 .list.h:
79         glib-genmarshal --prefix=gis_cclosure_marshal --header $< > $@
80
81 test: all .libs/$(GIS_SUBDIR)
82         ./gis-test
83
84 gdb: all .libs/$(GIS_SUBDIR)
85         gdb ./gis-test
86
87 ddd: all .libs/$(GIS_SUBDIR)
88         ddd ./gis-test
89
90 .libs/$(GIS_SUBDIR): plugins/.libs
91         ln -sf ../plugins/.libs .libs/$(GIS_SUBDIR)
92
93 memcheck: all
94         G_SLICE=always-malloc                   \
95         G_DEBUG=gc-friendly,resident-modules    \
96         valgrind --track-origins=yes            \
97                  --leak-check=full              \
98                  --leak-resolution=high         \
99                  --num-callers=50               \
100                  --suppressions=gtk.suppression \
101                  ./gis-test                     \
102         2> valgrind.out