blob: 9edb5acf988d3b98a529083aa28666718db1f3be [file] [log] [blame]
l.yang7d7b51c2023-08-04 17:02:48 +08001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -std=gnu++14 \
6 -g -Os \
7 -flto \
8 -fPIC \
9 -fpermissive \
10
11
12
13ifeq ($(strip $(TARGET_PLATFORM)), T106)
14LOCAL_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
15endif
16
17
18$(warning ################# rock ROOT: $(ROOT),includedir:$(includedir),)
19
20LOCAL_PATH = .
21
22LOCAL_C_INCLUDES = \
23 -I. \
24 -I$(LOCAL_PATH)/include \
25 -I$(ROOT)$(includedir)/logger \
26 -I$(ROOT)$(includedir)/liblog \
27 -I$(ROOT)$(includedir)/glib-2.0 \
28 -I$(ROOT)$(libdir)/glib-2.0/include \
29 -I$(ROOT)$(includedir) \
30
31
32
33LOCAL_LIBS := \
34 -L. \
35 -ldl \
36 -lstdc++ \
37 -llynq-log \
38 -lupi_ab \
39 -lcrypto \
40 -lnvram \
xf.lice873192023-11-08 17:10:35 -080041 -lflags \
l.yang7d7b51c2023-08-04 17:02:48 +080042
43
44SOURCES = $(wildcard *.cpp)
45
46EXECUTABLE = liblynq-fota.so
47
48OBJECTS=$(SOURCES:.cpp=.o)
49
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.PHONY: clean
76clean:
77 $(RM) $(OBJECTS) $(EXECUTABLE)