blob: bdd8518ade5d55ac8728427d50dc0f7db5b14853 [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++ \
29 -lcutils \
30 -lutils \
31 -lpthread \
32 -llynq-log \
33 -lxml2 \
34
35
36SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
37
38EXECUTABLE = liblynq-qser-gnss.so
39
40OBJECTS=$(SOURCES:.cpp=.o)
41
42
43.PHONY: build clean install pack_rootfs
44all: build
45$(EXECUTABLE): $(OBJECTS)
46 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
47
48%.o : %.cpp
49 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
50
51build: $(EXECUTABLE)
52 $(warning ########## build $(EXECUTABLE) ##########)
53install:
54 mkdir -p $(ROOT)$(base_libdir)/
55 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
56 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
57pack_rootfs:
58 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
59 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
60 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
61 mkdir -p $(PACK_TO)$(base_libdir)/
62 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
63 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
64.PHONY: clean
65clean:
66 $(RM) $(OBJECTS) $(EXECUTABLE)
67 -find . -name "*.o" -delete