xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | include $(COMMON_MK) |
| 2 | |
| 3 | commonSources:= \ |
| 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 | |
| 24 | LOCAL_SRC_FILES = $(commonSources) |
| 25 | |
| 26 | LOCAL_MODULE := libutils.so |
| 27 | |
| 28 | LOCAL_C_INCLUDES = -I../include |
| 29 | LOCAL_C_INCLUDES += -I../include/log |
| 30 | LOCAL_C_INCLUDES += -I../include/cutils |
| 31 | LOCAL_C_INCLUDES += -I../include/utils |
| 32 | #-I$(STAGEDIR) |
| 33 | |
| 34 | 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 |
| 35 | LOCAL_CFLAGS += -Werror |
| 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 += -lpthread |
| 41 | LOCAL_LDLIBS += -L../liblog -llog |
| 42 | LOCAL_LDLIBS += -L../libcutils -lcutils |
| 43 | #LOCAL_LDFLAGS += -shared |
| 44 | LDFLAGS += -shared |
| 45 | |
| 46 | ALL_OBJS = $(subst .cpp,.o, $(LOCAL_SRC_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) |
| 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 | |