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