1## Process this file with automake to produce Makefile.in
2
3RM = rm -f
4
5AM_CPPFLAGS = -DLADSPA_PATH="\"@LADSPA_PATH@\""
6
7if HAVE_LIBLTDL
8# This is being used as a short cut to turn off versioning of ALL dynamic
9# fmt libraries.  If any fmt ever needs to add a specific LDFLAGS
10# then it will need to also add -avoid-version because AM_LDFLAGS
11# is ignored when you specify a more specific one.
12# We want to version libsox and we are OK because they
13# have a more specific LDFLAGS that includes -version-info.
14AM_LDFLAGS = -avoid-version -module
15AM_CPPFLAGS += -DPKGLIBDIR="\"$(pkglibdir)\""
16endif
17
18
19
20#########################
21# SoX - the application #
22#########################
23
24bin_PROGRAMS = sox
25EXTRA_PROGRAMS = example0 example1 example2 example3 example4 example5 example6 sox_sample_test
26lib_LTLIBRARIES = libsox.la
27include_HEADERS = sox.h
28sox_SOURCES = sox.c
29if HAVE_WIN32_GLOB
30sox_SOURCES += win32/glob.c win32/glob.h
31AM_CPPFLAGS += -I$(srcdir)/win32
32endif
33sox_LDADD = libsox.la
34example0_SOURCES = example0.c
35example1_SOURCES = example1.c
36example2_SOURCES = example2.c
37example3_SOURCES = example3.c
38example4_SOURCES = example4.c
39example5_SOURCES = example5.c
40example6_SOURCES = example6.c
41sox_sample_test_SOURCES = sox_sample_test.c
42
43
44
45######################################################
46# libsox - file format, effects, and utility library #
47######################################################
48
49# Format handlers and utils source
50libsox_la_SOURCES = adpcms.c adpcms.h aiff.c aiff.h cvsd.c cvsd.h cvsdfilt.h \
51	  g711.c g711.h g721.c g723_24.c g723_40.c g72x.c g72x.h vox.c vox.h \
52	  raw.c raw.h formats.c formats.h formats_i.c sox_i.h skelform.c \
53	  xmalloc.c xmalloc.h getopt.c \
54	  util.c util.h libsox.c libsox_i.c sox-fmt.c soxomp.h
55
56# Effects source
57libsox_la_SOURCES += \
58	band.h bend.c biquad.c biquad.h biquads.c chorus.c compand.c \
59	compandt.c compandt.h contrast.c dcshift.c delay.c dft_filter.c \
60	dft_filter.h dither.c dither.h divide.c downsample.c earwax.c \
61	echo.c echos.c effects.c effects.h effects_i.c effects_i_dsp.c \
62	fade.c fft4g.c fft4g.h fifo.h fir.c firfit.c flanger.c gain.c \
63	hilbert.c input.c ladspa.h ladspa.c loudness.c mcompand.c \
64	mcompand_xover.h noiseprof.c noisered.c \
65	noisered.h output.c overdrive.c pad.c phaser.c rate.c \
66	rate_filters.h rate_half_fir.h rate_poly_fir0.h rate_poly_fir.h \
67	remix.c repeat.c reverb.c reverse.c silence.c sinc.c skeleff.c \
68	speed.c splice.c stat.c stats.c stretch.c swap.c \
69	synth.c tempo.c tremolo.c trim.c upsample.c vad.c vol.c
70if HAVE_PNG
71    libsox_la_SOURCES += spectrogram.c
72endif
73
74libsox_la_LIBADD =
75
76# Libraries required by libsox for file handlers, effects, or utils;
77# regardless if libltdl is used or not.
78if HAVE_PNG
79libsox_la_LIBADD += @PNG_LIBS@
80endif
81if HAVE_MAGIC
82libsox_la_LIBADD += @MAGIC_LIBS@
83endif
84if HAVE_LIBGSM
85libsox_la_LIBADD += @LIBGSM_LIBS@
86endif
87
88libsox_la_CFLAGS =
89libsox_la_LDFLAGS = -no-undefined -version-info @SHLIB_VERSION@ \
90  -export-symbols $(srcdir)/libsox.sym
91
92EXTRA_libsox_la_DEPENDENCIES = $(srcdir)/libsox.sym
93
94if HAVE_LIBLTDL
95  libsox_la_CFLAGS += $(LIBLTDL_CFLAGS)
96  libsox_la_LIBADD += $(LIBLTDL_LIBS)
97endif
98
99
100
101#########################
102# libsox - File Formats #
103#########################
104
105# Uncomment for bit-rot detection on linux
106#libsox_la_SOURCES += coreaudio.c sndio.c sunaudio.c
107#libsox_la_CFLAGS += -Ibit-rot
108
109libsox_la_SOURCES += raw-fmt.c s1-fmt.c s2-fmt.c s3-fmt.c \
110  s4-fmt.c u1-fmt.c u2-fmt.c u3-fmt.c u4-fmt.c al-fmt.c la-fmt.c ul-fmt.c \
111  lu-fmt.c 8svx.c aiff-fmt.c aifc-fmt.c au.c avr.c cdr.c cvsd-fmt.c \
112  dvms-fmt.c dat.c hcom.c htk.c maud.c prc.c sf.c smp.c \
113  sounder.c soundtool.c sphere.c tx16w.c voc.c vox-fmt.c ima-fmt.c adpcm.c adpcm.h \
114  ima_rw.c ima_rw.h wav.c wve.c xa.c nulfile.c f4-fmt.c f8-fmt.c gsrt.c \
115  id3.c id3.h
116
117if HAVE_ID3TAG
118  libsox_la_LIBADD += @ID3TAG_LIBS@
119endif
120
121pkglib_LTLIBRARIES =
122
123include optional-fmts.am
124
125
126
127# example programs will need same link options as sox does.
128example0_LDADD = ${sox_LDADD}
129example1_LDADD = ${sox_LDADD}
130example2_LDADD = ${sox_LDADD}
131example3_LDADD = ${sox_LDADD}
132example4_LDADD = ${sox_LDADD}
133example5_LDADD = ${sox_LDADD}
134example6_LDADD = ${sox_LDADD}
135
136EXTRA_DIST = monkey.wav optional-fmts.am \
137	     tests.sh testall.sh tests.bat testall.bat test-comments
138
139all: sox$(EXEEXT)
140
141examples: example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT)
142
143extras: examples sox_sample_test$(EXEEXT)
144
145MAKELINKS = for n in $(SYMLINKS); do $(RM) $$n$(EXEEXT) && $(LN_S) sox$(EXEEXT) $$n$(EXEEXT); done
146
147all-local: sox$(EXEEXT)
148	$(MAKELINKS)
149
150install-exec-hook:
151	cd $(DESTDIR)$(bindir) && $(MAKELINKS)
152
153uninstall-hook:
154	cd $(DESTDIR)$(bindir) && $(RM) play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT)
155
156clean-local:
157	$(RM) play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT)
158	$(RM) sox_sample_test$(EXEEXT)
159	$(RM) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT)
160
161distclean-local:
162
163loc:
164	sloccount \
165	$(include_HEADERS) \
166	$(sox_SOURCES) \
167	$(example0_SOURCES) \
168	$(example1_SOURCES) \
169	$(example2_SOURCES) \
170	$(example3_SOURCES) \
171	$(example4_SOURCES) \
172	$(example5_SOURCES) \
173	$(example6_SOURCES) \
174	$(sox_sample_test_SOURCES) \
175	$(libsox_la_SOURCES)
176
177
178# Ideally we would use the "check" target so that "make distcheck"
179# would run the test suite, but an uninstalled libltdl build cannot
180# currently load its formats and effects, so the checks would fail.
181installcheck:
182	$(srcdir)/tests.sh --bindir=$(DESTDIR)${bindir} --builddir=${builddir} --srcdir=${srcdir}
183	$(srcdir)/testall.sh --bindir=$(DESTDIR)${bindir} --srcdir=${srcdir}
184
185