chiark / gitweb /
ef10c490b1aaf5dc72f838e267d6c18e3e920179
[disorder] / lib / Makefile.am
1 #
2 # This file is part of DisOrder.
3 # Copyright (C) 2004-2008 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 3 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,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU 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, see <http://www.gnu.org/licenses/>.
17 #
18
19 noinst_LIBRARIES=libdisorder.a
20 include_HEADERS=disorder.h
21
22 if SERVER
23 TRACKDB=trackdb.c
24 else
25 TRACKDB=trackdb-stub.c
26 endif
27
28 libdisorder_a_SOURCES=charset.c charset.h               \
29         addr.c addr.h                                   \
30         alsabg.c alsabg.h                               \
31         arcfour.c arcfour.h                             \
32         authhash.c authhash.h                           \
33         basen.c basen.h                                 \
34         base64.c base64.h                               \
35         bits.c bits.h                                   \
36         cache.c cache.h                                 \
37         cgi.c cgi.h                                     \
38         client.c client.h                               \
39         client-common.c client-common.h                 \
40         configuration.c configuration.h                 \
41         cookies.c cookies.h                             \
42         dateparse.c dateparse.h xgetdate.c              \
43         defs.c defs.h                                   \
44         eclient.c eclient.h                             \
45         email.c                                         \
46         eventdist.c eventdist.h                         \
47         event.c event.h                                 \
48         eventlog.c eventlog.h                           \
49         filepart.c filepart.h                           \
50         hash.c hash.h                                   \
51         heap.h                                          \
52         hex.c hex.h                                     \
53         hostname.c hostname.h                           \
54         ifreq.c ifreq.h                                 \
55         inputline.c inputline.h                         \
56         kvp.c kvp.h                                     \
57         log.c log.h log-impl.h                          \
58         logfd.c logfd.h                                 \
59         macros.c macros-builtin.c macros.h              \
60         mem.c mem.h mem-impl.h                          \
61         mime.h mime.c                                   \
62         mixer.c mixer.h mixer-oss.c mixer-alsa.c        \
63         printf.c printf.h                               \
64         asprintf.c fprintf.c snprintf.c                 \
65         queue.c queue.h                                 \
66         random.c random.h                               \
67         regsub.c regsub.h                               \
68         rights.c queue-rights.c rights.h                \
69         rtp.h                                           \
70         selection.c selection.h                         \
71         sendmail.c sendmail.h                           \
72         signame.c signame.h                             \
73         sink.c sink.h                                   \
74         speaker-protocol.c speaker-protocol.h           \
75         split.c split.h                                 \
76         syscalls.c syscalls.h                           \
77         common.h                                        \
78         table.c table.h                                 \
79         timeval.h                                       \
80         $(TRACKDB) trackdb.h trackdb-int.h              \
81         trackname.c trackorder.c trackname.h            \
82         tracksort.c                                     \
83         url.h url.c                                     \
84         user.h user.c                                   \
85         unicode.h unicode.c                             \
86         unidata.h unidata.c                             \
87         vacopy.h                                        \
88         vector.c vector.h                               \
89         version.c version.h                             \
90         wav.h wav.c                                     \
91         wstat.c wstat.h                                 \
92         disorder.h
93
94 version-string: ../config.status ${top_srcdir}/scripts/make-version-string
95         CC="${CC}" ${top_srcdir}/scripts/make-version-string > $@.new
96         @if cmp $@.new $@; then \
97                 echo rm -f $@.new; rm -f $@.new; else \
98                 echo mv $@.new $@; mv $@.new $@; fi
99
100 versionstring.h: version-string ${top_srcdir}/scripts/text2c
101         ${top_srcdir}/scripts/text2c -extern disorder_version_string \
102                 version-string > $@.new
103         @if cmp $@.new $@; then \
104                 echo rm -f $@.new; rm -f $@.new; else \
105                 echo mv $@.new $@; mv $@.new $@; fi
106
107 definitions.h: Makefile
108         rm -f $@.new
109         echo "/** @file lib/definitions.h" >> $@.new
110         echo " * @brief Definitions exported from makefile" >> $@.new
111         echo " *" >> $@.new
112         echo " * DO NOT EDIT." >> $@.new
113         echo " */" >> $@.new
114         echo "#define PKGLIBDIR \"${pkglibdir}\"" >> $@.new
115         echo "#define PKGCONFDIR \"${sysconfdir}/\"PACKAGE" >> $@.new
116         echo "#define PKGSTATEDIR \"${localstatedir}/\"PACKAGE" >> $@.new
117         echo "#define PKGDATADIR \"${pkgdatadir}/\"" >> $@.new
118         echo "#define SBINDIR \"${sbindir}/\"" >> $@.new
119         echo "#define BINDIR \"${bindir}/\"" >> $@.new
120         echo "#define FINKBINDIR \"${finkbindir}/\"" >> $@.new
121         echo "#define SENDMAIL \"${SENDMAIL}\"" >> $@.new
122         @if cmp $@.new $@; then \
123                 echo rm -f $@.new; rm -f $@.new; else \
124                 echo mv $@.new $@; mv $@.new $@; fi
125 defs.o: definitions.h versionstring.h
126 defs.lo: definitions.h versionstring.h
127
128 rebuild-unicode:
129         cd ${srcdir} && ${top_srcdir}/scripts/make-unidata
130
131 %.i: %.c
132         $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -c $< > $@.new
133         mv $@.new $@
134
135 CLEANFILES=definitions.h definitions.h.new version-string versionstring.h \
136            *.gcda *.gcov *.gcno
137
138 EXTRA_DIST=trackdb.c trackdb-stub.c