blob: b08e5905879e6fbeca9a611ac89dc9c596cdb782 [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 \
lichengzhang29fc2fa2023-08-02 23:20:48 -070037
38
39SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
40
41EXECUTABLE = liblynq-qser-gnss.so
42
43OBJECTS=$(SOURCES:.cpp=.o)
44
45
46.PHONY: build clean install pack_rootfs
47all: build
48$(EXECUTABLE): $(OBJECTS)
49 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
50
51%.o : %.cpp
52 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
53
54build: $(EXECUTABLE)
55 $(warning ########## build $(EXECUTABLE) ##########)
56install:
57 mkdir -p $(ROOT)$(base_libdir)/
58 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
59 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
60pack_rootfs:
61 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
62 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
63 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
64 mkdir -p $(PACK_TO)$(base_libdir)/
65 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
66 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
67.PHONY: clean
68clean:
69 $(RM) $(OBJECTS) $(EXECUTABLE)
70 -find . -name "*.o" -delete