blob: 632441c3e17f8cb9ed2a65e0a6bed08a9d8f1eb6 [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 \
xf.li7ccf8372024-03-07 00:08:02 -080042 -lzxiclzma \
l.yang7d7b51c2023-08-04 17:02:48 +080043
44
45SOURCES = $(wildcard *.cpp)
46
47EXECUTABLE = liblynq-fota.so
48
49OBJECTS=$(SOURCES:.cpp=.o)
50
51
52.PHONY: build clean install pack_rootfs
53
54all: build
55$(EXECUTABLE): $(OBJECTS)
56 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
57
58%.o : %.cpp
59 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
60
61build: $(EXECUTABLE)
62 $(warning ########## build $(EXECUTABLE) ##########)
63
64install:
65 mkdir -p $(ROOT)$(base_libdir)/
66 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
67 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
68
69pack_rootfs:
70 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
71 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
72 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
73 mkdir -p $(PACK_TO)$(base_libdir)/
74 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
75 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
76.PHONY: clean
77clean:
78 $(RM) $(OBJECTS) $(EXECUTABLE)