1
2cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))
3
4obj_s := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.s))
5obj_c := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c))
6obj_cpp := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.cpp))
7
8obj-y := $(obj_c:.c=.o) $(obj_s:.S=.o) $(obj_cpp:.cpp=.o)
9
10ccflags-y := \
11	-Iservices/fs/fat \
12	-Iservices/fs/sd \
13	-Iservices/fs/fat/ChaN \
14	-Iutils/uarthci \
15	-Iutils/cqueue \
16	-Iplatform/drivers/codec  \
17	-Iservices/multimedia/audio/process/floatlimiter/include \
18	-Iplatform/drivers/ana
19
20ifneq ($(AF_STACK_SIZE),)
21CFLAGS_audioflinger.o += -DAF_STACK_SIZE=$(AF_STACK_SIZE)
22endif
23
24ifeq ($(AUDIO_CODEC_ASYNC_CLOSE),1)
25CFLAGS_audioflinger.o += -D__CODEC_ASYNC_CLOSE__
26endif
27
28ifeq ($(CODEC_PLAY_BEFORE_CAPTURE),1)
29CFLAGS_audioflinger.o += -DCODEC_PLAY_BEFORE_CAPTURE
30endif
31
32ifeq ($(AUDIO_OUTPUT_SMALL_GAIN_ATTN),1)
33CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_SMALL_GAIN_ATTN
34endif
35
36ifeq ($(AUDIO_OUTPUT_SW_GAIN),1)
37CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_SW_GAIN
38endif
39
40ifeq ($(AUDIO_OUTPUT_SW_LIMITER),1)
41CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_SW_LIMITER
42endif
43
44ifeq ($(ANC_APP),1)
45CFLAGS_audioflinger.o += -DANC_APP
46ifeq ($(CODEC_ANC_BOOST),1)
47CFLAGS_audioflinger.o += -DCODEC_ANC_BOOST
48endif
49endif
50
51ifeq ($(AUDIO_RESAMPLE),1)
52CFLAGS_audioflinger.o += -D__AUDIO_RESAMPLE__
53endif
54
55ifeq ($(AUDIO_OUTPUT_DC_CALIB),1)
56CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_DC_CALIB
57endif
58ifeq ($(AUDIO_OUTPUT_DC_CALIB_ANA),1)
59CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_DC_CALIB_ANA
60endif
61
62ifeq ($(AUDIO_OUTPUT_GAIN_M60DB_CHECK),1)
63CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_GAIN_M60DB_CHECK
64endif
65
66ifeq ($(CODEC_DSD),1)
67CFLAGS_audioflinger.o += -DCODEC_DSD
68endif
69
70ifeq ($(AUDIO_OUTPUT_INVERT_RIGHT_CHANNEL),1)
71CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_INVERT_RIGHT_CHANNEL
72endif
73
74ifeq ($(AUDIO_OUTPUT_INVERT_ALL_CHANNEL),1)
75CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_INVERT_ALL_CHANNEL
76endif
77
78ifeq ($(AUDIO_OUTPUT_CALIB_GAIN_MISSMATCH),1)
79CFLAGS_audioflinger.o += -DAUDIO_OUTPUT_CALIB_GAIN_MISSMATCH
80endif
81
82ifneq ($(CHIP_HAS_I2S),)
83CFLAGS_audioflinger.o += -DCHIP_HAS_I2S=$(CHIP_HAS_I2S)
84endif
85
86#-------------------------------
87# Audioflinger device selection
88#-------------------------------
89# Internal codec default on
90AF_DEVICE_INT_CODEC ?= 1
91
92# BT PCM default on for BT applications
93ifeq ($(RTOS),1)
94AF_DEVICE_BT_PCM ?= 1
95endif
96
97# Individual device macro
98ifeq ($(AF_DEVICE_EXT_CODEC),1)
99CFLAGS_audioflinger.o += -DAF_DEVICE_EXT_CODEC
100endif
101ifeq ($(AF_DEVICE_I2S),1)
102CFLAGS_audioflinger.o += -DAF_DEVICE_I2S
103endif
104ifeq ($(AF_DEVICE_TDM),1)
105CFLAGS_audioflinger.o += -DAF_DEVICE_TDM
106endif
107ifeq ($(AF_DEVICE_INT_CODEC),1)
108CFLAGS_audioflinger.o += -DAF_DEVICE_INT_CODEC
109endif
110ifeq ($(AF_DEVICE_SPDIF),1)
111CFLAGS_audioflinger.o += -DAF_DEVICE_SPDIF
112endif
113ifeq ($(AF_DEVICE_BT_PCM),1)
114CFLAGS_audioflinger.o += -DAF_DEVICE_BT_PCM
115endif
116ifeq ($(AF_DEVICE_DPD_RX),1)
117CFLAGS_audioflinger.o += -DAF_DEVICE_DPD_RX
118endif
119ifeq ($(AUDIO_ANC_FB_MC),1)
120CFLAGS_audioflinger.o += -DAF_DEVICE_MC
121endif
122
123#-------------------------------
124# End
125#-------------------------------
126
127