chiark / gitweb /
compute stats in a subprocess to avoid wedging the server if it takes ages
[disorder] / server / Makefile.am
1 #
2 # This file is part of DisOrder.
3 # Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 # USA
19 #
20
21 sbin_PROGRAMS=disorderd disorder-deadlock disorder-rescan disorder-dump \
22               disorder-speaker disorder-decode disorder-normalize \
23               disorder-stats
24 noinst_PROGRAMS=disorder.cgi trackname
25 noinst_DATA=uk.org.greenend.rjk.disorder.plist
26
27 AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
28
29 disorderd_SOURCES=disorderd.c                           \
30         api.c api-server.c                              \
31         daemonize.c daemonize.h                         \
32         play.c play.h                                   \
33         server.c server.h                               \
34         server-queue.c server-queue.h                   \
35         setup.c setup.h                                 \
36         state.c state.h                                 \
37         trackdb.c trackdb.h trackdb-int.h exports.c     \
38         ../lib/memgc.c
39 disorderd_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
40         $(LIBPCRE) $(LIBDB) $(LIBAO) $(LIBGC) $(LIBGCRYPT) $(LIBICONV)
41 disorderd_LDFLAGS=-export-dynamic
42 disorderd_DEPENDENCIES=../lib/libdisorder.a
43
44 disorder_deadlock_SOURCES=deadlock.c                    \
45         trackdb.c trackdb.h
46 disorder_deadlock_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
47         $(LIBDB) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
48 disorder_deadlock_DEPENDENCIES=../lib/libdisorder.a
49
50 disorder_speaker_SOURCES=speaker.c speaker.h \
51                          speaker-command.c \
52                          speaker-network.c \
53                          speaker-coreaudio.c \
54                          speaker-oss.c \
55                          speaker-alsa.c
56 disorder_speaker_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
57         $(LIBASOUND) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT) $(COREAUDIO)
58 disorder_speaker_DEPENDENCIES=../lib/libdisorder.a
59
60 disorder_decode_SOURCES=decode.c
61 disorder_decode_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
62         $(LIBMAD) $(LIBVORBISFILE) $(LIBFLAC)
63 disorder_decode_DEPENDENCIES=../lib/libdisorder.a
64
65 disorder_normalize_SOURCES=normalize.c
66 disorder_normalize_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
67         $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
68 disorder_normalize_DEPENDENCIES=../lib/libdisorder.a
69
70 disorder_rescan_SOURCES=rescan.c                        \
71         api.c api-server.c                              \
72         trackdb.c trackdb.h exports.c                   \
73         ../lib/memgc.c
74 disorder_rescan_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
75         $(LIBDB) $(LIBGC) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
76 disorder_rescan_LDFLAGS=-export-dynamic
77 disorder_rescan_DEPENDENCIES=../lib/libdisorder.a
78
79 disorder_stats_SOURCES=stats.c trackdb.c trackdb.h
80 disorder_stats_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
81         $(LIBDB) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
82 disorder_stats_DEPENDENCIES=../lib/libdisorder.a
83
84 disorder_dump_SOURCES=dump.c                            \
85         trackdb.c trackdb.h                             \
86         ../lib/memgc.c
87 disorder_dump_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
88         $(LIBPCRE) $(LIBDB) $(LIBICONV) $(LIBGC) $(LIBGCRYPT)
89 disorder_dump_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
90
91 disorder_cgi_SOURCES=dcgi.c dcgi.h                      \
92         api.c api-client.c api-client.h                 \
93         cgi.c cgi.h cgimain.c exports.c
94 disorder_cgi_LDADD=../lib/libdisorder.a \
95         $(LIBPCRE) $(LIBGCRYPT) $(LIBDL)
96 disorder_cgi_LDFLAGS=-export-dynamic
97 disorder_cgi_DEPENDENCIES=../lib/libdisorder.a
98
99 trackname_SOURCES=trackname.c
100 trackname_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
101 trackname_DEPENDENCIES=../lib/libdisorder.a
102
103 install-exec-hook:
104         $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
105
106 check: check-help
107
108 # check everything has working --help
109 check-help: all
110         ./disorderd --help > /dev/null
111         ./disorder-dump --help > /dev/null
112         ./disorder-deadlock --help > /dev/null
113         ./trackname --help > /dev/null
114         ./disorder-speaker --help > /dev/null
115
116 cgi.o: ../lib/definitions.h
117
118 # for Mac OS X >=10.4
119 SEDFILES=uk.org.greenend.rjk.disorder.plist
120 include ${top_srcdir}/scripts/sedfiles.make
121 EXTRA_DIST=uk.org.greenend.rjk.disorder.plist.in
122 LAUNCHD=/Library/LaunchDaemons
123
124 #install-data-hook:
125 #       @if [ -d ${LAUNCHD} ]; then \
126 #         echo $(INSTALL) -m 644 uk.org.greenend.rjk.disorder.plist ${LAUNCHD};\
127 #         $(INSTALL) -m 644 uk.org.greenend.rjk.disorder.plist ${LAUNCHD};\
128 #         if [ "$$(NOLAUNCH)" != "" ]; then \
129 #           echo launchctl unload ${LAUNCHD} \|\| true;\
130 #           launchctl unload ${LAUNCHD} || true;\
131 #           echo launchctl load ${LAUNCHD} \|\| true;\
132 #           launchctl load ${LAUNCHD} || true;\
133 #         fi;\
134 #       fi