Restore builds --without-server
[disorder] / lib / Makefile.am
CommitLineData
460b9539 1#
2# This file is part of DisOrder.
4dadf1a2 3# Copyright (C) 2004-2008 Richard Kettlewell
460b9539 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
0b861e97 21noinst_LIBRARIES=libdisorder.a
460b9539 22include_HEADERS=disorder.h
23noinst_PROGRAMS=test
24
e63c38e8
RK
25if SERVER
26TRACKDB=trackdb.c
27else
28TRACKDB=trackdb-stub.c
29endif
30
0b861e97 31libdisorder_a_SOURCES=charset.c charset.h \
460b9539 32 addr.c addr.h \
4dadf1a2 33 alsabg.c alsabg.h \
460b9539 34 authhash.c authhash.h \
35 basen.c basen.h \
fce810c2 36 base64.c base64.h \
460b9539 37 cache.c cache.h \
38 client.c client.h \
39 client-common.c client-common.h \
40 configuration.c configuration.h \
b12be54a 41 cookies.c cookies.h \
460b9539 42 defs.c defs.h \
43 eclient.c eclient.h \
44 event.c event.h \
45 eventlog.c eventlog.h \
46 filepart.c filepart.h \
47 hash.c hash.h \
22168975 48 heap.h \
460b9539 49 hex.c hex.h \
bb6ae3fb 50 hostname.c hostname.h \
81b1bf12 51 ifreq.c ifreq.h \
460b9539 52 inputline.c inputline.h \
53 kvp.c kvp.h \
54 log.c log.h log-impl.h \
55 logfd.c logfd.h \
56 mem.c mem.h mem-impl.h \
57 mime.h mime.c \
b25aac59 58 mixer.c mixer.h mixer-oss.c mixer-alsa.c \
460b9539 59 plugin.c plugin.h \
60 printf.c printf.h \
61 asprintf.c fprintf.c snprintf.c \
62 queue.c queue.h \
63 regsub.c regsub.h \
938d8157 64 rights.c queue-rights.c rights.h \
e83d0967 65 rtp.h \
460b9539 66 selection.c selection.h \
bb6ae3fb 67 sendmail.c sendmail.h \
460b9539 68 signame.c signame.h \
69 sink.c sink.h \
ea410ba1 70 speaker-protocol.c speaker-protocol.h \
460b9539 71 split.c split.h \
72 syscalls.c syscalls.h \
73 types.h \
74 table.c table.h \
e83d0967 75 timeval.h \
e63c38e8 76 $(TRACKDB) trackdb.h trackdb-int.h \
460b9539 77 trackname.c trackname.h \
36bde473 78 url.h url.c \
460b9539 79 user.h user.c \
e5a5a138 80 unicode.h unicode.c \
61507e3c 81 unidata.h unidata.c \
460b9539 82 vacopy.h \
83 vector.c vector.h \
3fbdc96d 84 version.c version.h \
ce6c36be 85 wav.h wav.c \
460b9539 86 wstat.c wstat.h \
87 disorder.h
460b9539 88
a05e4467
RK
89version-string: ../config.status ${top_srcdir}/scripts/make-version-string
90 CC="${CC}" ${top_srcdir}/scripts/make-version-string > $@.new
91 @if cmp $@.new $@; then \
92 echo rm -f $@.new; rm -f $@.new; else \
93 echo mv $@.new $@; mv $@.new $@; fi
94
3fbdc96d 95versionstring.h: version-string ${top_srcdir}/scripts/text2c
a05e4467
RK
96 ${top_srcdir}/scripts/text2c -extern disorder_version_string \
97 version-string > $@.new
98 @if cmp $@.new $@; then \
99 echo rm -f $@.new; rm -f $@.new; else \
100 echo mv $@.new $@; mv $@.new $@; fi
101
460b9539 102definitions.h: Makefile
103 rm -f $@.new
104 echo "#define PKGLIBDIR \"${pkglibdir}\"" > $@.new
105 echo "#define PKGCONFDIR \"${sysconfdir}/\"PACKAGE" >> $@.new
106 echo "#define PKGSTATEDIR \"${localstatedir}/\"PACKAGE" >> $@.new
107 echo "#define PKGDATADIR \"${pkgdatadir}/\"" >> $@.new
e83d0967
RK
108 echo "#define SBINDIR \"${sbindir}/\"" >> $@.new
109 echo "#define BINDIR \"${bindir}/\"" >> $@.new
110 echo "#define FINKBINDIR \"${finkbindir}/\"" >> $@.new
66ec39ed
RK
111 @if cmp $@.new $@; then \
112 echo rm -f $@.new; rm -f $@.new; else \
113 echo mv $@.new $@; mv $@.new $@; fi
3fbdc96d
RK
114defs.o: definitions.h versionstring.h
115defs.lo: definitions.h versionstring.h
460b9539 116
b90f122b
RK
117test_SOURCES=test.c memgc.c test.h t-addr.c t-basen.c t-cache.c \
118 t-casefold.c t-cookies.c t-filepart.c t-hash.c t-heap.c \
119 t-hex.c t-kvp.c t-mime.c t-printf.c t-regsub.c t-selection.c \
120 t-signame.c t-sink.c t-split.c t-unicode.c t-url.c t-utf8.c \
121 t-words.c t-wstat.c
fe575537 122test_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
0b861e97 123test_DEPENDENCIES=libdisorder.a
460b9539 124
033fd4e3 125check: test #test.i
460b9539 126 ./test
127
fbd54d8e
RK
128check-report: before-check check make-coverage-reports
129before-check:
130 rm -f *.gcda *.gcov
131make-coverage-reports:
3d853cec 132 ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . *.c
fbd54d8e 133
e5a5a138
RK
134rebuild-unicode:
135 cd ${srcdir} && ${top_srcdir}/scripts/make-unidata
136
033fd4e3
RK
137%.i: %.c
138 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -c $< > $@.new
139 mv $@.new $@
140
66ec39ed 141CLEANFILES=definitions.h definitions.h.new
e63c38e8
RK
142
143EXTRA_DIST=trackdb.c trackdb-stub.c