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