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