blob: 3770eef87be40655001c177d55ee34fd5c973cc5 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001include $(COMMON_MK)
2
3sources := \
4 Binder.cpp \
5 BpBinder.cpp \
6 BufferedTextOutput.cpp \
7 Debug.cpp \
8 IInterface.cpp \
9 IMemory.cpp \
10 IPCThreadState.cpp \
11 IPermissionController.cpp \
12 IServiceManager.cpp \
13 MemoryDealer.cpp \
14 MemoryBase.cpp \
15 MemoryHeapBase.cpp \
16 Parcel.cpp \
17 PermissionCache.cpp \
18 ProcessState.cpp \
19 Static.cpp \
20 TextOutput.cpp \
21
22LOCAL_SRC_FILES = $(sources)
23
24LOCAL_MODULE := libbinder.so
25
26LOCAL_C_INCLUDES = -I./include
27LOCAL_C_INCLUDES += -I./include/log
28LOCAL_C_INCLUDES += -I./include/cutils
29LOCAL_C_INCLUDES += -I./include/utils
30
31LOCAL_CFLAGS += -fPIC -g -O -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
32LOCAL_CFLAGS += -Werror
33
34LOCAL_CPPFLAGS += -fPIC -g -O2 -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
35#LOCAL_CPPFLAGS += -Werror
36LOCAL_CPPFLAGS += -std=c++11
37
38LOCAL_LDLIBS += -lpthread
39LOCAL_LDLIBS += -L./libcutils -lcutils
40LOCAL_LDLIBS += -L./liblog -llog
41LOCAL_LDLIBS += -L./libutils -lutils
42#LOCAL_LDFLAGS += -shared
43LDFLAGS += -Wl,--no-undefined
44LDFLAGS += -shared
45
46LIB_LOG_MODULE = m_liblog
47LIB_UTILS_MODULE = m_libutils
48LIB_CUTILS_MODULE = m_libcutils
49
50ALL_OBJS = $(subst .cpp,.o, $(LOCAL_SRC_FILES))
51
52all : $(LOCAL_MODULE)
53 @echo "Compile $(LOCAL_MODULE) done!"
54
55#clean : $(LIB_UTILS_MODULE)_clean $(LIB_CUTILS_MODULE)_clean $(LIB_LOG_MODULE)_clean
56# @rm -rvf $(ALL_OBJS) $(LOCAL_MODULE)
57
58#$(LOCAL_MODULE) : $(ALL_OBJS) $(LIB_CUTILS_MODULE) $(LIB_LOG_MODULE) $(LIB_UTILS_MODULE)
59# $(CXX) $(LOCAL_LDFLAGS) $(LOCAL_CPPFLAGS) -o $@ $^ $(LOCAL_LDLIBS)
60# $(CXX) $(LDFLAGS) $(LOCAL_CPPFLAGS) -o $@ $(ALL_OBJS) $(LOCAL_LDLIBS)
61
62#%.o:%.c
63# @echo Compile $<
64# $(CC) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -c $< -o $@
65
66#%.o:%.cpp
67# @echo Compile $<
68# $(CXX) $(LOCAL_CPPFLAGS) $(LOCAL_C_INCLUDES) -c $< -o $@
69
70romfs: $(LIB_UTILS_MODULE)_install $(LIB_CUTILS_MODULE)_install $(LIB_LOG_MODULE)_install
71 $(ROMFSINST) $(LOCAL_MODULE) /lib/$(LOCAL_MODULE)
72 @echo $(LOCAL_MODULE) has been installed!
73
74#Make shared library.
75#$(LIB_UTILS_MODULE):
76# $(MAKE) -C libutils all
77
78#$(LIB_CUTILS_MODULE):
79# $(MAKE) -C libcutils all
80
81#$(LIB_LOG_MODULE):
82# $(MAKE) -C liblog all
83
84#Clean shared library.
85#$(LIB_UTILS_MODULE)_clean:
86# $(MAKE) -C libutils clean
87
88#$(LIB_CUTILS_MODULE)_clean:
89# $(MAKE) -C libcutils clean
90
91#$(LIB_LOG_MODULE)_clean:
92# $(MAKE) -C liblog clean
93
94#Install shared library.
95$(LIB_UTILS_MODULE)_install:
96 $(MAKE) -C libutils romfs
97
98$(LIB_CUTILS_MODULE)_install:
99 $(MAKE) -C libcutils romfs
100
101$(LIB_LOG_MODULE)_install:
102 $(MAKE) -C liblog romfs
103