-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
68 lines (50 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Set to yes, for a debug build.
DEBUG=no
# Set to yes, for an optimized build with debug output.
BENCHMARK=no
# Set to no, to disable multithreading.
THREADED=yes
# Set to yes, to enable dumping of filter response plots.
PLOT=no
# Set to yes, to build lib32 version for 64-bit systems.
LIB32=no
PREFIX = /usr/local
LIBDIR = $(PREFIX)/lib
CFLAGS = -fPIC -DPIC
CFLAGS += -Wall -Wextra -Wpedantic -Wno-unused-parameter
LDFLAGS=-lm -lasound -lfftw3f
INSTALL=/usr/bin/install
ifneq ($(DEBUG),yes)
CFLAGS += -O3
else
CFLAGS += -g
endif
ifeq ($(PLOT),yes)
CFLAGS += -DPLOT_FILTER
endif
ifeq ($(filter yes,$(DEBUG) $(BENCHMARK)),)
CFLAGS += -DNDEBUG
endif
ifeq ($(THREADED),yes)
CFLAGS += -DWITH_THREADS
LDFLAGS += -lfftw3f_threads
endif
ifeq ($(LIB32),yes)
CFLAGS += -m32
LIBDIR = $(PREFIX)/lib32
endif
all: libasound_module_pcm_loudness.so
libasound_module_pcm_loudness.so: loudness_pcm.c contours.h
$(CC) -o $@ -shared ${CFLAGS} loudness_pcm.c ${LDFLAGS}
install: libasound_module_pcm_loudness.so
mkdir -p $(LIBDIR)
$(INSTALL) -m 644 libasound_module_pcm_loudness.so $(LIBDIR)/
uninstall:
rm -f $(LIBDIR)/libasound_module_pcm_loudness.so
dist:
if [ -e /tmp/loudness ]; then rm -rf /tmp/loudness; fi
mkdir /tmp/loudness
cp loudness_pcm.c contours.h Makefile /tmp/loudness
cd /tmp; tar zcf alsaloudness.tar.gz loudness/
clean:
rm -f libasound_module_pcm_loudness.so *~