chiark / gitweb /
ogg decoding in disorder-decode
[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 noinst_PROGRAMS=disorder.cgi trackname
24 noinst_DATA=uk.org.greenend.rjk.disorder.plist
25
26 AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
27
28 disorderd_SOURCES=disorderd.c                           \
29         api.c api-server.c                              \
30         daemonize.c daemonize.h                         \
31         play.c play.h                                   \
32         server.c server.h                               \
33         state.c state.h                                 \
34         trackdb.c trackdb.h trackdb-int.h exports.c     \
35         ../lib/memgc.c
36 disorderd_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
37         $(LIBPCRE) $(LIBDB) $(LIBAO) $(LIBGC) $(LIBGCRYPT) $(LIBICONV)
38 disorderd_LDFLAGS=-export-dynamic
39 disorderd_DEPENDENCIES=../lib/libdisorder.a
40
41 disorder_deadlock_SOURCES=deadlock.c                    \
42         trackdb.c trackdb.h
43 disorder_deadlock_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
44         $(LIBDB) $(LIBPCRE) $(LIBICONV)
45 disorder_deadlock_DEPENDENCIES=../lib/libdisorder.a
46
47 disorder_speaker_SOURCES=speaker.c speaker.h \
48                          speaker-command.c \
49                          speaker-network.c \
50                          speaker-alsa.c
51 disorder_speaker_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
52         $(LIBASOUND) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT)
53 disorder_speaker_DEPENDENCIES=../lib/libdisorder.a
54
55 disorder_decode_SOURCES=decode.c
56 disorder_decode_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
57         $(LIBMAD) $(LIBVORBISFILE)
58 disorder_decode_DEPENDENCIES=../lib/libdisorder.a
59
60 disorder_normalize_SOURCES=normalize.c
61 disorder_normalize_LDADD=$(LIBOBJS) ../lib/libdisorder.a $(LIBPCRE)
62 disorder_normalize_DEPENDENCIES=../lib/libdisorder.a
63
64 disorder_rescan_SOURCES=rescan.c                        \
65         api.c api-server.c                              \
66         trackdb.c trackdb.h exports.c                   \
67         ../lib/memgc.c
68 disorder_rescan_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
69         $(LIBDB) $(LIBGC) $(LIBPCRE) $(LIBICONV)
70 disorder_rescan_LDFLAGS=-export-dynamic
71 disorder_rescan_DEPENDENCIES=../lib/libdisorder.a
72
73 disorder_dump_SOURCES=dump.c                            \
74         trackdb.c trackdb.h                             \
75         ../lib/memgc.c
76 disorder_dump_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
77         $(LIBPCRE) $(LIBDB) $(LIBICONV) $(LIBGC)
78 disorder_dump_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
79
80 disorder_cgi_SOURCES=dcgi.c dcgi.h                      \
81         api.c api-client.c api-client.h                 \
82         cgi.c cgi.h cgimain.c exports.c
83 disorder_cgi_LDADD=../lib/libdisorder.a \
84         $(LIBPCRE) $(LIBGCRYPT) $(LIBDL)
85 disorder_cgi_LDFLAGS=-export-dynamic
86 disorder_cgi_DEPENDENCIES=../lib/libdisorder.a
87
88 trackname_SOURCES=trackname.c
89 trackname_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBICONV)
90 trackname_DEPENDENCIES=../lib/libdisorder.a
91
92 install-exec-hook:
93         $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
94
95 check: check-help
96
97 # check everything has working --help
98 check-help: all
99         ./disorderd --help > /dev/null
100         ./disorder-dump --help > /dev/null
101         ./disorder-deadlock --help > /dev/null
102         ./trackname --help > /dev/null
103         ./disorder-speaker --help > /dev/null
104
105 cgi.o: ../lib/definitions.h
106
107 # for Mac OS X >=10.4
108 SEDFILES=uk.org.greenend.rjk.disorder.plist
109 include ${top_srcdir}/scripts/sedfiles.make
110 EXTRA_DIST=uk.org.greenend.rjk.disorder.plist.in
111 LAUNCHD=/Library/LaunchDaemons
112
113 install-data-hook:
114         @if [ -d ${LAUNCHD} ]; then \
115           echo $(INSTALL) -m 644 uk.org.greenend.rjk.disorder.plist ${LAUNCHD};\
116           $(INSTALL) -m 644 uk.org.greenend.rjk.disorder.plist ${LAUNCHD};\
117           if [ "$$(NOLAUNCH)" != "" ]; then \
118             echo launchctl unload ${LAUNCHD} \|\| true;\
119             launchctl unload ${LAUNCHD} || true;\
120             echo launchctl load ${LAUNCHD} \|\| true;\
121             launchctl load ${LAUNCHD} || true;\
122          fi;\
123         fi