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