blob: e7018b4afd4f52045d1657105648c9875e4ca903 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -std=gnu++14 \
6 -g -Os \
7 -flto \
8 -DRIL_SHLIB \
9 -DATCI_PARSE \
10 -DKEEP_ALIVE \
11 -DECALL_SUPPORT \
12 -fpermissive \
13
14$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT))
15ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
16 LOCAL_CFLAGS += -DC2K_SUPPORT
17
18endif
19
20ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
21 LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
22 -DANDROID_MULTI_SIM \
23 -DMODE_DSDS
24endif
25
26ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
27 LOCAL_CFLAGS += -DMODE_DSSS
28endif
29
30$(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM))
31ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
32#$(warning #################add for debug $(ROOT), $(includedir))
33$(warning ################# TARGET_PLATFORM_MT2731)
34 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
35 -DMD_93_SUPPORT
36else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
37$(warning ################# TARGET_PLATFORM_MT2635)
38 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
39 -DMD_90_SUPPORT
40endif
41
42$(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir))
43LOCAL_PATH = .
44
45LOCAL_C_INCLUDES = \
46 -I. \
47 -I$(ROOT)$(includedir)/openssl \
48 -I$(ROOT)$(includedir)/liblog \
49 -I$(LOCAL_PATH)/include \
50
51
52LOCAL_LIBS := \
53 -L. \
54 -ldl \
55 -lpthread \
56 -llynq-log \
57 -lssl \
58 -lcrypto \
59 -lmosquitto \
60
61SOURCES = $(wildcard *.c wildcard *.h ftp/*.c http/src/*.c lynq_mqtt/*.c)
62
63EXECUTABLE = liblynq-protcl.so
64
65OBJECTS=$(SOURCES:.c=.o)
66
67
68.PHONY: build clean install pack_rootfs
69
70all: build
71$(EXECUTABLE): $(OBJECTS)
72 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
73
74%.o : %.c
75 $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
76
77build: $(EXECUTABLE)
78 $(warning ########## build $(EXECUTABLE) ##########)
79
80install:
81 mkdir -p $(ROOT)$(base_libdir)/
82 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
83 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
84
85pack_rootfs:
86 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
87 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
88 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
89 mkdir -p $(PACK_TO)$(base_libdir)/
90 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
91 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
92.PHONY: clean
93clean:
94 $(RM) $(OBJECTS) $(EXECUTABLE)