chiark / gitweb /
Fix a few of the things the Clang static analyzer detects:
[disorder] / server / Makefile.am
index 965467e..27c8fdd 100644 (file)
@@ -1,6 +1,6 @@
 #
 # This file is part of DisOrder.
-# Copyright (C) 2004-2009 Richard Kettlewell
+# Copyright (C) 2004-2010 Richard Kettlewell
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
 
 disorderd_SOURCES=disorderd.c api.c api-server.c daemonize.c play.c    \
        server.c server-queue.c queue-ops.c state.c plugin.c            \
-       schedule.c dbparams.c background.c \
+       schedule.c dbparams.c background.c mount.c \
        exports.c ../lib/memgc.c disorder-server.h
 disorderd_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
        $(LIBPCRE) $(LIBDB) $(LIBAO) $(LIBGC) $(LIBGCRYPT) $(LIBICONV) \
@@ -44,14 +44,15 @@ disorder_speaker_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
        $(LIBPTHREAD)
 disorder_speaker_DEPENDENCIES=../lib/libdisorder.a
 
-disorder_decode_SOURCES=decode.c disorder-server.h
+disorder_decode_SOURCES=decode.c decode.h disorder-server.h    \
+decode-mp3.c decode-ogg.c decode-wav.c decode-flac.c
 disorder_decode_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
        $(LIBMAD) $(LIBVORBISFILE) $(LIBFLAC)
 disorder_decode_DEPENDENCIES=../lib/libdisorder.a
 
 disorder_normalize_SOURCES=normalize.c disorder-server.h
 disorder_normalize_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
-       $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
+       $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT) $(LIBSAMPLERATE)
 disorder_normalize_DEPENDENCIES=../lib/libdisorder.a
 
 disorder_rescan_SOURCES=rescan.c plugin.c api.c api-server.c exports.c \
@@ -64,7 +65,7 @@ disorder_rescan_DEPENDENCIES=../lib/libdisorder.a
 disorder_choose_SOURCES=choose.c server-queue.c ../lib/memgc.c \
                        disorder-server.h
 disorder_choose_LDADD=$(LIBOBJS) ../lib/libdisorder.a   \
-       $(LIBDB) $(LIBGC) $(LIBPCRE) $(LIBGCRYPT)
+       $(LIBDB) $(LIBGC) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
 disorder_choose_LDFLAGS=-export-dynamic
 disorder_choose_DEPENDENCIES=../lib/libdisorder.a
 
@@ -117,39 +118,34 @@ check-help: all
        ./disorder-choose --help > /dev/null
        ./disorder-choose --version > /dev/null
 
-check-decode: disorder-decode disorder-normalize endian
-       echo "speaker_backend network" > config
-       echo "broadcast 127.255.255.255 9" > config
-       oggdec -b 16 -e `./endian` -R -s 1 -o oggdec.raw ${top_srcdir}/sounds/scratch.ogg
-       @$(MAKE) check-ogg
-       @$(MAKE) check-wav
-       @if which flac >/dev/null 2>&1; then $(MAKE) check-flac; fi
-       rm -f config oggdec.raw
+check-decode: check-wav check-flac check-mp3
 
-# TODO mp3 - but sox doesn't (reliably) know how to encode to it
+check-mp3: disorder-decode disorder-normalize
+       ./disorder-decode ${top_srcdir}/sounds/scratch.mp3 | \
+         ./disorder-normalize --config ${srcdir}/test-config > mp3ed.raw
+       cmp mp3ed.raw ${top_srcdir}/sounds/scratch-mp3.raw
+       rm -f mp3ed.raw
 
-check-ogg:
+# TODO ogg decoding comes out OK but different depending on platform, version
+# or something.  Makes it tricky to test!
+check-ogg: disorder-decode disorder-normalize
        ./disorder-decode ${top_srcdir}/sounds/scratch.ogg | \
-         ./disorder-normalize --config config > ogged.raw
-       cmp ogged.raw oggdec.raw
+         ./disorder-normalize --config ${srcdir}/test-config > ogged.raw
+       cmp ogged.raw ${top_srcdir}/sounds/scratch.raw
        rm -f ogged.raw
 
-check-wav:
-       sox ${top_srcdir}/sounds/scratch.ogg scratch.wav
-       ./disorder-decode scratch.wav | \
-         ./disorder-normalize --config config > waved.raw
-       cmp waved.raw oggdec.raw
-       rm -rf scratch.wav waved.raw
-
-check-flac:
-       rm -f scratch.wav scratch.flac
-       sox ${top_srcdir}/sounds/scratch.ogg scratch.wav
-       flac scratch.wav
-       ./disorder-decode scratch.flac | \
-         ./disorder-normalize --config config > flacced.raw
-       cmp flacced.raw oggdec.raw
-       rm -f scratch.flac scratch.wav flacced.raw
-
-EXTRA_DIST=README.dbversions
+check-wav: disorder-decode disorder-normalize
+       ./disorder-decode ${top_srcdir}/sounds/scratch.wav | \
+         ./disorder-normalize --config ${srcdir}/test-config > waved.raw
+       cmp waved.raw ${top_srcdir}/sounds/scratch.raw
+       rm -rf waved.raw
+
+check-flac: disorder-decode disorder-normalize
+       ./disorder-decode ${top_srcdir}/sounds/scratch.flac | \
+         ./disorder-normalize --config ${srcdir}/test-config > flacced.raw
+       cmp flacced.raw ${top_srcdir}/sounds/scratch.raw
+       rm -f flacced.raw
+
+EXTRA_DIST=README.dbversions test-config
 
 CLEANFILES=*.gcda *.gcov *.gcno *.c.html index.html