blob: e5a1c204b38b2be56cebb07497bb6c412c51497e [file] [log] [blame]
lichengzhang45091302023-10-08 02:10:34 -07001
2SHELL = /bin/sh
3RM = rm -f
4
5LOCAL_CFLAGS := -Wall \
6 -std=gnu++14 \
7 -g -Os \
8 -flto \
9 -fPIC \
10 -fpermissive \
11
12ifeq ($(strip $(TARGET_PLATFORM)), T106)
13LOCAL_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
14endif
15ifeq ($(strip $(TARGET_PLATFORM)), T106)
16LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106
17LOCAL_CFLAGS += -DLYNQ_SW_INSIDE_VERSION=\"$(LYNQ_CONFIG_VERSION)\"
18LOCAL_CFLAGS += -DLYNQ_SW_VERSION=\"$(LYNQ_CONFIG_SW_VERSION)\"
19endif
20$(warning ################# lynq at common demo ROOT: $(ROOT),includedir:$(includedir))
21LOCAL_PATH = .
22
23LOCAL_C_INCLUDES = \
24 -I. \
25 -I$(LOCAL_PATH)/include/ \
26 -I$(ROOT)$(includedir)/logger \
27 -I$(ROOT)$(includedir)/liblog \
28
29
30LOCAL_LIBS := \
31 -L. \
32 -ldl \
33 -lstdc++ \
34 -llog \
35 -lcutils \
36 -lutils \
37 -lbinder \
38 -lpthread \
39 -llynq-log \
jb.qi539afe42023-11-23 01:52:18 -080040 -llynq-qser-autosuspend \
lichengzhang45091302023-10-08 02:10:34 -070041
42
43SOURCES = $(wildcard *.cpp)
44
45EXECUTABLE = liblynq-at-common.so
46
47OBJECTS=$(SOURCES:.cpp=.o)
48
49.PHONY: build clean install pack_rootfs
50
51all: build
52$(EXECUTABLE): $(OBJECTS)
53 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
54
55%.o : %.cpp
56 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
57
58build: $(EXECUTABLE)
59 $(warning ########## build $(EXECUTABLE) ##########)
60
61install:
62 mkdir -p $(ROOT)$(base_libdir)/
63 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
64 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
65
66pack_rootfs:
67 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
68 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
69 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
70 mkdir -p $(PACK_TO)$(base_libdir)/
71 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
72 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
73
74.PHONY: clean
75clean:
76 $(RM) $(OBJECTS) $(EXECUTABLE)
77 -find . -name "*.o" -delete