blob: 8ab638332c03c0a6f0d33df1f599ce0dad481b57 [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
sj.zhang5ad93312023-10-13 03:08:29 -070014$(warning lynq qser gnss demo ROOT = $(ROOT), includedir = $(includedir))
lichengzhang29fc2fa2023-08-02 23:20:48 -070015LOCAL_PATH = .
16
17LOCAL_C_INCLUDES = \
18 -I. \
19 -I$(LOCAL_PATH)/include/ \
20 -I$(ROOT)$(includedir)/logger \
21 -I$(ROOT)$(includedir)/liblog \
22 -I$(ROOT)$(includedir)/libxml2 \
sj.zhang5ad93312023-10-13 03:08:29 -070023 -I$(ROOT)$(includedir)\
lichengzhang29fc2fa2023-08-02 23:20:48 -070024
25
26LOCAL_LIBS := \
27 -L. \
28 -lstdc++ \
sj.zhang5ad93312023-10-13 03:08:29 -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 \
sj.zhang5ad93312023-10-13 03:08:29 -070036 -lsctel \
lichengzhang645d3652023-10-18 01:48:04 -070037 -lbsp \
xy.he75a67942023-12-07 00:02:40 -080038 -lnvram \
lichengzhang29fc2fa2023-08-02 23:20:48 -070039
40
41SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
42
43EXECUTABLE = liblynq-qser-gnss.so
44
45OBJECTS=$(SOURCES:.cpp=.o)
46
47
48.PHONY: build clean install pack_rootfs
49all: build
50$(EXECUTABLE): $(OBJECTS)
51 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
52
53%.o : %.cpp
54 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
55
56build: $(EXECUTABLE)
57 $(warning ########## build $(EXECUTABLE) ##########)
58install:
59 mkdir -p $(ROOT)$(base_libdir)/
60 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
61 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
62pack_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)
69.PHONY: clean
70clean:
71 $(RM) $(OBJECTS) $(EXECUTABLE)
72 -find . -name "*.o" -delete