Makefile.in 7.01 KB
Newer Older
1
#
bjornroche's avatar
bjornroche committed
2
# PortAudio V19 Makefile.in
3 4
#
# Dominic Mazzoni
bjornroche's avatar
bjornroche committed
5
# Modifications by Mikael Magnusson
6
# Modifications by Stelios Bounanos
7 8
#

bjornroche's avatar
bjornroche committed
9 10 11 12
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
top_builddir = .
13
PREFIX = @prefix@
bjornroche's avatar
bjornroche committed
14 15 16 17 18
prefix = $(PREFIX)
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
19
CC = @CC@
20
CXX = @CXX@
21
CFLAGS = @CFLAGS@ @DEFS@
22 23 24
LIBS = @LIBS@
AR = @AR@
RANLIB = @RANLIB@
25
SHELL = @SHELL@
bjornroche's avatar
bjornroche committed
26
LIBTOOL = @LIBTOOL@
27
INSTALL = @INSTALL@
bjornroche's avatar
bjornroche committed
28
INSTALL_DATA = @INSTALL_DATA@
29
SHARED_FLAGS = @SHARED_FLAGS@
bjornroche's avatar
bjornroche committed
30
LDFLAGS = @LDFLAGS@
31
DLL_LIBS = @DLL_LIBS@
bjornroche's avatar
bjornroche committed
32 33 34 35 36 37 38
CXXFLAGS = @CXXFLAGS@
NASM = @NASM@
NASMOPT = @NASMOPT@
LN_S = @LN_S@
LT_CURRENT=@LT_CURRENT@
LT_REVISION=@LT_REVISION@
LT_AGE=@LT_AGE@
39 40

OTHER_OBJS = @OTHER_OBJS@
41
INCLUDES = @INCLUDES@
42

bjornroche's avatar
bjornroche committed
43 44 45 46
PALIB = libportaudio.la
PAINC = include/portaudio.h

PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
47
	     -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS)_.*" \
bjornroche's avatar
bjornroche committed
48
	     -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
49 50

COMMON_OBJS = \
bjornroche's avatar
bjornroche committed
51 52 53 54 55 56 57 58
	src/common/pa_allocation.o \
	src/common/pa_converters.o \
	src/common/pa_cpuload.o \
	src/common/pa_dither.o \
	src/common/pa_debugprint.o \
	src/common/pa_front.o \
	src/common/pa_process.o \
	src/common/pa_stream.o \
59 60
	src/common/pa_trace.o \
	src/hostapi/skeleton/pa_hostapi_skeleton.o
philburk's avatar
philburk committed
61 62 63 64 65 66 67 68

LOOPBACK_OBJS = \
	qa/loopback/src/audio_analyzer.o \
	qa/loopback/src/biquad_filter.o \
	qa/loopback/src/paqa_tools.o \
	qa/loopback/src/test_audio_analyzer.o \
	qa/loopback/src/write_wav.o \
	qa/loopback/src/paqa.o
69
	
70
EXAMPLES = \
71 72 73 74 75 76 77 78 79 80
	bin/pa_devs \
	bin/pa_fuzz \
	bin/paex_pink \
	bin/paex_read_write_wire \
	bin/paex_record \
	bin/paex_saw \
	bin/paex_sine \
	bin/paex_write_sine \
	bin/paex_write_sine_nonint

81
SELFTESTS = \
bjornroche's avatar
bjornroche committed
82 83
	bin/paqa_devs \
	bin/paqa_errs \
84 85 86
	bin/paqa_latency
	
TESTS = \
bjornroche's avatar
bjornroche committed
87
	bin/patest1 \
88
	bin/patest_buffer \
bjornroche's avatar
bjornroche committed
89
	bin/patest_callbackstop \
90 91 92
	bin/patest_clip \
	bin/patest_dither \
	bin/patest_hang \
bjornroche's avatar
bjornroche committed
93
	bin/patest_in_overflow \
94 95 96 97 98
	bin/patest_latency \
	bin/patest_leftright \
	bin/patest_longsine \
	bin/patest_many \
	bin/patest_maxsines \
99
	bin/patest_mono \
100
	bin/patest_multi_sine \
bjornroche's avatar
bjornroche committed
101 102
	bin/patest_out_underflow \
	bin/patest_prime \
103 104
	bin/patest_ringmix \
	bin/patest_sine8 \
bjornroche's avatar
bjornroche committed
105
	bin/patest_sine_channelmaps \
106 107
	bin/patest_sine_formats \
	bin/patest_sine_time \
108
	bin/patest_sine_srate \
bjornroche's avatar
bjornroche committed
109
	bin/patest_start_stop \
110
	bin/patest_stop \
bjornroche's avatar
bjornroche committed
111
	bin/patest_stop_playout \
112
	bin/patest_toomanysines \
113
	bin/patest_two_rates \
114
	bin/patest_underflow \
bjornroche's avatar
bjornroche committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
	bin/patest_wire \
	bin/pa_minlat

# Most of these don't compile yet.  Put them in TESTS, above, if
# you want to try to compile them...
ALL_TESTS = \
	$(TESTS) \
	bin/patest_sync \
	bin/debug_convert \
	bin/debug_dither_calc \
	bin/debug_dual \
	bin/debug_multi_in \
	bin/debug_multi_out \
	bin/debug_record \
	bin/debug_record_reuse \
	bin/debug_sine_amp \
	bin/debug_sine \
	bin/debug_sine_formats \
	bin/debug_srate \
	bin/debug_test1

