blob: 339640044dbfd3cb331bf1b70fffc93c3bfd24ca [file] [log] [blame]
b.liu9a306862024-03-06 16:49:40 +08001ROOT = $(shell pwd)/../..
2include ../Make.defines
3
4LOCAL_PATH=$(BUILD_ROOT)/libmbtk_tcpip
5
6INC_DIR +=
7
8LIB_DIR +=
9
10LIBS += -llog -lmbtk_lib -lmbtk_net
11
12CFLAGS += -shared -Wl,-shared,-Bsymbolic
13
14MY_FILES_PATH:=$(LOCAL_PATH)
15MY_FILES_SUFFIX:=%.c %.cpp
16My_All_Files := $(foreach src_path,$(MY_FILES_PATH), $(shell find "$(src_path)" -type f))
17MY_SRC_LIST := $(filter $(MY_FILES_SUFFIX),$(My_All_Files))
18MY_SRC_LIST := $(MY_SRC_LIST:$(LOCAL_PATH)/%=%)
19LOCAL_SRC_FILES += $(MY_SRC_LIST)
20
21OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES)))
22$(info OBJS = $(OBJS))
23
24dtarget := $(OUT_DIR)/lib/libmbtk_tcpip.so
25
26all: $(dtarget)
27
28$(dtarget):$(OBJS)
29 $(CC) $(CFLAGS) $(DEFINE) $(LIB_DIR) $(LIBS) $(OBJS) -o $@
30
31%.o:%.c
32 $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
33
34%.o:%.cpp
35 $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
36
37clean:
38 rm -f $(OBJS) $(dtarget)
39