blob: 38466cbafcbcd76442e0fa3bac3ee4422dbf300b [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001include $(COMMON_MK)
2
3commonSources:= \
4 BasicHashtable.cpp \
5 BlobCache.cpp \
6 FileMap.cpp \
7 LinearAllocator.cpp \
8 LinearTransform.cpp \
9 Log.cpp \
10 NativeHandle.cpp \
11 RefBase.cpp \
12 SharedBuffer.cpp \
13 Static.cpp \
14 String8.cpp \
15 String16.cpp \
16 SystemClock.cpp \
17 Threads.cpp \
18 Timers.cpp \
19 Unicode.cpp \
20 VectorImpl.cpp \
21 misc.cpp
22
23
24LOCAL_SRC_FILES = $(commonSources)
25
26LOCAL_MODULE := libutils.so
27
28LOCAL_C_INCLUDES = -I../include
29LOCAL_C_INCLUDES += -I../include/log
30LOCAL_C_INCLUDES += -I../include/cutils
31LOCAL_C_INCLUDES += -I../include/utils
32#-I$(STAGEDIR)
33
34LOCAL_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
35LOCAL_CFLAGS += -Werror
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 += -lpthread
41LOCAL_LDLIBS += -L../liblog -llog
42LOCAL_LDLIBS += -L../libcutils -lcutils
43#LOCAL_LDFLAGS += -shared
44LDFLAGS += -shared
45
46ALL_OBJS = $(subst .cpp,.o, $(LOCAL_SRC_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)
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