blob: 174c713d6b780eda029737f2ba2a6c0b1a53b473 [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
lichengzhangf492f9d2024-02-22 14:53:41 +080014
15ifeq ($(strip $(MOBILETEK_GNSS_TYPE)), HD)
16 LOCAL_CFLAGS += -DHD_GNSS
17else ifeq ($(strip $(MOBILETEK_GNSS_TYPE)), HX)
18 LOCAL_CFLAGS += -DHX_GNSS
19endif
20
sj.zhang5ad93312023-10-13 03:08:29 -070021$(warning lynq qser gnss demo ROOT = $(ROOT), includedir = $(includedir))
lichengzhang29fc2fa2023-08-02 23:20:48 -070022LOCAL_PATH = .
23
24LOCAL_C_INCLUDES = \
25 -I. \
26 -I$(LOCAL_PATH)/include/ \
27 -I$(ROOT)$(includedir)/logger \
28 -I$(ROOT)$(includedir)/liblog \
29 -I$(ROOT)$(includedir)/libxml2 \
sj.zhang5ad93312023-10-13 03:08:29 -070030 -I$(ROOT)$(includedir)\
lichengzhang29fc2fa2023-08-02 23:20:48 -070031
32
33LOCAL_LIBS := \
34 -L. \
35 -lstdc++ \
sj.zhang5ad93312023-10-13 03:08:29 -070036 -llog \
lichengzhang29fc2fa2023-08-02 23:20:48 -070037 -lcutils \
38 -lutils \
39 -lpthread \
40 -llynq-log \
41 -lxml2 \
sj.zhangd5788132023-10-10 03:23:17 -070042 -llynq-uci \
sj.zhang5ad93312023-10-13 03:08:29 -070043 -lsctel \
lichengzhang645d3652023-10-18 01:48:04 -070044 -lbsp \
xy.he75a67942023-12-07 00:02:40 -080045 -lnvram \
lichengzhang29fc2fa2023-08-02 23:20:48 -070046
47
48SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
49
50EXECUTABLE = liblynq-qser-gnss.so
51
52OBJECTS=$(SOURCES:.cpp=.o)
53
54
55.PHONY: build clean install pack_rootfs
56all: build
57$(EXECUTABLE): $(OBJECTS)
58 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
59
60%.o : %.cpp
61 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
62
63build: $(EXECUTABLE)
64 $(warning ########## build $(EXECUTABLE) ##########)
65install:
66 mkdir -p $(ROOT)$(base_libdir)/
67 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
68 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
69pack_rootfs:
70 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
71 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
72 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
73 mkdir -p $(PACK_TO)$(base_libdir)/
74 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
75 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
76.PHONY: clean
77clean:
78 $(RM) $(OBJECTS) $(EXECUTABLE)
79 -find . -name "*.o" -delete