xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | include $(COMMON_MK) |
| 2 | |
| 3 | sources := \ |
| 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 | |
| 22 | LOCAL_SRC_FILES = $(sources) |
| 23 | |
| 24 | LOCAL_MODULE := libbinder.so |
| 25 | |
| 26 | LOCAL_C_INCLUDES = -I./include |
| 27 | LOCAL_C_INCLUDES += -I./include/log |
| 28 | LOCAL_C_INCLUDES += -I./include/cutils |
| 29 | LOCAL_C_INCLUDES += -I./include/utils |
| 30 | |
| 31 | LOCAL_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 |
| 32 | LOCAL_CFLAGS += -Werror |
| 33 | |
| 34 | LOCAL_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 |
| 36 | LOCAL_CPPFLAGS += -std=c++11 |
| 37 | |
| 38 | LOCAL_LDLIBS += -lpthread |
| 39 | LOCAL_LDLIBS += -L./libcutils -lcutils |
| 40 | LOCAL_LDLIBS += -L./liblog -llog |
| 41 | LOCAL_LDLIBS += -L./libutils -lutils |
| 42 | #LOCAL_LDFLAGS += -shared |
| 43 | LDFLAGS += -Wl,--no-undefined |
| 44 | LDFLAGS += -shared |
| 45 | |
| 46 | LIB_LOG_MODULE = m_liblog |
| 47 | LIB_UTILS_MODULE = m_libutils |
| 48 | LIB_CUTILS_MODULE = m_libcutils |
| 49 | |
| 50 | ALL_OBJS = $(subst .cpp,.o, $(LOCAL_SRC_FILES)) |
| 51 | |
| 52 | all : $(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 | |
| 70 | romfs: $(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 | |