blob: e5dedabe719743382dc3ce10fe86e99ec8ebc7d6 [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
lh328e7ed2022-01-20 03:12:06 -080015
lh328e7ed2022-01-20 03:12:06 -080016
ll7683a722023-01-19 11:14:23 +080017$(warning ################# lynq data demo ROOT: $(ROOT),includedir:$(includedir))
lh328e7ed2022-01-20 03:12:06 -080018LOCAL_PATH = .
19
20LOCAL_C_INCLUDES = \
21 -I. \
22 -I$(LOCAL_PATH)/include/libsms \
ll7683a722023-01-19 11:14:23 +080023 -I$(ROOT)$(includedir)/logger \
lh328e7ed2022-01-20 03:12:06 -080024 -I$(ROOT)$(includedir)/liblog \
ll7683a722023-01-19 11:14:23 +080025 -I$(ROOT)$(includedir)/vendor-ril \
26 -I$(ROOT)$(includedir)/lynq_shm \
lh328e7ed2022-01-20 03:12:06 -080027
28
29LOCAL_LIBS := \
30 -L. \
31 -ldl \
ll7683a722023-01-19 11:14:23 +080032 -lstdc++ \
33 -llog \
lh328e7ed2022-01-20 03:12:06 -080034 -lcutils \
ll7683a722023-01-19 11:14:23 +080035 -lutils \
36 -lbinder \
37 -lpthread \
lh328e7ed2022-01-20 03:12:06 -080038 -llynq-log \
ll7683a722023-01-19 11:14:23 +080039 -llynq-shm \
lh328e7ed2022-01-20 03:12:06 -080040
ll7683a722023-01-19 11:14:23 +080041SOURCES = $(wildcard *.cpp)
lh328e7ed2022-01-20 03:12:06 -080042
43EXECUTABLE = liblynq-sms.so
44
ll7683a722023-01-19 11:14:23 +080045OBJECTS=$(SOURCES:.cpp=.o)
lh328e7ed2022-01-20 03:12:06 -080046
47
48.PHONY: build clean install pack_rootfs
lh328e7ed2022-01-20 03:12:06 -080049all: build
50$(EXECUTABLE): $(OBJECTS)
51 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
52
ll7683a722023-01-19 11:14:23 +080053%.o : %.cpp
54 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
lh328e7ed2022-01-20 03:12:06 -080055
56build: $(EXECUTABLE)
57 $(warning ########## build $(EXECUTABLE) ##########)
lh328e7ed2022-01-20 03:12:06 -080058install:
59 mkdir -p $(ROOT)$(base_libdir)/
60 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
ll7683a722023-01-19 11:14:23 +080061 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
lh328e7ed2022-01-20 03:12:06 -080062pack_rootfs:
63 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
64 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
65 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
66 mkdir -p $(PACK_TO)$(base_libdir)/
67 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
68 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
lh328e7ed2022-01-20 03:12:06 -080069.PHONY: clean
70clean:
71 $(RM) $(OBJECTS) $(EXECUTABLE)
ll7683a722023-01-19 11:14:23 +080072 -find . -name "*.o" -delete