huangcm
2025-09-01 53d8e046ac1bf2ebe94f671983e3d3be059df91a
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
60
61
62
63
64
65
66
67
68
69
70
71
 
# define sources root directory before everything
SRC_ROOT := ../..
 
# change compiler and linker option before you include rule.mk
#
# link to libscript.a when you need to fetch configuration
# from test_script
#
#CFLAGS := $(CFLAGS) -g
LDFLAGS := -lscript -lpthread -lsalsa
 
# include rule.mk
include $(SRC_ROOT)/rule.mk
 
CFLAGS := $(CFLAGS) -I$(LIBDIR)/salsa-lib-0.0.22/src
 
tinyalsa_objs += \
   ./common/tinyalsa/pcm.o \
   ./common/tinyalsa/mixer.o
 
CFLAGS := $(CFLAGS) -I./common/tinyalsa/include
# add stdc++ lib and math lib
CFLAGS := $(CFLAGS) -lstdc++ -lm
audiotester_objs += \
   ./common/AudioFileContext.o \
   ./common/AudioPlayer.o \
   ./common/AudioRecorder.o \
   ./common/AudioRouter.o \
   ./common/FFT.o \
   ./common/common.o \
   LoopbackTester.o \
   PlayRecTester.o \
   AudioTester.o
 
# chip header file
ifeq ($(LICHEE_CHIP),sun50iw1p1)
CFLAGS := $(CFLAGS) -I./platform/sun50iw1p
endif
 
ifeq ($(LICHEE_CHIP),sun9iw1p1)
CFLAGS := $(CFLAGS) -I./platform/sun9iw1p
endif
 
ifeq ($(LICHEE_CHIP),sun8iw6p1)
CFLAGS := $(CFLAGS) -I./platform/sun8iw6p
endif
 
ifeq ($(LICHEE_CHIP),sun8iw5p1)
CFLAGS := $(CFLAGS) -I./platform/sun8iw5p
endif
 
# add your target(s) to all
.PHONY: all
all: audiotester
 
# define you target, the target will be output to dragonboard/output/bin
# directory
audiotester: $(tinyalsa_objs) $(audiotester_objs)
   $(LINK_MSG)
   $(LINKX)
 
# change 'example_objs' to your objects collection variable
$(tinyalsa_objs): %.o: %.c
   $(COMPILE_MSG)
   $(COMPILEX)
 
# change 'example_objs' to your objects collection variable
$(audiotester_objs): %.o: %.cpp
   $(COMPILE_MSG)
   $(COMPILEX)