forked from Decatf/audio-route
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (43 loc) · 1.41 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
export DESTDIR ?=
export PREFIX ?= /usr/local
export CROSS_COMPILE =
export INCDIR ?= $(PREFIX)/include/audio_route
export LIBDIR ?= $(PREFIX)/lib
export BINDIR ?= $(PREFIX)/bin
export MANDIR ?= $(PREFIX)/share/man
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
LD = $(CROSS_COMPILE)gcc
WARNINGS = -Wall -Wextra -Werror -Wfatal-errors
INCLUDE_DIRS := -Iinclude/ $(INCLUDE_DIRS)
override CFLAGS := $(WARNINGS) $(INCLUDE_DIRS) -fPIC $(CFLAGS)
LIBS=-ltinyalsa -lexpat
OBJECTS = audio_route.o
.PHONY: all
all: libaudioroute.a libaudioroute.so
audio_route.o: audio_route.c
libaudioroute.a: $(OBJECTS)
libaudioroute.a: $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
libaudioroute.so: libaudioroute.so.1
ln -sf $< $@
libaudioroute.so.1: libaudioroute.so.1.1.1
ln -sf $< $@
libaudioroute.so.1.1.1: $(OBJECTS)
$(LD) $(LIBS) $(LDFLAGS) -shared -Wl,-soname,libaudioroute.so.1 $^ -o $@
.PHONY: clean
clean:
rm -f libaudioroute.a
rm -f libaudioroute.so
rm -f libaudioroute.so.1
rm -f libaudioroute.so.1.1.1
rm -f $(OBJECTS)
.PHONY: install
install: libaudioroute.a libaudioroute.so.1
install -d $(DESTDIR)$(LIBDIR)/
install libaudioroute.a $(DESTDIR)$(LIBDIR)/
install libaudioroute.so.1.1.1 $(DESTDIR)$(LIBDIR)/
ln -sf libaudioroute.so.1.1.1 $(DESTDIR)$(LIBDIR)/libaudioroute.so.1
ln -sf libaudioroute.so.1 $(DESTDIR)$(LIBDIR)/libaudioroute.so
install -d $(DESTDIR)$(INCDIR)/
install include/audio_route/audio_route.h $(DESTDIR)$(INCDIR)/