LIBA_TARGET 		:= libmid.a

$(call Append_Conditional, LIB_SRCS_EXCLUDE, midware.c)
$(call Append_Conditional, SRCS_kk_midware, midware.c)
$(call Append_Conditional, TARGET, kk_midware)

CFLAGS 			+= -I$(TOP_DIR)/common/nanomsg/include
CFLAGS 			+= -I$(TOP_DIR)/common/ev/include
CFLAGS 			+= -I$(TOP_DIR)/common/api
CFLAGS 			+= -I$(TOP_DIR)/common/sqlite
CFLAGS 			+= -I$(TOP_DIR)/src/tsl/tsl_handle
LDFLAGS         += -lapi_com -liot_cjson -lkk_tsl
LDFLAGS         += -lm  -lkk_hal
LDFLAGS         += -lsqlite -ldl -lcurl

ifeq ($(CONFIG_MODEL),x86)
	LDFLAGS         += -L$(TOP_DIR)/common/nanomsg -lnanomsg_ubuntu -lanl
	LDFLAGS         += -L$(TOP_DIR)/common/ev  -lev_ubuntu  
else ifeq ($(CONFIG_MODEL),nx5)
	LDFLAGS         += -L$(TOP_DIR)/common/nanomsg -lnanomsg_nx5 -lanl
	LDFLAGS         += -L$(TOP_DIR)/common/ev  -lev_nx5  
else
	LDFLAGS         += -L$(TOP_DIR)/common/nanomsg -lnanomsg -lanl
	LDFLAGS         += -L$(TOP_DIR)/common/ev  -lev  	
endif