blob: 3d31d75f7ecf4193c3c8b1064066ad99561275c3 (
plain)
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
|
PREFIX ?= /usr/local
libdir ?= /lib
includedir ?= /include
MAKEFLAGS += --no-builtin-rules
WARNINGS := -Wall -Wextra -Wpedantic -Wformat=2 -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wstack-usage=12500 \
-Wfloat-equal -Wcast-align -Wpointer-arith -Wchar-subscripts -Warray-bounds=2
override CFLAGS ?= -g
override CFLAGS += -std=c11 $(WARNINGS)
override CPPFLAGS += -Iinclude
libs = libasound.so
all: $(libs)
%.so:
$(LINK.c) $(filter %.c,$^) $(LDLIBS) -fPIC -shared -o $@
libasound.so: private override CPPFLAGS += -D_POSIX_SOURCE
libasound.so: private override CFLAGS += -Wno-unused-parameter -Wno-deprecated-declarations
libasound.so: private override LDFLAGS += -Wl,--version-script=libasound.map
libasound.so: private override LDLIBS += -lsndio
libasound.so: libasound.c libasound.map stubs.h symversioning-hell.h
install-lib: $(libs)
install -Dm755 $^ -t "$(DESTDIR)$(PREFIX)$(libdir)"
install-include:
install -Dm755 -d include/alsa "$(DESTDIR)$(PREFIX)$(includedir)"
install: install-lib install-include
clean:
$(RM) $(libs)
.PHONY: all clean install
|