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