-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (37 loc) · 966 Bytes
/
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
CC = gcc
AR = ar
LIB_SUFFIX = a
NAME = libalac
ALAC_LIB = $(NAME).$(LIB_SUFFIX)
OBJS = alac.o
BIN = alacSample
RM = rm -f
ALSA_DIR = /home/pi/alsa-lib-1.1.7/build
FAAC_DIR = /home/pi/faac/bin
LIB_DIR = ./lib
INCS = -I $(FAAC_DIR)/include -I$(ALSA_DIR)/include -I./include
LIBS = -L$(FAAC_DIR)/lib -L$(ALSA_DIR)/lib -L./lib
LIB_FLAG = -lfaac -lasound -lalac
CFLAGS = $(INCS) $(LIBS) $(LIB_FLAG) -fPIC -Wall
SYS = posix
SO_VERSION =1
SOX_posix =so
SOX=$(SOX_$(SYS))
SO_posix =.$(SOX).$(SO_VERSION)
SO_EXT =$(SO_$(SYS))
SO_LDFLAGS = -shared -Wl,-soname,$@
all: $(BIN)
clean:
${RM} *.o $(LIB_DIR)/libalac.* $(BIN) *.aac
#$(BIN): $(AR) libalac$(SO_EXT)
$(BIN): $(ALAC_LIB)
$(CC) [email protected] -o $@ $(CFLAGS)
$(ALAC_LIB) : $(OBJS)
@mkdir -p $(LIB_DIR)
$(AR) -r $(LIB_DIR)/$@ $^
libalac$(SO_EXT): $(OBJS)
@mkdir -p $(LIB_DIR)
$(CC) $(SO_LDFLAGS) $< -o $(LIB_DIR)/$@
ln -sf $@ $(LIB_DIR)/libalac.$(SOX)
alac.o : alac.c
$(CC) -c $< -o $@ $(CFLAGS)