xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | include $(COMMON_MK) |
| 2 | |
| 3 | TARGET_USES_LOGD = true |
| 4 | |
| 5 | ifneq ($(TARGET_USES_LOGD),false) |
| 6 | liblog_sources := logd_write.c |
| 7 | else |
| 8 | liblog_sources := logd_write_kern.c |
| 9 | endif |
| 10 | |
| 11 | liblog_sources += logprint.c event_tag_map.c |
| 12 | |
| 13 | liblog_target_sources := $(liblog_sources) |
| 14 | |
| 15 | ifneq ($(TARGET_USES_LOGD),false) |
| 16 | liblog_target_sources += log_read.c |
| 17 | else |
| 18 | liblog_target_sources += log_read_kern.c |
| 19 | endif |
| 20 | |
| 21 | LOCAL_SRC_FILES = $(liblog_target_sources) |
| 22 | |
| 23 | LOCAL_SRC_CPP_FILES = log_time.cpp |
| 24 | |
| 25 | LOCAL_MODULE := liblog.so |
| 26 | |
| 27 | LOCAL_C_INCLUDES = -I../include |
| 28 | LOCAL_C_INCLUDES += -I../include/log |
| 29 | LOCAL_C_INCLUDES += -I../include/cutils |
| 30 | LOCAL_C_INCLUDES += -I../include/utils |
| 31 | #-I$(STAGEDIR) |
| 32 | |
| 33 | LOCAL_CFLAGS += -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 |
| 34 | LOCAL_CFLAGS += -Werror |
| 35 | # -nostartfiles |
| 36 | |
| 37 | 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 |
| 38 | LOCAL_CPPFLAGS += -std=c++11 |
| 39 | |
| 40 | LOCAL_LDLIBS += |
| 41 | #LOCAL_LDFLAGS += -shared |
| 42 | LDFLAGS += -shared |
| 43 | |
| 44 | ALL_OBJS = $(subst .c,.o, $(LOCAL_SRC_FILES)) |
| 45 | |
| 46 | ALL_CPP_OBJS = $(subst .cpp,.o, $(LOCAL_SRC_CPP_FILES)) |
| 47 | |
| 48 | all : $(LOCAL_MODULE) |
| 49 | @echo "Compile $(LOCAL_MODULE) done!" |
| 50 | |
| 51 | clean : |
| 52 | @rm -rvf $(ALL_OBJS) $(LOCAL_MODULE) |
| 53 | |
| 54 | $(LOCAL_MODULE) : $(ALL_OBJS) $(ALL_CPP_OBJS) |
| 55 | # $(CXX) $(LOCAL_LDFLAGS) $(LOCAL_CPPFLAGS) -o $@ $^ $(LOCAL_LDLIBS) |
| 56 | $(CXX) $(LDFLAGS) $(LOCAL_CPPFLAGS) -o $@ $^ $(LOCAL_LDLIBS) |
| 57 | |
| 58 | %.o:%.c |
| 59 | @echo Compile $< |
| 60 | $(CC) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -c $< -o $@ |
| 61 | |
| 62 | %.o:%.cpp |
| 63 | @echo Compile $< |
| 64 | $(CXX) $(LOCAL_CPPFLAGS) $(LOCAL_C_INCLUDES) -c $< -o $@ |
| 65 | |
| 66 | romfs: |
| 67 | $(ROMFSINST) $(LOCAL_MODULE) /lib/$(LOCAL_MODULE) |
| 68 | @echo $(LOCAL_MODULE) has been installed! |
| 69 | |