blob: bbf1198b61f6b0755500957e33cc7efe56ae5435 [file] [log] [blame]
BUILD_ROOT = $(shell pwd)/..
include $(BUILD_ROOT)/Make.defines
LOCAL_PATH=$(BUILD_ROOT)/libmbtk_net
INC_DIR +=
LIB_DIR +=
LIBS += -llog -lmbtk_lib -lprop2uci
ifeq ($(BUILD_PLATFORM), master)
LIBS += -lpolarssl
else
LIBS += -lssl -lcrypto
endif
CFLAGS += -shared -Wl,-shared,-Bsymbolic
DEFINE += -DMBTK_NET_MONITOR_SUPPORT
MY_FILES_PATH:=$(LOCAL_PATH)
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)
OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES)))
$(info OBJS = $(OBJS))
dtarget := $(OUT_DIR)/lib/libmbtk_net.so
all: $(dtarget)
$(dtarget):$(OBJS)
$(CC) $(CFLAGS) $(DEFINE) $(LIB_DIR) $(LIBS) $(OBJS) -o $@
%.o:%.c
$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
%.o:%.cpp
$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
clean:
rm -f $(OBJS) $(dtarget)