blob: 3f929a2999d405bb17cc4119711889ee6f9125bf [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 ################# RITA ROOT: $(ROOT),includedir:$(includedir))
45LOCAL_PATH = .
46
47LOCAL_C_INCLUDES = \
48 -I. \
49 -I$(LOCAL_PATH)/../include/liblog \
50 -I$(ROOT)$(includedir) \
51 -I$(ROOT)$(includedir)/logger \
52
53
54
55
56LOCAL_LIBS := \
57 -L. \
58 -ldl \
59 -lstdc++ \
60 -llog \
61 -lcutils \
62 -lutils \
63 -lpower \
64 -lpal \
65 -lnandapi \
66 -lsncfg \
67
68SOURCES = $(wildcard *.c wildcard *.h)
69
70EXECUTABLE = liblynq-log.so
71
72OBJECTS=$(SOURCES:.c=.o)
73
74
75.PHONY: build clean install pack_rootfs
76
77all: build
78$(EXECUTABLE): $(OBJECTS)
79 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
80
81%.o : %.c
82 $(CC) $(LOCAL_C_INCLUDES) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
83
84build: $(EXECUTABLE)
85 $(warning ########## build $(EXECUTABLE) ##########)
86
87install:
88 mkdir -p $(ROOT)$(base_libdir)/
89 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
90 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
91
92pack_rootfs:
93 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
94 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
95 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
96 mkdir -p $(PACK_TO)$(base_libdir)/
97 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
98 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
99.PHONY: clean
100clean:
101 $(RM) $(OBJECTS) $(EXECUTABLE)