blob: 6010a931e43583d7a6ff782330db12ff0a7a2c82 [file] [log] [blame]
sj.zhang47c326a2023-08-22 15:28:52 +08001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -std=gnu++14 \
6 -g -Os \
7 -flto \
8 -fPIC \
9 -fpermissive \
10
11ifeq ($(strip $(TARGET_PLATFORM)), T106)
12LOCAL_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
13endif
14
15ifeq ($(strip $(TARGET_PLATFORM)), T106)
16LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106
17endif
18
19LOCAL_CFLAGS += $(CFLAGS)
20$(warning ################# rock ROOT: $(ROOT),includedir:$(includedir),)
21
22LOCAL_PATH = .
23
24LOCAL_C_INCLUDES = \
25 -I. \
26 -I$(LOCAL_PATH)/include \
27 -I$(ROOT)$(includedir)/logger \
28 -I$(ROOT)$(includedir)/liblog \
29 -I$(ROOT)$(includedir) \
30
31
32LOCAL_LIBS := \
33 -L. \
34 -ldl \
35 -lstdc++ \
36 -lpthread \
37 -lsctel \
xf.li7ccf8372024-03-07 00:08:02 -080038 -lscrtc \
sj.zhang47c326a2023-08-22 15:28:52 +080039 -llynq-uci \
sj.zhangfdb20be2023-08-23 10:02:53 +080040 -llynq-log \
xy.he75a67942023-12-07 00:02:40 -080041 -lnvram \
xy.he5859d892024-01-04 00:33:36 -080042 -lscipc \
sj.zhang47c326a2023-08-22 15:28:52 +080043
44
45SOURCES = $(wildcard *.cpp)
46
47EXECUTABLE = liblynq-systime.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.PHONY: clean
76clean:
77 $(RM) $(OBJECTS) $(EXECUTABLE)
78