1# Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13ifneq ($(GEN_SDK_LIB_SERVICE),1) 14 15LIB_NAME := libservices 16obj-y := 17ifeq ($(SDK),1) 18obj-y += $(LIB_NAME).a 19else 20ifeq ($(WIFI_APP_SUPPORT),1) 21src_obj := wifi_app/ 22$(LIB_NAME)-y := $(src_obj) 23obj-y += $(LIB_NAME).a 24endif 25endif 26 27ifeq ($(BT_CLOSE),1) 28ifeq ($(WIFI_RF_TEST_ONLY),1) 29ifeq ($(ROM_BUILD),1) 30obj-y += ../utils/crc32/ ../utils/crc16/ ../utils/heap/ 31else 32obj-y += ../utils/crc32/ ../utils/crc16/ ../utils/heap/ norflash_api/ overlay/ 33endif 34else 35obj-y += audio_dump/ audioflinger/ audio_process/ hw_dsp/ resources/ voice_dev/ \ 36 ../utils/crc32/ ../utils/crc16/ ../utils/heap/ norflash_api/ overlay/ 37endif 38else 39obj-y += audio_dump/ \ 40 audioflinger/ \ 41 audio_process/ \ 42 hw_dsp/ \ 43 voice_dev/ \ 44 bt_app/ \ 45 overlay/ \ 46 resources/ \ 47 ../utils/crc32/ \ 48 ../utils/crc16/ \ 49 ../utils/heap/ \ 50 osif/ \ 51 norflash_api/ 52 53ifeq ($(AI_VOICE),1) 54obj-y += app_ai/ 55endif 56 57endif 58 59ifeq ($(HISTREAMER_HTTP_EN), 1) 60obj-y += histreamer_http/ 61endif 62 63ifeq ($(BT_SOURCE),1) 64obj-y += app_bt_source/ 65endif 66 67ifeq ($(SPEECH_BONE_SENSOR),1) 68obj-y += bone_sensor/ 69endif 70 71ifneq ($(filter 1,$(INTERCONNECTION) $(INTERACTION) $(AI_VOICE)),) 72obj-y += interconnection/ 73endif 74 75ifneq ($(BT_CLOSE),1) 76obj-y += bt_profiles_enhanced/ 77obj-y += bt_if_enhanced/ 78endif 79ifeq ($(MBED),1) 80obj-y += fs/ 81endif 82 83#ifneq ($(filter 1, $(MBED) $(AI_VOICE) $(TOTA_v2)),) 84obj-y +=../utils/kfifo/ 85#endif 86 87ifeq ($(UTILS_INTERSYSHCI),1) 88obj-y +=../utils/intersyshci/ 89endif 90 91ifeq ($(UTILS_BES_KV),1) 92obj-y +=../utils/bes_kv/ 93endif 94 95ifeq ($(VOICE_DATAPATH_ENABLED),1) 96obj-y += voicepath/ 97obj-y += voicepath/$(VOICE_DATAPATH_TYPE)/ 98endif 99 100ifneq ($(BT_CLOSE),1) 101ifneq ($(filter 1, $(VOICE_DATAPATH_ENABLED) $(AI_VOICE)),) 102obj-y += app_ai/ 103endif 104endif 105 106ifneq ($(BT_CLOSE),1) 107ifeq ($(BLE),1) 108ifeq ($(BLE_V2),1) 109obj-y += \ 110 ble_app_v2/ \ 111 bridge/ \ 112 ble_stack_v2/ \ 113 ../utils/retention_ram/ \ 114 ble_profiles_v2/ 115 116ifeq ($(BLE_AOB_UX_ENABLED),1) 117obj-y += aob_core/ 118endif 119 120ifeq ($(BLE_AUDIO_ENABLED),1) 121obj-y += ble_audio_app/ 122endif 123 124ifneq ($(IBRT_CORE_V2),1) 125obj-y += ../utils/hsm/ 126endif 127 128else 129obj-y += \ 130 ble_app/ \ 131 bridge/ \ 132 ble_stack/ \ 133 ../utils/retention_ram/ \ 134 ble_profiles/ 135 136endif 137endif 138endif 139 140ifeq ($(AUTO_TEST),1) 141obj-y += auto_test/ 142endif 143 144obj-y += nv_section/ 145 146ifeq ($(SYS_TIME_SUPPORT),1) 147obj-y += sys_time/ 148endif 149 150ifneq ($(FPGA),1) 151ifneq ($(WIFI_RF_TEST_ONLY),1) 152ifneq ($(ROM_BUILD),1) 153obj-y += nvrecord/ 154endif 155endif 156endif 157 158ifeq ($(VOICE_RECOGNITION),1) 159obj-y += voice_recognition/ 160endif 161 162ifeq ($(APP_ANC_TEST),1) 163obj-y += anc_spp_tool/ 164endif 165 166ifeq ($(TEST_OVER_THE_AIR),1) 167obj-y += tota/ 168endif 169 170ifeq ($(TEST_OVER_THE_AIR_v2),1) 171obj-y += tota_v2/ 172endif 173 174ifneq ($(filter 1, $(BES_OTA) $(AI_OTA) $(GMA_VOICE)),) 175ifeq ($(FPGA_IBRT_OTA),1) 176obj-y += fpga_ibrt_ota/ 177else 178obj-y += ota/ 179endif 180endif 181 182ifneq ($(filter 1, $(BES_OTA) $(AI_OTA) $(BES_OTA_BASIC)),) 183ifeq ($(IBRT_OTA),1) 184ifeq ($(FPGA_IBRT_OTA),1) 185obj-y += fpga_ibrt_ota/ 186else 187obj-y += ibrt_ota/ 188endif 189 190else 191obj-y += ota/ 192endif 193endif 194 195ifeq ($(TILE_DATAPATH_ENABLED),1) 196obj-y += ../thirdparty/tile/ 197endif 198 199ifeq ($(AI_VOICE),1) 200obj-y += ai_voice/ \ 201 ../utils/crc16/ 202endif 203 204ifeq ($(CHIP_HAS_CP),1) 205obj-y += cp_boot/ 206ifeq ($(CP_ENABLE),1) 207obj-y += cp_server/ 208endif 209ifeq ($(CP_DSP),1) 210obj-y += cp_dsp/ 211endif 212endif 213 214ifeq ($(MCU_DSP),1) 215obj-y += mcu_dsp/ 216endif 217 218ifeq ($(IBRT),1) 219 220ifeq ($(IBRT_UI_V1),1) 221obj-y += ibrt_core/ 222obj-y += app_ibrt/ 223obj-y += ibrt_ui/ 224endif 225 226ifeq ($(IBRT_CORE_V2),1) 227obj-y += ../utils/hsm/ 228obj-y += app_ibrt_v2/ 229obj-y += ibrt_core_v2/ 230obj-y += custom_api/ 231endif 232 233ifeq ($(IBRT_UI_V2),1) 234obj-y += ibrt_ui_v2/ 235endif 236 237endif 238 239ifeq ($(TWS_SYSTEM_ENABLED),1) 240obj-y += ibrt_middleware/ 241endif 242 243ifeq ($(RSA_SHA),1) 244obj-y +=../utils/sha256/ ../utils/rsa2048/ 245endif 246 247ifeq ($(AES256_FOR_BIN),1) 248obj-y +=../utils/aes256/ 249endif 250 251obj-y += communication/ 252 253 254ifeq ($(RPC_SUPPORT),1) 255obj-y += rpc/ 256endif 257 258ifeq ($(THROUGH_PUT),1) 259obj-y += through_put/ 260endif 261 262ifeq ($(EPLAYER_ON),1) 263obj-y += eplayer/eplayer/ 264ifeq ($(EPLAYER_TEST),1) 265obj-y += eplayer/tests/ 266endif 267endif 268 269ifeq ($(ETRANSPORT_ON),1) 270obj-y += etransport/ 271endif 272 273ifeq ($(ECOMM_ON),1) 274obj-y += ecomm/ 275endif 276 277ifeq ($(EAUDIO_ON),1) 278obj-y += eaudio/ 279obj-y += eaudio/device/ 280obj-y += eaudio/policy/ 281obj-y += eaudio/effect/ 282obj-y += eaudio/resample/ 283obj-y += eaudio/heap/ 284ifeq ($(EAUDIO_TEST),1) 285obj-y += eaudio/tests/ 286endif 287endif 288 289ifeq ($(A7_DSP_ENABLE),1) 290obj-y += a7_dsp/ 291obj-y += transq_msg/ 292endif 293 294ifeq ($(USE_BT_SERVICE_ADAPTER),1) 295obj-y += bt_service/ 296endif 297 298ifneq ($(BT_CLOSE),1) 299ifeq ($(USE_BT_ADAPTER),1) 300obj-y += bluetooth_adapter/ 301endif 302endif 303 304ifeq ($(LPLAYER_EN),1) 305obj-y += lplayer/ 306endif 307 308ifeq ($(MINI_WAV_PLAYER_EN),1) 309obj-y += lplayer/mini/ 310endif 311 312ifeq ($(LINEIN_TRANS_ON),1) 313obj-y += besaud_service/ 314endif 315 316else 317 318 319cur_dir := $(dir $(lastword $(MAKEFILE_LIST))) 320 321LIB_NAME := libservices 322obj-y := 323 324ifneq ($(SDK),1) 325 326ifeq ($(BT_CLOSE),1) 327src_obj := hw_dsp/ resources/ voice_dev/ \ 328 ../utils/crc32/ ../utils/crc16/ ../utils/heap/ overlay/ 329else 330src_obj := \ 331 hw_dsp/ \ 332 voice_dev/ \ 333 bt_app/ \ 334 overlay/ \ 335 resources/ \ 336 ../utils/crc32/ \ 337 ../utils/crc16/ \ 338 ../utils/heap/ \ 339 osif/ 340 341ifeq ($(AI_VOICE),1) 342src_obj += app_ai/ 343endif 344endif 345 346ifneq ($(NUTTX_BUILD),1) 347src_obj += audioflinger/ audio_process/ norflash_api/ audio_dump/ 348endif 349 350ifeq ($(BT_SOURCE),1) 351src_obj += app_bt_source/ 352endif 353 354ifeq ($(BONE_SENSOR_TDM),1) 355src_obj += bone_sensor/ 356endif 357 358ifneq ($(filter 1,$(INTERCONNECTION) $(INTERACTION) $(AI_VOICE)),) 359src_obj += interconnection/ 360endif 361ifneq ($(BT_CLOSE),1) 362src_obj += bt_profiles_enhanced/ 363src_obj += bt_if_enhanced/ 364endif 365ifeq ($(MBED),1) 366src_obj += fs/ 367endif 368 369ifeq ($(SERVICE_ONE_LIB),1) 370src_obj += multimedia/ 371endif 372 373#ifneq ($(MBED)_$(AI_VOICE),0_0) 374src_obj +=../utils/kfifo/ 375#endif 376 377ifeq ($(UTILS_INTERSYSHCI),1) 378src_obj +=../utils/intersyshci/ 379endif 380 381ifeq ($(UTILS_BES_KV),1) 382src_obj +=../utils/bes_kv/ 383endif 384 385ifeq ($(VOICE_DATAPATH_ENABLED),1) 386src_obj += voicepath/ 387src_obj += voicepath/$(VOICE_DATAPATH_TYPE)/ 388endif 389 390ifneq ($(BT_CLOSE),1) 391ifeq ($(BLE),1) 392ifeq ($(BLE_V2),1) 393src_obj += ble_app_v2/ \ 394 bridge/ \ 395 ble_stack_v2/ \ 396 ../utils/retention_ram/ \ 397 ble_profiles_v2/ 398 399ifeq ($(BLE_AOB_UX_ENABLED),1) 400src_obj += ble_audio_mgr/ 401endif 402 403ifeq ($(BLE_AUDIO_ENABLED),1) 404src_obj += ble_audio_app/ 405endif 406 407ifneq ($(IBRT_CORE_V2),1) 408src_obj += ../utils/hsm/ 409endif 410 411else 412src_obj += ble_app/ \ 413 bridge/ \ 414 ble_stack/ \ 415 ../utils/retention_ram/ \ 416 ble_profiles/ 417 418endif 419 420endif 421endif 422 423ifeq ($(AUTO_TEST),1) 424src_obj += auto_test/ 425endif 426 427ifneq ($(NUTTX_BUILD),1) 428src_obj += nv_section/ 429endif 430 431ifeq ($(SYS_TIME_SUPPORT),1) 432src_obj += sys_time/ 433endif 434 435ifneq ($(FPGA),1) 436ifneq ($(NUTTX_BUILD),1) 437src_obj += nvrecord/ 438endif 439endif 440 441ifeq ($(VOICE_RECOGNITION),1) 442src_obj+= voice_recognition/ 443endif 444 445ifeq ($(APP_ANC_TEST),1) 446src_obj += anc_spp_tool/ 447endif 448 449ifeq ($(TEST_OVER_THE_AIR),1) 450src_obj += tota/ 451endif 452 453ifeq ($(TEST_OVER_THE_AIR_v2),1) 454src_obj += tota_v2/ 455endif 456 457ifneq ($(filter 1, $(BES_OTA) $(AI_OTA) $(BES_OTA_BASIC)),) 458ifeq ($(FPGA_IBRT_OTA),1) 459src_obj += fpga_ibrt_ota/ 460else 461src_obj += ota/ 462endif 463endif 464 465ifeq ($(TILE_DATAPATH_ENABLED),1) 466src_obj += ../thirdparty/tile/ 467endif 468 469ifeq ($(AI_VOICE),1) 470src_obj += ai_voice/ 471endif 472 473 474ifeq ($(IBRT),1) 475 476ifeq ($(IBRT_UI_V1),1) 477src_obj += ibrt_core/ 478src_obj += app_ibrt/ 479src_obj += ibrt_ui/ 480endif 481 482ifeq ($(IBRT_CORE_V2),1) 483src_obj += ../utils/hsm/ 484src_obj += app_ibrt_v2/ 485src_obj += ibrt_core_v2/ 486src_obj += custom_api/ 487endif 488 489ifeq ($(IBRT_UI_V2),1) 490src_obj += ibrt_ui_v2/ 491endif 492 493endif 494 495ifeq ($(TWS_SYSTEM_ENABLED),1) 496src_obj += ibrt_middleware/ 497endif 498 499ifneq ($(NUTTX_BUILD),1) 500ifeq ($(CHIP_HAS_CP),1) 501src_obj += cp_boot/ 502ifeq ($(CP_ENABLE),1) 503src_obj += cp_server/ 504endif 505ifeq ($(CP_DSP),1) 506src_obj += cp_dsp/ 507endif 508endif 509endif 510 511ifeq ($(MCU_DSP),1) 512src_obj += mcu_dsp/ 513endif 514 515ifeq ($(LPLAYER_EN),1) 516src_obj += lplayer/ 517endif 518 519ifeq ($(MINI_WAV_PLAYER_EN),1) 520src_obj += lplayer/mini/ 521endif 522 523ifeq ($(RSA_SHA),1) 524src_obj +=../utils/sha256/ ../utils/rsa2048/ 525endif 526 527ifeq ($(AES256_FOR_BIN),1) 528src_obj +=../utils/aes256/ 529endif 530 531src_obj += communication/ 532 533 534ifeq ($(RPC_SUPPORT),1) 535src_obj += rpc/ 536endif 537 538ifeq ($(THROUGH_PUT),1) 539src_obj += through_put/ 540endif 541 542 543ifeq ($(EPLAYER_ON),1) 544src_obj += eplayer/eplayer/ 545ifeq ($(EPLAYER_TEST),1) 546src_obj += eplayer/tests/ 547endif 548endif 549 550ifeq ($(ETRANSPORT_ON),1) 551src_obj += etransport/ 552endif 553 554ifeq ($(ECOMM_ON),1) 555src_obj += ecomm/ 556endif 557 558 559ifeq ($(EAUDIO_ON),1) 560src_obj += eaudio/ 561src_obj += eaudio/device/ 562src_obj += eaudio/policy/ 563src_obj += eaudio/effect/ 564src_obj += eaudio/resample/ 565src_obj += eaudio/heap/ 566ifeq ($(EAUDIO_TEST),1) 567src_obj += eaudio/tests/ 568endif 569endif 570 571ifneq ($(NUTTX_BUILD),1) 572ifeq ($(WIFI_APP_SUPPORT),1) 573src_obj += wifi_app/ 574endif 575endif 576 577ifeq ($(A7_DSP_ENABLE),1) 578 579ifeq ($(A7_INTO_LIB),1) 580src_obj += a7_dsp/ 581endif 582src_obj += transq_msg/ 583 584endif 585 586ifeq ($(USE_BT_SERVICE_ADAPTER),1) 587src_obj += bt_service/ 588endif 589 590ifeq ($(USE_BT_ADAPTER),1) 591src_obj += bluetooth_adapter/ 592endif 593 594$(LIB_NAME)-y := $(src_obj) 595endif 596 597obj-y := 598 599ifeq ($(A7_DSP_ENABLE),1) 600obj-y += a7_dsp/ 601endif 602 603obj-y += $(LIB_NAME).a 604endif 605 606ccflags-y += \ 607 -Inet/wifi/ \ 608 -Iservices/wifi_app/ \ 609 -Iservices/wifi_app/wifi_console/ \ 610 -Inet/mbedtls/include \ 611 -Inet/mbedtls/include/mbedtls \ 612 613ifeq ($(WIFI_APP_SUPPORT),1) 614obj-y += wifi_app/wifiapp.o 615endif 616 617export REL_AT_C ?= 0 618ifeq ($(REL_AT_C),1) 619 620obj-y += wifi_app/wifi_console/at.o 621 622ccflags-y += \ 623 -Iservices/wifi_app/ping/ \ 624 -Iservices/nv_section/factory_section/ \ 625 -Iservices/wifi_app/iperf/ \ 626 -Iplatform/drivers/wifi/ \ 627 -Inet/wpa_supplicant_l/src/utils/ \ 628 -Inet/utils/ \ 629 -Iservices/wifi_app/sniffer/ \ 630 -Iservices/wifi_app/bes_airkiss/ \ 631 -Inv_section/factory_section/ \ 632 -Iservices/nv_section/factory_section/ \ 633 -Iutils/hexdump/ \ 634 -Inet/core/ \ 635 -Iservices/wifi_app/wifi_socket/ \ 636 -Iplatform/hal/$(CHIP)/ \ 637 -Iplatform/drivers/ana/ \ 638 -Iservices/a7_dsp/common/ \ 639 -Iutils/ocd/ \ 640 -Iservices/lplayer/interface/include/ \ 641 -Iservices/lplayer/interface/include/ \ 642 -Iservices/lplayer/component/audio_sink/include/ \ 643 -Iservices/lplayer/component/include/ \ 644 -Iservices/wifi_app/alsa_adapter/ 645endif 646 647ifeq ($(PCM_AUDIO_INSTANCE_ENABLE),1) 648ccflags-y += -Iservices/a7_dsp/os/test/pcm_audio_instance/ 649endif 650 651ifeq ($(SPEECH_MSG_TEST_CASE),1) 652ccflags-y += -Iservices/a7_dsp/os/test/speech_msg_test/ 653endif 654 655