blob: e7566415746c6a9a78838b15b8cd45b909b0fceb [file] [log] [blame]
b.liu1c74d692024-08-14 17:43:59 +08001BUILD_ROOT = $(shell pwd)/..
2include $(BUILD_ROOT)/Make.defines
3
4LOCAL_PATH=$(BUILD_ROOT)/lynq_lib_v2
5
6INC_DIR +=
7
8LIB_DIR +=
9
10#LIBS += -llog -lmbtk_lib
11LIBS += -lmbtk_lib -lrilutil -lprop2uci -lmtel -laudio-apu -lcutils -ltinyalsa -lacm -llog -ljson-c -lblobmsg_json
12LIBS += -lmbtk_audio -lmbtk_ril -lmbtk_fota -lmbtk_factory -lmbtk_net -lmbtk_gnss
13
14CFLAGS += -shared -Wl,-shared,-Bsymbolic
15
16DEFINE +=
17
18MY_FILES_PATH:=$(LOCAL_PATH)/src
19#ifeq ($(CONFIG_MBTK_QL_SUPPORT),y)
20#MY_FILES_PATH += $(LOCAL_PATH)/ql
21#endif
22
23#ifeq ($(CONFIG_MBTK_PLATFORM),linux)
24#MY_FILES_PATH += $(LOCAL_PATH)/platform/linux
25#endif
26
27#LOCAL_SRC_FILES = $(wildcard src/*.c) $(wildcard src/*.cpp)
28LOCAL_SRC_FILES = src/lynq_adc.c \
29 src/lynq_alarm.c \
30 src/lynq_data_call.c \
31 src/lynq_fota.c \
32 src/lynq_gpio.c \
33 src/lynq_irq.c \
34 src/lynq_log.c \
35 src/lynq_net_light.c \
36 src/lynq_network.c \
37 src/lynq_sim.c \
38 src/lynq_sleep.c \
39 src/lynq_sms.c \
40 src/lynq_thermal.c \
41 src/lynq_time.c \
42 src/lynq_voice_call.c \
43 src/lynq_chip_id.c \
44 src/lynq_gnss.c
45
46ifeq ($(BUILD_PLATFORM), v2102)
47LOCAL_SRC_FILES += src/lynq_audio.c
48endif
49
50OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES)))
51$(info OBJS = $(OBJS))
52
53dtarget := $(OUT_DIR)/lib/liblynq_lib.so
54
55all: $(dtarget)
56
57$(dtarget): $(OBJS)
58 $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $(OBJS) -o $@
59
60%.o:%.c
61 $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
62
63%.o:%.cpp
64 $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
65
66clean:
67 rm -f $(OBJS) $(dtarget)
68