blob: 50a692fb149e3817bc038f3916f17df32217c5f3 (
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
38
39
40
41
42
43
44
45
|
TOPDIR ?= ..
INCDIR ?= $(TOPDIR)/include
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DESTDIR ?=
PREFIX ?= /usr/local
CROSS_COMPILE =
CC = $(CROSS_COMPILE)gcc
override CFLAGS := -Wall -Wextra -Werror -Wfatal-errors -I $(INCDIR) -fPIC $(CFLAGS)
AR = $(CROSS_COMPILE)ar
ARFLAGS = rcs
LD = $(CROSS_COMPILE)gcc
LDFLAGS =
OBJECTS = mixer.o pcm.o
.PHONY: all
all: libtinyalsa.a libtinyalsa.so
pcm.o: pcm.c $(INCDIR)/tinyalsa/pcm.h
mixer.o: mixer.c $(INCDIR)/tinyalsa/mixer.h
libtinyalsa.a: $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
libtinyalsa.so: $(OBJECTS)
$(LD) $(LDFLAGS) -shared $^ -o $@
.PHONY: clean
clean:
rm -f libtinyalsa.a
rm -f libtinyalsa.so
rm -f $(OBJECTS)
.PHONY: install
install: libtinyalsa.a libtinyalsa.so
mkdir -p $(DESTDIR)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
cp -u libtinyalsa.a $(DESTDIR)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
cp -u libtinyalsa.so $(DESTDIR)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
|