This repository has been archived by the owner on Aug 28, 2018. It is now read-only.
forked from m13253/libllsm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
60 lines (47 loc) · 1.89 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
CC = gcc
LINK = gcc -fopenmp
AR = ar
CFLAGS = -Ofast -std=c99 -Wall -fPIC -fopenmp
ARFLAGS = -rv
OUT_DIR = ./build
OBJS = $(OUT_DIR)/fftsg_h.o $(OUT_DIR)/math-funcs.o $(OUT_DIR)/llsm.o $(OUT_DIR)/envelope.o
LIBS =
LIBPYIN = external/libpyin
LIBGVPS = $(LIBPYIN)/external/libgvps
default: $(OUT_DIR)/libllsm.a
test: $(OUT_DIR)/llsm-test
$(OUT_DIR)/llsm-test test/arctic_a0001.wav
testapprox: $(OUT_DIR)/check-approx
$(OUT_DIR)/check-approx
$(OUT_DIR)/llsm-test: $(OUT_DIR)/libllsm.a test/test.c external/matlabfunctions.c $(LIBGVPS)/build/libgvps.a $(LIBPYIN)/build/libpyin.a
$(LINK) $(CFLAGS) -o $(OUT_DIR)/llsm-test test/test.c external/matlabfunctions.c $(OUT_DIR)/libllsm.a $(LIBPYIN)/build/libpyin.a $(LIBGVPS)/build/libgvps.a -lm
$(OUT_DIR)/check-approx: $(OUT_DIR)/libllsm.a test/check-approx.c external/matlabfunctions.c
$(CC) $(CFLAGS) -o $(OUT_DIR)/check-approx test/check-approx.c external/matlabfunctions.c $(OUT_DIR)/libllsm.a -lm
$(LIBGVPS)/build/libgvps.a:
cd $(LIBGVPS); mkdir -p build; make
$(LIBPYIN)/build/libpyin.a: $(LIBGVPS)//build/libgvps.a
cd $(LIBPYIN); mkdir -p build; make
$(OUT_DIR)/libllsm.a: $(OBJS)
$(AR) $(ARFLAGS) $(OUT_DIR)/libllsm.a $(OBJS) $(LIBS)
@echo Done.
$(OUT_DIR)/math-funcs.o : math-funcs.c math-funcs.h common.h
$(OUT_DIR)/llsm.o : llsm.c llsm.h envelope.h math-funcs.h common.h
$(OUT_DIR)/envelope.o : envelope.c envelope.h math-funcs.h common.h
$(OUT_DIR)/fftsg_h.o : external/fftsg_h.c
mkdir -p build
$(CC) $(CFLAGS) -o $(OUT_DIR)/fftsg_h.o -c external/fftsg_h.c
$(OUT_DIR)/%.o : %.c
mkdir -p build
$(CC) $(CFLAGS) -o $(OUT_DIR)/$*.o -c $*.c
install: $(OUT_DIR)/libllsm.a
cp $(OUT_DIR)/libllsm.a /usr/lib/
cp llsm.h /usr/include/
@echo Done.
clean:
@echo 'Removing all temporary binaries... '
@rm -f $(OUT_DIR)/libllsm.a $(OUT_DIR)/*.o
@echo Done.
clear:
@echo 'Removing all temporary binaries... '
@rm -f $(OUT_DIR)/libllsm.a $(OUT_DIR)/*.o
@echo Done.