OBJS := $(COMMON_OBJS) $(OTHER_OBJS)

LTOBJS := $(OBJS:.o=.lo)

SRC_DIRS = \
	src/common \
	src/hostapi/alsa \
	src/hostapi/asihpi \
	src/hostapi/asio \
	src/hostapi/coreaudio \
	src/hostapi/dsound \
	src/hostapi/jack \
	src/hostapi/oss \
	src/hostapi/wasapi \
	src/hostapi/wdmks \
	src/hostapi/wmme \
	src/os/unix \
	src/os/win

SUBDIRS =
@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp

158
all: lib/$(PALIB) all-recursive tests examples selftests
bjornroche's avatar
bjornroche committed
159 160 161

tests: bin-stamp $(TESTS)

162 163
examples: bin-stamp $(EXAMPLES)

164 165
selftests: bin-stamp $(SELFTESTS)

philburk's avatar
philburk committed
166 167
loopback: bin-stamp bin/paloopback

168
# With ASIO enabled we must link libportaudio and all test programs with CXX
bjornroche's avatar
bjornroche committed
169
lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC)
170 171
	@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS)
	@WITH_ASIO_TRUE@  $(LIBTOOL) --mode=link --tag=CXX $(CXX) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS)
bjornroche's avatar
bjornroche committed
172 173

$(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c
174 175
	@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
	@WITH_ASIO_TRUE@  $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
bjornroche's avatar
bjornroche committed
176

177 178 179 180
$(EXAMPLES): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) examples/%.c
	@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/examples/$*.c lib/$(PALIB) $(LIBS)
	@WITH_ASIO_TRUE@  $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/examples/$*.c lib/$(PALIB) $(LIBS)

181 182 183 184
$(SELFTESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) qa/%.c
	@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/qa/$*.c lib/$(PALIB) $(LIBS)
	@WITH_ASIO_TRUE@  $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/qa/$*.c lib/$(PALIB) $(LIBS)

philburk's avatar
philburk committed
185 186 187 188
bin/paloopback: lib/$(PALIB) $(MAKEFILE) $(PAINC) $(LOOPBACK_OBJS)
	@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(LOOPBACK_OBJS) lib/$(PALIB) $(LIBS)
	@WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS)  $(LOOPBACK_OBJS) lib/$(PALIB) $(LIBS)

bjornroche's avatar
bjornroche committed
189 190 191 192
install: lib/$(PALIB) portaudio-2.0.pc
	$(INSTALL) -d $(DESTDIR)$(libdir)
	$(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir)
	$(INSTALL) -d $(DESTDIR)$(includedir)
193 194 195
	for include in $(INCLUDES); do \
		$(INSTALL_DATA) -m 644 $(top_srcdir)/include/$$include $(DESTDIR)$(includedir)/$$include; \
	done
bjornroche's avatar
bjornroche committed
196 197
	$(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig
	$(INSTALL) -m 644 portaudio-2.0.pc $(DESTDIR)$(libdir)/pkgconfig/portaudio-2.0.pc
198 199 200 201 202 203 204
	@echo ""
	@echo "------------------------------------------------------------"
	@echo "PortAudio was successfully installed."
	@echo ""
	@echo "On some systems (e.g. Linux) you should run 'ldconfig' now"
	@echo "to make the shared object available.  You may also need to"
	@echo "modify your LD_LIBRARY_PATH environment variable to include"
bjornroche's avatar
bjornroche committed
205
	@echo "the directory $(libdir)"
206 207
	@echo "------------------------------------------------------------"
	@echo ""
bjornroche's avatar
bjornroche committed
208 209 210 211 212 213
	$(MAKE) install-recursive

uninstall:
	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(PALIB)
	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(includedir)/portaudio.h
	$(MAKE) uninstall-recursive
214 215

clean:
philburk's avatar
philburk committed
216
	$(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(LOOPBACK_OBJS) $(ALL_TESTS) lib/$(PALIB)
bjornroche's avatar
bjornroche committed
217 218 219 220 221
	$(RM) bin-stamp lib-stamp
	-$(RM) -r bin lib

distclean: clean
	$(RM) config.log config.status Makefile libtool portaudio-2.0.pc
222

bjornroche's avatar
bjornroche committed
223
%.o: %.c $(MAKEFILE) $(PAINC)
224 225
	$(CC) -c $(CFLAGS) $< -o $@

bjornroche's avatar
bjornroche committed
226 227 228
%.lo: %.c $(MAKEFILE) $(PAINC)
	$(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@

229 230 231
%.lo: %.cpp $(MAKEFILE) $(PAINC)
	$(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(CXXFLAGS) $< -o $@

bjornroche's avatar
bjornroche committed
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
%.o: %.cpp $(MAKEFILE) $(PAINC)
	$(CXX) -c $(CXXFLAGS) $< -o $@

%.o: %.asm
	$(NASM) $(NASMOPT) -o $@ $<

bin-stamp:
	-mkdir bin
	touch $@

lib-stamp:
	-mkdir lib
	-mkdir -p $(SRC_DIRS)
	touch $@

Makefile: Makefile.in config.status
	$(SHELL) config.status

all-recursive:
	if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir all; done ; fi

install-recursive:
	if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir install; done ; fi
255

bjornroche's avatar
bjornroche committed
256 257
uninstall-recursive:
	if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir uninstall; done ; fi