blob: 42190be4a5950a4f2db671e1c57187c5cdc50754 [file] [log] [blame]
#
# Marvell audio libacm Makefile
#
#
include $(TOPDIR)/.config
include $(BUILDROOT)/rules.make
PLATFORM_SDK_VERSION = 1.0
LOCAL_PATH=$(PXA_LIBACM_DIR)/acm
#stub must be last
LOCAL_C_INCLUDES += \
-I$(AUDIO_GEN_INCLUDE)/stub \
-I$(MRVLDIR)/services/android_wrapper/log \
-I$(MRVLDIR)/lte-telephony/apps/libdiag/include \
-I$(MRVLDIR)/lte-telephony/apps/aud_sw/vcm_ipc \
-I$(MRVLDIR)/services/audio/libaudio-apu
LOCAL_SRC_FILES:= \
src/acm_aph.c \
src/acm_api.c \
src/acm_i2c_adaptor.c \
src/acm_record_mode.c \
src/acm_log.c \
src/audio_pa.c
LOCAL_CFLAGS := \
-Wno-format-security \
-DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
-D_POSIX_SOURCE
LOCAL_CFLAGS += -DACM_ALSA_INIT
# DEBUG: logger: USE_LOGCAT or/and USE_ACM_LOG or nothing
LOCAL_CFLAGS += -DUSE_LOGCAT
# Refer acm_debug.h for deep-debug
ifeq ($(strip $(BOARD_USES_GPIO_SPKR_SWITCH)),true)
LOCAL_CFLAGS += -DWITH_GPIO_SPKR_SWITCH
LOCAL_SRC_FILES += src/acm_gpio.c
ifneq ($(BOARD_GPIO_SPKR_SWITCH_PATH),)
LOCAL_CFLAGS += -DGPIO_SPKR_SWITCH_PATH=\"$(BOARD_GPIO_SPKR_SWITCH_PATH)\"
endif
endif
#ifeq ($(strip $(BOARD_AUDIO_COMPONENT_CODEC)),ELBA)
# LOCAL_CFLAGS += -DCODEC_ELBA
# LOCAL_SRC_FILES += src/acm_elba.c
#else ifeq ($(strip $(BOARD_AUDIO_COMPONENT_CODEC)),GELATO)
# LOCAL_CFLAGS += -DCODEC_GELATO
# LOCAL_SRC_FILES += src/acm_gelato.c
#endif
#ifeq ($(strip $(BOARD_AUDIO_COMPONENT_PMIC)),USTICA)
# LOCAL_CFLAGS += -DPMIC_USTICA
# LOCAL_SRC_FILES += src/acm_ustica.c
#else ifeq ($(strip $(BOARD_AUDIO_COMPONENT_PMIC)),PIANOSA)
# LOCAL_CFLAGS += -DPMIC_PIANOSA
# LOCAL_SRC_FILES += src/acm_pianosa.c
#endif
ifeq ($(CONFIG_KERNEL_CODEC_PM812),y)
LOCAL_CFLAGS += -DCODEC_ELBA
LOCAL_SRC_FILES += src/acm_elba.c
LOCAL_CFLAGS += -DPMIC_USTICA
LOCAL_SRC_FILES += src/acm_ustica.c
endif
ifeq ($(CONFIG_KERNEL_CODEC_PM805),y)
LOCAL_CFLAGS += -DCODEC_ELBA
LOCAL_SRC_FILES += src/acm_elba.c
endif
ifeq ($(CONFIG_KERNEL_CODEC_NAU8810),y)
LOCAL_CFLAGS += -DCODEC_NAU8810_HANDLE
LOCAL_SRC_FILES += src/acm_nau8810_handle.c
endif
ifeq ($(CONFIG_KERNEL_CODEC_ALC5616),y)
LOCAL_CFLAGS += -DCODEC_ALC5616_HANDLE -DCODEC_ALC5616
LOCAL_SRC_FILES += src/acm_alc5616_handle.c
endif
ifeq ($(CONFIG_KERNEL_MODEM_AUDIO_INTERNAL_CODEC),y)
LOCAL_CFLAGS += -DINTERNAL_CODEC
endif
ifeq ($(CONFIG_TARGET_mmp_asr1901_KSTR901),y)
LOCAL_CFLAGS += -DTARGET_mmp_asr1901_KSTR901
LOCAL_SRC_FILES += src/audio_dsp.c
endif
ifeq ($(CONFIG_TARGET_mmp_asr1906_KSTRZ906),y)
LOCAL_CFLAGS += -DTARGET_mmp_asr1901_KSTR901
LOCAL_SRC_FILES += src/audio_dsp.c
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_48KHz),y)
LOCAL_CFLAGS += -DCODEC_PCM_48KHz
endif
ifeq ($(BOARD_ENABLE_AUDIO_CALIBRATION),true)
ifneq ($(BOARD_AUDIO_CALIBRATION_DIR),)
LOCAL_CFLAGS += -DAUDIO_CALIBRATION_DIR=\"$(BOARD_AUDIO_CALIBRATION_DIR)\"
endif
LOCAL_CFLAGS += -DWITH_AUDIO_CALIBRATION
LOCAL_SRC_FILES += src/ac_thread.c
LOCAL_C_INCLUDES += -I$(LOCAL_PATH)/inc
ifeq ($(BOARD_ENABLE_BLUETOOTH_NREC),true)
LOCAL_CFLAGS += -DWITH_NREC
endif
ifeq ($(BOARD_ENABLE_LOOPBACK),true)
LOCAL_CFLAGS += -DWITH_LOOPBACK
endif
ifeq ($(BOARD_USES_DMIC),true)
LOCAL_CFLAGS += -DWITH_DMIC
endif
ifeq ($(BOARD_USES_MIC1),true)
LOCAL_CFLAGS += -DWITH_MIC1
endif
ifeq ($(BOARD_USES_MIC2),true)
LOCAL_CFLAGS += -DWITH_MIC2
endif
ifeq ($(BOARD_WITH_STEREO_SPKR),true)
LOCAL_CFLAGS += -DWITH_STEREO_SPKR
endif
ifeq ($(BOARD_CODEC_HIFI_SLAVE),true)
LOCAL_CFLAGS += -DCODEC_HIFI_SLAVE
endif
ifeq ($(BOARD_CODEC_VC_SLAVE),true)
LOCAL_CFLAGS += -DCODEC_VC_SLAVE
endif
ifeq ($(BOARD_CODEC_FM_SLAVE),true)
LOCAL_CFLAGS += -DCODEC_FM_SLAVE
endif
ifeq ($(BOARD_CODEC_WB_RATE),true)
LOCAL_CFLAGS += -DCODEC_WB_RATE
endif
ifeq ($(BOARD_ENABLE_SIDETONE),true)
LOCAL_CFLAGS += -DWITH_SIDETONE
endif
endif
$(eval $(call define-local-build-dir, objs_libacm))
dtarget := $(PXA_TARGET_OLIB)/libacm.so
build: $(dtarget)
LIBS :=
ifneq ($(PROPERTY_AUDIO_CODEC),)
LIBS += -lprop2uci
endif
#LIBS += -lxml2 -ltinyalsa -llog -lpthread -lcrypto
LIBS += -ltinyalsa -llog -lpthread
CFLAGS += $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS)
$(eval $(call add-many-objects-rule, libacm_src, $(LOCAL_SRC_FILES),,))
$(dtarget): $(libacm_src_oo) alwayslink
@echo " SO $@"
$(MRVL_HIDE)$(CC) $(CFLAGS) $(SHAREDOBJFLAGS) \
-o $@ $(libacm_src_oo) $(PXA_LD_FLAGS) $(LIBS)
$(call copy_elf,$(dtarget),lib)
install:
clean:
$(call clean_target, $(dtarget), lib)
# rm -rf $(LOCAL_BUILD_DIR)
rm -ff $(dtarget)
ifeq "$(filter clean ,$(MAKECMDGOALS))" ""
-include $(libacm_src_dd)
endif