blob: 6198bcbea294ed23b1dd431e12c92cda92b77ef7 [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
14CFLAGS += -fPIC -O2 $(INCLUDE) -D_LARGEFILE64_SOURCE
15
16$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT))
17ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
18 LOCAL_CFLAGS += -DC2K_SUPPORT
19
20endif
21
22ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
23 LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
24 -DANDROID_MULTI_SIM \
25 -DMODE_DSDS
26endif
27
28ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
29 LOCAL_CFLAGS += -DMODE_DSSS
30endif
31
32$(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM))
33ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
34#$(warning #################add for debug $(ROOT), $(includedir))
35$(warning ################# TARGET_PLATFORM_MT2731)
36 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
37 -DMD_93_SUPPORT
38else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
39$(warning ################# TARGET_PLATFORM_MT2635)
40 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
41 -DMD_90_SUPPORT
42endif
43
44$(warning ################# liblynq_fota ROOT: $(ROOT),includedir:$(includedir))
45LOCAL_PATH = .
46
47LOCAL_C_INCLUDES = \
48 -I. \
49 -I./include \
50 -I$(LOCAL_PATH)/../include \
51 -I$(ROOT)$(includedir)/logger \
52 -I$(ROOT)$(includedir)/liblog \
53 -I$(ROOT)$(includedir)/ftp \
54 -I$(ROOT)$(includedir)/glib-2.0 \
55 -I$(ROOT)$(libdir)/glib-2.0/include \
56
57
58
59
60LOCAL_LIBS := \
61 -L. \
62 -L./lib \
63 -llog \
64 -lstdc++ \
65 -liotpatch \
66 -lmd5 \
67 -lnandapi \
68 -lbootctrl \
69 -llynq-log \
70 -llynq-protcl \
71
72SOURCES = $(wildcard *.c wildcard *.h rock_ua/*.c MD5/*c)
73
74EXECUTABLE = liblynq-fota.so
75
76OBJECTS=$(SOURCES:.c=.o)
77
78
79.PHONY: build clean install pack_rootfs
80
81all: build
82$(EXECUTABLE): $(OBJECTS)
83 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
84
85%.o : %.c
86 $(CC) $(LOCAL_C_INCLUDES) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
87
88build: $(EXECUTABLE)
89 $(warning ########## build $(EXECUTABLE) ##########)
90
91install:
92 mkdir -p $(ROOT)$(base_libdir)/
93 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
94 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
95
96pack_rootfs:
97 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
98 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
99 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
100 mkdir -p $(PACK_TO)$(base_libdir)/
101 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
102 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
103.PHONY: clean
104clean:
105 $(RM) $(OBJECTS) $(EXECUTABLE)
106
107