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