blob: 5a3446094bd1ae37bdd1484f6e652e2c1e879b28 [file] [log] [blame]
b.liu3743bce2024-03-22 19:27:58 +08001BUILD_ROOT = $(shell pwd)/..
2include $(BUILD_ROOT)/Make.defines
b.liu5fa9e772023-11-23 18:00:55 +08003
b.liu9a306862024-03-06 16:49:40 +08004LOCAL_PATH=$(BUILD_ROOT)/libql_lib
b.liu5fa9e772023-11-23 18:00:55 +08005
b.liu9a306862024-03-06 16:49:40 +08006INC_DIR +=
b.liu1c1c7212023-12-22 16:35:27 +08007
b.liu5fa9e772023-11-23 18:00:55 +08008LIB_DIR +=
9
b.liu9a306862024-03-06 16:49:40 +080010LIBS += -llog -lubus -lubox -lblobmsg_json -lrilutil -lmbtk_lib -lmbtk_ril -lmbtk_fota -lmbtk_http -lmbtk_factory -lmbtk_audio
b.liu5fa9e772023-11-23 18:00:55 +080011
12CFLAGS += -shared -Wl,-shared,-Bsymbolic
13
14DEFINE +=
15
16MY_FILES_PATH:=$(LOCAL_PATH)/src
17#ifeq ($(CONFIG_MBTK_QL_SUPPORT),y)
18#MY_FILES_PATH += $(LOCAL_PATH)/ql
19#endif
20
21#ifeq ($(CONFIG_MBTK_PLATFORM),linux)
22#MY_FILES_PATH += $(LOCAL_PATH)/platform/linux
23#endif
24
25#MY_FILES_SUFFIX:=%.c %.cpp
26#My_All_Files := $(foreach src_path,$(MY_FILES_PATH), $(shell find "$(src_path)" -type f))
27#MY_SRC_LIST := $(filter $(MY_FILES_SUFFIX),$(My_All_Files))
28#MY_SRC_LIST := $(MY_SRC_LIST:$(LOCAL_PATH)/%=%)
29
30LOCAL_SRC_FILES = $(wildcard src/*.c) $(wildcard src/*.cpp)
31$(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES))
32
33OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES)))
34$(info OBJS = $(OBJS))
35
b.liu9a306862024-03-06 16:49:40 +080036dtarget := $(OUT_DIR)/lib/libql_lib.so
b.liu5fa9e772023-11-23 18:00:55 +080037
38all: $(dtarget)
39
40$(dtarget): $(OBJS)
41 $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $(OBJS) -o $@
42
43%.o:%.c
44 $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
b.liu1c1c7212023-12-22 16:35:27 +080045
b.liu5fa9e772023-11-23 18:00:55 +080046%.o:%.cpp
47 $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
48
49clean:
50 rm -f $(OBJS) $(dtarget)
51