]> Pileus Git - aweather/blobdiff - src/Makefile.am
Fix memory leaks
[aweather] / src / Makefile.am
index ca40656920c4ae030e5d3e3cbd96a490eaad9091..b72794b611c36888c3401567e652f5414e5592ae 100644 (file)
@@ -1,7 +1,8 @@
 SUBDIRS = plugins
 
 AM_CFLAGS   = -Wall --std=gnu99 $(GRITS_CFLAGS)
-AM_LDFLAGS  = -Wl,--export-dynamic
+AM_LDFLAGS  = -Wl,--export-dynamic \
+              -Wl,--as-needed -Wl,--no-undefined
 
 bin_PROGRAMS = aweather wsr88ddec
 aweather_SOURCES  = main.c \
@@ -9,6 +10,7 @@ aweather_SOURCES  = main.c \
        aweather-location.c aweather-location.h
 aweather_CPPFLAGS = \
        -DHTMLDIR="\"$(dots)$(htmldir)\"" \
+       -DICONDIR="\"$(dots)$(datadir)/icons\"" \
        -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \
        -DPLUGINSDIR="\"$(dots)$(pkglibdir)\""
 aweather_LDADD    = $(GRITS_LIBS)
@@ -32,7 +34,7 @@ aweather_dbg_CPPFLAGS = $(aweather_CPPFLAGS)
 aweather_dbg_LDADD    = $(aweather_LDADD)
 endif
 
-.rc.o: ../data/aweather.ico
+.rc.o: ../data/icons/48x48/aweather.ico
        $(RC) -o $@ $<
 
 CLEANFILES = gmon.out valgrind.out
@@ -49,3 +51,15 @@ gdb: all
 
 ddd: all
        ddd .libs/aweather
+
+memcheck: all
+       G_SLICE=always-malloc                   \
+       G_DEBUG=gc-friendly,resident-modules    \
+       valgrind --track-origins=yes            \
+                --leak-check=full              \
+                --leak-resolution=high         \
+                --num-callers=50               \
+                --suppressions=gtk.suppression \
+                --suppressions=/usr/lib/valgrind/default.supp \
+                .libs/aweather                 \
+       2> valgrind.out