blob: e7abb27b0a633d0d8a07ed6035ef5b5d4f3557bd [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 \
ll7683a722023-01-19 11:14:23 +08008 -DRIL_SHLIB \
9 -DATCI_PARSE \
lh328e7ed2022-01-20 03:12:06 -080010 -fPIC \
ll7683a722023-01-19 11:14:23 +080011 -DKEEP_ALIVE \
12 -DECALL_SUPPORT \
lh328e7ed2022-01-20 03:12:06 -080013 -fpermissive \
14
lh2974e4a2024-02-21 00:14:24 -080015ifeq ($(strip $(MOBILETEK_RIL_CFG)), GSW)
16 LOCAL_CFLAGS += -DGSW_RIL_CFG
17endif
lh328e7ed2022-01-20 03:12:06 -080018
ll7683a722023-01-19 11:14:23 +080019$(warning ################# lynq data demo ROOT: $(ROOT),includedir:$(includedir))
lh328e7ed2022-01-20 03:12:06 -080020LOCAL_PATH = .
21
22LOCAL_C_INCLUDES = \
23 -I. \
24 -I$(LOCAL_PATH)/include/libsms \
ll7683a722023-01-19 11:14:23 +080025 -I$(ROOT)$(includedir)/logger \
lh328e7ed2022-01-20 03:12:06 -080026 -I$(ROOT)$(includedir)/liblog \
ll7683a722023-01-19 11:14:23 +080027 -I$(ROOT)$(includedir)/vendor-ril \
28 -I$(ROOT)$(includedir)/lynq_shm \
lh328e7ed2022-01-20 03:12:06 -080029
30
31LOCAL_LIBS := \
32 -L. \
33 -ldl \
ll7683a722023-01-19 11:14:23 +080034 -lstdc++ \
35 -llog \
lh328e7ed2022-01-20 03:12:06 -080036 -lcutils \
ll7683a722023-01-19 11:14:23 +080037 -lutils \
38 -lbinder \
39 -lpthread \
lh328e7ed2022-01-20 03:12:06 -080040 -llynq-log \
ll7683a722023-01-19 11:14:23 +080041 -llynq-shm \
lh328e7ed2022-01-20 03:12:06 -080042
ll7683a722023-01-19 11:14:23 +080043SOURCES = $(wildcard *.cpp)
lh328e7ed2022-01-20 03:12:06 -080044
45EXECUTABLE = liblynq-sms.so
46
ll7683a722023-01-19 11:14:23 +080047OBJECTS=$(SOURCES:.cpp=.o)
lh328e7ed2022-01-20 03:12:06 -080048
49
50.PHONY: build clean install pack_rootfs
lh328e7ed2022-01-20 03:12:06 -080051all: build
52$(EXECUTABLE): $(OBJECTS)
53 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
54
ll7683a722023-01-19 11:14:23 +080055%.o : %.cpp
56 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
lh328e7ed2022-01-20 03:12:06 -080057
58build: $(EXECUTABLE)
59 $(warning ########## build $(EXECUTABLE) ##########)
lh328e7ed2022-01-20 03:12:06 -080060install:
61 mkdir -p $(ROOT)$(base_libdir)/
62 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
ll7683a722023-01-19 11:14:23 +080063 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
lh328e7ed2022-01-20 03:12:06 -080064pack_rootfs:
65 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
66 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
67 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
68 mkdir -p $(PACK_TO)$(base_libdir)/
69 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
70 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
lh328e7ed2022-01-20 03:12:06 -080071.PHONY: clean
72clean:
73 $(RM) $(OBJECTS) $(EXECUTABLE)
ll7683a722023-01-19 11:14:23 +080074 -find . -name "*.o" -delete