blob: c59a62eccaf951a0ce0d6f1c057f7c394db514d6 [file] [log] [blame]
lichengzhang29fc2fa2023-08-02 23:20:48 -07001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -std=gnu++14 \
6 -g -Os \
7 -flto \
8 -fPIC \
9 -fpermissive \
10
11ifeq ($(strip $(TARGET_PLATFORM)), T106)
12LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
13endif
14
15$(warning ################# lynq qser sms demo ROOT: $(ROOT),includedir:$(includedir))
16LOCAL_PATH = .
17
18LOCAL_C_INCLUDES = \
19 -I. \
20 -I$(LOCAL_PATH)/include/ \
21 -I$(ROOT)$(includedir)/logger \
22 -I$(ROOT)$(includedir)/liblog \
23 -I$(ROOT)$(includedir)/libxml2 \
24
25
26LOCAL_LIBS := \
27 -L. \
28 -lstdc++ \
lichengzhang7c137cc2023-10-07 03:03:53 -070029 -llog \
lichengzhang29fc2fa2023-08-02 23:20:48 -070030 -lcutils \
31 -lutils \
32 -lpthread \
33 -llynq-log \
34 -lxml2 \
sj.zhangd5788132023-10-10 03:23:17 -070035 -llynq-uci \
lichengzhang29fc2fa2023-08-02 23:20:48 -070036
37
38SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
39
40EXECUTABLE = liblynq-qser-gnss.so
41
42OBJECTS=$(SOURCES:.cpp=.o)
43
44
45.PHONY: build clean install pack_rootfs
46all: build
47$(EXECUTABLE): $(OBJECTS)
48 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
49
50%.o : %.cpp
51 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
52
53build: $(EXECUTABLE)
54 $(warning ########## build $(EXECUTABLE) ##########)
55install:
56 mkdir -p $(ROOT)$(base_libdir)/
57 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
58 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
59pack_rootfs:
60 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
61 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
62 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
63 mkdir -p $(PACK_TO)$(base_libdir)/
64 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
65 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
66.PHONY: clean
67clean:
68 $(RM) $(OBJECTS) $(EXECUTABLE)
69 -find . -name "*.o" -delete