blob: 3129978b4acd669879bfd642deca42b9ecf1da2c [file] [log] [blame]
BUILD_ROOT = $(shell pwd)/..
include $(BUILD_ROOT)/Make.defines
LOCAL_PATH=$(BUILD_ROOT)/libmbtk_lib
INC_DIR += \
-I$(LOCAL_PATH)/audio \
-I$(LOCAL_PATH)/coap \
-I$(LOCAL_PATH)/common \
-I$(LOCAL_PATH)/ecall \
-I$(LOCAL_PATH)/fota \
-I$(LOCAL_PATH)/ftp \
-I$(LOCAL_PATH)/gnss \
-I$(LOCAL_PATH)/http \
-I$(LOCAL_PATH)/mqtt \
-I$(LOCAL_PATH)/mqtt/MQTTPacket \
-I$(LOCAL_PATH)/net \
-I$(LOCAL_PATH)/tcpip \
-I$(LOCAL_PATH)/ril/inc \
-I$(LOCAL_PATH)/sleep \
-I$(LOCAL_PATH)/wifi \
-I$(BUILD_ROOT)/mbtk_rtpd/inc
LIB_DIR +=
LIBS += -llog -lubus -lubox -luci -lprop2uci -lrilutil -lblobmsg_json -ldl -lcutils -laudio-apu -lwpa_client
$(info SSL support)
#DEFINE += -DMBTK_MBEDTLS_V3_6_2_SUPPORT
#LIBS += -lmbedcrypto -lmbedtls -lmbedx509
DEFINE += -DMBTK_OPENSSL_V3_0_0_SUPPORT
LIBS += -lssl -lcrypto
CFLAGS += -Wno-error=unused-but-set-variable
ifeq ($(BUILD_LIB_TYPE), shared)
CFLAGS += -shared -Wl,-shared,-Bsymbolic
endif
DEFINE += -DMBTK_NET_MONITOR_SUPPORT
#MY_FILES_PATH:=$(LOCAL_PATH)/src
#ifeq ($(CONFIG_MBTK_QL_SUPPORT),y)
#MY_FILES_PATH += $(LOCAL_PATH)/ql
#endif
#ifeq ($(CONFIG_MBTK_PLATFORM),linux)
#MY_FILES_PATH += $(LOCAL_PATH)/platform/linux
#endif
#MY_FILES_SUFFIX:=%.c %.cpp
#My_All_Files := $(foreach src_path,$(MY_FILES_PATH), $(shell find "$(src_path)" -type f))
#MY_SRC_LIST := $(filter $(MY_FILES_SUFFIX),$(My_All_Files))
#MY_SRC_LIST := $(MY_SRC_LIST:$(LOCAL_PATH)/%=%)
#LOCAL_SRC_FILES += $(MY_SRC_LIST)
# common
# common/mbtk_debug.c
LOCAL_SRC_FILES = \
common/ds_ASBuffer.cpp \
common/ds_ASString.cpp \
common/mbtk_at.c \
common/mbtk_bs_position.c \
common/mbtk_file.c \
common/mbtk_list.c \
common/mbtk_log.c \
common/mbtk_map.c \
common/mbtk_ntp.c \
common/mbtk_queue.c \
common/mbtk_str.c \
common/mbtk_task.c \
common/mbtk_utf.c \
common/mbtk_utils.c \
common/ringbuffer.c \
common/mbtk_mtd.c \
common/mbtk_device_info.c \
common/mbtk_version.c \
common/mbtk_gpio.c \
common/mbtk_adc.c \
common/mbtk_loopbuff.c \
common/mbtk_oem_rw.c
ifeq ($(MBTK_SOURCE_VERSION), 2)
LOCAL_SRC_FILES += common/mbtk_led_control.c
endif
# audio
LOCAL_SRC_FILES += \
audio/mbtk_audio.c \
audio/mbtk_audio_gain.c \
audio/mbtk_pcm_stream.c \
audio/mbtk_wav.c \
audio/mbtk_audio_ubus.c
# rtp
LOCAL_SRC_FILES += \
rtp/mbtk_rtp.c
# coap
LOCAL_SRC_FILES += \
coap/mbtk_coap.c \
coap/mbtk_coap_api.cpp \
coap/mbtk_coap_pdu.cpp
# fota
LOCAL_SRC_FILES += \
fota/mbtk_fota.c
# gnss
LOCAL_SRC_FILES += \
gnss/mbtk_gnss.c
# net
LOCAL_SRC_FILES += \
net/mbtk_dhcp.c \
net/mbtk_ifc.c \
net/mbtk_net_control.c \
net/mbtk_mbedtls.c \
net/mbtk_openssl.c \
net/mbtk_sock.c \
net/mbtk_sock2.c
# ril
LOCAL_SRC_FILES += ril/mbtk_pdu_sms.c
ifeq ($(MBTK_SOURCE_VERSION), 2)
LOCAL_SRC_FILES += \
ril/v2/ril_utils.c \
ril/v2/mbtk_ril_api.c
else
LOCAL_SRC_FILES += \
ril/v1/mbtk_info.c \
ril/v1/mbtk_info_api.c
endif
# ftp
LOCAL_SRC_FILES += \
ftp/mbtk_ftp.c \
ftp/mbtk_ftp_at.c
# http
LOCAL_SRC_FILES += \
http/mbtk_http.c \
http/mbtk_http_base.c \
http/mbtk_http_chunks.c
# mqtt
LOCAL_SRC_FILES += \
mqtt/mbtk_mqtt.c \
mqtt/MQTTClient.c \
mqtt/MQTTLinux.c \
mqtt/MQTTPacket/core_sha1.c \
mqtt/MQTTPacket/core_sha256.c \
mqtt/MQTTPacket/MQTTConnectClient.c \
mqtt/MQTTPacket/MQTTConnectServer.c \
mqtt/MQTTPacket/MQTTDeserializePublish.c \
mqtt/MQTTPacket/MQTTFormat.c \
mqtt/MQTTPacket/MQTTPacket.c \
mqtt/MQTTPacket/MQTTSerializePublish.c \
mqtt/MQTTPacket/MQTTSubscribeClient.c \
mqtt/MQTTPacket/MQTTSubscribeServer.c \
mqtt/MQTTPacket/MQTTUnsubscribeClient.c \
mqtt/MQTTPacket/MQTTUnsubscribeServer.c
# tcpip
LOCAL_SRC_FILES += \
tcpip/mbtk_tcpip_at.c
# sleep
LOCAL_SRC_FILES += \
sleep/mbtk_sleep.c \
sleep/mbtk_lpm.c
#wifi
LOCAL_SRC_FILES += \
wifi/sta_cli.c \
wifi/sta_ctrl.c \
wifi/mbtk_wifi_ap.c
OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES)))
$(info OBJS = $(OBJS))
ifeq ($(BUILD_LIB_TYPE), shared)
dtarget := $(OUT_DIR)/lib/libmbtk_lib.so
else
dtarget := $(OUT_DIR)/lib/libmbtk_lib.a
endif
all: $(dtarget)
$(dtarget):$(OBJS)
$(CC) $(CFLAGS) $(DEFINE) $(LIB_DIR) $(LIBS) $(OBJS) -o $@
@cp -f wifi/libs/libwpa_client.so $(OUT_DIR)/lib
%.o:%.c
$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
%.o:%.cpp
$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
clean:
rm -f $(OBJS) $(dtarget)