blob: 228b1bcad475b84a3d38a61fc6b0a49b68ba924c [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 \
xf.li7ccf8372024-03-07 00:08:02 -080044 -lscrtc \
lichengzhang645d3652023-10-18 01:48:04 -070045 -lbsp \
xy.he75a67942023-12-07 00:02:40 -080046 -lnvram \
lichengzhang29fc2fa2023-08-02 23:20:48 -070047
48
49SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
50
51EXECUTABLE = liblynq-qser-gnss.so
52
53OBJECTS=$(SOURCES:.cpp=.o)
54
55
56.PHONY: build clean install pack_rootfs
57all: build
58$(EXECUTABLE): $(OBJECTS)
59 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
60
61%.o : %.cpp
62 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
63
64build: $(EXECUTABLE)
65 $(warning ########## build $(EXECUTABLE) ##########)
66install:
67 mkdir -p $(ROOT)$(base_libdir)/
68 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
69 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
70pack_rootfs:
71 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
72 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
73 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
74 mkdir -p $(PACK_TO)$(base_libdir)/
75 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
76 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
77.PHONY: clean
78clean:
79 $(RM) $(OBJECTS) $(EXECUTABLE)
80 -find . -name "*.o" -delete