blob: 309f928b3e62ffb2899a915d6c488adddfa0b2eb [file] [log] [blame]
l.yangb488ebc2023-08-21 17:58:00 +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 \
xf.li7ccf8372024-03-07 00:08:02 -080038 -lsctel \
39 -lscrtc \
l.yangb488ebc2023-08-21 17:58:00 +080040
41
42SOURCES = $(wildcard *.cpp)
43
44EXECUTABLE = libpoweralarm.so
45
46OBJECTS=$(SOURCES:.cpp=.o)
47
48
49.PHONY: build clean install pack_rootfs
50
51all: build
52$(EXECUTABLE): $(OBJECTS)
53 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
54
55%.o : %.cpp
56 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
57
58build: $(EXECUTABLE)
59 $(warning ########## build $(EXECUTABLE) ##########)
60
61install:
62 mkdir -p $(ROOT)$(base_libdir)/
63 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
64 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
65
66pack_rootfs:
67 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
68 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
69 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
70 mkdir -p $(PACK_TO)$(base_libdir)/
71 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
72 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
73.PHONY: clean
74clean:
75 $(RM) $(OBJECTS) $(EXECUTABLE)
76