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